main_2020_show.js 2.6 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653546545465554656546575465854659546605466154662546635466454665546665466754668546695467054671546725467354674546755467654677546785467954680546815468254683546845468554686546875468854689546905469154692546935469454695546965469754698546995470054701547025470354704547055470654707547085470954710547115471254713547145471554716547175471854719547205472154722547235472454725547265472754728547295473054731547325473354734547355473654737547385473954740547415474254743547445474554746547475474854749547505475154752547535475454755547565475754758547595476054761547625476354764547655476654767547685476954770547715477254773547745477554776547775477854779547805478154782547835478454785547865478754788547895479054791547925479354794547955479654797547985479954800548015480254803548045480554806548075480854809548105481154812548135481454815548165481754818548195482054821548225482354824548255482654827548285482954830548315483254833548345483554836548375483854839548405484154842548435484454845548465484754848548495485054851548525485354854548555485654857548585485954860548615486254863548645486554866548675486854869548705487154872548735487454875548765487754878548795488054881548825488354884548855488654887548885488954890548915489254893548945489554896548975489854899549005490154902549035490454905549065490754908549095491054911549125491354914549155491654917549185491954920549215492254923549245492554926549275492854929549305493154932549335493454935549365493754938549395494054941549425494354944549455494654947549485494954950549515495254953549545495554956549575495854959549605496154962549635496454965549665496754968549695497054971549725497354974549755497654977549785497954980549815498254983549845498554986549875498854989549905499154992549935499454995549965499754998549995500055001550025500355004550055500655007550085500955010550115501255013550145501555016550175501855019550205502155022550235502455025550265502755028550295503055031550325503355034550355503655037550385503955040550415504255043550445504555046550475504855049550505505155052550535505455055550565505755058550595506055061550625506355064550655506655067550685506955070550715507255073550745507555076550775507855079550805508155082550835508455085550865508755088550895509055091550925509355094550955509655097550985509955100551015510255103551045510555106551075510855109551105511155112551135511455115551165511755118551195512055121551225512355124551255512655127551285512955130551315513255133551345513555136551375513855139551405514155142551435514455145551465514755148551495515055151551525515355154551555515655157551585515955160551615516255163551645516555166551675516855169551705517155172551735517455175551765517755178551795518055181551825518355184551855518655187551885518955190551915519255193551945519555196551975519855199552005520155202552035520455205552065520755208552095521055211552125521355214552155521655217552185521955220552215522255223552245522555226552275522855229552305523155232552335523455235552365523755238552395524055241552425524355244552455524655247552485524955250552515525255253552545525555256552575525855259552605526155262552635526455265552665526755268552695527055271552725527355274552755527655277552785527955280552815528255283552845528555286552875528855289552905529155292552935529455295552965529755298552995530055301553025530355304553055530655307553085530955310553115531255313553145531555316553175531855319553205532155322553235532455325553265532755328553295533055331553325533355334553355533655337553385533955340553415534255343553445534555346553475534855349553505535155352553535535455355553565535755358553595536055361553625536355364553655536655367553685536955370553715537255373553745537555376553775537855379553805538155382553835538455385553865538755388553895539055391553925539355394553955539655397553985539955400554015540255403554045540555406554075540855409554105541155412554135541455415554165541755418554195542055421554225542355424554255542655427554285542955430554315543255433554345543555436554375543855439554405544155442554435544455445554465544755448554495545055451554525545355454554555545655457554585545955460554615546255463554645546555466554675546855469554705547155472554735547455475554765547755478554795548055481554825548355484554855548655487554885548955490554915549255493554945549555496554975549855499555005550155502555035550455505555065550755508555095551055511555125551355514555155551655517555185551955520555215552255523555245552555526555275552855529555305553155532555335553455535555365553755538555395554055541555425554355544555455554655547555485554955550555515555255553555545555555556555575555855559555605556155562555635556455565555665556755568555695557055571555725557355574555755557655577555785557955580555815558255583555845558555586555875558855589555905559155592555935559455595555965559755598555995560055601556025560355604556055560655607556085560955610556115561255613556145561555616556175561855619556205562155622556235562455625556265562755628556295563055631556325563355634556355563655637556385563955640556415564255643556445564555646556475564855649556505565155652556535565455655556565565755658556595566055661556625566355664556655566655667556685566955670556715567255673556745567555676556775567855679556805568155682556835568455685556865568755688556895569055691556925569355694556955569655697556985569955700557015570255703557045570555706557075570855709557105571155712557135571455715557165571755718557195572055721557225572355724557255572655727557285572955730557315573255733557345573555736557375573855739557405574155742557435574455745557465574755748557495575055751557525575355754557555575655757557585575955760557615576255763557645576555766557675576855769557705577155772557735577455775557765577755778557795578055781557825578355784557855578655787557885578955790557915579255793557945579555796557975579855799558005580155802558035580455805558065580755808558095581055811558125581355814558155581655817558185581955820558215582255823558245582555826558275582855829558305583155832558335583455835558365583755838558395584055841558425584355844558455584655847558485584955850558515585255853558545585555856558575585855859558605586155862558635586455865558665586755868558695587055871558725587355874558755587655877558785587955880558815588255883558845588555886558875588855889558905589155892558935589455895558965589755898558995590055901559025590355904559055590655907559085590955910559115591255913559145591555916559175591855919559205592155922559235592455925559265592755928559295593055931559325593355934559355593655937559385593955940559415594255943559445594555946559475594855949559505595155952559535595455955559565595755958559595596055961559625596355964559655596655967559685596955970559715597255973559745597555976559775597855979559805598155982559835598455985559865598755988559895599055991559925599355994559955599655997559985599956000560015600256003560045600556006560075600856009560105601156012560135601456015560165601756018560195602056021560225602356024560255602656027560285602956030560315603256033560345603556036560375603856039560405604156042560435604456045560465604756048560495605056051560525605356054560555605656057560585605956060560615606256063560645606556066560675606856069560705607156072560735607456075560765607756078560795608056081560825608356084560855608656087560885608956090560915609256093560945609556096560975609856099561005610156102561035610456105561065610756108561095611056111561125611356114561155611656117561185611956120561215612256123561245612556126561275612856129561305613156132561335613456135561365613756138561395614056141561425614356144561455614656147561485614956150561515615256153561545615556156561575615856159561605616156162561635616456165561665616756168561695617056171561725617356174561755617656177561785617956180561815618256183561845618556186561875618856189561905619156192561935619456195561965619756198561995620056201562025620356204562055620656207562085620956210562115621256213562145621556216562175621856219562205622156222562235622456225562265622756228562295623056231562325623356234562355623656237562385623956240562415624256243562445624556246562475624856249562505625156252562535625456255562565625756258562595626056261562625626356264562655626656267562685626956270562715627256273562745627556276562775627856279562805628156282562835628456285562865628756288562895629056291562925629356294562955629656297562985629956300563015630256303563045630556306563075630856309563105631156312563135631456315563165631756318563195632056321563225632356324563255632656327563285632956330563315633256333563345633556336563375633856339563405634156342563435634456345563465634756348563495635056351563525635356354563555635656357563585635956360563615636256363563645636556366563675636856369563705637156372563735637456375563765637756378563795638056381563825638356384563855638656387563885638956390563915639256393563945639556396563975639856399564005640156402564035640456405564065640756408564095641056411564125641356414564155641656417564185641956420564215642256423564245642556426564275642856429564305643156432564335643456435564365643756438564395644056441564425644356444564455644656447564485644956450564515645256453564545645556456564575645856459564605646156462564635646456465564665646756468564695647056471564725647356474564755647656477564785647956480564815648256483564845648556486564875648856489564905649156492564935649456495564965649756498564995650056501565025650356504565055650656507565085650956510565115651256513565145651556516565175651856519565205652156522565235652456525565265652756528565295653056531565325653356534565355653656537565385653956540565415654256543565445654556546565475654856549565505655156552565535655456555565565655756558565595656056561565625656356564565655656656567565685656956570565715657256573565745657556576565775657856579565805658156582565835658456585565865658756588565895659056591565925659356594565955659656597565985659956600566015660256603566045660556606566075660856609566105661156612566135661456615566165661756618566195662056621566225662356624566255662656627566285662956630566315663256633566345663556636566375663856639566405664156642566435664456645566465664756648566495665056651566525665356654566555665656657566585665956660566615666256663566645666556666566675666856669566705667156672566735667456675566765667756678566795668056681566825668356684566855668656687566885668956690566915669256693566945669556696566975669856699567005670156702567035670456705567065670756708567095671056711567125671356714567155671656717567185671956720567215672256723567245672556726567275672856729567305673156732567335673456735567365673756738567395674056741567425674356744567455674656747567485674956750567515675256753567545675556756567575675856759567605676156762567635676456765567665676756768567695677056771567725677356774567755677656777567785677956780567815678256783567845678556786567875678856789567905679156792567935679456795567965679756798567995680056801568025680356804568055680656807568085680956810568115681256813568145681556816568175681856819568205682156822568235682456825568265682756828568295683056831568325683356834568355683656837568385683956840568415684256843568445684556846568475684856849568505685156852568535685456855568565685756858568595686056861568625686356864568655686656867568685686956870568715687256873568745687556876568775687856879568805688156882568835688456885568865688756888568895689056891568925689356894568955689656897568985689956900569015690256903569045690556906569075690856909569105691156912569135691456915569165691756918569195692056921569225692356924569255692656927569285692956930569315693256933569345693556936569375693856939569405694156942569435694456945569465694756948569495695056951569525695356954569555695656957569585695956960569615696256963569645696556966569675696856969569705697156972569735697456975569765697756978569795698056981569825698356984569855698656987569885698956990569915699256993569945699556996569975699856999570005700157002570035700457005570065700757008570095701057011570125701357014570155701657017570185701957020570215702257023570245702557026570275702857029570305703157032570335703457035570365703757038570395704057041570425704357044570455704657047570485704957050570515705257053570545705557056570575705857059570605706157062570635706457065570665706757068570695707057071570725707357074570755707657077570785707957080570815708257083570845708557086570875708857089570905709157092570935709457095570965709757098570995710057101571025710357104571055710657107571085710957110571115711257113571145711557116571175711857119571205712157122571235712457125571265712757128571295713057131571325713357134571355713657137571385713957140571415714257143571445714557146571475714857149571505715157152571535715457155571565715757158571595716057161571625716357164571655716657167571685716957170571715717257173571745717557176571775717857179571805718157182571835718457185571865718757188571895719057191571925719357194571955719657197571985719957200572015720257203572045720557206572075720857209572105721157212572135721457215572165721757218572195722057221572225722357224572255722657227572285722957230572315723257233572345723557236572375723857239572405724157242572435724457245572465724757248572495725057251572525725357254572555725657257572585725957260572615726257263572645726557266572675726857269572705727157272572735727457275572765727757278572795728057281572825728357284572855728657287572885728957290572915729257293572945729557296572975729857299573005730157302573035730457305573065730757308573095731057311573125731357314573155731657317573185731957320573215732257323573245732557326573275732857329573305733157332573335733457335573365733757338573395734057341573425734357344573455734657347573485734957350573515735257353573545735557356573575735857359573605736157362573635736457365573665736757368573695737057371573725737357374573755737657377573785737957380573815738257383573845738557386573875738857389573905739157392573935739457395573965739757398573995740057401574025740357404574055740657407574085740957410574115741257413574145741557416574175741857419574205742157422574235742457425574265742757428574295743057431574325743357434574355743657437574385743957440574415744257443574445744557446574475744857449574505745157452574535745457455574565745757458574595746057461574625746357464574655746657467574685746957470574715747257473574745747557476574775747857479574805748157482574835748457485574865748757488574895749057491574925749357494574955749657497574985749957500575015750257503575045750557506575075750857509575105751157512575135751457515575165751757518575195752057521575225752357524575255752657527575285752957530575315753257533575345753557536575375753857539575405754157542575435754457545575465754757548575495755057551575525755357554575555755657557575585755957560575615756257563575645756557566575675756857569575705757157572575735757457575575765757757578575795758057581575825758357584575855758657587575885758957590575915759257593575945759557596575975759857599576005760157602576035760457605576065760757608576095761057611576125761357614576155761657617576185761957620576215762257623576245762557626576275762857629576305763157632576335763457635576365763757638576395764057641576425764357644576455764657647576485764957650576515765257653576545765557656576575765857659576605766157662576635766457665576665766757668576695767057671576725767357674576755767657677576785767957680576815768257683576845768557686576875768857689576905769157692576935769457695576965769757698576995770057701577025770357704577055770657707577085770957710577115771257713577145771557716577175771857719577205772157722577235772457725577265772757728577295773057731577325773357734577355773657737577385773957740577415774257743577445774557746577475774857749577505775157752577535775457755577565775757758577595776057761577625776357764577655776657767577685776957770577715777257773577745777557776577775777857779577805778157782577835778457785577865778757788577895779057791577925779357794577955779657797577985779957800578015780257803578045780557806578075780857809578105781157812578135781457815578165781757818578195782057821578225782357824578255782657827578285782957830578315783257833578345783557836578375783857839578405784157842578435784457845578465784757848578495785057851578525785357854578555785657857578585785957860578615786257863578645786557866578675786857869578705787157872578735787457875578765787757878578795788057881578825788357884578855788657887578885788957890578915789257893578945789557896578975789857899579005790157902579035790457905579065790757908579095791057911579125791357914579155791657917579185791957920579215792257923579245792557926579275792857929579305793157932579335793457935579365793757938579395794057941579425794357944579455794657947579485794957950579515795257953579545795557956579575795857959579605796157962579635796457965579665796757968579695797057971579725797357974579755797657977579785797957980579815798257983579845798557986579875798857989579905799157992579935799457995579965799757998579995800058001580025800358004580055800658007580085800958010580115801258013580145801558016580175801858019580205802158022580235802458025580265802758028580295803058031580325803358034580355803658037580385803958040580415804258043580445804558046580475804858049580505805158052580535805458055580565805758058580595806058061580625806358064580655806658067580685806958070580715807258073580745807558076580775807858079580805808158082580835808458085580865808758088580895809058091580925809358094580955809658097580985809958100581015810258103581045810558106581075810858109581105811158112581135811458115581165811758118581195812058121581225812358124581255812658127581285812958130581315813258133581345813558136581375813858139581405814158142581435814458145581465814758148581495815058151581525815358154581555815658157581585815958160581615816258163581645816558166581675816858169581705817158172581735817458175581765817758178581795818058181581825818358184581855818658187581885818958190581915819258193581945819558196581975819858199582005820158202582035820458205582065820758208582095821058211582125821358214582155821658217582185821958220582215822258223582245822558226582275822858229582305823158232582335823458235582365823758238582395824058241582425824358244582455824658247582485824958250582515825258253582545825558256582575825858259582605826158262582635826458265582665826758268582695827058271582725827358274582755827658277582785827958280582815828258283582845828558286582875828858289582905829158292582935829458295582965829758298582995830058301583025830358304583055830658307583085830958310583115831258313583145831558316583175831858319583205832158322583235832458325583265832758328583295833058331583325833358334583355833658337583385833958340583415834258343583445834558346583475834858349583505835158352583535835458355583565835758358583595836058361583625836358364583655836658367583685836958370583715837258373583745837558376583775837858379583805838158382583835838458385583865838758388583895839058391583925839358394583955839658397583985839958400584015840258403584045840558406584075840858409584105841158412584135841458415584165841758418584195842058421584225842358424584255842658427584285842958430584315843258433584345843558436584375843858439584405844158442584435844458445584465844758448584495845058451584525845358454584555845658457584585845958460584615846258463584645846558466584675846858469584705847158472584735847458475584765847758478584795848058481584825848358484584855848658487584885848958490584915849258493584945849558496584975849858499585005850158502585035850458505585065850758508585095851058511585125851358514585155851658517585185851958520585215852258523585245852558526585275852858529585305853158532585335853458535585365853758538585395854058541585425854358544585455854658547585485854958550585515855258553585545855558556585575855858559585605856158562585635856458565585665856758568585695857058571585725857358574585755857658577585785857958580585815858258583585845858558586585875858858589585905859158592585935859458595585965859758598585995860058601586025860358604586055860658607586085860958610586115861258613586145861558616586175861858619586205862158622586235862458625586265862758628586295863058631586325863358634586355863658637586385863958640586415864258643586445864558646586475864858649586505865158652586535865458655586565865758658586595866058661586625866358664586655866658667586685866958670586715867258673586745867558676586775867858679586805868158682586835868458685586865868758688586895869058691586925869358694586955869658697586985869958700587015870258703587045870558706587075870858709587105871158712587135871458715587165871758718587195872058721587225872358724587255872658727587285872958730587315873258733587345873558736587375873858739587405874158742587435874458745587465874758748587495875058751587525875358754587555875658757587585875958760587615876258763587645876558766587675876858769587705877158772587735877458775587765877758778587795878058781587825878358784587855878658787587885878958790587915879258793587945879558796587975879858799588005880158802588035880458805588065880758808588095881058811588125881358814588155881658817588185881958820588215882258823588245882558826588275882858829588305883158832588335883458835588365883758838588395884058841588425884358844588455884658847588485884958850588515885258853588545885558856588575885858859588605886158862588635886458865588665886758868588695887058871588725887358874588755887658877588785887958880588815888258883588845888558886588875888858889588905889158892588935889458895588965889758898588995890058901589025890358904589055890658907589085890958910589115891258913589145891558916589175891858919589205892158922589235892458925589265892758928589295893058931589325893358934589355893658937589385893958940589415894258943589445894558946589475894858949589505895158952589535895458955589565895758958589595896058961589625896358964589655896658967589685896958970589715897258973589745897558976589775897858979589805898158982589835898458985589865898758988589895899058991589925899358994589955899658997589985899959000590015900259003590045900559006590075900859009590105901159012590135901459015590165901759018590195902059021590225902359024590255902659027590285902959030590315903259033590345903559036590375903859039590405904159042590435904459045590465904759048590495905059051590525905359054590555905659057590585905959060590615906259063590645906559066590675906859069590705907159072590735907459075590765907759078590795908059081590825908359084590855908659087590885908959090590915909259093590945909559096590975909859099591005910159102591035910459105591065910759108591095911059111591125911359114591155911659117591185911959120591215912259123591245912559126591275912859129591305913159132591335913459135591365913759138591395914059141591425914359144591455914659147591485914959150591515915259153591545915559156591575915859159591605916159162591635916459165591665916759168591695917059171591725917359174591755917659177591785917959180591815918259183591845918559186591875918859189591905919159192591935919459195591965919759198591995920059201592025920359204592055920659207592085920959210592115921259213592145921559216592175921859219592205922159222592235922459225592265922759228592295923059231592325923359234592355923659237592385923959240592415924259243592445924559246592475924859249592505925159252592535925459255592565925759258592595926059261592625926359264592655926659267592685926959270592715927259273592745927559276592775927859279592805928159282592835928459285592865928759288592895929059291592925929359294592955929659297592985929959300593015930259303593045930559306593075930859309593105931159312593135931459315593165931759318593195932059321593225932359324593255932659327593285932959330593315933259333593345933559336593375933859339593405934159342593435934459345593465934759348593495935059351593525935359354593555935659357593585935959360593615936259363593645936559366593675936859369593705937159372593735937459375593765937759378593795938059381593825938359384593855938659387593885938959390593915939259393593945939559396593975939859399594005940159402594035940459405594065940759408594095941059411594125941359414594155941659417594185941959420594215942259423594245942559426594275942859429594305943159432594335943459435594365943759438594395944059441594425944359444594455944659447594485944959450594515945259453594545945559456594575945859459594605946159462594635946459465594665946759468594695947059471594725947359474594755947659477594785947959480594815948259483594845948559486594875948859489594905949159492594935949459495594965949759498594995950059501595025950359504595055950659507595085950959510595115951259513595145951559516595175951859519595205952159522595235952459525595265952759528595295953059531595325953359534595355953659537595385953959540595415954259543595445954559546595475954859549595505955159552595535955459555595565955759558595595956059561595625956359564595655956659567595685956959570595715957259573595745957559576595775957859579595805958159582595835958459585595865958759588595895959059591595925959359594595955959659597595985959959600596015960259603596045960559606596075960859609596105961159612596135961459615596165961759618596195962059621596225962359624596255962659627596285962959630596315963259633596345963559636596375963859639596405964159642596435964459645596465964759648596495965059651596525965359654596555965659657596585965959660596615966259663596645966559666596675966859669596705967159672596735967459675596765967759678596795968059681596825968359684596855968659687596885968959690596915969259693596945969559696596975969859699597005970159702597035970459705597065970759708597095971059711597125971359714597155971659717597185971959720597215972259723597245972559726597275972859729597305973159732597335973459735597365973759738597395974059741597425974359744597455974659747597485974959750597515975259753597545975559756597575975859759597605976159762597635976459765597665976759768597695977059771597725977359774597755977659777597785977959780597815978259783597845978559786597875978859789597905979159792597935979459795597965979759798597995980059801598025980359804598055980659807598085980959810598115981259813598145981559816598175981859819598205982159822598235982459825598265982759828598295983059831598325983359834598355983659837598385983959840598415984259843598445984559846598475984859849598505985159852598535985459855598565985759858598595986059861598625986359864598655986659867598685986959870598715987259873598745987559876598775987859879598805988159882598835988459885598865988759888598895989059891598925989359894598955989659897598985989959900599015990259903599045990559906599075990859909599105991159912599135991459915599165991759918599195992059921599225992359924599255992659927599285992959930599315993259933599345993559936599375993859939599405994159942599435994459945599465994759948599495995059951599525995359954599555995659957599585995959960599615996259963599645996559966599675996859969599705997159972599735997459975599765997759978599795998059981599825998359984599855998659987599885998959990599915999259993599945999559996599975999859999600006000160002600036000460005600066000760008600096001060011600126001360014600156001660017600186001960020600216002260023600246002560026600276002860029600306003160032600336003460035600366003760038600396004060041600426004360044600456004660047600486004960050600516005260053600546005560056600576005860059600606006160062600636006460065600666006760068600696007060071600726007360074600756007660077600786007960080600816008260083600846008560086600876008860089600906009160092600936009460095600966009760098600996010060101601026010360104601056010660107601086010960110601116011260113601146011560116601176011860119601206012160122601236012460125601266012760128601296013060131601326013360134601356013660137601386013960140601416014260143601446014560146601476014860149601506015160152601536015460155601566015760158601596016060161601626016360164601656016660167601686016960170601716017260173601746017560176601776017860179601806018160182601836018460185601866018760188601896019060191601926019360194601956019660197601986019960200602016020260203602046020560206602076020860209602106021160212602136021460215602166021760218602196022060221602226022360224602256022660227602286022960230602316023260233602346023560236602376023860239602406024160242602436024460245602466024760248602496025060251602526025360254602556025660257602586025960260602616026260263602646026560266602676026860269602706027160272602736027460275602766027760278602796028060281602826028360284602856028660287602886028960290602916029260293602946029560296602976029860299603006030160302603036030460305603066030760308603096031060311603126031360314603156031660317603186031960320603216032260323603246032560326603276032860329603306033160332603336033460335603366033760338603396034060341603426034360344603456034660347603486034960350603516035260353603546035560356603576035860359603606036160362603636036460365603666036760368603696037060371603726037360374603756037660377603786037960380603816038260383603846038560386603876038860389603906039160392603936039460395603966039760398603996040060401604026040360404604056040660407604086040960410604116041260413604146041560416604176041860419604206042160422604236042460425604266042760428604296043060431604326043360434604356043660437604386043960440604416044260443604446044560446604476044860449604506045160452604536045460455604566045760458604596046060461604626046360464604656046660467604686046960470604716047260473604746047560476604776047860479604806048160482604836048460485604866048760488604896049060491604926049360494604956049660497604986049960500605016050260503605046050560506605076050860509605106051160512605136051460515605166051760518605196052060521605226052360524605256052660527605286052960530605316053260533605346053560536605376053860539605406054160542605436054460545605466054760548605496055060551605526055360554605556055660557605586055960560605616056260563605646056560566605676056860569605706057160572605736057460575605766057760578605796058060581605826058360584605856058660587605886058960590605916059260593605946059560596605976059860599606006060160602606036060460605606066060760608606096061060611606126061360614606156061660617606186061960620606216062260623606246062560626606276062860629606306063160632606336063460635606366063760638606396064060641606426064360644606456064660647606486064960650606516065260653606546065560656606576065860659606606066160662606636066460665606666066760668606696067060671606726067360674606756067660677606786067960680606816068260683606846068560686606876068860689606906069160692606936069460695606966069760698606996070060701607026070360704607056070660707607086070960710607116071260713607146071560716607176071860719607206072160722607236072460725607266072760728607296073060731607326073360734607356073660737607386073960740607416074260743607446074560746607476074860749607506075160752607536075460755607566075760758607596076060761607626076360764607656076660767607686076960770607716077260773607746077560776607776077860779607806078160782607836078460785607866078760788607896079060791607926079360794607956079660797607986079960800608016080260803608046080560806608076080860809608106081160812608136081460815608166081760818608196082060821608226082360824608256082660827608286082960830608316083260833608346083560836608376083860839608406084160842608436084460845608466084760848608496085060851608526085360854608556085660857608586085960860608616086260863608646086560866608676086860869608706087160872608736087460875608766087760878608796088060881608826088360884608856088660887608886088960890608916089260893608946089560896608976089860899609006090160902609036090460905609066090760908609096091060911609126091360914609156091660917609186091960920609216092260923609246092560926609276092860929609306093160932609336093460935609366093760938609396094060941609426094360944609456094660947609486094960950609516095260953609546095560956609576095860959609606096160962609636096460965609666096760968609696097060971609726097360974609756097660977609786097960980609816098260983609846098560986609876098860989609906099160992609936099460995609966099760998609996100061001610026100361004610056100661007610086100961010610116101261013610146101561016610176101861019610206102161022610236102461025610266102761028610296103061031610326103361034610356103661037610386103961040610416104261043
  1. /* 许钟文修改的 标记 xzw
  2. 另外 所有"matter"字样已被我删除 原因:删除matterport信息
  3. */
  4. let highMapAddColor = 0//true
  5. !function() {
  6. "use strict";
  7. function t(t, i) {
  8. return typeof t === i
  9. }
  10. function i(t, i) {
  11. return t instanceof i
  12. }
  13. function n(t) {
  14. return t && t.nodeType
  15. }
  16. function e(t) {
  17. return n(t) ? t : i(t, g) ? t[0] : void 0
  18. }
  19. function o(t, i, n) {
  20. return g.each(t, function(t, e) {
  21. n = i.call(e, n, t, e)
  22. }),
  23. n
  24. }
  25. function r(t, i, n) {
  26. var e, o, r;
  27. if (t === i)
  28. return !0;
  29. if (!t || !i || t.constructor !== i.constructor)
  30. return !1;
  31. for (e = 0,
  32. o = n.length; o > e; e += 1) {
  33. if (r = n[e],
  34. t[r] && y(t[r].equals) && !t[r].equals(i[r]))
  35. return !1;
  36. if (t[r] !== i[r])
  37. return !1
  38. }
  39. return !0
  40. }
  41. function s(t, i, n, e) {
  42. this.left = E(t),
  43. this.top = E(i),
  44. this.width = E(n),
  45. this.height = E(e),
  46. this.right = this.left + this.width,
  47. this.bottom = this.top + this.height
  48. }
  49. function h(t, i, n, e) {
  50. this.visible = t || 0,
  51. this.viewport = i || 0,
  52. this.possible = n || 0,
  53. this.rects = e && T({}, e) || null
  54. }
  55. function l(t, i) {
  56. this.els = t,
  57. this.viewport = i
  58. }
  59. function c(t, i, n) {
  60. var e;
  61. return g.inArray(n, q) >= 0 ? e = s.ofElement(t) : g.inArray(n, S) >= 0 && (e = h.of(t, i)),
  62. e ? e[n] : 0
  63. }
  64. function u(t, i) {
  65. return t.val - i.val
  66. }
  67. function a(t, i) {
  68. return i.val - t.val
  69. }
  70. function f(t) {
  71. var i = s.ofContent(t, !0)
  72. , n = s.ofViewport(t, !0)
  73. , e = i.width - n.width
  74. , o = i.height - n.height;
  75. this.content = i,
  76. this.viewport = n,
  77. this.width = 0 >= e ? null : n.left / e,
  78. this.height = 0 >= o ? null : n.top / o,
  79. this.left = n.left,
  80. this.top = n.top,
  81. this.right = i.right - n.right,
  82. this.bottom = i.bottom - n.bottom
  83. }
  84. function p(t) {
  85. this.el = t || window
  86. }
  87. function d(t, i) {
  88. this.context = t,
  89. this.viewport = i,
  90. this.init()
  91. }
  92. function v(t, i, n, e) {
  93. this.context = new l(t,i),
  94. this.property = n,
  95. this.descending = e,
  96. this.init()
  97. }
  98. function w(t) {
  99. t && t !== window && t !== document ? (this.context = t,
  100. this.$autoTarget = g(t)) : this.context = window,
  101. this.init()
  102. }
  103. var g = jQuery
  104. , m = g(window)
  105. , b = g(document)
  106. , T = g.extend
  107. , y = g.isFunction
  108. , k = Math.max
  109. , V = Math.min
  110. , E = Math.round
  111. , x = function() {
  112. var t = {}
  113. , i = 1;
  114. return function(n) {
  115. return n ? (t[n] || (t[n] = i,
  116. i += 1),
  117. t[n]) : 0
  118. }
  119. }();
  120. T(s.prototype, {
  121. equals: function(t) {
  122. return r(this, t, ["left", "top", "width", "height"])
  123. },
  124. area: function() {
  125. return this.width * this.height
  126. },
  127. relativeTo: function(t) {
  128. return new s(this.left - t.left,this.top - t.top,this.width,this.height)
  129. },
  130. intersection: function(t) {
  131. if (!i(t, s))
  132. return null;
  133. var n = k(this.left, t.left)
  134. , e = V(this.right, t.right)
  135. , o = k(this.top, t.top)
  136. , r = V(this.bottom, t.bottom)
  137. , h = e - n
  138. , l = r - o;
  139. return h >= 0 && l >= 0 ? new s(n,o,h,l) : null
  140. },
  141. envelope: function(t) {
  142. if (!i(t, s))
  143. return this;
  144. var n = V(this.left, t.left)
  145. , e = k(this.right, t.right)
  146. , o = V(this.top, t.top)
  147. , r = k(this.bottom, t.bottom)
  148. , h = e - n
  149. , l = r - o;
  150. return new s(n,o,h,l)
  151. }
  152. }),
  153. T(s, {
  154. ofContent: function(t, i) {
  155. 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())
  156. },
  157. ofViewport: function(t, i) {
  158. 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())
  159. },
  160. ofElement: function(t) {
  161. var i = g(t);
  162. if (!i.is(":visible"))
  163. return null;
  164. var n = i.offset();
  165. return new s(n.left,n.top,i.outerWidth(),i.outerHeight())
  166. }
  167. }),
  168. T(h.prototype, {
  169. equals: function(t) {
  170. return this.fracsEqual(t) && this.rectsEqual(t)
  171. },
  172. fracsEqual: function(t) {
  173. return r(this, t, ["visible", "viewport", "possible"])
  174. },
  175. rectsEqual: function(t) {
  176. return r(this.rects, t.rects, ["document", "element", "viewport"])
  177. }
  178. }),
  179. T(h, {
  180. of: function(t, i) {
  181. var e, o, r;
  182. return t = n(t) && s.ofElement(t) || t,
  183. i = n(i) && s.ofViewport(i) || i || s.ofViewport(),
  184. t instanceof s && (e = t.intersection(i)) ? (o = e.area(),
  185. r = V(t.width, i.width) * V(t.height, i.height),
  186. new h(o / t.area(),o / i.area(),o / r,{
  187. document: e,
  188. element: e.relativeTo(t),
  189. viewport: e.relativeTo(i)
  190. })) : new h
  191. }
  192. });
  193. var q = ["width", "height", "left", "right", "top", "bottom"]
  194. , S = ["possible", "visible", "viewport"];
  195. T(l.prototype, {
  196. sorted: function(t, i) {
  197. var n = this.viewport;
  198. return g.map(this.els, function(i) {
  199. return {
  200. el: i,
  201. val: c(i, n, t)
  202. }
  203. }).sort(i ? a : u)
  204. },
  205. best: function(t, i) {
  206. return this.els.length ? this.sorted(t, i)[0] : null
  207. }
  208. }),
  209. T(f.prototype, {
  210. equals: function(t) {
  211. return r(this, t, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  212. }
  213. }),
  214. T(p.prototype, {
  215. equals: function(t) {
  216. return r(this, t, ["el"])
  217. },
  218. scrollState: function() {
  219. return new f(this.el)
  220. },
  221. scrollTo: function(t, i, n) {
  222. var e = g(this.el === window ? "html,body" : this.el);
  223. t = t || 0,
  224. i = i || 0,
  225. n = isNaN(n) ? 1e3 : n,
  226. e.stop(!0).animate({
  227. scrollLeft: t,
  228. scrollTop: i
  229. }, n)
  230. },
  231. scroll: function(t, i, n) {
  232. var e = this.el === window ? m : g(this.el);
  233. t = t || 0,
  234. i = i || 0,
  235. this.scrollTo(e.scrollLeft() + t, e.scrollTop() + i, n)
  236. },
  237. scrollToRect: function(t, i, n, e) {
  238. i = i || 0,
  239. n = n || 0,
  240. this.scrollTo(t.left - i, t.top - n, e)
  241. },
  242. scrollToElement: function(t, i, n, e) {
  243. var o = s.ofElement(t).relativeTo(s.ofContent(this.el));
  244. this.scrollToRect(o, i, n, e)
  245. }
  246. });
  247. var C = {
  248. init: function() {
  249. this.callbacks = g.Callbacks("memory unique"),
  250. this.currVal = null,
  251. this.prevVal = null,
  252. this.checkProxy = g.proxy(this.check, this),
  253. this.autoCheck()
  254. },
  255. bind: function(t) {
  256. this.callbacks.add(t)
  257. },
  258. unbind: function(t) {
  259. t ? this.callbacks.remove(t) : this.callbacks.empty()
  260. },
  261. trigger: function() {
  262. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  263. },
  264. check: function(t) {
  265. var i = this.updatedValue(t);
  266. return void 0 !== i && (this.prevVal = this.currVal,
  267. this.currVal = i,
  268. this.trigger(),
  269. !0)
  270. },
  271. $autoTarget: m,
  272. autoEvents: "load resize scroll",
  273. autoCheck: function(t) {
  274. this.$autoTarget[t === !1 ? "off" : "on"](this.autoEvents, this.checkProxy)
  275. }
  276. };
  277. T(d.prototype, C, {
  278. updatedValue: function() {
  279. var t = h.of(this.context, this.viewport);
  280. return this.currVal && this.currVal.equals(t) ? void 0 : t
  281. }
  282. }),
  283. T(v.prototype, C, {
  284. updatedValue: function() {
  285. var t = this.context.best(this.property, this.descending);
  286. return t && (t = t.val > 0 ? t.el : null,
  287. this.currVal !== t) ? t : void 0
  288. }
  289. }),
  290. T(w.prototype, C, {
  291. updatedValue: function() {
  292. var t = new f(this.context);
  293. return this.currVal && this.currVal.equals(t) ? void 0 : t
  294. }
  295. });
  296. var L = function(t, i) {
  297. var n = [].slice
  298. , e = jQuery
  299. , o = e.extend
  300. , r = e.isFunction
  301. , s = o({}, i)
  302. , h = function(i, n, o, s) {
  303. return o = r(o) ? o.apply(i, n) : o,
  304. r(s[o]) ? s[o].apply(i, n) : void e.error('Method "' + o + '" does not exist on jQuery.' + t)
  305. }
  306. , l = function() {
  307. return h(this, n.call(arguments), s.defaultStatic, l)
  308. }
  309. , c = function(t) {
  310. return r(c[t]) ? c[t].apply(this, n.call(arguments, 1)) : h(this, n.call(arguments), s.defaultMethod, c)
  311. }
  312. , u = function(t) {
  313. t && (o(l, t.statics),
  314. o(c, t.methods)),
  315. l.modplug = u
  316. };
  317. u.prev = {
  318. statics: e[t],
  319. methods: e.fn[t]
  320. },
  321. u(i),
  322. e[t] = l,
  323. e.fn[t] = c
  324. }
  325. , M = "fracs";
  326. L(M, {
  327. statics: {
  328. version: "0.15.0",
  329. Rect: s,
  330. Fractions: h,
  331. Group: l,
  332. ScrollState: f,
  333. Viewport: p,
  334. FracsCallbacks: d,
  335. GroupCallbacks: v,
  336. ScrollStateCallbacks: w,
  337. fracs: function(t, i) {
  338. return h.of(t, i)
  339. }
  340. },
  341. methods: {
  342. content: function(t) {
  343. return this.length ? s.ofContent(this[0], t) : null
  344. },
  345. envelope: function() {
  346. return o(this, function(t) {
  347. var i = s.ofElement(this);
  348. return t ? t.envelope(i) : i
  349. })
  350. },
  351. fracs: function(i, n, o) {
  352. t(i, "string") || (o = n,
  353. n = i,
  354. i = null),
  355. y(n) || (o = n,
  356. n = null),
  357. o = e(o);
  358. var r = M + ".fracs." + x(o);
  359. return "unbind" === i ? this.each(function() {
  360. var t = g(this).data(r);
  361. t && t.unbind(n)
  362. }) : "check" === i ? this.each(function() {
  363. var t = g(this).data(r);
  364. t && t.check()
  365. }) : y(n) ? this.each(function() {
  366. var t = g(this)
  367. , i = t.data(r);
  368. i || (i = new d(this,o),
  369. t.data(r, i)),
  370. i.bind(n)
  371. }) : this.length ? h.of(this[0], o) : null
  372. },
  373. intersection: function() {
  374. return o(this, function(t) {
  375. var i = s.ofElement(this);
  376. return t ? t.intersection(i) : i
  377. })
  378. },
  379. max: function(t, i, n) {
  380. return y(i) || (n = i,
  381. i = null),
  382. n = e(n),
  383. i ? (new v(this,n,t,!0).bind(i),
  384. this) : this.pushStack(new l(this,n).best(t, !0).el)
  385. },
  386. min: function(t, i, n) {
  387. return y(i) || (n = i,
  388. i = null),
  389. n = e(n),
  390. i ? (new v(this,n,t).bind(i),
  391. this) : this.pushStack(new l(this,n).best(t).el)
  392. },
  393. rect: function() {
  394. return this.length ? s.ofElement(this[0]) : null
  395. },
  396. scrollState: function(i, n) {
  397. var e = M + ".scrollState";
  398. return t(i, "string") || (n = i,
  399. i = null),
  400. "unbind" === i ? this.each(function() {
  401. var t = g(this).data(e);
  402. t && t.unbind(n)
  403. }) : "check" === i ? this.each(function() {
  404. var t = g(this).data(e);
  405. t && t.check()
  406. }) : y(n) ? this.each(function() {
  407. var t = g(this)
  408. , i = t.data(e);
  409. i || (i = new w(this),
  410. t.data(e, i)),
  411. i.bind(n)
  412. }) : this.length ? new f(this[0]) : null
  413. },
  414. scroll: function(t, i, n) {
  415. return this.each(function() {
  416. new p(this).scroll(t, i, n)
  417. })
  418. },
  419. scrollTo: function(t, i, n, o) {
  420. return g.isNumeric(t) && (o = n,
  421. n = i,
  422. i = t,
  423. t = null),
  424. t = e(t),
  425. this.each(function() {
  426. t ? new p(this).scrollToElement(t, i, n, o) : new p(this).scrollTo(i, n, o)
  427. })
  428. },
  429. scrollToThis: function(t, i, n, o) {
  430. return o = new p(e(o)),
  431. o.scrollToElement(this[0], t, i, n),
  432. this
  433. },
  434. softLink: function(t, i, n, o) {
  435. return o = new p(e(o)),
  436. this.filter("a[href^=#]").each(function() {
  437. var e = g(this);
  438. e.on("click", function() {
  439. o.scrollToElement(g(e.attr("href"))[0], t, i, n)
  440. })
  441. })
  442. },
  443. sort: function(i, n, o) {
  444. return t(n, "boolean") || (o = n,
  445. n = null),
  446. o = e(o),
  447. this.pushStack(g.map(new l(this,o).sorted(i, !n), function(t) {
  448. return t.el
  449. }))
  450. },
  451. viewport: function(t) {
  452. return this.length ? s.ofViewport(this[0], t) : null
  453. }
  454. },
  455. defaultStatic: "fracs",
  456. defaultMethod: "fracs"
  457. })
  458. }();
  459. if ("undefined" == typeof jQuery)
  460. throw new Error("Bootstrap's JavaScript requires jQuery");
  461. +function(t) {
  462. "use strict";
  463. function e(e) {
  464. return this.each(function() {
  465. var o = t(this)
  466. , s = o.data("bs.tooltip")
  467. , n = "object" == typeof e && e;
  468. (s || "destroy" != e) && (s || o.data("bs.tooltip", s = new i(this,n)),
  469. "string" == typeof e && s[e]())
  470. })
  471. }
  472. var i = function(t, e) {
  473. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  474. this.init("tooltip", t, e)
  475. };
  476. i.VERSION = "3.2.0",
  477. i.DEFAULTS = {
  478. animation: !0,
  479. placement: "top",
  480. selector: !1,
  481. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  482. trigger: "hover focus",
  483. title: "",
  484. delay: 0,
  485. html: !1,
  486. container: !1,
  487. viewport: {
  488. selector: "body",
  489. padding: 0
  490. }
  491. },
  492. i.prototype.init = function(e, i, o) {
  493. this.enabled = !0,
  494. this.type = e,
  495. this.$element = t(i),
  496. this.options = this.getOptions(o),
  497. this.$viewport = this.options.viewport && t(this.options.viewport.selector || this.options.viewport);
  498. for (var s = this.options.trigger.split(" "), n = s.length; n--; ) {
  499. var r = s[n];
  500. if ("click" == r)
  501. this.$element.on("click." + this.type, this.options.selector, t.proxy(this.toggle, this));
  502. else if ("manual" != r) {
  503. var a = "hover" == r ? "mouseenter" : "focusin"
  504. , l = "hover" == r ? "mouseleave" : "focusout";
  505. this.$element.on(a + "." + this.type, this.options.selector, t.proxy(this.enter, this)),
  506. this.$element.on(l + "." + this.type, this.options.selector, t.proxy(this.leave, this))
  507. }
  508. }
  509. this.options.selector ? this._options = t.extend({}, this.options, {
  510. trigger: "manual",
  511. selector: ""
  512. }) : this.fixTitle()
  513. }
  514. ,
  515. i.prototype.getDefaults = function() {
  516. return i.DEFAULTS
  517. }
  518. ,
  519. i.prototype.getOptions = function(e) {
  520. return e = t.extend({}, this.getDefaults(), this.$element.data(), e),
  521. e.delay && "number" == typeof e.delay && (e.delay = {
  522. show: e.delay,
  523. hide: e.delay
  524. }),
  525. e
  526. }
  527. ,
  528. i.prototype.getDelegateOptions = function() {
  529. var e = {}
  530. , i = this.getDefaults();
  531. return this._options && t.each(this._options, function(t, o) {
  532. i[t] != o && (e[t] = o)
  533. }),
  534. e
  535. }
  536. ,
  537. i.prototype.enter = function(e) {
  538. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  539. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  540. t(e.currentTarget).data("bs." + this.type, i)),
  541. clearTimeout(i.timeout),
  542. i.hoverState = "in",
  543. i.options.delay && i.options.delay.show ? void (i.timeout = setTimeout(function() {
  544. // "in" == i.hoverState && i.show()
  545. }, i.options.delay.show)) : i.show()
  546. }
  547. ,
  548. i.prototype.leave = function(e) {
  549. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  550. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  551. t(e.currentTarget).data("bs." + this.type, i)),
  552. clearTimeout(i.timeout),
  553. i.hoverState = "out",
  554. i.options.delay && i.options.delay.hide ? void (i.timeout = setTimeout(function() {
  555. "out" == i.hoverState && i.hide()
  556. }, i.options.delay.hide)) : i.hide()
  557. }
  558. ,
  559. i.prototype.show = function() {
  560. var e = t.Event("show.bs." + this.type);
  561. if (this.hasContent() && this.enabled) {
  562. this.$element.trigger(e);
  563. var i = t.contains(document.documentElement, this.$element[0]);
  564. if (e.isDefaultPrevented() || !i)
  565. return;
  566. var o = this
  567. , s = this.tip()
  568. , n = this.getUID(this.type);
  569. this.setContent(),
  570. s.attr("id", n),
  571. this.$element.attr("aria-describedby", n),
  572. this.options.animation && s.addClass("fade");
  573. var r = "function" == typeof this.options.placement ? this.options.placement.call(this, s[0], this.$element[0]) : this.options.placement
  574. , a = /\s?auto?\s?/i
  575. , l = a.test(r);
  576. l && (r = r.replace(a, "") || "top"),
  577. s.detach().css({
  578. top: 0,
  579. left: 0,
  580. display: "block"
  581. }).addClass(r).data("bs." + this.type, this),
  582. this.options.container ? s.appendTo(this.options.container) : s.insertAfter(this.$element);
  583. var p = this.getPosition()
  584. , h = s[0].offsetWidth
  585. , f = s[0].offsetHeight;
  586. if (l) {
  587. var u = r
  588. , c = this.$element.parent()
  589. , d = this.getPosition(c);
  590. 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,
  591. s.removeClass(u).addClass(r)
  592. }
  593. var g = this.getCalculatedOffset(r, p, h, f);
  594. this.applyPlacement(g, r);
  595. var y = function() {
  596. o.$element.trigger("shown.bs." + o.type),
  597. o.hoverState = null
  598. };
  599. t.support.transition && this.$tip.hasClass("fade") ? s.one("bsTransitionEnd", y).emulateTransitionEnd(150) : y()
  600. }
  601. }
  602. ,
  603. i.prototype.applyPlacement = function(e, i) {
  604. var o = this.tip()
  605. , s = o[0].offsetWidth
  606. , n = o[0].offsetHeight
  607. , r = parseInt(o.css("margin-top"), 10)
  608. , a = parseInt(o.css("margin-left"), 10);
  609. isNaN(r) && (r = 0),
  610. isNaN(a) && (a = 0),
  611. e.top = e.top + r,
  612. e.left = e.left + a,
  613. t.offset.setOffset(o[0], t.extend({
  614. using: function(t) {
  615. o.css({
  616. top: Math.round(t.top),
  617. left: Math.round(t.left)
  618. })
  619. }
  620. }, e), 0),
  621. o.addClass("in");
  622. var l = o[0].offsetWidth
  623. , p = o[0].offsetHeight;
  624. "top" == i && p != n && (e.top = e.top + n - p);
  625. var h = this.getViewportAdjustedDelta(i, e, l, p);
  626. h.left ? e.left += h.left : e.top += h.top;
  627. var f = h.left ? 2 * h.left - s + l : 2 * h.top - n + p
  628. , u = h.left ? "left" : "top"
  629. , c = h.left ? "offsetWidth" : "offsetHeight";
  630. o.offset(e),
  631. this.replaceArrow(f, o[0][c], u)
  632. }
  633. ,
  634. i.prototype.replaceArrow = function(t, e, i) {
  635. this.arrow().css(i, t ? 50 * (1 - t / e) + "%" : "")
  636. }
  637. ,
  638. i.prototype.setContent = function() {
  639. var t = this.tip()
  640. , e = this.getTitle();
  641. t.find(".tooltip-inner")[this.options.html ? "html" : "text"](e),
  642. t.removeClass("fade in top bottom left right")
  643. }
  644. ,
  645. i.prototype.hide = function() {
  646. function e() {
  647. "in" != i.hoverState && o.detach(),
  648. i.$element.trigger("hidden.bs." + i.type)
  649. }
  650. var i = this
  651. , o = this.tip()
  652. , s = t.Event("hide.bs." + this.type);
  653. if (this.$element.removeAttr("aria-describedby"),
  654. this.$element.trigger(s),
  655. !s.isDefaultPrevented())
  656. return o.removeClass("in"),
  657. t.support.transition && this.$tip.hasClass("fade") ? o.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  658. this.hoverState = null,
  659. this
  660. }
  661. ,
  662. i.prototype.fixTitle = function() {
  663. var t = this.$element;
  664. (t.attr("title") || "string" != typeof t.attr("data-original-title")) && t.attr("data-original-title", t.attr("title") || "").attr("title", "")
  665. }
  666. ,
  667. i.prototype.hasContent = function() {
  668. return this.getTitle()
  669. }
  670. ,
  671. i.prototype.getPosition = function(e) {
  672. e = e || this.$element;
  673. var i = e[0]
  674. , o = "BODY" == i.tagName;
  675. return t.extend({}, "function" == typeof i.getBoundingClientRect ? i.getBoundingClientRect() : null, {
  676. scroll: o ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  677. width: o ? t(window).width() : e.outerWidth(),
  678. height: o ? t(window).height() : e.outerHeight()
  679. }, o ? {
  680. top: 0,
  681. left: 0
  682. } : e.offset())
  683. }
  684. ,
  685. i.prototype.getCalculatedOffset = function(t, e, i, o) {
  686. return "bottom" == t ? {
  687. top: e.top + e.height,
  688. left: e.left + e.width / 2 - i / 2
  689. } : "top" == t ? {
  690. top: e.top - o,
  691. left: e.left + e.width / 2 - i / 2
  692. } : "left" == t ? {
  693. top: e.top + e.height / 2 - o / 2,
  694. left: e.left - i
  695. } : {
  696. top: e.top + e.height / 2 - o / 2,
  697. left: e.left + e.width
  698. }
  699. }
  700. ,
  701. i.prototype.getViewportAdjustedDelta = function(t, e, i, o) {
  702. var s = {
  703. top: 0,
  704. left: 0
  705. };
  706. if (!this.$viewport)
  707. return s;
  708. var n = this.options.viewport && this.options.viewport.padding || 0
  709. , r = this.getPosition(this.$viewport);
  710. if (/right|left/.test(t)) {
  711. var a = e.top - n - r.scroll
  712. , l = e.top + n - r.scroll + o;
  713. a < r.top ? s.top = r.top - a : l > r.top + r.height && (s.top = r.top + r.height - l)
  714. } else {
  715. var p = e.left - n
  716. , h = e.left + n + i;
  717. p < r.left ? s.left = r.left - p : h > r.width && (s.left = r.left + r.width - h)
  718. }
  719. return s
  720. }
  721. ,
  722. i.prototype.getTitle = function() {
  723. var t, e = this.$element, i = this.options;
  724. return t = e.attr("data-original-title") || ("function" == typeof i.title ? i.title.call(e[0]) : i.title)
  725. }
  726. ,
  727. i.prototype.getUID = function(t) {
  728. do
  729. t += ~~(1e6 * Math.random());
  730. while (document.getElementById(t));return t
  731. }
  732. ,
  733. i.prototype.tip = function() {
  734. return this.$tip = this.$tip || t(this.options.template)
  735. }
  736. ,
  737. i.prototype.arrow = function() {
  738. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  739. }
  740. ,
  741. i.prototype.validate = function() {
  742. this.$element[0].parentNode || (this.hide(),
  743. this.$element = null,
  744. this.options = null)
  745. }
  746. ,
  747. i.prototype.enable = function() {
  748. this.enabled = !0
  749. }
  750. ,
  751. i.prototype.disable = function() {
  752. this.enabled = !1
  753. }
  754. ,
  755. i.prototype.toggleEnabled = function() {
  756. this.enabled = !this.enabled
  757. }
  758. ,
  759. i.prototype.toggle = function(e) {
  760. var i = this;
  761. e && (i = t(e.currentTarget).data("bs." + this.type),
  762. i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  763. t(e.currentTarget).data("bs." + this.type, i))),
  764. i.tip().hasClass("in") ? i.leave(i) : i.enter(i)
  765. }
  766. ,
  767. i.prototype.destroy = function() {
  768. clearTimeout(this.timeout),
  769. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  770. }
  771. ;
  772. var o = t.fn.tooltip;
  773. t.fn.tooltip = e,
  774. t.fn.tooltip.Constructor = i,
  775. t.fn.tooltip.noConflict = function() {
  776. return t.fn.tooltip = o,
  777. this
  778. }
  779. }(jQuery);
  780. !function(e, t, n) {
  781. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  782. }("Keen", this, function() {
  783. "use strict";
  784. function Keen() {
  785. return _init.apply(this, arguments)
  786. }
  787. function _init(e) {
  788. if (_isUndefined(e))
  789. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  790. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  791. throw new Error("Please provide a projectId");
  792. this.configure(e)
  793. }
  794. function _extend(e) {
  795. for (var t = 1; t < arguments.length; t++)
  796. for (var n in arguments[t])
  797. e[n] = arguments[t][n];
  798. return e
  799. }
  800. function _isUndefined(e) {
  801. return void 0 === e
  802. }
  803. function _type(e) {
  804. var t = e && e.constructor ? e.constructor.toString() : void 0;
  805. return t ? t.match(/function (.*)\(/)[1] : "Null"
  806. }
  807. function _each(e, t, n) {
  808. var r;
  809. if (!e)
  810. return 0;
  811. if (n = n ? n : e,
  812. "array" === _type(e)) {
  813. for (r = 0; r < e.length; r++)
  814. if (t.call(n, e[r], r, e) === !1)
  815. return 0
  816. } else
  817. for (r in e)
  818. if (e.hasOwnProperty(r) && t.call(n, e[r], r, e) === !1)
  819. return 0;
  820. return 1
  821. }
  822. function _parse_params(e) {
  823. for (var t, n = {}, r = /\+/g, i = /([^&=]+)=?([^&]*)/g, o = function(e) {
  824. return decodeURIComponent(e.replace(r, " "))
  825. }, a = e.split("?")[1]; t = i.exec(a); )
  826. n[o(t[1])] = o(t[2]);
  827. return n
  828. }
  829. function _set_protocol(e) {
  830. switch (e) {
  831. case "http":
  832. return "http";
  833. case "auto":
  834. return location.protocol.replace(/:/g, "");
  835. case "https":
  836. case void 0:
  837. default:
  838. return "https"
  839. }
  840. }
  841. function _set_request_type(e) {
  842. var t = e || "jsonp"
  843. , n = !1;
  844. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (n = !0),
  845. null == t || "xhr" == t ? n ? "xhr" : "jsonp" : t
  846. }
  847. function _build_url(e) {
  848. return this.client.endpoint + "/projects/" + this.client.projectId + e
  849. }
  850. function _uploadEvent(e, t, n, r, i) {
  851. var o = _build_url.apply(this, ["/events/" + e])
  852. , a = {};
  853. n = n !== !1,
  854. this.client.globalProperties && (a = this.client.globalProperties(e));
  855. for (var c in t)
  856. t.hasOwnProperty(c) && (a[c] = t[c]);
  857. switch (this.client.requestType) {
  858. case "xhr":
  859. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, n, r, i]);
  860. break;
  861. case "jsonp":
  862. var s = JSON.stringify(a)
  863. , l = Keen.Base64.encode(s);
  864. o = o + "?api_key=" + this.client.writeKey,
  865. o = o + "&data=" + l,
  866. o = o + "&modified=" + (new Date).getTime(),
  867. _request.jsonp.apply(this, [o, this.client.writeKey, r, i]);
  868. break;
  869. case "beacon":
  870. var s = JSON.stringify(a)
  871. , l = Keen.Base64.encode(s);
  872. o = o + "?api_key=" + encodeURIComponent(this.client.writeKey),
  873. o = o + "&data=" + encodeURIComponent(l),
  874. o = o + "&modified=" + encodeURIComponent((new Date).getTime()),
  875. o += "&c=clv1",
  876. _request.beacon.apply(this, [o, null, r, i])
  877. }
  878. }
  879. Keen.prototype.configure = function(e) {
  880. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  881. e.protocol = _set_protocol(e.protocol),
  882. e.requestType = _set_request_type(e.requestType),
  883. this.client = {
  884. projectId: e.projectId,
  885. writeKey: e.writeKey,
  886. readKey: e.readKey,
  887. globalProperties: null,
  888. endpoint: e.protocol + "://" + e.host,
  889. requestType: e.requestType
  890. },
  891. Keen.trigger("client", this, e),
  892. this.trigger("ready"),
  893. this
  894. }
  895. ;
  896. var _request = {
  897. xhr: function(e, t, n, r, i, o, a, c) {
  898. if (!i)
  899. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  900. var s = new XMLHttpRequest;
  901. if (s.onreadystatechange = function() {
  902. if (4 == s.readyState)
  903. if (s.status >= 200 && s.status < 300) {
  904. var e;
  905. try {
  906. e = JSON.parse(s.responseText)
  907. } catch (e) {
  908. Keen.log("Could not JSON parse HTTP response: " + s.responseText),
  909. c && c(s, e)
  910. }
  911. a && e && a(e)
  912. } else
  913. Keen.log("HTTP request failed."),
  914. c && c(s, null)
  915. }
  916. ,
  917. s.open(e, t, o),
  918. i && s.setRequestHeader("Authorization", i),
  919. r && s.setRequestHeader("Content-Type", "application/json"),
  920. n)
  921. for (var l in n)
  922. n.hasOwnProperty(l) && s.setRequestHeader(l, n[l]);
  923. var u = r ? JSON.stringify(r) : null;
  924. s.send(u)
  925. },
  926. jsonp: function(e, t, n, r) {
  927. if (!t)
  928. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  929. if (t && e.indexOf("api_key") < 0) {
  930. var i = e.indexOf("?") > 0 ? "&" : "?";
  931. e = e + i + "api_key=" + t
  932. }
  933. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  934. o += "a";
  935. var a = !1;
  936. window[o] = function(e) {
  937. a = !0,
  938. n && e && n(e),
  939. window[o] = void 0
  940. }
  941. ,
  942. e = e + "&jsonp=" + o;
  943. var c = document.createElement("script");
  944. c.id = "keen-jsonp",
  945. c.src = e,
  946. document.getElementsByTagName("head")[0].appendChild(c),
  947. c.onreadystatechange = function() {
  948. a === !1 && "loaded" === this.readyState && (a = !0,
  949. r && r())
  950. }
  951. ,
  952. c.onerror = function() {
  953. a === !1 && (a = !0,
  954. r && r())
  955. }
  956. },
  957. beacon: function(e, t, n, r) {
  958. if (t && e.indexOf("api_key") < 0) {
  959. var i = e.indexOf("?") > 0 ? "&" : "?";
  960. e = e + i + "api_key=" + t
  961. }
  962. var o = !1
  963. , a = document.createElement("img");
  964. a.onload = function() {
  965. if (o = !0,
  966. "naturalHeight"in this) {
  967. if (this.naturalHeight + this.naturalWidth === 0)
  968. return void this.onerror()
  969. } else if (this.width + this.height === 0)
  970. return void this.onerror();
  971. n && n({
  972. created: !0
  973. })
  974. }
  975. ,
  976. a.onerror = function() {
  977. o = !0,
  978. r && r()
  979. }
  980. ,
  981. a.src = e
  982. }
  983. }
  984. , Events = Keen.Events = {
  985. on: function(e, t) {
  986. this.listeners || (this.listeners = {});
  987. var n = this.listeners[e] || (this.listeners[e] = []);
  988. return n.push({
  989. callback: t
  990. }),
  991. this
  992. },
  993. off: function(e, t) {
  994. if (!e && !t)
  995. return this.listeners = void 0,
  996. delete this.listeners,
  997. this;
  998. for (var n = this.listeners[e] || [], r = n.length; r--; )
  999. t && t == n[r].callback && this.listeners[e].splice(r, 1),
  1000. t && 0 != n.length || (this.listeners[e] = void 0,
  1001. delete this.listeners[e]);
  1002. return this
  1003. },
  1004. trigger: function(e) {
  1005. if (!this.listeners)
  1006. return this;
  1007. for (var t = Array.prototype.slice.call(arguments, 1), n = this.listeners[e] || [], r = 0; r < n.length; r++)
  1008. n[r].callback.apply(this, t);
  1009. return this
  1010. }
  1011. };
  1012. _extend(Keen.prototype, Events),
  1013. _extend(Keen, Events),
  1014. Keen.loaded = !0,
  1015. Keen.utils = {
  1016. each: _each,
  1017. extend: _extend,
  1018. parseParams: _parse_params
  1019. },
  1020. Keen.ready = function(e) {
  1021. Keen.loaded ? e() : Keen.on("ready", e)
  1022. }
  1023. ,
  1024. Keen.log = function(e) {
  1025. "object" == typeof console && console.log("[Keen IO]", e)
  1026. }
  1027. ;
  1028. var Plugins = Keen.Plugins = {};
  1029. Keen.prototype.addEvent = function() {
  1030. _uploadEvent.apply(this, arguments)
  1031. }
  1032. ,
  1033. Keen.prototype.addEventSync = function(e, t, n, r) {
  1034. _uploadEvent.apply(this, [e, t, !1, n, r])
  1035. }
  1036. ,
  1037. Keen.prototype.trackExternalLink = function(e, t, n, r, i) {
  1038. var o = e
  1039. , a = o.metaKey
  1040. , c = o.target
  1041. , s = !1
  1042. , l = function() {};
  1043. return void 0 === r && (r = 500),
  1044. "A" === c.nodeName ? l = function() {
  1045. a || s || (s = !0,
  1046. window.location = c.href)
  1047. }
  1048. : "FORM" === c.nodeName && (l = function() {
  1049. s || (s = !0,
  1050. c.submit())
  1051. }
  1052. ),
  1053. i && (l = function() {
  1054. s || (s = !0,
  1055. i())
  1056. }
  1057. ),
  1058. _uploadEvent.call(this, t, n, l, l),
  1059. setTimeout(function() {
  1060. l()
  1061. }, r),
  1062. !!a && void 0
  1063. }
  1064. ,
  1065. Keen.prototype.setGlobalProperties = function(e) {
  1066. if (!this.client)
  1067. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1068. if (!e || "function" != typeof e)
  1069. throw new Error("Invalid value for global properties: " + e);
  1070. this.client.globalProperties = e
  1071. }
  1072. ,
  1073. Keen.Base64 = {
  1074. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1075. encode: function(e) {
  1076. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map;
  1077. for (e = this.utf8.encode(e); l < e.length; )
  1078. t = e.charCodeAt(l++),
  1079. n = e.charCodeAt(l++),
  1080. r = e.charCodeAt(l++),
  1081. i = t >> 2,
  1082. o = (3 & t) << 4 | n >> 4,
  1083. a = isNaN(n) ? 64 : (15 & n) << 2 | r >> 6,
  1084. c = isNaN(n) || isNaN(r) ? 64 : 63 & r,
  1085. s = s + u.charAt(i) + u.charAt(o) + u.charAt(a) + u.charAt(c);
  1086. return s
  1087. },
  1088. decode: function(e) {
  1089. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map, f = String.fromCharCode;
  1090. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1091. t = u.indexOf(e.charAt(l++)),
  1092. n = u.indexOf(e.charAt(l++)),
  1093. r = u.indexOf(e.charAt(l++)),
  1094. i = u.indexOf(e.charAt(l++)),
  1095. o = t << 2 | n >> 4,
  1096. a = (15 & n) << 4 | r >> 2,
  1097. c = (3 & r) << 6 | i,
  1098. s = s + (f(o) + (64 != r ? f(a) : "")) + (64 != i ? f(c) : "");
  1099. return this.utf8.decode(s)
  1100. },
  1101. utf8: {
  1102. encode: function(e) {
  1103. for (var t, n = "", r = 0, i = String.fromCharCode; r < e.length; )
  1104. t = e.charCodeAt(r++),
  1105. 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);
  1106. return n
  1107. },
  1108. decode: function(e) {
  1109. for (var t, n, r = "", i = 0, o = String.fromCharCode; i < e.length; )
  1110. n = e.charCodeAt(i),
  1111. 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];
  1112. return r
  1113. }
  1114. }
  1115. },
  1116. "object" != typeof JSON && (JSON = {}),
  1117. function() {
  1118. function f(e) {
  1119. return 10 > e ? "0" + e : e
  1120. }
  1121. function quote(e) {
  1122. return escapable.lastIndex = 0,
  1123. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1124. var t = meta[e];
  1125. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1126. }) + '"' : '"' + e + '"'
  1127. }
  1128. function str(e, t) {
  1129. var n, r, i, o, a, c = gap, s = t[e];
  1130. switch (s && "object" == typeof s && "function" == typeof s.toJSON && (s = s.toJSON(e)),
  1131. "function" == typeof rep && (s = rep.call(t, e, s)),
  1132. typeof s) {
  1133. case "string":
  1134. return quote(s);
  1135. case "number":
  1136. return isFinite(s) ? String(s) : "null";
  1137. case "boolean":
  1138. case "null":
  1139. return String(s);
  1140. case "object":
  1141. if (!s)
  1142. return "null";
  1143. if (gap += indent,
  1144. a = [],
  1145. "[object Array]" === Object.prototype.toString.apply(s)) {
  1146. for (o = s.length,
  1147. n = 0; o > n; n += 1)
  1148. a[n] = str(n, s) || "null";
  1149. return i = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + c + "]" : "[" + a.join(",") + "]",
  1150. gap = c,
  1151. i
  1152. }
  1153. if (rep && "object" == typeof rep)
  1154. for (o = rep.length,
  1155. n = 0; o > n; n += 1)
  1156. "string" == typeof rep[n] && (r = rep[n],
  1157. i = str(r, s),
  1158. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1159. else
  1160. for (r in s)
  1161. Object.prototype.hasOwnProperty.call(s, r) && (i = str(r, s),
  1162. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1163. return i = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + c + "}" : "{" + a.join(",") + "}",
  1164. gap = c,
  1165. i
  1166. }
  1167. }
  1168. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1169. 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
  1170. }
  1171. ,
  1172. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1173. return this.valueOf()
  1174. }
  1175. );
  1176. 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 = {
  1177. "\b": "\\b",
  1178. "\t": "\\t",
  1179. "\n": "\\n",
  1180. "\f": "\\f",
  1181. "\r": "\\r",
  1182. '"': '\\"',
  1183. "\\": "\\\\"
  1184. }, rep;
  1185. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, n) {
  1186. var r;
  1187. if (gap = "",
  1188. indent = "",
  1189. "number" == typeof n)
  1190. for (r = 0; n > r; r += 1)
  1191. indent += " ";
  1192. else
  1193. "string" == typeof n && (indent = n);
  1194. if (rep = t,
  1195. t && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1196. throw new Error("JSON.stringify");
  1197. return str("", {
  1198. "": e
  1199. })
  1200. }
  1201. ),
  1202. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1203. function walk(e, t) {
  1204. var n, r, i = e[t];
  1205. if (i && "object" == typeof i)
  1206. for (n in i)
  1207. Object.prototype.hasOwnProperty.call(i, n) && (r = walk(i, n),
  1208. void 0 !== r ? i[n] = r : delete i[n]);
  1209. return reviver.call(e, t, i)
  1210. }
  1211. var j;
  1212. if (text = String(text),
  1213. cx.lastIndex = 0,
  1214. cx.test(text) && (text = text.replace(cx, function(e) {
  1215. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1216. })),
  1217. /^[\],:{}\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, "")))
  1218. return j = eval("(" + text + ")"),
  1219. "function" == typeof reviver ? walk({
  1220. "": j
  1221. }, "") : j;
  1222. throw new SyntaxError("JSON.parse")
  1223. }
  1224. )
  1225. }(),
  1226. !function(e, t, n) {
  1227. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  1228. }("domready", Keen.utils, function(e) {
  1229. function t(e) {
  1230. for (d = 1; e = r.shift(); )
  1231. e()
  1232. }
  1233. 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]);
  1234. return o[l] && o[l](s, n = function() {
  1235. o.removeEventListener(s, n, i),
  1236. t()
  1237. }
  1238. , i),
  1239. c && o.attachEvent(u, n = function() {
  1240. /^c/.test(o[f]) && (o.detachEvent(u, n),
  1241. t())
  1242. }
  1243. ),
  1244. e = c ? function(t) {
  1245. self != top ? d ? t() : r.push(t) : function() {
  1246. try {
  1247. a.doScroll("left")
  1248. } catch (n) {
  1249. return setTimeout(function() {
  1250. e(t)
  1251. }, 50)
  1252. }
  1253. t()
  1254. }()
  1255. }
  1256. : function(e) {
  1257. d ? e() : r.push(e)
  1258. }
  1259. });
  1260. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1261. if (loaded && cached) {
  1262. clients = cached.clients || {},
  1263. ready = cached.ready || [];
  1264. for (var instance in clients)
  1265. if (clients.hasOwnProperty(instance)) {
  1266. var client = clients[instance];
  1267. for (var method in Keen.prototype)
  1268. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1269. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1270. ,
  1271. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1272. ,
  1273. client._config && (client.configure.call(client, client._config),
  1274. delete client._config),
  1275. client._setGlobalProperties) {
  1276. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1277. client.setGlobalProperties.apply(client, globals[i]);
  1278. delete client._setGlobalProperties
  1279. }
  1280. if (client._addEvent) {
  1281. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1282. client.addEvent.apply(client, queue[i]);
  1283. delete client._addEvent
  1284. }
  1285. var callback = client._on || [];
  1286. if (client._on) {
  1287. for (var i = 0; i < callback.length; i++)
  1288. client.on.apply(client, callback[i]);
  1289. client.trigger("ready"),
  1290. delete client._on
  1291. }
  1292. }
  1293. for (var i = 0; i < ready.length; i++) {
  1294. var callback = ready[i];
  1295. Keen.on("ready", function() {
  1296. callback()
  1297. })
  1298. }
  1299. }
  1300. return Keen.loaded && setTimeout(function() {
  1301. Keen.utils.domready(function() {
  1302. Keen.trigger("ready")
  1303. })
  1304. }, 0),
  1305. Keen
  1306. });
  1307. !function() {
  1308. var t = window.analytics = window.analytics || [];
  1309. if (!t.initialize) {
  1310. if (t.invoked)
  1311. return void (window.console && console.error && console.error("Segment snippet included twice."));
  1312. t.invoked = !0,
  1313. t.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1314. t.factory = function(e) {
  1315. return function() {
  1316. var n = Array.prototype.slice.call(arguments);
  1317. return n.unshift(e),
  1318. t.push(n),
  1319. t
  1320. }
  1321. }
  1322. ;
  1323. for (var e = 0; e < t.methods.length; e++) {
  1324. var n = t.methods[e];
  1325. t[n] = t.factory(n)
  1326. }
  1327. t.load = function(t) {
  1328. var e = document.createElement("script");
  1329. e.type = "text/javascript",
  1330. e.async = !0,
  1331. e.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + t + "/analytics.min.js";
  1332. var n = document.getElementsByTagName("script")[0];
  1333. n.parentNode.insertBefore(e, n)
  1334. }
  1335. ,
  1336. t.SNIPPET_VERSION = "4.0.0"
  1337. }
  1338. }();
  1339. !function(i, e) {
  1340. "use strict";
  1341. var s = ""
  1342. , r = "?"
  1343. , o = "function"
  1344. , a = "undefined"
  1345. , n = "object"
  1346. , t = "major"
  1347. , d = "model"
  1348. , w = "name"
  1349. , l = "type"
  1350. , p = "vendor"
  1351. , m = "version"
  1352. , c = "architecture"
  1353. , u = "console"
  1354. , g = "mobile"
  1355. , f = "tablet"
  1356. , h = "smarttv"
  1357. , b = {
  1358. has: function(i, e) {
  1359. return e.toLowerCase().indexOf(i.toLowerCase()) !== -1
  1360. },
  1361. lowerize: function(i) {
  1362. return i.toLowerCase()
  1363. }
  1364. }
  1365. , y = {
  1366. rgx: function() {
  1367. for (var i, s, r, t, d, w, l, p = 0, m = arguments; p < m.length; p += 2) {
  1368. var c = m[p]
  1369. , u = m[p + 1];
  1370. if (typeof i === a) {
  1371. i = {};
  1372. for (t in u)
  1373. d = u[t],
  1374. typeof d === n ? i[d[0]] = e : i[d] = e
  1375. }
  1376. for (s = r = 0; s < c.length; s++)
  1377. if (w = c[s].exec(this.getUA())) {
  1378. for (t = 0; t < u.length; t++)
  1379. l = w[++r],
  1380. d = u[t],
  1381. 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;
  1382. break
  1383. }
  1384. if (w)
  1385. break
  1386. }
  1387. return i
  1388. },
  1389. str: function(i, s) {
  1390. for (var o in s)
  1391. if (typeof s[o] === n && s[o].length > 0) {
  1392. for (var a = 0; a < s[o].length; a++)
  1393. if (b.has(s[o][a], i))
  1394. return o === r ? e : o
  1395. } else if (b.has(s[o], i))
  1396. return o === r ? e : o;
  1397. return i
  1398. }
  1399. }
  1400. , v = {
  1401. browser: {
  1402. oldsafari: {
  1403. major: {
  1404. 1: ["/8", "/1", "/3"],
  1405. 2: "/4",
  1406. "?": "/"
  1407. },
  1408. version: {
  1409. "1.0": "/8",
  1410. 1.2: "/1",
  1411. 1.3: "/3",
  1412. "2.0": "/412",
  1413. "2.0.2": "/416",
  1414. "2.0.3": "/417",
  1415. "2.0.4": "/419",
  1416. "?": "/"
  1417. }
  1418. }
  1419. },
  1420. device: {
  1421. sprint: {
  1422. model: {
  1423. "Evo Shift 4G": "7373KT"
  1424. },
  1425. vendor: {
  1426. HTC: "APA",
  1427. Sprint: "Sprint"
  1428. }
  1429. }
  1430. },
  1431. os: {
  1432. windows: {
  1433. version: {
  1434. ME: "4.90",
  1435. "NT 3.11": "NT3.51",
  1436. "NT 4.0": "NT4.0",
  1437. 2e3: "NT 5.0",
  1438. XP: ["NT 5.1", "NT 5.2"],
  1439. Vista: "NT 6.0",
  1440. 7: "NT 6.1",
  1441. 8: "NT 6.2",
  1442. 8.1: "NT 6.3",
  1443. RT: "ARM"
  1444. }
  1445. }
  1446. }
  1447. }
  1448. , k = {
  1449. 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]],
  1450. 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]],
  1451. 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]],
  1452. 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]],
  1453. 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]]
  1454. }
  1455. , x = function(e) {
  1456. var r = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : s);
  1457. return this instanceof x ? (this.getBrowser = function() {
  1458. return y.rgx.apply(this, k.browser)
  1459. }
  1460. ,
  1461. this.getCPU = function() {
  1462. return y.rgx.apply(this, k.cpu)
  1463. }
  1464. ,
  1465. this.getDevice = function() {
  1466. return y.rgx.apply(this, k.device)
  1467. }
  1468. ,
  1469. this.getEngine = function() {
  1470. return y.rgx.apply(this, k.engine)
  1471. }
  1472. ,
  1473. this.getOS = function() {
  1474. return y.rgx.apply(this, k.os)
  1475. }
  1476. ,
  1477. this.getResult = function() {
  1478. return {
  1479. ua: this.getUA(),
  1480. browser: this.getBrowser(),
  1481. engine: this.getEngine(),
  1482. os: this.getOS(),
  1483. device: this.getDevice(),
  1484. cpu: this.getCPU()
  1485. }
  1486. }
  1487. ,
  1488. this.getUA = function() {
  1489. return r
  1490. }
  1491. ,
  1492. this.setUA = function(i) {
  1493. return r = i,
  1494. this
  1495. }
  1496. ,
  1497. void this.setUA(r)) : new x(e).getResult()
  1498. };
  1499. if (typeof exports !== a)
  1500. typeof module !== a && module.exports && (exports = module.exports = x),
  1501. exports.UAParser = x;
  1502. else if (i.UAParser = x,
  1503. typeof define === o && define.amd && define(function() {
  1504. return x
  1505. }),
  1506. typeof i.jQuery !== a) {
  1507. var A = i.jQuery
  1508. , _ = new x;
  1509. A.ua = _.getResult(),
  1510. A.ua.get = function() {
  1511. return _.getUA()
  1512. }
  1513. ,
  1514. A.ua.set = function(i) {
  1515. _.setUA(i);
  1516. var e = _.getResult();
  1517. for (var s in e)
  1518. A.ua[s] = e[s]
  1519. }
  1520. }
  1521. }(this);
  1522. window.Modernizr = function(n, e, t) {
  1523. function o(n) {
  1524. d.cssText = n
  1525. }
  1526. function r(n, e) {
  1527. return typeof n === e
  1528. }
  1529. var i, c, u, a = "2.8.2", f = {}, s = e.documentElement, l = "modernizr", p = e.createElement(l), d = p.style, y = ({}.toString,
  1530. {}), w = [], b = w.slice, v = {}.hasOwnProperty;
  1531. u = r(v, "undefined") || r(v.call, "undefined") ? function(n, e) {
  1532. return e in n && r(n.constructor.prototype[e], "undefined")
  1533. }
  1534. : function(n, e) {
  1535. return v.call(n, e)
  1536. }
  1537. ,
  1538. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1539. var e = this;
  1540. if ("function" != typeof e)
  1541. throw new TypeError;
  1542. var t = b.call(arguments, 1)
  1543. , o = function() {
  1544. if (this instanceof o) {
  1545. var r = function() {};
  1546. r.prototype = e.prototype;
  1547. var i = new r
  1548. , c = e.apply(i, t.concat(b.call(arguments)));
  1549. return Object(c) === c ? c : i
  1550. }
  1551. return e.apply(n, t.concat(b.call(arguments)))
  1552. };
  1553. return o
  1554. }
  1555. ),
  1556. y.webgl = function() {
  1557. return !!n.WebGLRenderingContext
  1558. }
  1559. ;
  1560. for (var h in y)
  1561. u(y, h) && (c = h.toLowerCase(),
  1562. f[c] = y[h](),
  1563. w.push((f[c] ? "" : "no-") + c));
  1564. return f.addTest = function(n, e) {
  1565. if ("object" == typeof n)
  1566. for (var o in n)
  1567. u(n, o) && f.addTest(o, n[o]);
  1568. else {
  1569. if (n = n.toLowerCase(),
  1570. f[n] !== t)
  1571. return f;
  1572. e = "function" == typeof e ? e() : e,
  1573. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (e ? "" : "no-") + n),
  1574. f[n] = e
  1575. }
  1576. return f
  1577. }
  1578. ,
  1579. o(""),
  1580. p = i = null,
  1581. f._version = a,
  1582. f
  1583. }(this, this.document);
  1584. !function(e, t, a) {
  1585. "use strict";
  1586. function n(t, h, m) {
  1587. function H(a) {
  1588. var n = 0
  1589. , i = Ee.length;
  1590. if (Ce.old = e.extend({}, Ce),
  1591. Ie = we ? 0 : be[ge.horizontal ? "width" : "height"](),
  1592. ke = Be[ge.horizontal ? "width" : "height"](),
  1593. ze = we ? t : Pe[ge.horizontal ? "outerWidth" : "outerHeight"](),
  1594. Ee.length = 0,
  1595. Ce.start = 0,
  1596. Ce.end = q(ze - Ie, 0),
  1597. Re) {
  1598. n = Ne.length,
  1599. qe = Pe.children(ge.itemSelector),
  1600. Ne.length = 0;
  1601. 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;
  1602. ze = 0,
  1603. qe.each(function(t, a) {
  1604. var n = e(a)
  1605. , i = a.getBoundingClientRect()
  1606. , l = E(ge.horizontal ? i.width || i.right - i.left : i.height || i.bottom - i.top)
  1607. , d = c(n, ge.horizontal ? "marginLeft" : "marginTop")
  1608. , p = c(n, ge.horizontal ? "marginRight" : "marginBottom")
  1609. , h = l + d + p
  1610. , m = !d || !p
  1611. , g = {};
  1612. g.el = a,
  1613. g.size = m ? l : h,
  1614. g.half = g.size / 2,
  1615. g.start = ze + (m ? d : 0),
  1616. g.center = g.start - E(Ie / 2 - g.size / 2),
  1617. g.end = g.start - Ie + g.size,
  1618. t || (ze += s),
  1619. ze += h,
  1620. ge.horizontal || u || p && d && t > 0 && (ze -= N(d, p)),
  1621. t === v && (g.end += o,
  1622. ze += o,
  1623. f = m ? p : 0),
  1624. Ne.push(g),
  1625. r = g
  1626. }),
  1627. Pe[0].style[ge.horizontal ? "width" : "height"] = (l ? ze : ze - s - o) + "px",
  1628. ze -= f,
  1629. Ne.length ? (Ce.start = Ne[0][Me ? "center" : "start"],
  1630. Ce.end = Me ? r.center : ze > Ie ? r.end : Ce.start) : Ce.start = Ce.end = 0
  1631. }
  1632. if (Ce.center = E(Ce.end / 2 + Ce.start / 2),
  1633. Q(),
  1634. Se.length && ke > 0 && (ge.dynamicHandle ? (Te = Ce.start === Ce.end ? ke : E(ke * Ie / ze),
  1635. Te = d(Te, ge.minHandleSize, ke),
  1636. Se[0].style[ge.horizontal ? "width" : "height"] = Te + "px") : Te = Se[ge.horizontal ? "outerWidth" : "outerHeight"](),
  1637. xe.end = ke - Te,
  1638. it || j()),
  1639. !we && Ie > 0) {
  1640. var p = Ce.start
  1641. , h = "";
  1642. if (Re)
  1643. e.each(Ne, function(e, t) {
  1644. Me ? Ee.push(t.center) : t.start + t.size > p && p <= Ce.end && (p = t.start,
  1645. Ee.push(p),
  1646. p += Ie,
  1647. p > Ce.end && p < Ce.end + Ie && Ee.push(Ce.end))
  1648. });
  1649. else
  1650. for (; p - Ie < Ce.end; )
  1651. Ee.push(p),
  1652. p += Ie;
  1653. if (De[0] && i !== Ee.length) {
  1654. for (var m = 0; m < Ee.length; m++)
  1655. h += ge.pageBuilder.call(ye, m);
  1656. Ae = De.html(h).children(),
  1657. Ae.eq(Oe.activePage).addClass(ge.activeClass)
  1658. }
  1659. }
  1660. if (Oe.slideeSize = ze,
  1661. Oe.frameSize = Ie,
  1662. Oe.sbSize = ke,
  1663. Oe.handleSize = Te,
  1664. Re) {
  1665. a && null != ge.startAt && (W(ge.startAt),
  1666. ye[Le ? "toCenter" : "toStart"](ge.startAt));
  1667. var g = Ne[Oe.activeItem];
  1668. X(Le && g ? g.center : d(Ce.dest, Ce.start, Ce.end))
  1669. } else
  1670. a ? null != ge.startAt && X(ge.startAt, 1) : X(d(Ce.dest, Ce.start, Ce.end));
  1671. pe("load")
  1672. }
  1673. function X(e, t, a) {
  1674. if (Re && at.released && !a) {
  1675. var n = $(e)
  1676. , i = e > Ce.start && e < Ce.end;
  1677. Le ? (i && (e = Ne[n.centerItem].center),
  1678. Me && ge.activateMiddle && W(n.centerItem)) : i && (e = Ne[n.firstItem].start)
  1679. }
  1680. 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),
  1681. et.start = +new Date,
  1682. et.time = 0,
  1683. et.from = Ce.cur,
  1684. et.to = e,
  1685. et.delta = e - Ce.cur,
  1686. et.tweesing = at.tweese || at.init && !at.slidee,
  1687. et.immediate = !et.tweesing && (t || at.init && at.slidee || !ge.speed),
  1688. at.tweese = 0,
  1689. e !== Ce.dest && (Ce.dest = e,
  1690. pe("change"),
  1691. it || Y()),
  1692. K(),
  1693. Q(),
  1694. Z(),
  1695. F()
  1696. }
  1697. function Y() {
  1698. if (ye.initialized) {
  1699. if (!it)
  1700. return it = w(Y),
  1701. void (at.released && pe("moveStart"));
  1702. et.immediate ? Ce.cur = et.to : et.tweesing ? (et.tweeseDelta = et.to - Ce.cur,
  1703. 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),
  1704. Ce.cur = et.from + et.delta * e.easing[ge.easing](et.time / ge.speed, et.time, 0, 1, ge.speed)),
  1705. et.to === Ce.cur ? (Ce.cur = et.to,
  1706. at.tweese = it = 0) : it = w(Y),
  1707. pe("move"),
  1708. 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"),
  1709. !it && at.released && pe("moveEnd"),
  1710. j()
  1711. }
  1712. }
  1713. function j() {
  1714. 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,
  1715. xe.cur = d(E(xe.cur), xe.start, xe.end),
  1716. _e.hPos !== xe.cur && (_e.hPos = xe.cur,
  1717. f ? Se[0].style[f] = v + (ge.horizontal ? "translateX" : "translateY") + "(" + xe.cur + "px)" : Se[0].style[ge.horizontal ? "left" : "top"] = xe.cur + "px"))
  1718. }
  1719. function F() {
  1720. Ae[0] && _e.page !== Oe.activePage && (_e.page = Oe.activePage,
  1721. Ae.removeClass(ge.activeClass).eq(Oe.activePage).addClass(ge.activeClass),
  1722. pe("activePage", _e.page))
  1723. }
  1724. function M() {
  1725. tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) || ye.stop(),
  1726. ot = at.init ? w(M) : 0,
  1727. tt.now = +new Date,
  1728. tt.pos = Ce.cur + (tt.now - tt.lastTime) / 1e3 * tt.speed,
  1729. X(at.init ? tt.pos : E(tt.pos)),
  1730. at.init || Ce.cur !== Ce.dest || pe("moveEnd"),
  1731. tt.lastTime = tt.now
  1732. }
  1733. function L(e, t, n) {
  1734. if ("boolean" === i(t) && (n = t,
  1735. t = a),
  1736. t === a)
  1737. X(Ce[e], n);
  1738. else {
  1739. if (Le && "center" !== e)
  1740. return;
  1741. var r = ye.getPos(t);
  1742. r && X(r[e], n, !Le)
  1743. }
  1744. }
  1745. function R(e) {
  1746. return null != e ? l(e) ? e >= 0 && e < Ne.length ? e : -1 : qe.index(e) : -1
  1747. }
  1748. function U(e) {
  1749. return R(l(e) && 0 > e ? e + Ne.length : e)
  1750. }
  1751. function W(e, t) {
  1752. var a = R(e);
  1753. return !(!Re || 0 > a) && ((_e.active !== a || t) && (qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  1754. qe.eq(a).addClass(ge.activeClass),
  1755. _e.active = Oe.activeItem = a,
  1756. Z(),
  1757. pe("active", a)),
  1758. a)
  1759. }
  1760. function $(e) {
  1761. e = d(l(e) ? e : Ce.dest, Ce.start, Ce.end);
  1762. var t = {}
  1763. , a = Me ? 0 : Ie / 2;
  1764. if (!we)
  1765. for (var n = 0, i = Ee.length; i > n; n++) {
  1766. if (e >= Ce.end || n === Ee.length - 1) {
  1767. t.activePage = Ee.length - 1;
  1768. break
  1769. }
  1770. if (e <= Ee[n] + a) {
  1771. t.activePage = n;
  1772. break
  1773. }
  1774. }
  1775. if (Re) {
  1776. for (var r = !1, s = !1, o = !1, c = 0, u = Ne.length; u > c; c++)
  1777. if (r === !1 && e <= Ne[c].start + Ne[c].half && (r = c),
  1778. o === !1 && e <= Ne[c].center + Ne[c].half && (o = c),
  1779. c === u - 1 || e <= Ne[c].end + Ne[c].half) {
  1780. s = c;
  1781. break
  1782. }
  1783. t.firstItem = l(r) ? r : 0,
  1784. t.centerItem = l(o) ? o : t.firstItem,
  1785. t.lastItem = l(s) ? s : t.centerItem
  1786. }
  1787. return t
  1788. }
  1789. function Q(t) {
  1790. e.extend(Oe, $(t))
  1791. }
  1792. function Z() {
  1793. var e = Ce.dest <= Ce.start
  1794. , t = Ce.dest >= Ce.end
  1795. , a = (e ? 1 : 0) | (t ? 2 : 0);
  1796. if (_e.slideePosState !== a && (_e.slideePosState = a,
  1797. Je.is("button,input") && Je.prop("disabled", e),
  1798. Ke.is("button,input") && Ke.prop("disabled", t),
  1799. Je.add(Qe)[e ? "addClass" : "removeClass"](ge.disabledClass),
  1800. Ke.add($e)[t ? "addClass" : "removeClass"](ge.disabledClass)),
  1801. _e.fwdbwdState !== a && at.released && (_e.fwdbwdState = a,
  1802. Qe.is("button,input") && Qe.prop("disabled", e),
  1803. $e.is("button,input") && $e.prop("disabled", t)),
  1804. Re && null != Oe.activeItem) {
  1805. var n = 0 === Oe.activeItem
  1806. , i = Oe.activeItem >= Ne.length - 1
  1807. , r = (n ? 1 : 0) | (i ? 2 : 0);
  1808. _e.itemsButtonState !== r && (_e.itemsButtonState = r,
  1809. Ze.is("button,input") && Ze.prop("disabled", n),
  1810. Ge.is("button,input") && Ge.prop("disabled", i),
  1811. Ze[n ? "addClass" : "removeClass"](ge.disabledClass),
  1812. Ge[i ? "addClass" : "removeClass"](ge.disabledClass))
  1813. }
  1814. }
  1815. function G(e, t, a) {
  1816. if (e = U(e),
  1817. t = U(t),
  1818. e > -1 && t > -1 && e !== t && (!a || t !== e - 1) && (a || t !== e + 1)) {
  1819. qe.eq(e)[a ? "insertAfter" : "insertBefore"](Ne[t].el);
  1820. var n = t > e ? e : a ? t : t - 1
  1821. , i = e > t ? e : a ? t + 1 : t
  1822. , r = e > t;
  1823. 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)),
  1824. H()
  1825. }
  1826. }
  1827. function J(e, t) {
  1828. for (var a = 0, n = Ve[e].length; n > a; a++)
  1829. if (Ve[e][a] === t)
  1830. return a;
  1831. return -1
  1832. }
  1833. function K() {
  1834. at.released && !ye.isPaused && ye.resume()
  1835. }
  1836. function V(e) {
  1837. return E(d(e, xe.start, xe.end) / xe.end * (Ce.end - Ce.start)) + Ce.start
  1838. }
  1839. function _() {
  1840. at.history[0] = at.history[1],
  1841. at.history[1] = at.history[2],
  1842. at.history[2] = at.history[3],
  1843. at.history[3] = at.delta
  1844. }
  1845. function ee(e) {
  1846. at.released = 0,
  1847. at.source = e,
  1848. at.slidee = "slidee" === e
  1849. }
  1850. function te(t) {
  1851. var a = "touchstart" === t.type
  1852. , n = t.data.source
  1853. , i = "slidee" === n;
  1854. 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),
  1855. ee(n),
  1856. at.init = 0,
  1857. at.$source = e(t.target),
  1858. at.touch = a,
  1859. at.pointer = a ? t.originalEvent.touches[0] : t,
  1860. at.initX = at.pointer.pageX,
  1861. at.initY = at.pointer.pageY,
  1862. at.initPos = i ? Ce.cur : xe.cur,
  1863. at.start = +new Date,
  1864. at.time = 0,
  1865. at.path = 0,
  1866. at.delta = 0,
  1867. at.locked = 0,
  1868. at.history = [0, 0, 0, 0],
  1869. at.pathToLock = i ? a ? 30 : 10 : 0,
  1870. b.on(a ? z : I, ae),
  1871. ye.pause(1),
  1872. (i ? Pe : Se).addClass(ge.draggedClass),
  1873. pe("moveStart"),
  1874. i && (rt = setInterval(_, 10)))
  1875. }
  1876. function ae(e) {
  1877. if (at.released = "mouseup" === e.type || "touchend" === e.type,
  1878. at.pointer = at.touch ? e.originalEvent[at.released ? "changedTouches" : "touches"][0] : e,
  1879. at.pathX = at.pointer.pageX - at.initX,
  1880. at.pathY = at.pointer.pageY - at.initY,
  1881. at.path = D(A(at.pathX, 2) + A(at.pathY, 2)),
  1882. at.delta = ge.horizontal ? at.pathX : at.pathY,
  1883. at.released || !(at.path < 1)) {
  1884. if (!at.init) {
  1885. if (!(ge.horizontal ? x(at.pathX) > x(at.pathY) : x(at.pathX) < x(at.pathY)))
  1886. return ne();
  1887. at.init = 1
  1888. }
  1889. r(e),
  1890. !at.locked && at.path > at.pathToLock && at.slidee && (at.locked = 1,
  1891. at.$source.on(B, s)),
  1892. at.released && (ne(),
  1893. ge.releaseSwing && at.slidee && (at.swing = (at.delta - at.history[0]) / 40 * 300,
  1894. at.delta += at.swing,
  1895. at.tweese = x(at.swing) > 10)),
  1896. X(at.slidee ? E(at.initPos - at.delta) : V(at.initPos + at.delta))
  1897. }
  1898. }
  1899. function ne() {
  1900. clearInterval(rt),
  1901. at.released = !0,
  1902. b.off(at.touch ? z : I, ae),
  1903. (at.slidee ? Pe : Se).removeClass(ge.draggedClass),
  1904. setTimeout(function() {
  1905. at.$source.off(B, s)
  1906. }),
  1907. Ce.cur === Ce.dest && at.init && pe("moveEnd"),
  1908. ye.resume(1),
  1909. at.init = 0
  1910. }
  1911. function ie(t) {
  1912. return ~e.inArray(t.nodeName, k) || e(t).is(ge.interactive)
  1913. }
  1914. function re() {
  1915. ye.stop(),
  1916. b.off("mouseup", re)
  1917. }
  1918. function se(e) {
  1919. switch (r(e),
  1920. this) {
  1921. case $e[0]:
  1922. case Qe[0]:
  1923. ye.moveBy($e.is(this) ? ge.moveBy : -ge.moveBy),
  1924. b.on("mouseup", re);
  1925. break;
  1926. case Ze[0]:
  1927. ye.prev();
  1928. break;
  1929. case Ge[0]:
  1930. ye.next();
  1931. break;
  1932. case Je[0]:
  1933. ye.prevPage();
  1934. break;
  1935. case Ke[0]:
  1936. ye.nextPage()
  1937. }
  1938. }
  1939. function oe(e) {
  1940. return nt.curDelta = (ge.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  1941. nt.curDelta /= 1 === e.deltaMode ? 3 : 100,
  1942. Re ? (p = +new Date,
  1943. nt.last < p - nt.resetTime && (nt.delta = 0),
  1944. nt.last = p,
  1945. nt.delta += nt.curDelta,
  1946. x(nt.delta) < 1 ? nt.finalDelta = 0 : (nt.finalDelta = E(nt.delta / 1),
  1947. nt.delta %= 1),
  1948. nt.finalDelta) : nt.curDelta
  1949. }
  1950. function le(e) {
  1951. e.originalEvent[g] = ye;
  1952. var t = +new Date;
  1953. if (O + ge.scrollHijack > t && Ue[0] !== document && Ue[0] !== window)
  1954. return void (O = t);
  1955. if (ge.scrollBy && Ce.start !== Ce.end) {
  1956. var a = oe(e.originalEvent);
  1957. (ge.scrollTrap || a > 0 && Ce.dest < Ce.end || 0 > a && Ce.dest > Ce.start) && r(e, 1),
  1958. ye.slideBy(ge.scrollBy * a)
  1959. }
  1960. }
  1961. function ce(e) {
  1962. ge.clickBar && e.target === Be[0] && (r(e),
  1963. X(V((ge.horizontal ? e.pageX - Be.offset().left : e.pageY - Be.offset().top) - Te / 2)))
  1964. }
  1965. function de(e) {
  1966. if (ge.keyboardNavBy)
  1967. switch (e.which) {
  1968. case ge.horizontal ? 37 : 38:
  1969. r(e),
  1970. ye["pages" === ge.keyboardNavBy ? "prevPage" : "prev"]();
  1971. break;
  1972. case ge.horizontal ? 39 : 40:
  1973. r(e),
  1974. ye["pages" === ge.keyboardNavBy ? "nextPage" : "next"]()
  1975. }
  1976. }
  1977. function ue(e) {
  1978. return ie(this) ? void (e.originalEvent[g + "ignore"] = !0) : void (this.parentNode !== Pe[0] || e.originalEvent[g + "ignore"] || ye.activate(this))
  1979. }
  1980. function fe() {
  1981. this.parentNode === De[0] && ye.activatePage(Ae.index(this))
  1982. }
  1983. function ve(e) {
  1984. ge.pauseOnHover && ye["mouseenter" === e.type ? "pause" : "resume"](2)
  1985. }
  1986. function pe(e, t) {
  1987. if (Ve[e]) {
  1988. for (me = Ve[e].length,
  1989. T.length = 0,
  1990. he = 0; me > he; he++)
  1991. T.push(Ve[e][he]);
  1992. for (he = 0; me > he; he++)
  1993. T[he].call(ye, e, t)
  1994. }
  1995. }
  1996. 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 = {
  1997. start: 0,
  1998. center: 0,
  1999. end: 0,
  2000. cur: 0,
  2001. dest: 0
  2002. }, Be = e(ge.scrollBar).eq(0), Se = Be.children().eq(0), ke = 0, Te = 0, xe = {
  2003. start: 0,
  2004. end: 0,
  2005. cur: 0
  2006. }, De = e(ge.pagesBar), Ae = 0, Ee = [], qe = 0, Ne = [], Oe = {
  2007. firstItem: 0,
  2008. lastItem: 0,
  2009. centerItem: 0,
  2010. activeItem: null,
  2011. activePage: 0
  2012. }, 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 = {
  2013. released: 1
  2014. }, nt = {
  2015. last: 0,
  2016. delta: 0,
  2017. resetTime: 200
  2018. }, it = 0, rt = 0, st = 0, ot = 0;
  2019. we || (t = be[0]),
  2020. ye.initialized = 0,
  2021. ye.frame = t,
  2022. ye.slidee = Pe[0],
  2023. ye.pos = Ce,
  2024. ye.rel = Oe,
  2025. ye.items = Ne,
  2026. ye.pages = Ee,
  2027. ye.isPaused = 0,
  2028. ye.options = ge,
  2029. ye.dragging = at,
  2030. ye.reload = function() {
  2031. H()
  2032. }
  2033. ,
  2034. ye.getPos = function(e) {
  2035. if (Re) {
  2036. var t = R(e);
  2037. return -1 !== t && Ne[t]
  2038. }
  2039. var a = Pe.find(e).eq(0);
  2040. if (a[0]) {
  2041. var n = ge.horizontal ? a.offset().left - Pe.offset().left : a.offset().top - Pe.offset().top
  2042. , i = a[ge.horizontal ? "outerWidth" : "outerHeight"]();
  2043. return {
  2044. start: n,
  2045. center: n - Ie / 2 + i / 2,
  2046. end: n - Ie + i,
  2047. size: i
  2048. }
  2049. }
  2050. return !1
  2051. }
  2052. ,
  2053. ye.moveBy = function(e) {
  2054. tt.speed = e,
  2055. !at.init && tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) && (tt.lastTime = +new Date,
  2056. tt.startPos = Ce.cur,
  2057. ee("button"),
  2058. at.init = 1,
  2059. pe("moveStart"),
  2060. y(ot),
  2061. M())
  2062. }
  2063. ,
  2064. ye.stop = function() {
  2065. "button" === at.source && (at.init = 0,
  2066. at.released = 1)
  2067. }
  2068. ,
  2069. ye.prev = function() {
  2070. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem - 1)
  2071. }
  2072. ,
  2073. ye.next = function() {
  2074. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem + 1)
  2075. }
  2076. ,
  2077. ye.prevPage = function() {
  2078. ye.activatePage(Oe.activePage - 1)
  2079. }
  2080. ,
  2081. ye.nextPage = function() {
  2082. ye.activatePage(Oe.activePage + 1)
  2083. }
  2084. ,
  2085. ye.slideBy = function(e, t) {
  2086. e && (Re ? ye[Le ? "toCenter" : "toStart"](d((Le ? Oe.centerItem : Oe.firstItem) + ge.scrollBy * e, 0, Ne.length)) : X(Ce.dest + e, t))
  2087. }
  2088. ,
  2089. ye.slideTo = function(e, t) {
  2090. X(e, t)
  2091. }
  2092. ,
  2093. ye.toStart = function(e, t) {
  2094. L("start", e, t)
  2095. }
  2096. ,
  2097. ye.toEnd = function(e, t) {
  2098. L("end", e, t)
  2099. }
  2100. ,
  2101. ye.toCenter = function(e, t) {
  2102. L("center", e, t)
  2103. }
  2104. ,
  2105. ye.getIndex = R,
  2106. ye.activate = function(e, t) {
  2107. var a = W(e);
  2108. ge.smart && a !== !1 && (Le ? ye.toCenter(a, t) : a >= Oe.lastItem ? ye.toStart(a, t) : a <= Oe.firstItem ? ye.toEnd(a, t) : K())
  2109. }
  2110. ,
  2111. ye.activatePage = function(e, t) {
  2112. l(e) && X(Ee[d(e, 0, Ee.length - 1)], t)
  2113. }
  2114. ,
  2115. ye.resume = function(e) {
  2116. ge.cycleBy && ge.cycleInterval && ("items" !== ge.cycleBy || Ne[0] && null != Oe.activeItem) && !(e < ye.isPaused) && (ye.isPaused = 0,
  2117. st ? st = clearTimeout(st) : pe("resume"),
  2118. st = setTimeout(function() {
  2119. switch (pe("cycle"),
  2120. ge.cycleBy) {
  2121. case "items":
  2122. ye.activate(Oe.activeItem >= Ne.length - 1 ? 0 : Oe.activeItem + 1);
  2123. break;
  2124. case "pages":
  2125. ye.activatePage(Oe.activePage >= Ee.length - 1 ? 0 : Oe.activePage + 1)
  2126. }
  2127. }, ge.cycleInterval))
  2128. }
  2129. ,
  2130. ye.pause = function(e) {
  2131. e < ye.isPaused || (ye.isPaused = e || 100,
  2132. st && (st = clearTimeout(st),
  2133. pe("pause")))
  2134. }
  2135. ,
  2136. ye.toggle = function() {
  2137. ye[st ? "pause" : "resume"]()
  2138. }
  2139. ,
  2140. ye.set = function(t, a) {
  2141. e.isPlainObject(t) ? e.extend(ge, t) : ge.hasOwnProperty(t) && (ge[t] = a)
  2142. }
  2143. ,
  2144. ye.add = function(t, a) {
  2145. var n = e(t);
  2146. Re ? (null == a || !Ne[0] || a >= Ne.length ? n.appendTo(Pe) : Ne.length && n.insertBefore(Ne[a].el),
  2147. null != Oe.activeItem && a <= Oe.activeItem && (_e.active = Oe.activeItem += n.length)) : Pe.append(n),
  2148. H()
  2149. }
  2150. ,
  2151. ye.remove = function(t) {
  2152. if (Re) {
  2153. var a = U(t);
  2154. if (a > -1) {
  2155. qe.eq(a).remove();
  2156. var n = a === Oe.activeItem;
  2157. null != Oe.activeItem && a < Oe.activeItem && (_e.active = --Oe.activeItem),
  2158. H(),
  2159. n && (_e.active = null,
  2160. ye.activate(Oe.activeItem))
  2161. }
  2162. } else
  2163. e(t).remove(),
  2164. H()
  2165. }
  2166. ,
  2167. ye.moveAfter = function(e, t) {
  2168. G(e, t, 1)
  2169. }
  2170. ,
  2171. ye.moveBefore = function(e, t) {
  2172. G(e, t)
  2173. }
  2174. ,
  2175. ye.on = function(e, t) {
  2176. if ("object" === i(e))
  2177. for (var a in e)
  2178. e.hasOwnProperty(a) && ye.on(a, e[a]);
  2179. else if ("function" === i(t))
  2180. for (var n = e.split(" "), r = 0, s = n.length; s > r; r++)
  2181. Ve[n[r]] = Ve[n[r]] || [],
  2182. -1 === J(n[r], t) && Ve[n[r]].push(t);
  2183. else if ("array" === i(t))
  2184. for (var o = 0, l = t.length; l > o; o++)
  2185. ye.on(e, t[o])
  2186. }
  2187. ,
  2188. ye.one = function(e, t) {
  2189. function a() {
  2190. t.apply(ye, arguments),
  2191. ye.off(e, a)
  2192. }
  2193. ye.on(e, a)
  2194. }
  2195. ,
  2196. ye.off = function(e, t) {
  2197. if (t instanceof Array)
  2198. for (var a = 0, n = t.length; n > a; a++)
  2199. ye.off(e, t[a]);
  2200. else
  2201. for (var i = e.split(" "), r = 0, s = i.length; s > r; r++)
  2202. if (Ve[i[r]] = Ve[i[r]] || [],
  2203. null == t)
  2204. Ve[i[r]].length = 0;
  2205. else {
  2206. var o = J(i[r], t);
  2207. -1 !== o && Ve[i[r]].splice(o, 1)
  2208. }
  2209. }
  2210. ,
  2211. ye.destroy = function() {
  2212. return Ue.add(Se).add(Be).add(De).add($e).add(Qe).add(Ze).add(Ge).add(Je).add(Ke).off("." + g),
  2213. b.off("keydown", de),
  2214. Ze.add(Ge).add(Je).add(Ke).removeClass(ge.disabledClass),
  2215. qe && null != Oe.activeItem && qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  2216. De.empty(),
  2217. we || (be.off("." + g),
  2218. He.restore(),
  2219. Xe.restore(),
  2220. Ye.restore(),
  2221. je.restore(),
  2222. e.removeData(t, g)),
  2223. Ne.length = Ee.length = 0,
  2224. _e = {},
  2225. ye.initialized = 0,
  2226. ye
  2227. }
  2228. ,
  2229. ye.init = function() {
  2230. if (!ye.initialized) {
  2231. ye.on(m);
  2232. var e = ["overflow", "position"]
  2233. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2234. He.save.apply(He, e),
  2235. Ye.save.apply(Ye, e),
  2236. Xe.save.apply(Xe, t),
  2237. je.save.apply(je, t);
  2238. var a = Se;
  2239. return we || (a = a.add(Pe),
  2240. be.css("overflow", "hidden"),
  2241. f || "static" !== be.css("position") || be.css("position", "relative")),
  2242. f ? v && a.css(f, v) : ("static" === Be.css("position") && Be.css("position", "relative"),
  2243. a.css({
  2244. position: "absolute"
  2245. })),
  2246. ge.forward && $e.on(S, se),
  2247. ge.backward && Qe.on(S, se),
  2248. ge.prev && Ze.on(B, se),
  2249. ge.next && Ge.on(B, se),
  2250. ge.prevPage && Je.on(B, se),
  2251. ge.nextPage && Ke.on(B, se),
  2252. Ue.on(C, le),// C是 "wheel.sly" 滚动监听
  2253. Be[0] && Be.on(B, ce),
  2254. Re && ge.activateOn && be.on(ge.activateOn + "." + g, "*", ue),
  2255. De[0] && ge.activatePageOn && De.on(ge.activatePageOn + "." + g, "*", fe),
  2256. We.on(P, {
  2257. source: "slidee"
  2258. }, te),
  2259. Se && Se.on(P, {
  2260. source: "handle"
  2261. }, te),
  2262. b.on("keydown", de),
  2263. we || (be.on("mouseenter." + g + " mouseleave." + g, ve),
  2264. be.on("scroll." + g, o)),
  2265. ye.initialized = 1,
  2266. H(!0),
  2267. ge.cycleBy && !we && ye[ge.startPaused ? "pause" : "resume"](),
  2268. ye
  2269. }
  2270. }
  2271. }
  2272. function i(e) {
  2273. 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
  2274. }
  2275. function r(e, t) {
  2276. e.preventDefault(),
  2277. t && e.stopPropagation()
  2278. }
  2279. function s(t) {
  2280. r(t, 1),
  2281. e(this).off(t.type, s)
  2282. }
  2283. function o() {
  2284. this.scrollLeft = 0,
  2285. this.scrollTop = 0
  2286. }
  2287. function l(e) {
  2288. return !isNaN(parseFloat(e)) && isFinite(e)
  2289. }
  2290. function c(e, t) {
  2291. return 0 | E(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2292. }
  2293. function d(e, t, a) {
  2294. return t > e ? t : e > a ? a : e
  2295. }
  2296. function u(e) {
  2297. var t = {};
  2298. return t.style = {},
  2299. t.save = function() {
  2300. if (e && e.nodeType) {
  2301. for (var a = 0; a < arguments.length; a++)
  2302. t.style[arguments[a]] = e.style[arguments[a]];
  2303. return t
  2304. }
  2305. }
  2306. ,
  2307. t.restore = function() {
  2308. if (e && e.nodeType) {
  2309. for (var a in t.style)
  2310. t.style.hasOwnProperty(a) && (e.style[a] = t.style[a]);
  2311. return t
  2312. }
  2313. }
  2314. ,
  2315. t
  2316. }
  2317. 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;
  2318. b.on(C, function(e) {
  2319. var t = e.originalEvent[g]
  2320. , a = +new Date;
  2321. (!t || t.options.scrollHijack < a - O) && (O = a)
  2322. }),
  2323. function(e) {
  2324. function t(e) {
  2325. var t = (new Date).getTime()
  2326. , n = Math.max(0, 16 - (t - a))
  2327. , i = setTimeout(e, n);
  2328. return a = t,
  2329. i
  2330. }
  2331. w = e.requestAnimationFrame || e.webkitRequestAnimationFrame || t;
  2332. var a = (new Date).getTime()
  2333. , n = e.cancelAnimationFrame || e.webkitCancelAnimationFrame || e.clearTimeout;
  2334. y = function(t) {
  2335. n.call(e, t)
  2336. }
  2337. }(window),
  2338. function() {
  2339. function e(e) {
  2340. for (var n = 0, i = t.length; i > n; n++) {
  2341. var r = t[n] ? t[n] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2342. if (null != a.style[r])
  2343. return r
  2344. }
  2345. }
  2346. var t = ["", "webkit", "moz", "ms", "o"]
  2347. , a = document.createElement("div");
  2348. f = e("transform"),
  2349. v = e("perspective") ? "translateZ(0) " : ""
  2350. }(),
  2351. t[m] = n,
  2352. e.fn[h] = function(t, a) {
  2353. var r, s;
  2354. return e.isPlainObject(t) || (("string" === i(t) || t === !1) && (r = t === !1 ? "destroy" : t,
  2355. s = Array.prototype.slice.call(arguments, 1)),
  2356. t = {}),
  2357. this.each(function(i, o) {
  2358. var l = e.data(o, g);
  2359. l || r ? l && r && l[r] && l[r].apply(l, s) : l = e.data(o, g, new n(o,t,a).init())
  2360. })
  2361. }
  2362. ,
  2363. n.defaults = {
  2364. slidee: null,
  2365. horizontal: !1,
  2366. itemNav: null,
  2367. itemSelector: null,
  2368. smart: !1,
  2369. activateOn: null,
  2370. activateMiddle: !1,
  2371. scrollSource: null,
  2372. scrollBy: 0,
  2373. scrollHijack: 300,
  2374. scrollTrap: !1,
  2375. dragSource: null,
  2376. mouseDragging: !1,
  2377. touchDragging: !1,
  2378. releaseSwing: !1,
  2379. swingSpeed: .2,
  2380. elasticBounds: !1,
  2381. interactive: null,
  2382. scrollBar: null,
  2383. dragHandle: !1,
  2384. dynamicHandle: !1,
  2385. minHandleSize: 50,
  2386. clickBar: !1,
  2387. syncSpeed: .5,
  2388. pagesBar: null,
  2389. activatePageOn: null,
  2390. pageBuilder: function(e) {
  2391. return "<li>" + (e + 1) + "</li>"
  2392. },
  2393. forward: null,
  2394. backward: null,
  2395. prev: null,
  2396. next: null,
  2397. prevPage: null,
  2398. nextPage: null,
  2399. cycleBy: null,
  2400. cycleInterval: 5e3,
  2401. pauseOnHover: !1,
  2402. startPaused: !1,
  2403. moveBy: 300,
  2404. speed: 0,
  2405. easing: "swing",
  2406. startAt: null,
  2407. keyboardNavBy: null,
  2408. draggedClass: "dragged",
  2409. activeClass: "active",
  2410. disabledClass: "disabled"
  2411. }
  2412. }(jQuery, window);
  2413. !function e(t, i, n) {
  2414. function r(a, s) {
  2415. if (!i[a]) {
  2416. if (!t[a]) {
  2417. var l = "function" == typeof require && require;
  2418. if (!s && l)
  2419. return l(a, !0);
  2420. if (o)
  2421. return o(a, !0);
  2422. var c = new Error("Cannot find module '" + a + "'");
  2423. throw c.code = "MODULE_NOT_FOUND",
  2424. c
  2425. }
  2426. var h = i[a] = {
  2427. exports: {}
  2428. };
  2429. t[a][0].call(h.exports, function(e) {
  2430. var i = t[a][1][e];
  2431. return r(i ? i : e)
  2432. }, h, h.exports, e, t, i, n)
  2433. }
  2434. return i[a].exports
  2435. }
  2436. for (var o = "function" == typeof require && require, a = 0; a < n.length; a++)
  2437. r(n[a]);
  2438. return r
  2439. }({
  2440. 1: [function(e, t, i) {
  2441. (function(i) {
  2442. "use strict";
  2443. function n(e) {
  2444. this.player = null,
  2445. this.director = null,
  2446. this.modelManager = null,
  2447. this.container = null,
  2448. this.tagManager = null,
  2449. this.fadeInSpeed = e,
  2450. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2451. }
  2452. var r = e("three")
  2453. , o = e("./util/logger")
  2454. , a = (e("./util/common"),
  2455. e("./enum/PlayerEvents"))
  2456. , s = e("./enum/DirectorEvents")
  2457. , l = e("./settings")
  2458. , c = e("./enum/Viewmode")
  2459. , h = (e("./enum/WarpStyle"),
  2460. e("./enum/BlackoutStyle"),
  2461. e("./enum/ModelManagerEvents"))
  2462. , u = e("./enum/tagEvents")
  2463. , d = e("./util/transitions")
  2464. , p = e("./util/lerp")
  2465. , f = new o(i);
  2466. //window.THREE = r;
  2467. n.prototype.init = function(e, t, i, n, r) {
  2468. window.app = this;
  2469. this.player = t,
  2470. this.director = e,
  2471. this.modelManager = i,
  2472. this.tagManager = n,
  2473. this.container = r,
  2474. this.updateModel(),
  2475. this.bindEvents()
  2476. }
  2477. ,
  2478. n.prototype.bindEvents = function() {
  2479. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  2480. this.player.on(a.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2481. this.player.on(a.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2482. this.player.on(a.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2483. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  2484. this.player.on(a.StartOutside, this.handleStartOutside.bind(this)),
  2485. this.player.on(a.WarpStarted, this.handleWarpStarted.bind(this)),
  2486. this.director.on(s.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2487. this.tagManager.on(u.TagActivated, this.ontagActivated.bind(this)),
  2488. this.tagManager.on(u.TagNavigation, this.onNavigationTotag.bind(this))
  2489. }
  2490. ,
  2491. n.prototype.updateModel = function() {
  2492. //模型this.model
  2493. this.model = this.modelManager.getActiveModel()
  2494. }
  2495. ,
  2496. n.prototype.handleWarpStarted = function() {
  2497. this.hidePlayerReticule()
  2498. }
  2499. ,
  2500. n.prototype.ontagActivated = function() {
  2501. this.hidePlayerReticule()
  2502. }
  2503. ,
  2504. n.prototype.onNavigationTotag = function() {
  2505. this.hidePlayerReticule()
  2506. }
  2507. ,
  2508. n.prototype.handlePlayerModeChanging = function(e, t, i) {
  2509. var n = this.modelManager.getActiveModel()
  2510. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : l[t].markerOpacity;
  2511. n.fadePanoMarkers(r),
  2512. n.setMode(t)
  2513. }
  2514. ,
  2515. n.prototype.handlePlayerModeChanged = function(e, t) {
  2516. var i = this.modelManager.getActiveModel()
  2517. , n = t === c.PANORAMA ? r.DoubleSide : r.FrontSide;
  2518. i.setSide(n),
  2519. i.setMode(t)
  2520. }
  2521. ,
  2522. n.prototype.handleClosestPanoChanging = function(e, t, i) {
  2523. i !== c.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2524. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2525. }
  2526. ,
  2527. n.prototype.handleActionInterruption = function() {}
  2528. ,
  2529. n.prototype.handleStartInside = function(e) {
  2530. var t = l[this.player.mode]
  2531. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2532. this.fadeIn(this.fadeInSpeed),
  2533. this.model.alpha = 0,
  2534. this.model.skybox.material.uniforms.opacity.value = 1,
  2535. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2536. var n = this.player.reticule;
  2537. d.start(p.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2538. }
  2539. ,
  2540. n.prototype.handleStartOutside = function(e) {
  2541. this.fadeIn(e)
  2542. }
  2543. ,
  2544. n.prototype.fadeIn = function(e) {
  2545. null !== e && void 0 !== e || (e = 2e3,
  2546. f.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2547. $(this.container).fadeIn(e)
  2548. }
  2549. ,
  2550. n.prototype.hidePlayerReticule = function() {
  2551. this.player.reticule.hide()
  2552. }
  2553. ,
  2554. t.exports = n
  2555. }
  2556. ).call(this, "/js/DisplayController.js")
  2557. }
  2558. , {
  2559. "./enum/BlackoutStyle": 18,
  2560. "./enum/DirectorEvents": 23,
  2561. "./enum/tagEvents": 32,
  2562. "./enum/ModelManagerEvents": 33,
  2563. "./enum/PlayerEvents": 40,
  2564. "./enum/Viewmode": 51,
  2565. "./enum/WarpStyle": 52,
  2566. "./settings": 166,
  2567. "./util/common": 185,
  2568. "./util/lerp": 188,
  2569. "./util/logger": 189,
  2570. "./util/transitions": 195,
  2571. three: 217
  2572. }],
  2573. 2: [function(e, t, i) {
  2574. "use strict";
  2575. function n() {
  2576. this.baseStartTime = performance.timing.navigationStart,
  2577. this.loadingStartTime = null,
  2578. this.waitingStartTime = null,
  2579. this.appReadyTime = null
  2580. }
  2581. n.prototype.setBaseStartTime = function(e) {
  2582. this.baseStartTime = e || Date.now()
  2583. }
  2584. ,
  2585. n.prototype.setWaitingStartTime = function(e) {
  2586. this.waitingStartTime = e || Date.now()
  2587. }
  2588. ,
  2589. n.prototype.setLoadingStartTime = function(e) {
  2590. this.loadingStartTime = e || Date.now()
  2591. }
  2592. ,
  2593. n.prototype.setAppReadyTime = function(e) {
  2594. this.appReadyTime = e || Date.now()
  2595. }
  2596. ,
  2597. n.prototype.calcFullLoadingTime = function() {
  2598. var e = this.appReadyTime - this.baseStartTime;
  2599. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  2600. e
  2601. }
  2602. ,
  2603. t.exports = n
  2604. }
  2605. , {}],
  2606. 3: [function(e, t, i) {
  2607. (function(i) {
  2608. "use strict";
  2609. function n() {
  2610. return 100 * Math.random()
  2611. }
  2612. var r = e("./util/logger")
  2613. , o = e("./util/browser")
  2614. , a = new r(i)
  2615. , s = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2616. initialized: !1,
  2617. init: function(e, t) {
  2618. if (t = t || {},
  2619. !this.initialized) {
  2620. this.initialized = !0,
  2621. o.valueFromHash("tilegen") && (t.tilegen = 1 === o.valueFromHash("tilegen", 0)),
  2622. o.valueFromHash("imgopt") && (t.imgopt = 1 === o.valueFromHash("imgopt", 0));
  2623. for (var i in e) {
  2624. var r = i.match("^sc_tilegen_([0-9]+)$");
  2625. r && (s.tilegen = n() < parseInt(r[1]));
  2626. var l = i.match("^sc_imgopt_([0-9]+)$");
  2627. l && (s.imgopt = n() < parseInt(l[1]))
  2628. }
  2629. for (var c in t)
  2630. s[c] = t[c],
  2631. a.debug("A/B override:", c, s[c])
  2632. }
  2633. },
  2634. changeIfTileGenerating: function(e) {
  2635. return s.tilegen && (e += e.indexOf("?") === -1 ? "?" : "&",
  2636. e += ""),
  2637. e
  2638. },
  2639. changeIfImageOptimzing: function(e) {
  2640. return s.imgopt && e.indexOf("imgopt=1") === -1 && (e += e.indexOf("?") === -1 ? "?" : "&",
  2641. e += ""),
  2642. e
  2643. },
  2644. tilegen: !1,
  2645. imgopt: !1
  2646. };
  2647. t.exports = s
  2648. }
  2649. ).call(this, "/js/ab.js")
  2650. }
  2651. , {
  2652. "./util/browser": 182,
  2653. "./util/logger": 189
  2654. }],
  2655. 4: [function(e, t, i) {
  2656. (function(i) {
  2657. "use strict";
  2658. function n() {
  2659. return {
  2660. addons: [{
  2661. name: "keen:ua_parser",
  2662. input: {
  2663. ua_string: "user_agent"
  2664. },
  2665. output: "parsed_user_agent"
  2666. }]
  2667. }
  2668. }
  2669. function r(e, t, i, n) {
  2670. function r(t) {
  2671. l[t.sid] = !0;
  2672. var i = t.billboard.media && t.billboard.media.type
  2673. , n = {
  2674. tag_id: t.sid,
  2675. tags_visited: Object.keys(l).length,
  2676. tag_count: Object.keys(e.tags).length,
  2677. tag_view_count: ++E,
  2678. has_media: !!i
  2679. };
  2680. i && (n.media_type = i),
  2681. u("tag_opened", n)
  2682. }
  2683. var l = {}
  2684. , h = Date.now() - N
  2685. , f = null;
  2686. n && (f = Date.now() - window.navigationStart);
  2687. var g;
  2688. try {
  2689. g = /* e.data.player_options.highlight_reel && */ e.heroLocations.length > 0
  2690. } catch (e) {
  2691. g = !1
  2692. }
  2693. var v, A = e.supportsVR;
  2694. A || (v = "VR disabled at the model/account level",
  2695. 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"))),
  2696. u("model_loaded", {
  2697. duration: h,
  2698. duration_from_navigation_start: f,
  2699. has_hlr: g,
  2700. has_vr: A,
  2701. vr_reason: v
  2702. });
  2703. var I = 0;
  2704. e.panos.forEach(function(e) {
  2705. e.on("enter", function() {
  2706. c("pano_viewed", {
  2707. pano_id: e.id,
  2708. pano_view_count: ++I,
  2709. alignment_type: e.alignmentType,
  2710. interaction_source: O,
  2711. navigation_source: p
  2712. })
  2713. })
  2714. });
  2715. var E = 0;
  2716. for (var T in e.tags)
  2717. e.tags[T].billboard.on(M.OPENED, r.bind(this, e.tags[T]));
  2718. t.on("tour_auto", function(e) {
  2719. p = "tour_" + e
  2720. }),
  2721. t.on("tour_manual", function(e) {
  2722. O = "gui-" + e,
  2723. p = "tour_manual"
  2724. }),
  2725. i.on(C.InteractionKey, function() {
  2726. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionKey)
  2727. }),
  2728. i.on(C.InteractionDirect, function() {
  2729. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionDirect)
  2730. }),
  2731. o(t),
  2732. a(),
  2733. s()
  2734. }
  2735. function o(e) {
  2736. I.on(T.OPENED, function() {
  2737. c("showcase_share_intent", {
  2738. pano_id: e.currentPano && e.currentPano.id
  2739. })
  2740. }),
  2741. I.on(T.LINK_CLICKED, function(t) {
  2742. c("showcase_share_action", {
  2743. channel: t.channel,
  2744. pano_id: e.currentPano && e.currentPano.id
  2745. })
  2746. }),
  2747. E.on(x.ORIGIN_LINK_CLICKED, function() {
  2748. c("showcase_share_origin_link_clicked")
  2749. })
  2750. }
  2751. function a() {}
  2752. function s() {
  2753. b.on(S.OPENED, c.bind(this, "showcase_gui", {
  2754. gui_action: "click_vr_button"
  2755. })),
  2756. b.on(S.LAUNCH, function(e) {
  2757. c("showcase_gui", {
  2758. gui_action: "launch_vr",
  2759. vr_platform: e.vr_platform,
  2760. vr_app: e.vr_app
  2761. })
  2762. }),
  2763. b.on(S.PREV, c.bind(this, "showcase_gui", {
  2764. gui_action: "vr_modal_prev"
  2765. })),
  2766. b.on(S.NEXT, function(e) {
  2767. c("showcase_gui", {
  2768. gui_action: e.nextAction
  2769. })
  2770. }),
  2771. b.on(S.CLOSED, c.bind(this, "showcase_gui", {
  2772. gui_action: "vr_modal_close"
  2773. })),
  2774. b.on(S.falseICECHOSEN, function(e) {
  2775. c("showcase_gui", {
  2776. gui_action: e.name + " "
  2777. })
  2778. }),
  2779. b.on(S.STORE, function(e) {
  2780. c("showcase_gui", {
  2781. gui_action: "launch_store",
  2782. store: e
  2783. })
  2784. })
  2785. }
  2786. function l(e, t) {
  2787. if (f)
  2788. try {
  2789. f.addEvent(e, v.extendObject({
  2790. host: window.location.host,
  2791. keen: n(),
  2792. user_agent: "${keen.user_agent}",
  2793. referrer: {
  2794. url: v.normalizeUrl(document.referrer),
  2795. domain: v.domainFromUrl(document.referrer),
  2796. url_original: document.referrer
  2797. },
  2798. embedded: m.inIframe(),
  2799. is_mobile: m.isMobile(),
  2800. version: "2.25.6-0-gd87e5b1"
  2801. }, t))
  2802. } catch (e) {
  2803. P.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2804. }
  2805. }
  2806. function c(e, t) {
  2807. if (t = t || {},
  2808. L)
  2809. try {
  2810. window.analytics.track(e, v.extendObject(t, B), {
  2811. context: {
  2812. app: {
  2813. name: "showcase",
  2814. version: "2.25.6-0-gd87e5b1"
  2815. },
  2816. screen: {
  2817. width: window.screen.width,
  2818. height: window.screen.height,
  2819. density: window.devicePixelRatio
  2820. }
  2821. }
  2822. })
  2823. } catch (t) {
  2824. console.warn("Failed to send data to segment for " + e)
  2825. }
  2826. }
  2827. function h(e, t) {
  2828. if (t = t || {},
  2829. navigator.sendBeacon && L)
  2830. try {
  2831. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  2832. event: e,
  2833. anonymousId: window.analytics.user().anonymousId(),
  2834. properties: v.extendObject(t, B),
  2835. writeKey: L,
  2836. sentAt: Date.now(),
  2837. type: "track",
  2838. context: {
  2839. userAgent: m.userAgent(),
  2840. library: {
  2841. name: "showcase-beacon",
  2842. version: "2.25.6-0-gd87e5b1"
  2843. },
  2844. app: {
  2845. name: "showcase",
  2846. version: "2.25.6-0-gd87e5b1"
  2847. }
  2848. }
  2849. }))
  2850. } catch (e) {
  2851. console.warn("Failed to send async segment request")
  2852. }
  2853. }
  2854. function u(e, t) {
  2855. t = t || {},
  2856. c(e, t)
  2857. }
  2858. function d(e, t) {
  2859. O = e === C.InteractionGui ? "gui-" + t : e,
  2860. p = "self_guided"
  2861. }
  2862. var p, f, g = (e("three"),
  2863. e("./util/ajax"),
  2864. e("./ab")), m = e("./util/browser"), v = e("./util/common"), A = e("./settings"), y = (e("./localization/localize"),
  2865. 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"),
  2866. "direct"), L = null, D = !1, N = null, B = null, F = v.uuid4();
  2867. t.exports = {
  2868. report: function(e, t, i, n) {
  2869. l("Session starts", {
  2870. model: e,
  2871. status: t,
  2872. loadtime: Date.now() - (N || Date.now()),
  2873. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2874. autoplay: i,
  2875. quickstart: n,
  2876. ab_tilegen: g.tilegen,
  2877. ab_imgopt: g.imgopt
  2878. })
  2879. },
  2880. impression: function(e) {
  2881. e = e || {};
  2882. var t = void 0 === e.isVisible || e.isVisible
  2883. , i = (void 0 !== e.immediate && e.immediate,
  2884. window.location.search.substr(1).split("&"));
  2885. u("impression", {
  2886. visible: t,
  2887. url_params: i
  2888. })
  2889. },
  2890. initKeen: function(e) {
  2891. return e.token && e.appId ? void (f = new Keen({
  2892. projectId: e.appId,
  2893. writeKey: e.token,
  2894. readKey: "",
  2895. requestType: "xhr"
  2896. })) : void P.warn("no keen token/appId")
  2897. },
  2898. initSegment: function(e) {
  2899. return e.token ? (L = e.token,
  2900. window.analytics.load(e.token),
  2901. B = {
  2902. model_id: e.model,
  2903. start_source: e.startSource,
  2904. autoplay: e.autoplay,
  2905. quickstart: e.quickstart,
  2906. language_tag: A.languageTag,
  2907. is_mobile: m.isMobile(),
  2908. iframe: m.inIframe(),
  2909. aspect_ratio: m.aspectRatio(),
  2910. session_id: F,
  2911. window: {
  2912. width: $("#player").width(),
  2913. height: $("#player").height()
  2914. },
  2915. platform: {
  2916. browser: {
  2917. name: $.ua.browser.name,
  2918. major: $.ua.browser.major,
  2919. version: $.ua.browser.version
  2920. },
  2921. os: {
  2922. name: $.ua.os.name,
  2923. version: $.ua.os.version
  2924. },
  2925. device: {
  2926. vendor: $.ua.device.vendor,
  2927. model: $.ua.device.model,
  2928. type: $.ua.device.type
  2929. }
  2930. }
  2931. },
  2932. D = Math.random() < A.analytics.sessionTrackingRate,
  2933. P.debug("tracking sample rate = " + A.analytics.sessionTrackingRate),
  2934. void P.debug("tracking this session = " + D)) : void P.warn("no segment token")
  2935. },
  2936. sessionStart: function(e) {
  2937. P.debug("analytics user_session_start"),
  2938. c("session_started"),
  2939. N = Date.now(),
  2940. window.addEventListener("unload", function() {
  2941. h("session_ended", {
  2942. duration: Date.now() - N
  2943. })
  2944. })
  2945. },
  2946. modelLoaded: function(e, t, i, n) {
  2947. r(e, t, i, n)
  2948. },
  2949. loadComplete: function(e) {
  2950. var t = {
  2951. time_to_app_start: e
  2952. };
  2953. c("load_times", t)
  2954. },
  2955. track: function(e, t) {
  2956. D && (P.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  2957. c(e, t))
  2958. },
  2959. trackAlways: function(e, t) {
  2960. P.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  2961. c(e, t)
  2962. },
  2963. getSessionId: function() {
  2964. return F
  2965. },
  2966. updateInteraction: d
  2967. }
  2968. }
  2969. ).call(this, "/js/analytics.js")
  2970. }
  2971. , {
  2972. "./ab": 3,
  2973. "./enum/ControlEvents": 21,
  2974. "./enum/PlayerEvents": 40,
  2975. "./enum/VROption": 47,
  2976. "./enum/VRPlatforms": 49,
  2977. "./enum/Viewmode": 51,
  2978. "./gui/sharing/ShareEvents": 76,
  2979. "./gui/sharing/modal": 77,
  2980. "./gui/title/TitleEvents": 80,
  2981. "./gui/title/titleBar": 82,
  2982. "./gui/vr/vrEvent": 85,
  2983. "./gui/vr/vrModal": 87,
  2984. "./localization/localize": 108,
  2985. "./tag/Billboard/BillboardEvent": 120,
  2986. "./settings": 166,
  2987. "./util/ajax": 181,
  2988. "./util/browser": 182,
  2989. "./util/common": 185,
  2990. "./util/logger": 189,
  2991. three: 217
  2992. }],
  2993. 5: [function(e, t, i) {
  2994. "use strict";
  2995. function n() {
  2996. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
  2997. this.controls = null
  2998. }
  2999. var r = e("three")
  3000. , o = e("../constants")
  3001. , a = e("../util/cameraLight");
  3002. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  3003. n.prototype.updateAspect = function(e) {
  3004. this.aspect = e,
  3005. this.updateProjectionMatrix()
  3006. }
  3007. ,
  3008. t.exports = n
  3009. }
  3010. , {
  3011. "../constants": 8,
  3012. "../util/cameraLight": 184,
  3013. three: 217
  3014. }],
  3015. 6: [function(e, t, i) {
  3016. "use strict";
  3017. function n() {
  3018. var e = $("#player").width() / $("#player").height();
  3019. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  3020. this.controls = null,
  3021. this.updateAspect(e)
  3022. }
  3023. var r = e("three")
  3024. , o = e("../constants");
  3025. n.prototype = Object.create(r.OrthographicCamera.prototype),
  3026. n.prototype.updateAspect = function(e) {
  3027. this.aspect = e,
  3028. this.top = o.orthoBase / e,
  3029. this.bottom = -o.orthoBase / e,
  3030. this.updateProjectionMatrix()
  3031. }
  3032. ,
  3033. t.exports = n
  3034. }
  3035. , {
  3036. "../constants": 8,
  3037. three: 217
  3038. }],
  3039. 7: [function(e, t, i) {
  3040. "use strict";
  3041. function n() {
  3042. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
  3043. this.controls = null
  3044. }
  3045. var r = e("three")
  3046. , o = e("../settings")
  3047. , a = e("../util/cameraLight");
  3048. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  3049. n.prototype.updateAspect = function(e) {
  3050. this.aspect = e,
  3051. this.updateProjectionMatrix()
  3052. }
  3053. ,
  3054. t.exports = n
  3055. }
  3056. , {
  3057. "../settings": 166,
  3058. "../util/cameraLight": 184,
  3059. three: 217
  3060. }],
  3061. 8: [function(e, t, i) {
  3062. "use strict";
  3063. t.exports = {
  3064. signedUrlDefaultExpireTime: 24e4,
  3065. signedUrlCheckInterval: 1e4,
  3066. signedUrlRefreshBuffer: 15e3,
  3067. dollhouseFOV: 70,
  3068. dollhouseNear: 1,
  3069. dollhouseFar: 5e3,
  3070. insideFOV: 70,
  3071. insideFOVMax: 120,
  3072. insideNear: .1,
  3073. insideFar: 5e3,
  3074. insideLookSpeed: .12,
  3075. insideLookLimitUp: 40, //视角
  3076. insideLookLimitDown: -40,
  3077. orthoNear: 1,
  3078. orthoFar: 5e3,
  3079. orthoBase: 10,
  3080. narrowLandscapeHeight: 290,
  3081. reallyNarrowLandscapeHeight: 250,
  3082. visionTilingStartDate: new Date("8/26/2016"),
  3083. visionTilingStartVersion: "1.1.407.13667",
  3084. windowHeightHighQualityThreshold: 900,
  3085. tourStepDelayDefault: 3500,
  3086. tourStepDelaySlideShow: 5e3,
  3087. workshopApsect: 9 / 16,
  3088. highQualityMaxZoom: 2,
  3089. ultraHighQualityMaxZoom: 3
  3090. }
  3091. }
  3092. , {}],
  3093. 9: [function(e, t, i) {
  3094. "use strict";
  3095. function n() {
  3096. this.activeControl = null,
  3097. this.controls = {},
  3098. this.cameras = {}
  3099. }
  3100. var r = e("./PanoramaControls")
  3101. , o = e("./DollhouseControls")
  3102. , a = e("./FloorplanControls")
  3103. , s = e("../cameras/PanoramaCamera")
  3104. , l = e("../cameras/DollhouseCamera")
  3105. , c = e("../cameras/FloorplanCamera")
  3106. , h = e("events").EventEmitter
  3107. , u = e("../enum/ControlEvents")
  3108. , d = e("../enum/ModelManagerEvents")
  3109. , p = e("../enum/Viewmode")
  3110. , f = e("../settings");
  3111. n.prototype = Object.create(h.prototype),
  3112. n.prototype.init = function(e, t) {
  3113. this.setUpControls(),
  3114. this.bindEvents(e, t)
  3115. }
  3116. ,
  3117. n.prototype.activateControls = function(e) {
  3118. this.activeControl && (this.activeControl.reset(),
  3119. this.activeControl.enabled = !1),
  3120. this.controls[e] && (this.controls[e].enabled = !0),
  3121. this.activeControl = this.controls[e]
  3122. }
  3123. ,
  3124. n.prototype.setUpControls = function() {
  3125. var e = {}
  3126. , t = {}
  3127. , i = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3128. , n = [s, l, c]
  3129. , h = [r, o, a];
  3130. i.forEach(function(i, r) {
  3131. e[i] = new n[r],
  3132. t[i] = new h[r](e[i]),
  3133. t[i].on(u.Move, this.emit.bind(this, u.Move)),
  3134. t[i].on(u.InputStart, this.emit.bind(this, u.InputStart)),
  3135. t[i].on(u.InteractionDirect, this.emit.bind(this, u.InteractionDirect)),
  3136. t[i].on(u.InteractionKey, this.emit.bind(this, u.InteractionKey)),
  3137. t[i].on(u.Pinch, this.emit.bind(this, u.Pinch)),
  3138. t[i].on(u.Scroll, this.emit.bind(this, u.Scroll))
  3139. }
  3140. .bind(this)),
  3141. this.controls = t,
  3142. this.cameras = e
  3143. }
  3144. ,
  3145. n.prototype.bindEvents = function(e, t) {
  3146. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3147. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3148. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3149. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3150. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this),{ passive: false }),
  3151. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3152. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3153. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3154. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3155. e.addEventListener("contextmenu", function(e) {
  3156. e.preventDefault()
  3157. }),
  3158. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3159. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3160. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3161. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3162. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3163. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3164. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3165. t.on(d.ActiveModelChanged, function(e) {
  3166. this.setModelForControls(e.model)
  3167. }
  3168. .bind(this))
  3169. }
  3170. ,
  3171. n.prototype.setModelForControls = function(e) {
  3172. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3173. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3174. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3175. this.controls[e].setBounds(t)
  3176. }
  3177. .bind(this))
  3178. }
  3179. ,
  3180. n.prototype.onMouseDown = function(e) {
  3181. e.preventDefault(),
  3182. this.activeControl && this.activeControl.onMouseDown(e)
  3183. }
  3184. ,
  3185. n.prototype.onMouseMove = function(e) {
  3186. e.preventDefault(),
  3187. this.activeControl && this.activeControl.onMouseMove(e)
  3188. }
  3189. ,
  3190. n.prototype.onMouseUp = function(e) {
  3191. e.preventDefault(),
  3192. this.activeControl && this.activeControl.onMouseUp(e)
  3193. }
  3194. ,
  3195. n.prototype.onMouseOver = function(e) {
  3196. e.preventDefault(),
  3197. this.activeControl && this.activeControl.onMouseOver(e)
  3198. }
  3199. ,
  3200. n.prototype.onMouseWheel = function(e) {
  3201. e.preventDefault(),
  3202. this.activeControl && this.activeControl.onMouseWheel(e)
  3203. }
  3204. ,
  3205. n.prototype.onTouchStart = function(e) {
  3206. e.preventDefault(),
  3207. this.activeControl && this.activeControl.onTouchStart(e);
  3208. var hotList = $('#hotListWrap')[0];
  3209. hotList.classList.remove('hotListActive');
  3210. $('#hotListContent ul .active').removeClass('active');
  3211. $('#hotList')[0].classList.remove('active')
  3212. }
  3213. ,
  3214. n.prototype.onTouchMove = function(e) {
  3215. e.preventDefault(),
  3216. this.activeControl && this.activeControl.onTouchMove(e)
  3217. }
  3218. ,
  3219. n.prototype.onTouchEnd = function(e) {
  3220. e.preventDefault(),
  3221. this.activeControl && this.activeControl.onTouchEnd(e)
  3222. }
  3223. ,
  3224. n.prototype.onPointerDown = function(e) {
  3225. if (e.preventDefault(),
  3226. this.activeControl)
  3227. switch (e.pointerType) {
  3228. case "mouse":
  3229. this.activeControl.onMouseDown(e);
  3230. break;
  3231. default:
  3232. this.activeControl.onPointerDown(e)
  3233. }
  3234. }
  3235. ,
  3236. n.prototype.onPointerMove = function(e) {
  3237. if (e.preventDefault(),
  3238. this.activeControl)
  3239. switch (e.pointerType) {
  3240. case "mouse":
  3241. this.activeControl.onMouseMove(e);
  3242. break;
  3243. default:
  3244. this.activeControl.onPointerMove(e)
  3245. }
  3246. }
  3247. ,
  3248. n.prototype.onPointerUp = function(e) {
  3249. if (e.preventDefault(),
  3250. this.activeControl)
  3251. switch (e.pointerType) {
  3252. case "mouse":
  3253. this.activeControl.onMouseUp(e);
  3254. break;
  3255. default:
  3256. this.activeControl.onPointerUp(e)
  3257. }
  3258. }
  3259. ,
  3260. n.prototype.onPointerCancel = function(e) {
  3261. e.preventDefault(),
  3262. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3263. }
  3264. ,
  3265. n.prototype.onKeyDown = function(e) {
  3266. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3267. this.activeControl && this.activeControl.onKeyDown(e))
  3268. }
  3269. ,
  3270. n.prototype.onKeyUp = function(e) {
  3271. e.preventDefault(),
  3272. this.activeControl && this.activeControl.onKeyUp(e)
  3273. }
  3274. ,
  3275. t.exports = n
  3276. }
  3277. , {
  3278. "../cameras/DollhouseCamera": 5,
  3279. "../cameras/FloorplanCamera": 6,
  3280. "../cameras/PanoramaCamera": 7,
  3281. "../enum/ControlEvents": 21,
  3282. "../enum/ModelManagerEvents": 33,
  3283. "../enum/Viewmode": 51,
  3284. "../settings": 166,
  3285. "./DollhouseControls": 10,
  3286. "./FloorplanControls": 11,
  3287. "./PanoramaControls": 13,
  3288. events: 202
  3289. }],
  3290. 10: [function(e, t, i) {
  3291. "use strict";
  3292. function n(e) {
  3293. a.call(this, e),
  3294. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3295. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3296. this.minDistance = o.dollhouseDefault.minDistance,
  3297. this.maxDistance = o.dollhouseDefault.maxDistance,
  3298. this.adjustedMinDistance = this.minDistance,
  3299. this.adjustedMaxDistance = this.maxDistance
  3300. }
  3301. var r = e("three")
  3302. , o = e("../settings")
  3303. , a = e("./OutsideControls");
  3304. n.prototype = Object.create(a.prototype),
  3305. n.prototype.pan = function(e, t) {
  3306. this.camera.updateMatrix();
  3307. var i = this.camera.position.clone().sub(this.target).length();
  3308. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3309. this.panLeft(2 * e * i / $("#player").height()),
  3310. this.panUp(-2 * t * i / $("#player").height())
  3311. }
  3312. ,
  3313. n.prototype.updateZoom = function() {
  3314. var e = this.offset.length();
  3315. return e * this.scale
  3316. }
  3317. ,
  3318. n.prototype.setZoomBounds = function(e) {
  3319. var t = e.min.distanceTo(e.max);
  3320. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3321. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3322. this.minDistance = this.adjustedMinDistance,
  3323. this.maxDistance = this.adjustedMaxDistance
  3324. }
  3325. ,
  3326. n.prototype.resetRanges = function(e, t) {
  3327. e ? (this.minDistance = Math.min(e, this.minDistance),
  3328. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3329. this.maxDistance = this.adjustedMaxDistance),
  3330. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3331. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3332. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3333. }
  3334. ,
  3335. n.prototype.toJSON = function() {
  3336. return a.prototype.toJSON.call(this)
  3337. }
  3338. ,
  3339. t.exports = n
  3340. }
  3341. , {
  3342. "../settings": 166,
  3343. "./OutsideControls": 12,
  3344. three: 217
  3345. }],
  3346. 11: [function(e, t, i) {
  3347. "use strict";
  3348. function n(e) {
  3349. a.call(this, e),
  3350. this.minDistance = 15,
  3351. this.maxDistance = 50,
  3352. this.noRotateUpDown = !0,
  3353. this.minPolarAngle = 0,
  3354. this.maxPolarAngle = 0,
  3355. this.mouseActions[l.LEFT] = s.PAN,
  3356. this.mouseActions[l.MIDDLE] = s.DOLLY,
  3357. this.mouseActions[l.RIGHT] = s.ROTATE,
  3358. this.touchActions[1] = s.PAN,
  3359. this.touchActions[2] = s.ROTATE_DOLLY,
  3360. this.absoluteScale = 1,
  3361. this.currentScale = 1
  3362. }
  3363. var r = e("three")
  3364. , o = e("../settings")
  3365. , a = e("./OutsideControls")
  3366. , s = e("../enum/ControlActions")
  3367. , l = e("../enum/MouseButton")
  3368. , c = e("../util/math")
  3369. , h = e("../util/browser");
  3370. n.prototype = Object.create(a.prototype),
  3371. n.prototype.zoomToContain = function(e) {
  3372. this.absoluteScale = this.getDefaultAbsoluteScale(e);
  3373. this.currentScale = this.absoluteScale
  3374. }
  3375. ,
  3376. n.prototype.getDefaultAbsoluteScale = function(modelSize, ratio) {
  3377. let defaultRatio = 1.2 , absoluteScale
  3378. if(_settings.floorPlanAngle){//指定了角度的话,就和browser.aspectRatio()无关,总使用纵向
  3379. var angle = parseFloat(_settings.floorPlanAngle)
  3380. modelSize = modelSize.clone().applyEuler(new THREE.Euler(0, angle, 0))
  3381. var n = Math.max(Math.abs(modelSize.x), Math.abs(modelSize.z) * this.camera.aspect) //视口宽高比 >= 1 情况下,模型所占最大视口尺寸
  3382. var screenSize = Math.min($("#player").width(), $("#player").height())
  3383. var maxSize = 800;//模型最大占据像素
  3384. ratio = ratio != void 0 ? ratio : Math.max(screenSize * defaultRatio / maxSize, defaultRatio) ;
  3385. absoluteScale = n / 2 / o.orthoBase * ratio; //根据模型所占最大视口尺寸调整缩放
  3386. }else{
  3387. var t = Math.max(modelSize.x, modelSize.z)
  3388. , i = Math.min(modelSize.x, modelSize.z)
  3389. , n = Math.max(t, i * this.camera.aspect)
  3390. , r = Math.max(i, t * this.camera.aspect);
  3391. absoluteScale = (h.aspectRatio() < 1 ? r : n) / 2 / o.orthoBase * defaultRatio
  3392. }
  3393. return absoluteScale
  3394. },
  3395. /* n.prototype.rotateToView = function(e, t) {
  3396. var i = 0
  3397. , n = h.aspectRatio() < 1
  3398. , r = e.x < e.z;
  3399. n === r ? t.z > 0 && (i = Math.PI) : i = t.x > 0 ? Math.PI / 2 : -Math.PI / 2,
  3400. this.rotateLeft(i),
  3401. this.update(0)
  3402. },
  3403. */
  3404. n.prototype.rotateToView = function(modelSize, direction) {
  3405. let i = 0, n = h.aspectRatio() < 1 //是否模型尺寸显“细长”
  3406. if(_settings.floorPlanAngle ){//规定了cadImage旋转值的话 (0是无效的,将不设置)
  3407. i = parseFloat(_settings.floorPlanAngle)
  3408. }else{
  3409. let r = modelSize.x < modelSize.z; //是否视口为“窄屏”
  3410. if(n === r) //“细长” 且 “窄屏”,说明模型尺寸比例与视口比例匹配,相机坐标只需要调转“前”“后”
  3411. {
  3412. if(direction.z > 0) //(第一种情况)相机是否位于背面。 注:在默认情况下webgl的相机朝向-z, direction.z > 0 说明相机视野已经偏向+z,说明相机位于模型“背面”
  3413. {
  3414. i = Math.PI; //经度上做180度轨道角位移,使相机移到静止模型的“前面”
  3415. }
  3416. //(第二种情况) 不做处理
  3417. }
  3418. else if(direction.x > 0)
  3419. {
  3420. i = Math.PI / 2;
  3421. }
  3422. else
  3423. {
  3424. i = -Math.PI / 2;
  3425. }
  3426. }
  3427. if(_settings.angleShift2d){
  3428. i += THREE.Math.degToRad(_settings.angleShift2d)
  3429. }
  3430. this.rotateLeft(i);
  3431. this.update(0);
  3432. }
  3433. ,
  3434. n.prototype.rotateToAngle = function(angle){//add 旋转到特定角度
  3435. this.rotateLeft(angle + this.lon);
  3436. this.update(0);
  3437. }
  3438. ,
  3439. n.prototype.pan = function(e, t) {
  3440. this.camera.updateMatrix(),
  3441. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3442. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3443. }
  3444. ,
  3445. n.prototype.updateZoom = function() {
  3446. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3447. this.absoluteScale = Math.max(o.zoomNearLimit, Math.min(this.absoluteScale, o.zoomFarLimit)),
  3448. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3449. this.camera.left = -o.orthoBase * this.currentScale,
  3450. this.camera.right = o.orthoBase * this.currentScale,
  3451. this.camera.top = o.orthoBase * this.currentScale / this.camera.aspect,
  3452. this.camera.bottom = -o.orthoBase * this.currentScale / this.camera.aspect,
  3453. this.camera.updateProjectionMatrix(),
  3454. this.offset.length()
  3455. }
  3456. ,
  3457. n.prototype.toJSON = function() {
  3458. var e = new r.Quaternion
  3459. , t = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  3460. , i = new r.Quaternion;
  3461. return function() {
  3462. var n = a.prototype.toJSON.call(this);
  3463. return e.copy(n.camera_quaternion),
  3464. i.copy(t),
  3465. i.multiply(e),
  3466. n.camera_quaternion.x = c.toPrecision(i.x, 4),
  3467. n.camera_quaternion.y = c.toPrecision(i.y, 4),
  3468. n.camera_quaternion.z = c.toPrecision(i.z, 4),
  3469. n.camera_quaternion.w = c.toPrecision(i.w, 4),
  3470. n.ortho_zoom = c.toPrecision(this.currentScale * this.camera.aspect, 4),
  3471. n
  3472. }
  3473. }(),
  3474. t.exports = n
  3475. }
  3476. , {
  3477. "../enum/ControlActions": 20,
  3478. "../enum/MouseButton": 34,
  3479. "../settings": 166,
  3480. "../util/browser": 182,
  3481. "../util/math": 190,
  3482. "./OutsideControls": 12,
  3483. three: 217
  3484. }],
  3485. 12: [function(e, t, i) {
  3486. "use strict";
  3487. function n(e) {
  3488. this.camera = e,
  3489. this.camera.controls = this,
  3490. this.enabled = !1,
  3491. this.target = new r.Vector3,
  3492. this.targetBounds = new r.Box3,
  3493. this.zoomSpeed = 1,
  3494. this.minDistance = 0,
  3495. this.maxDistance = 1 / 0,
  3496. this.noRotateUpDown = !1,
  3497. this.rotateSpeed = 1,
  3498. this.keyboardZoomSpeed = 0,
  3499. this.keyPanSpeed = 7,
  3500. this.autoRotate = !1,
  3501. this.autoRotateSpeed = 2,
  3502. this.autoPan = !1,
  3503. this.autoPanPosition = new r.Vector3,
  3504. this.minPolarAngle = r.Math.degToRad(25),
  3505. this.maxPolarAngle = r.Math.degToRad(65),
  3506. this.rotationAcceleration = new r.Vector2,
  3507. this.rotationSpeed = new r.Vector2,
  3508. this.panAcceleration = new r.Vector2,
  3509. this.panSpeed = new r.Vector2,
  3510. this.rotateStart = new r.Vector2,
  3511. this.rotateEnd = new r.Vector2,
  3512. this.rotateDelta = new r.Vector2,
  3513. this.panStart = new r.Vector2,
  3514. this.panEnd = new r.Vector2,
  3515. this.panDelta = new r.Vector2,
  3516. this.panOffset = new r.Vector3,
  3517. this.offset = new r.Vector3,
  3518. this.dollyStart = new r.Vector2,
  3519. this.dollyEnd = new r.Vector2,
  3520. this.dollyDelta = new r.Vector2,
  3521. this.phiDelta = 0,
  3522. this.thetaDelta = 0,
  3523. this.scale = 1,
  3524. this.panVector = new r.Vector3,
  3525. this.lastPosition = new r.Vector3,
  3526. this.state = c.NONE,
  3527. this.mouseActions = {},
  3528. this.mouseActions[h.LEFT] = c.ROTATE,
  3529. this.mouseActions[h.MIDDLE] = c.DOLLY,
  3530. this.mouseActions[h.RIGHT] = c.PAN,
  3531. this.touchActions = {},
  3532. this.touchActions[1] = c.ROTATE,
  3533. this.touchActions[2] = c.PAN_DOLLY,
  3534. this.lastMoveTime = 0,
  3535. this.pointersLimit = 2,
  3536. this.pointers = []
  3537. }
  3538. var r = e("three")
  3539. , o = e("../settings")
  3540. , a = e("../util/common")
  3541. , s = e("../util/math")
  3542. , l = e("../enum/Vectors")
  3543. , c = e("../enum/ControlActions")
  3544. , h = e("../enum/MouseButton")
  3545. , u = e("../enum/Keys")
  3546. , d = e("../enum/ControlEvents")
  3547. , p = e("events").EventEmitter
  3548. , f = 1e-6;
  3549. n.prototype = Object.create(p.prototype),
  3550. n.prototype.setBounds = function(e) {
  3551. this.targetBounds = e
  3552. }
  3553. ,
  3554. n.prototype.isEngaged = function() {
  3555. return this.state !== c.NONE
  3556. }
  3557. ,
  3558. n.prototype.rotateLeft = function(e) {
  3559. void 0 === e && (e = this.getAutoRotationAngle()),
  3560. this.thetaDelta -= e
  3561. }
  3562. ,
  3563. n.prototype.rotateUp = function(e) {
  3564. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3565. this.phiDelta -= e)
  3566. }
  3567. ,
  3568. n.prototype.panLeft = function(e) {
  3569. var t = this.camera.matrix.elements;
  3570. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3571. this.panOffset.multiplyScalar(-e),
  3572. this.panVector.add(this.panOffset)
  3573. }
  3574. ,
  3575. n.prototype.panUp = function(e) {
  3576. var t = this.camera.matrix.elements;
  3577. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3578. this.panOffset.multiplyScalar(-e),
  3579. this.panVector.add(this.panOffset)
  3580. }
  3581. ,
  3582. n.prototype.startRotating = function(e, t) {
  3583. e && this.navRotationAcc("x", e),
  3584. t && this.navRotationAcc("y", t)
  3585. }
  3586. ,
  3587. n.prototype.stopRotating = function(e) {
  3588. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3589. this.navRotationAcc("x", 0),
  3590. this.navRotationAcc("y", 0)
  3591. }
  3592. ,
  3593. n.prototype.setAutoPanPosition = function(e, t) {
  3594. var i = new r.Vector3
  3595. , n = new r.Vector3;
  3596. return function(e, t) {
  3597. i.copy(this.camera.position),
  3598. void 0 === e && null === e || i.setX(e),
  3599. void 0 === t && null === t || i.setZ(t);
  3600. var r = this.camera.position.distanceTo(this.target)
  3601. , o = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3602. this.targetClamped = !1,
  3603. n.copy(i).addScaledVector(o, r),
  3604. this.targetBounds.containsPoint(n) || (this.targetBounds.clampPoint(n, n),
  3605. i.copy(n).addScaledVector(o, -r),
  3606. this.targetClamped = !0),
  3607. this.autoPanPosition.x = i.x,
  3608. this.autoPanPosition.z = i.z,
  3609. this.autoPan && this.stopAutoPanning()
  3610. }
  3611. }(),
  3612. n.prototype.stopAutoPanning = function() {
  3613. var e = this.autoPan;
  3614. this.autoPan = !1,
  3615. this.emit(this.targetClamped ? d.AutoPanClamped : e ? d.AutoPanInterrupt : d.AutoPanComplete)
  3616. }
  3617. ,
  3618. n.prototype.dollyIn = function(e) {
  3619. void 0 === e && (e = this.getZoomScale()),
  3620. this.scale /= e
  3621. }
  3622. ,
  3623. n.prototype.dollyOut = function(e) {
  3624. void 0 === e && (e = this.getZoomScale()),
  3625. this.scale *= e
  3626. }
  3627. ,
  3628. n.prototype.updatePan = function(e) {
  3629. if (this.panSpeed.multiplyScalar(1 - o.panFriction).addScaledVector(this.panAcceleration, o.panAccelerationOutside * e),
  3630. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3631. this.autoPan) {
  3632. var t = (new r.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3633. t.setY(0).clampLength(0, 50 * e),
  3634. this.target.add(t),
  3635. this.camera.position.add(t),
  3636. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3637. this.stopAutoPanning())
  3638. }
  3639. }
  3640. ,
  3641. n.prototype.update = function(e) {
  3642. e || (e = 1 / 60)
  3643. var friction = Math.min(1, o.rotationFriction * e * 60) //add 如果deltaTime > 1/ 60 (比较卡),就增加rotationFriction, 以防止转动过久
  3644. this.rotationSpeed.multiplyScalar(1 - friction).addScaledVector(this.rotationAcceleration, o.rotationAccelerationOutside * e),
  3645. this.rotateLeft(-this.rotationSpeed.x),
  3646. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3647. this.updatePan(e);
  3648. var t = this.camera.position;
  3649. this.offset.copy(t).sub(this.target);
  3650. var i = Math.atan2(this.offset.x, this.offset.z)
  3651. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3652. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3653. i += this.thetaDelta,
  3654. n += this.phiDelta,
  3655. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3656. n = Math.max(f, Math.min(Math.PI - f, n));
  3657. this.lon = i, this.lat = n//add
  3658. var r = this.updateZoom();
  3659. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3660. this.target.add(this.panVector),
  3661. this.targetBounds.clampPoint(this.target, this.target),
  3662. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3663. this.offset.y = r * Math.cos(n),
  3664. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3665. t.copy(this.target).add(this.offset),
  3666. this.camera.lookAt(this.target),
  3667. this.thetaDelta = 0,
  3668. this.phiDelta = 0,
  3669. this.scale = 1,
  3670. this.panVector.set(0, 0, 0),
  3671. this.lastPosition.distanceTo(this.camera.position) > 0 && this.lastPosition.copy(this.camera.position)
  3672. }
  3673. ,
  3674. n.prototype.getAutoRotationAngle = function() {
  3675. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3676. }
  3677. ,
  3678. n.prototype.getZoomScale = function() {
  3679. return Math.pow(.95, this.zoomSpeed)
  3680. }
  3681. ,
  3682. n.prototype.onMouseDown = function(e) {
  3683. if (this.enabled) {
  3684. switch (e.preventDefault(),
  3685. this.stopAutoPanning(),
  3686. this.mouseDown = !0,
  3687. this.state = this.mouseActions[e.button],
  3688. this.state) {
  3689. case c.ROTATE:
  3690. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3691. this.rotationSpeed.set(0, 0);
  3692. break;
  3693. case c.DOLLY:
  3694. this.dollyStart.set(e.clientX, e.clientY);
  3695. break;
  3696. case c.PAN:
  3697. this.panStart.set(e.clientX, e.clientY)
  3698. }
  3699. this.emit(d.InputStart, "mouse")
  3700. }
  3701. }
  3702. ,
  3703. n.prototype.onMouseMove = function(e) {
  3704. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3705. switch (e.preventDefault(),
  3706. this.state) {
  3707. case c.ROTATE:
  3708. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3709. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3710. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3711. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3712. this.rotateStart.copy(this.rotateEnd);
  3713. break;
  3714. case c.DOLLY:
  3715. this.dollyEnd.set(e.clientX, e.clientY),
  3716. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart);
  3717. var t = this.dollyDelta.y > 0 ? this.dollyIn : this.dollyOut;
  3718. t.call(this),
  3719. this.dollyStart.copy(this.dollyEnd);
  3720. break;
  3721. case c.PAN:
  3722. this.panEnd.set(e.clientX, e.clientY),
  3723. this.panDelta.subVectors(this.panEnd, this.panStart),
  3724. this.pan(this.panDelta.x, this.panDelta.y),
  3725. this.panStart.copy(this.panEnd)
  3726. }
  3727. this.emit(d.Move, "mouse"),
  3728. this.lastMoveTime = e.timeStamp,
  3729. this.update()
  3730. }
  3731. }
  3732. ,
  3733. n.prototype.onMouseUp = function(e) {
  3734. this.enabled && (this.mouseDown = !1,
  3735. this.state = c.NONE,
  3736. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3737. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3738. this.update(),
  3739. this.rotationAcceleration.set(0, 0),
  3740. this.rotateDelta.set(0, 0)))
  3741. }
  3742. ,
  3743. n.prototype.onMouseOver = function(e) {
  3744. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3745. }
  3746. ,
  3747. n.prototype.onMouseWheel = function(e) {
  3748. if (this.enabled && o.useWheel) {
  3749. this.emit(d.Move, "wheel");
  3750. var t = e.wheelDelta || -e.detail
  3751. , i = t > 0 ? this.dollyOut : this.dollyIn;
  3752. i.call(this),
  3753. this.update()
  3754. }
  3755. }
  3756. ,
  3757. n.prototype.onKeyDown = function(e) {
  3758. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3759. this.handleKeyDown(e.which)))
  3760. }
  3761. ,
  3762. n.prototype.navRotationAcc = function(e, t) {
  3763. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3764. }
  3765. ,
  3766. n.prototype.navPanAcc = function(e, t) {
  3767. this.stopAutoPanning(),
  3768. this.panAcceleration[e] = t
  3769. }
  3770. ,
  3771. n.prototype.handleKeyDown = function(e) {
  3772. var t = !0;
  3773. switch (e) {
  3774. case u.UPARROW:
  3775. case u.I:
  3776. this.navRotationAcc("y", 1);
  3777. break;
  3778. case u.DOWNARROW:
  3779. case u.K:
  3780. this.navRotationAcc("y", -1);
  3781. break;
  3782. case u.LEFTARROW:
  3783. case u.J:
  3784. this.navRotationAcc("x", -1);
  3785. break;
  3786. case u.RIGHTARROW:
  3787. case u.L:
  3788. this.navRotationAcc("x", 1);
  3789. break;
  3790. case u.W:
  3791. this.navPanAcc("y", 1);
  3792. break;
  3793. case u.S:
  3794. this.navPanAcc("y", -1);
  3795. break;
  3796. case u.A:
  3797. this.navPanAcc("x", -1);
  3798. break;
  3799. case u.D:
  3800. this.navPanAcc("x", 1);
  3801. break;
  3802. default:
  3803. t = !1
  3804. }
  3805. t && this.emit(d.Move, "key")
  3806. }
  3807. ,
  3808. n.prototype.onKeyUp = function(e) {
  3809. this.enabled && (e.preventDefault(),
  3810. e.stopPropagation(),
  3811. this.handleKeyUp(e.which))
  3812. }
  3813. ,
  3814. n.prototype.handleKeyUp = function(e) {
  3815. switch (e) {
  3816. case u.I:
  3817. case u.K:
  3818. case u.UPARROW:
  3819. case u.DOWNARROW:
  3820. this.keyboardZoomSpeed = 0,
  3821. this.rotationAcceleration.y = 0;
  3822. break;
  3823. case u.J:
  3824. case u.L:
  3825. case u.LEFTARROW:
  3826. case u.RIGHTARROW:
  3827. this.rotationAcceleration.x = 0;
  3828. break;
  3829. case u.S:
  3830. case u.W:
  3831. this.panAcceleration.y = 0;
  3832. break;
  3833. case u.A:
  3834. case u.D:
  3835. this.panAcceleration.x = 0
  3836. }
  3837. }
  3838. ,
  3839. n.prototype.onTouchStart = function(e) {
  3840. if (this.enabled || this.state === c.NONE) {
  3841. e.preventDefault(),
  3842. e.stopPropagation(),
  3843. this.stopAutoPanning();
  3844. var t = function() {
  3845. if (2 === e.touches.length) {
  3846. var t = e.touches[0].pageX - e.touches[1].pageX
  3847. , i = e.touches[0].pageY - e.touches[1].pageY;
  3848. this.dollyStart.set(t, i)
  3849. }
  3850. }
  3851. .bind(this)
  3852. , i = function() {
  3853. this.panStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  3854. }
  3855. .bind(this)
  3856. , n = function() {
  3857. this.rotateStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  3858. }
  3859. .bind(this);
  3860. switch (this.state = this.touchActions[e.touches.length],
  3861. this.state) {
  3862. case c.PAN_DOLLY:
  3863. t();
  3864. case c.PAN:
  3865. i();
  3866. break;
  3867. case c.ROTATE_DOLLY:
  3868. t();
  3869. case c.ROTATE:
  3870. n()
  3871. }
  3872. this.rotationSpeed.set(0, 0),
  3873. this.emit(d.InputStart, "touch")
  3874. }
  3875. }
  3876. ,
  3877. n.prototype.onTouchMove = function(e) {
  3878. if (this.enabled && this.state !== c.NONE) {
  3879. e.preventDefault(),
  3880. e.stopPropagation();
  3881. var t = function() {
  3882. var t = e.touches[0].pageX - e.touches[1].pageX
  3883. , i = e.touches[0].pageY - e.touches[1].pageY;
  3884. this.dollyEnd.set(t, i);
  3885. var n = this.dollyStart.length() - this.dollyEnd.length();
  3886. n > 0 ? this.dollyOut(1 + n / 500) : this.dollyIn(1 - n / 500),
  3887. this.dollyStart.copy(this.dollyEnd)
  3888. }
  3889. .bind(this)
  3890. , i = function() {
  3891. this.panEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  3892. this.panDelta.subVectors(this.panEnd, this.panStart),
  3893. this.pan(this.panDelta.x, this.panDelta.y),
  3894. this.panStart.copy(this.panEnd),
  3895. this.rotateDelta.set(0, 0)
  3896. }
  3897. .bind(this)
  3898. , n = function() {
  3899. this.rotateEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  3900. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3901. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3902. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3903. this.rotateStart.copy(this.rotateEnd)
  3904. }
  3905. .bind(this)
  3906. , r = function() {
  3907. if (2 === e.touches.length) {
  3908. var i = window.devicePixelRatio || 1
  3909. , r = e.touches[1].pageX - e.touches[0].pageX
  3910. , s = e.touches[1].pageY - e.touches[0].pageY
  3911. , l = Math.sqrt(r * r + s * s)
  3912. , h = Math.abs(this.dollyStart.length() - l);
  3913. if (h > o.input.touchMoveThreshold * i)
  3914. this.state = c.DOLLY,
  3915. t();
  3916. else {
  3917. var u = a.average(e.touches, "pageX")
  3918. , d = a.average(e.touches, "pageY")
  3919. , p = this.rotateDelta.set(u, d).sub(this.rotateStart).length();
  3920. p > o.input.touchMoveThreshold && (this.state = c.ROTATE,
  3921. this.rotateStart.set(u, d),
  3922. n())
  3923. }
  3924. }
  3925. }
  3926. .bind(this);
  3927. switch (this.state) {
  3928. case c.PAN_DOLLY:
  3929. t();
  3930. case c.PAN:
  3931. i();
  3932. break;
  3933. case c.ROTATE_DOLLY:
  3934. r();
  3935. break;
  3936. case c.DOLLY:
  3937. t();
  3938. break;
  3939. case c.ROTATE:
  3940. n();
  3941. break;
  3942. default:
  3943. this.state = c.NONE
  3944. }
  3945. this.lastMoveTime = e.timeStamp,
  3946. this.emit(d.Move, "touch")
  3947. }
  3948. }
  3949. ,
  3950. n.prototype.onTouchEnd = function(e) {
  3951. this.enabled && (this.state === c.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3952. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3953. this.state = c.NONE,
  3954. this.update(),
  3955. this.rotationAcceleration.set(0, 0),
  3956. this.rotateDelta.set(0, 0))
  3957. }
  3958. ,
  3959. n.prototype.onPointerDown = function(e) {
  3960. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3961. id: e.pointerId,
  3962. pageX: e.pageX,
  3963. pageY: e.pageY
  3964. }),
  3965. e.touches = this.pointers,
  3966. this.onTouchStart(e)),
  3967. this.emit(d.InputStart, "pointer"))
  3968. }
  3969. ,
  3970. n.prototype.onPointerMove = function(e) {
  3971. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  3972. e.pointerId === t.id && (t.pageX = e.pageX,
  3973. t.pageY = e.pageY)
  3974. }),
  3975. e.touches = this.pointers,
  3976. this.onTouchMove(e))
  3977. }
  3978. ,
  3979. n.prototype.onPointerUp = function(e) {
  3980. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  3981. e.pointerId === t.id && this.pointers.splice(i, 1)
  3982. }
  3983. .bind(this)),
  3984. e.touches = this.pointers,
  3985. this.onTouchEnd(e))
  3986. }
  3987. ,
  3988. n.prototype.reset = function() {
  3989. this.state = c.NONE,
  3990. this.stopAutoPanning(),
  3991. this.rotationSpeed.set(0, 0),
  3992. this.rotationAcceleration.set(0, 0),
  3993. this.panSpeed.set(0, 0),
  3994. this.panAcceleration.set(0, 0)
  3995. }
  3996. ,
  3997. n.prototype.toJSON = function() {
  3998. var e = {
  3999. camera_position: {
  4000. x: s.toPrecision(this.camera.position.x, 4),
  4001. y: s.toPrecision(this.camera.position.y, 4),
  4002. z: s.toPrecision(this.camera.position.z, 4)
  4003. },
  4004. camera_quaternion: {
  4005. x: s.toPrecision(this.camera.quaternion.x, 4),
  4006. y: s.toPrecision(this.camera.quaternion.y, 4),
  4007. z: s.toPrecision(this.camera.quaternion.z, 4),
  4008. w: s.toPrecision(this.camera.quaternion.w, 4)
  4009. }
  4010. };
  4011. return e
  4012. }
  4013. ,
  4014. t.exports = n
  4015. }
  4016. , {
  4017. "../enum/ControlActions": 20,
  4018. "../enum/ControlEvents": 21,
  4019. "../enum/Keys": 30,
  4020. "../enum/MouseButton": 34,
  4021. "../enum/Vectors": 50,
  4022. "../settings": 166,
  4023. "../util/common": 185,
  4024. "../util/math": 190,
  4025. events: 202,
  4026. three: 217
  4027. }],
  4028. 13: [function(e, t, i) {
  4029. (function(i) {
  4030. "use strict";
  4031. function n(e) {
  4032. this.camera = e,
  4033. this.camera.controls = this,
  4034. this.target = new r.Vector3(0,0,0),
  4035. this.lookVector = new r.Vector3,
  4036. this.lookSpeed = .05,
  4037. this.rotationAcc = new r.Vector2,
  4038. this.rotationSpeed = new r.Vector2,
  4039. this.lat = 0,
  4040. this.lon = 0,
  4041. this.phi = 0,
  4042. this.theta = 0,
  4043. this.enabled = !1,
  4044. this.locked = !1,
  4045. this.pointer = new r.Vector2(0,0),
  4046. this.rotationHistory = [],
  4047. this.rotationDifference = new r.Vector2,
  4048. this.pointerDragOn = !1,
  4049. this.pointerDragStart = new r.Vector2(0,0),
  4050. this.pinchDistance = 0,
  4051. this.moveStart = new r.Vector2,
  4052. this.moveTolerance = .01,
  4053. this.pointersLimit = 2,
  4054. this.pointers = []
  4055. }
  4056. var r = e("three")
  4057. , o = e("../util/logger")
  4058. , a = e("../settings")
  4059. , s = e("../util/common")
  4060. , l = e("../util/math")
  4061. , c = (e("../enum/Vectors"),
  4062. e("../enum/MouseButton"))
  4063. , h = e("../enum/Keys")
  4064. , u = e("../enum/ControlEvents")
  4065. , d = e("events").EventEmitter;
  4066. new o(i);
  4067. n.prototype = Object.create(d.prototype),
  4068. n.prototype.usable = function() {
  4069. return this.enabled && !this.locked
  4070. }
  4071. ,
  4072. /* n.prototype.lookAt = function(e) {
  4073. var t = this.camera.position.clone().sub(e)
  4074. , i = Math.atan(t.z / t.x);
  4075. i += t.x < 0 ? Math.PI : 0,
  4076. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0,
  4077. this.lon = r.Math.radToDeg(i) + 180;
  4078. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  4079. , o = Math.atan(t.y / n);
  4080. this.lat = -r.Math.radToDeg(o)
  4081. }
  4082. */
  4083. n.prototype.lookAt = function(aim, dir) {
  4084. var t = dir || this.camera.position.clone().sub(aim); //aim所指点的笛卡尔坐标系
  4085. var i = Math.atan(t.z / t.x);
  4086. i += t.x < 0 ? Math.PI : 0;
  4087. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0;
  4088. this.lon = r.Math.radToDeg(i) + 180;
  4089. var n = Math.sqrt(t.x * t.x + t.z * t.z),
  4090. o = Math.atan(t.y / n);
  4091. this.lat = -r.Math.radToDeg(o);
  4092. }
  4093. ,
  4094. n.prototype.startRotationFrom = function(e, t) {
  4095. l.convertScreenPositionToNDC(e, t, this.pointer),
  4096. this.pointerDragOn = !0,
  4097. this.pointerDragStart.copy(this.pointer),
  4098. this.moveStart.copy(this.pointer),
  4099. this.rotationHistory = [],
  4100. this.rotationSpeed.set(0, 0)
  4101. }
  4102. ,
  4103. n.prototype.onMouseOver = function(e) {
  4104. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  4105. }
  4106. ,
  4107. n.prototype.onTouchStart = function(e) {
  4108. if (this.usable()) {
  4109. switch (e.preventDefault(),
  4110. e.stopPropagation(),
  4111. e.touches.length) {
  4112. case 1:
  4113. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  4114. break;
  4115. case 2:
  4116. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4117. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  4118. this.pinchDistance = Math.sqrt(t * t + i * i)
  4119. }
  4120. this.emit(u.InputStart, "touch")
  4121. }
  4122. }
  4123. ,
  4124. n.prototype.onPointerDown = function(e) {
  4125. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  4126. id: e.pointerId,
  4127. clientX: e.clientX,
  4128. clientY: e.clientY
  4129. }),
  4130. e.touches = this.pointers,
  4131. this.onTouchStart(e),
  4132. this.emit(u.InputStart, "pointer"))
  4133. }
  4134. ,
  4135. n.prototype.onMouseDown = function(e) {
  4136. if (this.usable()) {
  4137. switch (e.preventDefault(),
  4138. e.stopPropagation(),
  4139. e.button) {
  4140. case c.LEFT:
  4141. this.startRotationFrom(e.clientX, e.clientY)
  4142. }
  4143. SoundManager.pause('tour',true) // zeg 点击场景时停止语音
  4144. this.emit(u.InputStart, "mouse")
  4145. }
  4146. }
  4147. ,
  4148. n.prototype.updateRotation = function() {
  4149. if (this.usable() && this.pointerDragOn) {
  4150. var e = new r.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  4151. , t = new r.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  4152. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  4153. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  4154. , o = Math.atan2(e.y, i)
  4155. , a = Math.atan2(t.y, n);
  4156. this.rotationDifference.y = r.Math.radToDeg(o - a),
  4157. e.y = 0,
  4158. t.y = 0;
  4159. var s = Math.acos(e.dot(t) / e.length() / t.length());
  4160. isNaN(s) || (this.rotationDifference.x = r.Math.radToDeg(s),
  4161. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4162. this.pointerDragStart.copy(this.pointer)
  4163. }
  4164. }
  4165. ,
  4166. n.prototype.onMouseMove = function(e) {
  4167. this.usable() && (l.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4168. 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"))
  4169. }
  4170. ,
  4171. n.prototype.onTouchMove = function(e) {
  4172. if (this.usable())
  4173. switch (this.emit(u.Move, "touch"),
  4174. e.touches.length) {
  4175. case 1:
  4176. l.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4177. break;
  4178. case 2:
  4179. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4180. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4181. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4182. Math.abs(n) > .01 && (this.emit(u.InteractionDirect),
  4183. this.emit(u.Pinch, n),
  4184. this.pinchDistance -= n)
  4185. }
  4186. }
  4187. ,
  4188. n.prototype.onPointerMove = function(e) {
  4189. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  4190. e.pointerId === t.id && (t.clientX = e.clientX,
  4191. t.clientY = e.clientY)
  4192. }),
  4193. e.touches = this.pointers,
  4194. this.onTouchMove(e))
  4195. }
  4196. ,
  4197. n.prototype.endRotation = function() {
  4198. this.pointerDragOn = !1;
  4199. var e = s.averageVectors(this.rotationHistory);
  4200. this.rotationSpeed.set(e.x * a.rotationAfterMoveMultiplier, e.y * a.rotationAfterMoveMultiplier)
  4201. }
  4202. ,
  4203. n.prototype.onTouchEnd = function(e) {
  4204. this.usable() && (e.preventDefault(),
  4205. e.stopPropagation(),
  4206. this.endRotation())
  4207. }
  4208. ,
  4209. n.prototype.onMouseUp = function(e) {
  4210. //if(window.vrEnabled && !browser.isMobile() )return //xzw add
  4211. this.usable() && (e.preventDefault(),
  4212. e.stopPropagation(),
  4213. this.endRotation())
  4214. }
  4215. ,
  4216. n.prototype.onPointerUp = function(e) {
  4217. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  4218. e.pointerId === t.id && this.pointers.splice(i, 1)
  4219. }
  4220. .bind(this)),
  4221. e.touches = this.pointers,
  4222. this.onTouchEnd(e))
  4223. }
  4224. ,
  4225. /* n.prototype.getLimitAngleAtPano = function(defaultAngle, pano){
  4226. let limitUpAtPano = a.upDownAngleLimitPanos?.[pano.id]
  4227. let insideLookLimitUp = limitUpAtPano?.up != void 0 ? limitUpAtPano?.up : defaultAngle
  4228. return insideLookLimitUp
  4229. } */
  4230. n.prototype.update = function(e) {
  4231. this.lon,
  4232. this.lat;
  4233. for (this.updateRotation(),
  4234. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > a.rotationAfterMoveHistoryCount; )
  4235. this.rotationHistory.shift();
  4236. this.lon += this.rotationDifference.x,
  4237. this.lat += this.rotationDifference.y,
  4238. this.rotationDifference.set(0, 0)
  4239. //改
  4240. var friction = Math.min(1, a.rotationFriction * e * 60) //如果deltaTime > 1/ 60 (比较卡),就增加rotationFriction, 以防止转动过久
  4241. this.rotationSpeed.x = this.rotationSpeed.x * (1 - friction) + this.rotationAcc.x * a.rotationAccelerationInside,
  4242. this.rotationSpeed.y = this.rotationSpeed.y * (1 - friction) + this.rotationAcc.y * a.rotationAccelerationInside,
  4243. this.lon += this.rotationSpeed.x * e,
  4244. this.lat += this.rotationSpeed.y * e
  4245. let insideLookLimitDown = this.insideLookLimitDown != void 0 ? this.insideLookLimitDown : a.insideLookLimitDown
  4246. let insideLookLimitUp = this.insideLookLimitUp != void 0 ? this.insideLookLimitUp : a.insideLookLimitUp
  4247. /* insideLookLimitUp = this.getLimitAngleAtPano(insideLookLimitUp, player.currentPano)
  4248. if(player.flying && player.nextPano){//过渡渐变
  4249. let insideLookLimitUp2 = this.getLimitAngleAtPano(insideLookLimitUp, player.nextPano)
  4250. if(insideLookLimitUp2 != insideLookLimitUp){
  4251. let object = transitions.funcs.find(e=>e.name == 'camFly')
  4252. if(object){
  4253. let r = object.current / object.duration
  4254. insideLookLimitUp = math.linearClamp(r,[0,1],[insideLookLimitUp,insideLookLimitUp2])
  4255. }else{
  4256. console.error('?????????????')
  4257. //insideLookLimitUp = insideLookLimitUp2
  4258. }
  4259. }
  4260. } */
  4261. insideLookLimitDown = insideLookLimitDown - a.insideFOV/2 + this.camera.fov / 2
  4262. insideLookLimitUp = insideLookLimitUp + a.insideFOV/2 - this.camera.fov / 2
  4263. 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 );
  4264. this.phi = r.Math.degToRad(90 - this.lat),
  4265. this.theta = r.Math.degToRad(this.lon),
  4266. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4267. this.lookVector.y = Math.cos(this.phi),
  4268. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4269. this.target.copy(this.lookVector).add(this.camera.position),
  4270. this.camera.lookAt(this.target)
  4271. }
  4272. ,
  4273. n.prototype.onMouseWheel = function(e) {
  4274. if (this.usable()) {
  4275. var t = e.wheelDelta || -e.detail;
  4276. this.emit(u.InteractionDirect),
  4277. this.emit(u.Scroll, t)
  4278. }
  4279. }
  4280. ,
  4281. n.prototype.onKeyDown = function(e) {
  4282. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4283. this.handleKeyDown(e.which)))
  4284. }
  4285. ,
  4286. n.prototype.handleKeyDown = function(e) {
  4287. var t = function(e, t) {
  4288. this.rotationAcc[e] = t
  4289. }
  4290. .bind(this);
  4291. this.emit(u.InteractionKey);
  4292. var i = !0;
  4293. switch (e) {
  4294. case h.LEFTARROW:
  4295. case h.J:
  4296. t("x", -1);
  4297. break;
  4298. case h.RIGHTARROW:
  4299. case h.L:
  4300. t("x", 1);
  4301. break;
  4302. case h.I:
  4303. t("y", 1);
  4304. break;
  4305. case h.K:
  4306. t("y", -1);
  4307. break;
  4308. default:
  4309. i = !1
  4310. }
  4311. i && this.emit(u.Move, "key")
  4312. }
  4313. ,
  4314. n.prototype.onKeyUp = function(e) {
  4315. this.usable() && (e.preventDefault(),
  4316. e.stopPropagation(),
  4317. this.handleKeyUp(e.which))
  4318. }
  4319. ,
  4320. n.prototype.handleKeyUp = function(e) {
  4321. switch (e) {
  4322. case h.LEFTARROW:
  4323. case h.J:
  4324. case h.RIGHTARROW:
  4325. case h.L:
  4326. this.rotationAcc.x = 0;
  4327. break;
  4328. case h.I:
  4329. case h.K:
  4330. this.rotationAcc.y = 0
  4331. }
  4332. }
  4333. ,
  4334. n.prototype.startRotating = function(e, t) {
  4335. e && (this.rotationAcc.x = e),
  4336. t && (this.rotationAcc.y = t)
  4337. }
  4338. ,
  4339. n.prototype.stopRotating = function(e) {
  4340. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4341. this.rotationAcc.set(0, 0)
  4342. }
  4343. ,
  4344. n.prototype.reset = function() {
  4345. this.pointerDragOn = !1,
  4346. this.rotationAcc.set(0, 0),
  4347. this.rotationSpeed.set(0, 0),
  4348. this.pointers = []
  4349. }
  4350. ,
  4351. n.prototype.toJSON = function() {
  4352. var e = {
  4353. camera_position: {
  4354. x: l.toPrecision(this.camera.position.x, 4),
  4355. y: l.toPrecision(this.camera.position.y, 4),
  4356. z: l.toPrecision(this.camera.position.z, 4)
  4357. },
  4358. camera_quaternion: {
  4359. x: l.toPrecision(this.camera.quaternion.x, 4),
  4360. y: l.toPrecision(this.camera.quaternion.y, 4),
  4361. z: l.toPrecision(this.camera.quaternion.z, 4),
  4362. w: l.toPrecision(this.camera.quaternion.w, 4)
  4363. }
  4364. };
  4365. return e
  4366. }
  4367. ,
  4368. n.prototype.setStateFromJSON = function(e) {
  4369. this.camera.position.copy(e.camera_position),
  4370. this.camera.quaternion.copy(e.camera_quaternion)
  4371. }
  4372. ,
  4373. t.exports = n
  4374. }
  4375. ).call(this, "/js/controls/PanoramaControls.js")
  4376. }
  4377. , {
  4378. "../enum/ControlEvents": 21,
  4379. "../enum/Keys": 30,
  4380. "../enum/MouseButton": 34,
  4381. "../enum/Vectors": 50,
  4382. "../settings": 166,
  4383. "../util/common": 185,
  4384. "../util/logger": 189,
  4385. "../util/math": 190,
  4386. events: 202,
  4387. three: 217
  4388. }],
  4389. 14: [function(e, t, i) {
  4390. (function(i) {
  4391. "use strict";
  4392. var n = e("three")
  4393. , r = e("../enum/Viewmode")
  4394. , o = e("../util/logger")
  4395. , a = new o(i);
  4396. t.exports = {
  4397. serialize: function(e) {
  4398. return encodeURI(JSON.stringify(e))
  4399. },
  4400. deserialize: function(e) {
  4401. function t(e) {
  4402. function t(e, t) {
  4403. return e && "number" == typeof t && !isNaN(t)
  4404. }
  4405. return e.reduce(t, !0)
  4406. }
  4407. try {
  4408. var i = JSON.parse(decodeURI(e))
  4409. , o = {
  4410. mode: r.fromInt(i.camera_mode),
  4411. panoId: i.scan_id,
  4412. position: (new n.Vector3).copy(i.camera_position),
  4413. quaternion: (new n.Quaternion).copy(i.camera_quaternion),
  4414. zoom: i.ortho_zoom,
  4415. floorVisibility: i.floor_visibility
  4416. }
  4417. , s = o.position;
  4418. t([s.x, s.y, s.z]) || o.position.set(0, 0, 0);
  4419. var l = o.quaternion;
  4420. return t([l.x, l.y, l.z, l.w]) || o.quaternion.set(0, 0, 0, 1),
  4421. o
  4422. } catch (i) {
  4423. a.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4424. try {
  4425. var c = e.split(",")
  4426. , h = {
  4427. x: parseFloat(c[2]),
  4428. y: parseFloat(c[3]),
  4429. z: parseFloat(c[4])
  4430. }
  4431. , u = {
  4432. x: parseFloat(c[5]),
  4433. y: parseFloat(c[6]),
  4434. z: parseFloat(c[7]),
  4435. w: parseFloat(c[8])
  4436. };
  4437. return t([h.x, h.y, h.z]) || (h.x = 0,
  4438. h.y = 0,
  4439. h.z = 0),
  4440. t([u.x, u.y, u.z, u.w]) || (u.x = 0,
  4441. u.y = 0,
  4442. u.z = 0,
  4443. u.w = 1),
  4444. {
  4445. mode: r.fromInt(c[0]),
  4446. panoId: c[1],
  4447. position: (new n.Vector3).copy(h),
  4448. quaternion: (new n.Quaternion).copy(u)
  4449. }
  4450. } catch (t) {
  4451. a.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4452. }
  4453. }
  4454. return null
  4455. }
  4456. }
  4457. }
  4458. ).call(this, "/js/controls/serializer.js")
  4459. }
  4460. , {
  4461. "../enum/Viewmode": 51,
  4462. "../util/logger": 189,
  4463. three: 217
  4464. }],
  4465. 15: [function(e, t, i) {
  4466. (function(i) {
  4467. "use strict";
  4468. function n() {
  4469. this.endlessLoop = a.warp.loop,
  4470. this.clock = new r.Clock(!0),
  4471. this.model = null,
  4472. this.player = null,
  4473. this.currentItem = null,
  4474. this.destinationItem = null,
  4475. this.tourIsPlaying = !1,
  4476. this.transitionStage = y.None,
  4477. this.nextFunc = null,
  4478. this.onTheBus = !1,
  4479. this.tourInProgress = !1,
  4480. this.reachSource = null,
  4481. this.interrupted = !1,
  4482. this.nItems = 0,
  4483. this.walkingSectionPaused = !1
  4484. }
  4485. var r = e("three")
  4486. , o = e("./util/logger")
  4487. , a = e("./settings")
  4488. , s = e("./util/transitions")
  4489. , l = e("events").EventEmitter
  4490. , c = e("./enum/Viewmode")
  4491. , h = e("./analytics")
  4492. , u = e("./enum/WarpStyle")
  4493. , s = e("./util/transitions")
  4494. , d = (e("./model/ModelManager"),
  4495. e("./enum/ModelManagerEvents"))
  4496. , p = e("./enum/DirectorEvents")
  4497. , f = e("./enum/PlayerEvents")
  4498. , g = (e("./enum/ControlEvents"),
  4499. e("./enum/BlackoutStyle"))
  4500. , m = e("./enum/PathDiscardMode")
  4501. , v = e("./enum/PathDisplayMode")
  4502. , A = (e("./player"),
  4503. new o(i))
  4504. , y = Object.freeze({
  4505. None: 0,
  4506. Moving: 1,
  4507. Aiming: 2,
  4508. Interlude: 3
  4509. })
  4510. , C = Object.freeze({
  4511. Forward: 1,
  4512. NoChange: 0,
  4513. Backwards: -1
  4514. })
  4515. , I = s.getUniqueId();
  4516. n.prototype = Object.create(l.prototype),
  4517. n.prototype.init = function(e, t) {
  4518. this.player = e,
  4519. this.modelManager = t,
  4520. this.updateModel(),
  4521. this.resetAll(),
  4522. this.bindEvents()
  4523. // // zeg 查询pano对应的导览片段
  4524. // if(!this.panoIdMap) {
  4525. // this.panoIdMap = new Map()
  4526. // this.model.heroLocations.forEach( (value, index) => {
  4527. // // value.heroLocations.forEach( hl => {
  4528. // if(!value.heroLocations) return
  4529. // let hl = value.heroLocations[0]
  4530. // let arr = this.panoIdMap.get(hl.panoId)
  4531. // if(arr){
  4532. // this.panoIdMap.set(hl.panoId, [...arr, index])
  4533. // } else {
  4534. // this.panoIdMap.set(hl.panoId, [index])
  4535. // }
  4536. // // })
  4537. // })
  4538. // }
  4539. }
  4540. ,
  4541. n.prototype.resetAll = function() {
  4542. if (this.currentItem = null,
  4543. this.destinationItem = null,
  4544. this.tourIsPlaying = !1,
  4545. //this.bgmReplay(),//xzw
  4546. this.transitionStage = y.None,
  4547. this.nextFunc = null,
  4548. this.onTheBus = !1,
  4549. this.reachSource = null,
  4550. this.interrupted = !1,
  4551. this.model) {
  4552. var e = a.path.typ === u.WALK ? u.WALK : u.STD;
  4553. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && this.model.data.player_options.fast_transitions === !1 ? e : u.BLACK
  4554. } else
  4555. this.defaultWarpStyle = u.BLACK,
  4556. A.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4557. this.resetSpecialTransition()
  4558. }
  4559. ,
  4560. n.prototype.updateModel = function() {
  4561. this.model = this.modelManager.getActiveModel(),
  4562. this.nItems = this.model.heroLocations.length
  4563. }
  4564. ,
  4565. n.prototype.bindEvents = function() {
  4566. this.modelManager.on(d.ActiveModelChanged, this.updateModel.bind(this)),
  4567. this.player.on(f.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4568. this.player.on(f.Move, this.handlePlayerMove.bind(this)),
  4569. this.player.on(f.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4570. this.player.on(f.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4571. this.player.on(f.InputStart, this.handlePlayerInputStart.bind(this)),
  4572. this.player.on(f.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4573. this.player.once(f.Move, function() {
  4574. s.cancelById(I)
  4575. })
  4576. }
  4577. ,
  4578. n.prototype.checkAndHandleWalkingtourInterruption = function(e) {//快速停止。 改:去掉判断nextWarpStyle,因为这个属性改乱了,导致点击停止按钮不执行
  4579. return /* e === u.WALK && ( */this.interrupt(g.NONE),
  4580. this.pauseWalkingSection(),
  4581. this.player.fastForwardActivePanoFlight(),
  4582. !0/* ) */
  4583. }
  4584. ,
  4585. n.prototype.handlePlayerMove = function(e) {
  4586. this.transitionStage === y.Interlude && this.interrupt(g.NONE),
  4587. this.emit("update.controls")
  4588. }
  4589. ,
  4590. n.prototype.handlePlayerPanoChosen = function(e, t) {
  4591. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4592. this.emit("update.controls"))
  4593. }
  4594. ,
  4595. n.prototype.handlePlayerModeChanged = function(e, t) {
  4596. this.intermediateState() || e === t || (this.onTheBus = !1,
  4597. this.emit("update.controls"))
  4598. }
  4599. ,
  4600. n.prototype.handlePlayerInputStart = function(e) {
  4601. this.transitionStage === y.Interlude && this.interrupt(g.NONE)
  4602. }
  4603. ,
  4604. n.prototype.handlePlayerFlyingStarted = function() {
  4605. this.clearWalkingSectionPaused()
  4606. }
  4607. ,
  4608. n.prototype.describe = function() {
  4609. return {
  4610. nItems: this.nItems,
  4611. currentItem: this.currentItem,
  4612. destinationItem: this.destinationItem,
  4613. tourIsPlaying: this.tourIsPlaying,
  4614. onTheBus: this.onTheBus,
  4615. endlessLoop: this.endlessLoop,
  4616. viewMode: this.player.mode,
  4617. inTransition: this._inTransition(),
  4618. transitionStage: this.transitionStage,
  4619. tourInProgress: this.tourInProgress
  4620. }
  4621. }
  4622. ,
  4623. n.prototype._inTransition = function() {
  4624. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === c.TRANSITIONING || this.tourIsPlaying
  4625. }
  4626. ,
  4627. n.prototype.bounceable = function() {
  4628. var e = this.clock.getDelta();
  4629. return this.isInterrupted() || e < .9 && e > .01 || this.player.flying && !this.player.isWarping()
  4630. }
  4631. ,
  4632. n.prototype.itemCompare = function(item1, item2, type){//add
  4633. if(type == 'equal'){//==
  4634. return item1 && item2 && item1[0] == item2[0] && item1[1] == item2[1]
  4635. }else if(type == 'less'){//<
  4636. return item1 && item2 && (item1[0] < item2[0]) || (item1[0] == item2[0] && item1[1] < item2[1])
  4637. }
  4638. }
  4639. n.prototype.currentMoveDirection = function() {
  4640. //return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  4641. 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
  4642. }
  4643. ,
  4644. n.prototype.clearPath = function() {
  4645. this._inTransition() || this.player.path.discardPathObject()
  4646. }
  4647. ,
  4648. n.prototype.allFloors = function() {
  4649. this.model.toggleAllFloors()
  4650. }
  4651. ,
  4652. n.prototype.actionComplete = function(e) {
  4653. if (this.interrupted = !1,
  4654. this.transitionStage = y.None,
  4655. this.resetSpecialTransition(),
  4656. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4657. this.tourIsPlaying || (this.player.disablePreRendering(),
  4658. this.player.mode === c.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4659. this.emit("update.controls"),
  4660. this.nextFunc) {
  4661. var t = this.nextFunc;
  4662. this.nextFunc = null,
  4663. t()
  4664. }
  4665. }
  4666. ,
  4667. n.prototype.awaitCompletion = function(e, t) {
  4668. this.nextFunc = t,
  4669. e()
  4670. }
  4671. ,
  4672. n.prototype.updateSuccessFunction = function(e) {
  4673. this.nextFunc = e
  4674. }
  4675. ,
  4676. n.prototype.interrupt = function(e, t) {//滑动屏幕或按下键盘等
  4677. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4678. this.tourIsPlaying = !1,
  4679. //this.bgmReplay(),//xzw
  4680. this.interrupted = !0,
  4681. this.nextFunc = null,
  4682. this.emit(p.ActionInterrupted),
  4683. null !== e && void 0 !== e || (e = g.BEGINNING),
  4684. this.player.interruptAndFastForward(e, t),
  4685. !0)
  4686. }
  4687. ,
  4688. n.prototype.wouldInterrupt = function() {
  4689. return this.transitionStage !== y.None
  4690. }
  4691. ,
  4692. n.prototype.intermediateState = function() {
  4693. return this.transitionStage !== y.None
  4694. }
  4695. ,
  4696. n.prototype.isInterrupted = function() {
  4697. return this.interrupted
  4698. }
  4699. ,
  4700. n.prototype.pauseWalkingSection = function() {
  4701. this.walkingSectionPaused = !0
  4702. }
  4703. ,
  4704. n.prototype.clearWalkingSectionPaused = function() {
  4705. this.walkingSectionPaused = !1
  4706. }
  4707. ,
  4708. n.prototype.autoTour = function() {
  4709. var e = Date.now();
  4710. this.model.auxDataPromise.then(function() {
  4711. e = Date.now() - e;
  4712. var t = a.warp.auto
  4713. , i = this.model.data && this.model.data.player_options /* && this.model.data.player_options.highlight_reel */;
  4714. t >= 0 && this.model.heroCount() > 1 && i && s.trigger({
  4715. duration: Math.max(1e3 * Math.min(300, t) - e, 0),
  4716. done: function() {
  4717. this.playTour()
  4718. }
  4719. .bind(this),
  4720. name: "_atr",
  4721. id: I
  4722. })
  4723. }
  4724. .bind(this))
  4725. }
  4726. ,
  4727. n.prototype.atDestinationPano = function(pano) {
  4728. if(null === this.destinationItem)return !1;
  4729. pano = pano || this.player.currentPano
  4730. if(!pano){
  4731. return !1;
  4732. }
  4733. var destination = this.destinationItem && this.model.getHeroDescriptorByIndex(this.destinationItem)
  4734. return destination && destination.panoId == pano.id
  4735. }
  4736. ,
  4737. n.prototype.redirectToItem = function(e, t) {
  4738. if (null === e || void 0 === e)
  4739. return void A.warn("Director.redirectToItem() -> Redirecting to null item.");
  4740. if (!this.wouldInterrupt())
  4741. return void A.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4742. if (this.player.mode === c.TRANSITIONING)
  4743. return void A.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4744. A.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4745. var i = function() {
  4746. s.setTimeout(function() {
  4747. this.setDestinationItem(e),
  4748. this.goToDestination(!0, g.BEGINNING, a.warp.warpInterruptionRedirectTime, !1)
  4749. }
  4750. .bind(this), 0)
  4751. }
  4752. .bind(this);
  4753. this.interrupt(g.END, 0),
  4754. this.updateSuccessFunction(i)
  4755. }
  4756. ,
  4757. n.prototype.useSpecialTransition = function(e) {
  4758. void 0 !== e && this.defaultWarpStyle !== u.BLACK && A.debug("useSpecialTransition(): " + e),
  4759. this.nextWarpStyle = u.BLACK
  4760. }
  4761. ,
  4762. n.prototype.resetSpecialTransition = function() {
  4763. this.nextWarpStyle = this.defaultWarpStyle
  4764. }
  4765. ,
  4766. n.prototype.arrivedAtDestination = function(e) {
  4767. if (this.player.flying || this.player.isWarping())
  4768. A.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4769. else {
  4770. this.transitionStage = y.Aiming;
  4771. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4772. this.player.model.fadePanoMarkers(0),
  4773. this.awaitCompletion(function() {
  4774. this.resetSpecialTransition(),
  4775. e ? this.player.aimTourCamera(this.destinationItem, v.Retain, v.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4776. }
  4777. .bind(this), t)
  4778. }
  4779. }
  4780. ,
  4781. n.prototype.goToDestination = function(e, t, i, n) {
  4782. //音频
  4783. var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo
  4784. // zeg 手动导览不播放音频
  4785. if(musicInfo && musicInfo.music && !e){
  4786. let musicType = localStorage.getItem('xunirole') || 'male'
  4787. let isMale = musicType.indexOf('female') < 0
  4788. let fixMusic = isMale?musicInfo.music:(musicInfo.fmusic||musicInfo.music)
  4789. // let src = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music : g_Prefix + musicInfo.music;
  4790. let src = fixMusic
  4791. let audioObj = SoundManager.list.find(e=>e.name == 'tour')
  4792. let audioSrc1 = common.getFileNameFromUrl(audioObj.src);
  4793. let audioSrc2 = common.getFileNameFromUrl(src)
  4794. if(audioSrc1 == audioSrc2){//应该是继续播放该folder
  4795. if(this.destinationItem[1] == 0){//从头开始播放 因为可能暂停后然后再点该缩略图播
  4796. SoundManager.play('tour',null,0) // currentTime = 0;
  4797. }else if( audioObj.audio.paused && audioObj.audio.currentTime < audioObj.audio.duration ){//未播完
  4798. SoundManager.play('tour')//继续播。为什么会有暂停的情况?如果手动切换到bgm了呢?
  4799. }
  4800. }else{//很可能是该folder的起始
  4801. SoundManager.play('tour', manage.dealURL(src))
  4802. }
  4803. }
  4804. let oldPos = this.player.position.clone();
  4805. let oldPano = this.player.currentPano
  4806. if (this.onTheBus = !0,
  4807. this.emit("update.controls"),
  4808. this.player.updateLastView(),
  4809. !n && this.atDestinationPano()){
  4810. /*
  4811. // 原地旋转时, 写到_warpCameraAim里,因那有时间
  4812. var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4813. if(r.zoom && r.zoom != this.player.zoomLevel){//add
  4814. this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime) //瞬间过渡的时间
  4815. } */
  4816. return void this.arrivedAtDestination(!0);
  4817. }
  4818. if (this.player.flying || this.player.isWarping())
  4819. A.warn("Cannot go to new destination while player is flying or warping.");
  4820. else {
  4821. var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4822. , o = null
  4823. , a1 = null;
  4824. if (r.isPano()) {
  4825. //var s = 0 === this.destinationItem || e ? u.BLACK : this.nextWarpStyle;
  4826. //var walk = window.DATA.black ? 'black' : 'walk';
  4827. //若是点击item,直接瞬间过渡。
  4828. var s = e ? 'black' : this.getMomentTour(this.destinationItem) //window.DATA.momentTour || "walk";
  4829. if(this.destinationItem[0] == 0 && this.destinationItem[1] == 0) s = 'black' // 周恩光加 返回最初导览点是瞬间过渡
  4830. a1 = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, v.Show, m.Slow, s, true, i, this.actionComplete.bind(this)),
  4831. o = this.arrivedAtDestination.bind(this, !0)
  4832. if(s=='black' && r.zoom && r.zoom != this.player.zoomLevel){//add
  4833. this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime) //瞬间过渡的时间
  4834. }
  4835. } else{
  4836. a1 = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4837. o = this.arrivedAtDestination.bind(this, !1);
  4838. }
  4839. this.transitionStage = y.Moving,
  4840. this.model.fadePanoMarkers(0),
  4841. this.awaitCompletion(function() {
  4842. a1();
  4843. }
  4844. .bind(this), o),
  4845. this.emit("update.controls")
  4846. }
  4847. }
  4848. ,
  4849. n.prototype.tourInterlude = function() {
  4850. if (h.trackAlways("reach_highlight", {
  4851. reach_source: this.reachSource
  4852. }),
  4853. this.model.fadePanoMarkers(0),
  4854. this.emit("update.controls"),
  4855. this.tourIsPlaying)
  4856. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4857. void this.awaitCompletion(function() {
  4858. this.transitionStage = y.Interlude,
  4859. this.player.tourInterlude(this.nextItem(this.currentItem),this.actionComplete.bind(this))
  4860. }
  4861. .bind(this), function(){
  4862. this.currentItem = [0,0],
  4863. this.stopTour(true),
  4864. this.emit(p.TourEnd)
  4865. }.bind(this)),
  4866. void (this.player.mode === c.PANORAMA && this.model.fadePanoMarkers(a.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  4867. this.transitionStage = y.Interlude,
  4868. this.player.tourInterlude(this.nextItem(this.currentItem),this.actionComplete.bind(this))
  4869. }
  4870. .bind(this), this.goNext.bind(this))
  4871. }
  4872. ,
  4873. n.prototype.findNearestItem = function(endToStart=true, searchEvery){//找到离currentPano最近的导览
  4874. /* if(this.atDestinationPano(this.player.currentPano)){//在终点直接从头。但有的场景可能不希望如此,就想跳到所属的展区开始。
  4875. return [0,0] //2023.7.7发现在点击item后播放会从头开始
  4876. } */
  4877. //注:没有判断此刻是否在panorama模式,就使用currentPano
  4878. var result = {item:[0,0], dis:Infinity};
  4879. var compare = (location, item)=>{
  4880. if(location.panoId != void 0 && location.panoId!= "outside"){
  4881. var pano = this.model.panos.index[location.panoId];
  4882. var dis = pano.position.distanceTo(this.player.currentPano.position)
  4883. if(dis<result.dis){
  4884. result.item = item, result.dis = dis, result.location = location, result.angle = null
  4885. }else if(dis == result.dis){
  4886. if(this.currentItem){
  4887. if(result.angle == void 0){
  4888. result.angle = result.location.quaternion.angleTo(player.quaternion)
  4889. }//用角度最接近的那一个
  4890. let angle = location.quaternion.angleTo(player.quaternion)
  4891. if(angle < result.angle){
  4892. result.item = item, result.dis = dis, result.location = location, result.angle = angle
  4893. }
  4894. /* //如果两个位置相同,优先播放在导览条上离激活的最近的那段导览
  4895. let dis1 = [Math.abs(item[0] - this.currentItem[0]), Math.abs(item[1] - this.currentItem[1])] //当前差距
  4896. let dis2 = [Math.abs(result.item[0] - this.currentItem[0]), Math.abs(result.item[1] - this.currentItem[1])]
  4897. if( this.itemCompare(dis1, dis2, 'less')){
  4898. result.item = item, result.dis = dis
  4899. } */
  4900. }
  4901. }
  4902. }
  4903. }
  4904. this.model.heroLocations.forEach((e,i)=>{
  4905. if(e.heroLocations){
  4906. if(searchEvery){
  4907. e.heroLocations.forEach((a,j)=>{
  4908. compare(a, [i,j])
  4909. })
  4910. }else{
  4911. var location = e.heroLocations.find(e=>e.panoId != void 0)
  4912. location && compare(location, [i,0]) //跳到此区域开头
  4913. }
  4914. }else{
  4915. compare(e, [i,0])
  4916. }
  4917. })
  4918. if(endToStart && this.atEndOfTour(result.item)){ //如果是最后一个点,直接跳到开头,否则导览开始就在终点的话不会从头开始
  4919. return [0,0] //但注意最后是区域的话result.item是区域开头,除非站在最末最末尾的位置,上面的atDestinationPano直接返回
  4920. }
  4921. return result.item
  4922. }
  4923. n.prototype.playTour = function() {
  4924. if (!this.bounceable() && this.model.heroLocations.length) {
  4925. // ------------这部分处理逻辑目前已由playTourNearBy()取代------------------------------------
  4926. // if(!this.currentItem) this.currentItem = []
  4927. // if(this.currentItem[0] != 0 || this.destinationItem[0]!= this.nItems-1){
  4928. // // zeg 从当前pano进行自动导览
  4929. // let currentPanoDestinations = this.panoIdMap.get(this.player.currentPano.id)
  4930. // // this.model.heroLocations.forEach( (value, index) => {
  4931. // // if(value.heroLocations.find( hl => hl.panoId == this.player.currentPano.id )) {
  4932. // // currentPanoDestinations.push(index)
  4933. // // }
  4934. // // })
  4935. // if(!currentPanoDestinations) {
  4936. // // let panoIndex = this.model.panos.list.findIndex( pano => pano.id == this.player.currentPano.id )
  4937. // let panoIndex = this.model.panos.list.indexOf( this.player.currentPano )
  4938. // let neighbourIndex = [ panoIndex + 1, panoIndex - 1, panoIndex + 2, panoIndex - 2, panoIndex + 3, panoIndex - 3 ]
  4939. // for(var i = 0; i < neighbourIndex.length; i++) {
  4940. // currentPanoDestinations = this.panoIdMap.get(this.model.panos.list[neighbourIndex[i]]&&this.model.panos.list[neighbourIndex[i]].id)
  4941. // if(currentPanoDestinations && currentPanoDestinations[0] != 0) break
  4942. // }
  4943. // if(!currentPanoDestinations) currentPanoDestinations = [0];
  4944. // }
  4945. // if(currentPanoDestinations.indexOf(this.currentItem[0]) == -1) {
  4946. // this.currentItem[0] = currentPanoDestinations[0]
  4947. // }
  4948. // }
  4949. return this.tourIsPlaying ? void A.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4950. this.tourInProgress = !0,
  4951. this.reachSource = "play",
  4952. this.tourIsPlaying = !0,
  4953. this.wasZoomEnabled = this.player.zoomEnabled,
  4954. this.player.zoomEnabled = !1,
  4955. this.resetSpecialTransition(),
  4956. this.emit("update.controls"),
  4957. this.emit(p.TourStart),
  4958. this.player.enablePreRendering(),
  4959. // this.currentItem[1] = null,
  4960. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4961. this.goToDestination()) : /* this.goNext() */(this.tourAdvance(0) ,this.goToDestination()))) //xzw: 不要直接跳到下一个点开始,从当前点开始,否则当一段区域内只有一个导览时播放会立刻跳到下一个缩略图进行。
  4962. }
  4963. }
  4964. n.prototype.playTourNearBy = function() {//就近导览
  4965. if (!this.bounceable()){
  4966. return this.tourIsPlaying ? void A.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4967. this.tourInProgress = !0,
  4968. this.reachSource = "play",
  4969. this.tourIsPlaying = !0,
  4970. this.wasZoomEnabled = this.player.zoomEnabled,
  4971. this.player.zoomEnabled = !1,
  4972. this.resetSpecialTransition(),
  4973. this.emit("update.controls"),
  4974. this.emit(p.TourStart),
  4975. this.player.enablePreRendering(),
  4976. /* this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4977. this.goToDestination()) : this.goNext())) */
  4978. this.setDestinationItem(this.findNearestItem()) , this.goToDestination()) )
  4979. }
  4980. }
  4981. ,
  4982. /* n.prototype.bgmReplay = function() {//xzw add 结束tour后可能要继续播放背景音乐
  4983. } */
  4984. n.prototype.stopTour = function(isAutoStop) {//停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  4985. SoundManager.pause('tour',true), // zeg 自动导览暂停时同时停止语音
  4986. this.isInterrupted() || this.transitionStage === y.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4987. this.tourIsPlaying = !1,
  4988. this.interrupt(),
  4989. this.clearWalkingSectionPaused(),
  4990. this.resetSpecialTransition(),
  4991. this.emit("update.controls"))
  4992. }
  4993. ,
  4994. n.prototype.endTourProgress = function() {
  4995. this.tourInProgress = !1,
  4996. this.emit("update.controls"),
  4997. this.emit(p.TourEnd)
  4998. }
  4999. ,
  5000. n.prototype.goToHighlight = function(e) {
  5001. if (this.wouldInterrupt())
  5002. this.itemCompare(this.destinationItem,e,'equal') ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  5003. else {
  5004. if (A.debug("<tour.goto " + e + ">"),
  5005. this.isInterrupted())
  5006. return;
  5007. this.clearWalkingSectionPaused(),
  5008. this.setDestinationItem(e),
  5009. this.useSpecialTransition("Hilight")
  5010. this.goToDestination(true),//add true
  5011. h.trackAlways("reach_highlight", {
  5012. reach_source: "thumb"
  5013. })
  5014. }
  5015. }
  5016. ,
  5017. n.prototype.prevHighlight = function() {
  5018. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  5019. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  5020. this.reachSource = "prev",
  5021. this.goPrev()))
  5022. }
  5023. ,
  5024. n.prototype.nextHighlight = function() {
  5025. this.bounceable() || (this.player.emit("tour_manual", "next"),
  5026. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  5027. this.reachSource = "next",
  5028. this.goNext()))
  5029. }
  5030. ,
  5031. n.prototype.changeMode = function(e) {
  5032. var t = $.Deferred()
  5033. , i = t.resolve.bind(t)
  5034. , n = t.reject.bind(t);
  5035. this.emit(p.StartModeChange);
  5036. var r = function() {
  5037. return this.clearWalkingSectionPaused(),
  5038. !!this.wouldInterrupt() && (this.interrupt(),
  5039. !0)
  5040. }
  5041. .bind(this);
  5042. if (!r()) {
  5043. switch (e) {
  5044. case c.PANORAMA:
  5045. 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);
  5046. break;
  5047. case c.DOLLHOUSE:
  5048. case c.FLOORPLAN:
  5049. this.player.flyToNewMode({
  5050. mode: e
  5051. }).done(i).fail(n);
  5052. break;
  5053. case c.OUTDOOR:
  5054. 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)
  5055. }
  5056. return t.promise()
  5057. }
  5058. }
  5059. ,
  5060. n.prototype.atEndOfTour = function(currentItem=this.currentItem) {
  5061. var end = currentItem && currentItem[0] >= this.nItems - 1;
  5062. if(end){
  5063. var heroLocations = this.model.heroLocations[this.nItems-1].heroLocations
  5064. if(heroLocations){
  5065. end = currentItem[1] >= heroLocations.length - 1
  5066. }
  5067. }
  5068. return end;
  5069. }
  5070. ,
  5071. n.prototype.firstDestination = function() {
  5072. //return 0 < this.nItems ? 0 : null
  5073. return 0 < this.nItems ? [0,0]: null
  5074. }
  5075. ,
  5076. n.prototype.finalDestination = function() {
  5077. //return 0 < this.nItems ? this.nItems - 1 : null
  5078. return 0 < this.nItems ? [this.nItems - 1,0]: null
  5079. }
  5080. ,
  5081. n.prototype.goPrev = function() {
  5082. this.tourAdvance(-1)
  5083. }
  5084. ,
  5085. n.prototype.goNext = function() {
  5086. this.tourAdvance(1)
  5087. }
  5088. ,
  5089. n.prototype.setDestinationItem = function(e) {
  5090. this.destinationItem = e,
  5091. this.emit("update.controls")
  5092. }
  5093. ,
  5094. n.prototype.setCurrentItem = function(e) {
  5095. this.currentItem = e,
  5096. this.emit("update.controls")
  5097. }
  5098. ,
  5099. n.prototype.nextItem = function(currentItem) {
  5100. //return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  5101. if(currentItem == void 0)return this.firstDestination()
  5102. var currentLocation = this.model.heroLocations[currentItem[0]];
  5103. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  5104. var item;
  5105. if(this.currentItem[1] >= currentChildNum - 1){//子目录中最后一个
  5106. item = [currentItem[0] + 1, 0] //结果可能超出nItems
  5107. }else{
  5108. item = [currentItem[0] , currentItem[1]+1]
  5109. }
  5110. if(item[0] >= this.nItems ){
  5111. item = this.firstDestination()
  5112. }
  5113. return item;
  5114. //暂时不理会endlessLoop,默认为false
  5115. }
  5116. ,
  5117. n.prototype.prevItem = function(currentItem) {
  5118. //return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  5119. if(currentItem == void 0)return this.firstDestination()
  5120. var item;
  5121. var lastLocation = this.model.heroLocations[currentItem[0]-1];
  5122. if(!lastLocation) return this.finalDestination()//[-1, 0]//this.setDestinationItem([-1, 0]) //结果小于0
  5123. else{
  5124. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  5125. if(this.currentItem[1] == 0){//子目录中第一个
  5126. return [currentItem[0] - 1, lastChildNum-1]
  5127. }else{
  5128. return [currentItem[0], currentItem[1]-1]
  5129. }
  5130. }
  5131. }
  5132. ,
  5133. n.prototype.tourAdvance = function(e) {//e是1或-1 或 0
  5134. A.debug("tourAdvance(" + e + ")")
  5135. if(null === this.currentItem || void 0 === this.currentItem){
  5136. this.setDestinationItem(this.firstDestination())
  5137. // this.setDestinationItem([currentPanoDestinations[0], 0])
  5138. }else{
  5139. var item = this.currentItem
  5140. if(e == 1){
  5141. item = this.nextItem(this.currentItem)
  5142. }else if(e == -1){
  5143. item = this.prevItem(this.currentItem)
  5144. }
  5145. this.setDestinationItem(item)
  5146. }
  5147. if(this.itemCompare(this.destinationItem, this.finalDestination(), 'equal')/* [0] < 0 */){
  5148. this.useSpecialTransition("reverse-looping to end")
  5149. }else if(this.itemCompare(this.destinationItem, this.firstDestination(), 'equal')){
  5150. this.useSpecialTransition("looping back to start")
  5151. }
  5152. /* var momentTour = this.getMomentTour(this.destinationItem);
  5153. if ( "black" === momentTour) { // 方奕卓 瞬间过渡, 相机缩放至1
  5154. var zoomLevel = this.player.zoomLevel;
  5155. this.player.zoomEnabled = true;
  5156. var zoom = function(e, d) {
  5157. this.player.zoomTo((1-e)*zoomLevel, true)
  5158. }.bind(this)
  5159. s.start(zoom, 1500, function(){
  5160. }, 0, d.easeOutQuad, "zoom")
  5161. } */
  5162. this.goToDestination()
  5163. }
  5164. ,
  5165. n.prototype.getMomentTour = function(destinationItem) {//add
  5166. var wholeMomentTour = window.DATA.momentTour || "walk"; //最外层 还有一种是'std'
  5167. if(!destinationItem) return wholeMomentTour
  5168. else{
  5169. var currentLocation = this.model.getHeroDescriptorByIndex(destinationItem)//最内层。 如果有使用最内层
  5170. if(currentLocation.momentTour)return currentLocation.momentTour;
  5171. var currentLocation_ = this.model.heroLocations[destinationItem[0]];
  5172. return currentLocation_.momentTour || wholeMomentTour; //若中间层或最内层有就使用,否则使用最外层
  5173. }
  5174. }
  5175. ,
  5176. t.exports = n
  5177. }
  5178. ).call(this, "/js/director.js")
  5179. }
  5180. , {
  5181. "./analytics": 4,
  5182. "./enum/BlackoutStyle": 18,
  5183. "./enum/ControlEvents": 21,
  5184. "./enum/DirectorEvents": 23,
  5185. "./enum/ModelManagerEvents": 33,
  5186. "./enum/PathDiscardMode": 38,
  5187. "./enum/PathDisplayMode": 39,
  5188. "./enum/PlayerEvents": 40,
  5189. "./enum/Viewmode": 51,
  5190. "./enum/WarpStyle": 52,
  5191. "./model/ModelManager": 140,
  5192. "./player": 155,
  5193. "./settings": 166,
  5194. "./util/logger": 189,
  5195. "./util/transitions": 195,
  5196. events: 202,
  5197. three: 217
  5198. }],
  5199. 16: [function(e, t, i) {
  5200. "use strict";
  5201. var n = e("three")
  5202. , r = e("./enum/Viewmode")
  5203. , o = (e("./settings"),
  5204. e("./util/transitions"))
  5205. , a = e("./enum/PlayerEvents")
  5206. , s = new n.ShaderPass(n.HorizontalBlurShader)
  5207. , l = new n.ShaderPass(n.VerticalBlurShader);
  5208. l.renderToScreen = !0;
  5209. var c = $("#player").width() / $("#player").height();
  5210. isNaN(c) && (c = 1);
  5211. var h = {
  5212. currentBlur: 0,
  5213. aspect: c,
  5214. blurStrength: 1,
  5215. hblurPass: s,
  5216. vblurPass: l,
  5217. fastTranMaskPass : new n.TransitionPass()
  5218. ,
  5219. bindEvents: function(e) {
  5220. e.on(a.ModeChanged, function(e, t) {
  5221. e === r.PANORAMA && (o.cancel(h.blur),
  5222. o.cancel(h.addBlur),
  5223. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  5224. })
  5225. },
  5226. blur: function(e) {
  5227. h.currentBlur = e;
  5228. var t = e * h.blurStrength;
  5229. l.uniforms.v.value = t / 512 * h.aspect,
  5230. s.uniforms.h.value = t / 512
  5231. },
  5232. addBlur: function(e) {
  5233. e = Math.max(e, h.currentBlur),
  5234. h.blur(e)
  5235. },
  5236. removeBlur: function(e) {
  5237. e = Math.min(1 - e, h.currentBlur),
  5238. h.blur(e)
  5239. }
  5240. };
  5241. h.blur(0),
  5242. t.exports = h
  5243. }
  5244. , {
  5245. "./enum/PlayerEvents": 40,
  5246. "./enum/Viewmode": 51,
  5247. "./settings": 166,
  5248. "./util/transitions": 195,
  5249. three: 217
  5250. }],
  5251. 17: [function(e, t, i) {
  5252. "use strict";
  5253. t.exports = {
  5254. UNKNOWN: 0,
  5255. ALIGNED: 1,
  5256. UNALIGNED: 2,
  5257. PLACED: 3
  5258. }
  5259. }
  5260. , {}],
  5261. 18: [function(e, t, i) {
  5262. "use strict";
  5263. t.exports = {
  5264. NONE: 0,
  5265. MIDDLE: 1,
  5266. END: 2,
  5267. BEGINNING: 3,
  5268. FADEIN: 4
  5269. }
  5270. }
  5271. , {}],
  5272. 19: [function(e, t, i) {
  5273. "use strict";
  5274. var n = e("three");
  5275. t.exports = {
  5276. newBlue: new n.Color(4967932),
  5277. altBlue: new n.Color(47355),
  5278. tagDefault: new n.Color(223357),
  5279. classicBlue: new n.Color(53759),
  5280. mpYellow: new n.Color(16502016),
  5281. mpOrange: new n.Color(16428055),
  5282. mpBlue: new n.Color(12096),
  5283. mpLtGrey: new n.Color(13751252),
  5284. mpDkGrey: new n.Color(10000019),
  5285. mpRed: new n.Color(12525854),
  5286. mpOrangeDesat: new n.Color(16764529),
  5287. mpBlueDesat: new n.Color(4034734),
  5288. mpRedDesat: new n.Color(14705505),
  5289. white: new n.Color(16777215),
  5290. black: new n.Color(0),
  5291. _desat: function(e, t) {
  5292. var i = t || .3
  5293. , r = (new n.Color).copy(e).getHSL();
  5294. return (new n.Color).setHSL(r.h, r.s * (1 - i), r.l)
  5295. },
  5296. _darken: function(e, t) {
  5297. var i = t || .2
  5298. , r = e.getHSL();
  5299. return (new n.Color).setHSL(r.h, r.s, r.l * (1 - i))
  5300. }
  5301. }
  5302. }
  5303. , {
  5304. three: 217
  5305. }],
  5306. 20: [function(e, t, i) {
  5307. "use strict";
  5308. t.exports = {
  5309. NONE: -1,
  5310. ROTATE: 0,
  5311. DOLLY: 1,
  5312. PAN: 2,
  5313. ROTATE_DOLLY: 3,
  5314. PAN_DOLLY: 4
  5315. }
  5316. }
  5317. , {}],
  5318. 21: [function(e, t, i) {
  5319. "use strict";
  5320. t.exports = {
  5321. Move: "move",
  5322. InteractionDirect: "interaction.direct",
  5323. InteractionKey: "interaction.key",
  5324. InteractionGui: "interaction.gui",
  5325. FlyInDirection: "fly.direction",
  5326. InputStart: "input.start",
  5327. Pinch: "input.pinch",
  5328. Scroll: "input.scroll",
  5329. AutoPanInterrupt: "autopan.interrupt",
  5330. AutoPanComplete: "autopan.complete",
  5331. AutoPanClamped: "autopan.clamped",
  5332. LongTap: "longtap"
  5333. }
  5334. }
  5335. , {}],
  5336. 22: [function(e, t, i) {
  5337. "use strict";
  5338. t.exports = Object.freeze({
  5339. FORWARD: "FORWARD",
  5340. LEFT: "LEFT",
  5341. RIGHT: "RIGHT",
  5342. BACK: "BACK",
  5343. UP: "UP",
  5344. DOWN: "DOWN"
  5345. })
  5346. }
  5347. , {}],
  5348. 23: [function(e, t, i) {
  5349. "use strict";
  5350. t.exports = {
  5351. ActionInterrupted: "action.interrupted",
  5352. TourStart: "tour.start",
  5353. TourEnd: "tour.end",
  5354. StartModeChange: "mode.startChange"
  5355. }
  5356. }
  5357. , {}],
  5358. 24: [function(e, t, i) {
  5359. "use strict";
  5360. t.exports = Object.freeze({
  5361. None: 0,
  5362. Queued: 1,
  5363. ForceQueued: 2,
  5364. Downloading: 3,
  5365. Downloaded: 4,
  5366. DownloadFailed: 5
  5367. })
  5368. }
  5369. , {}],
  5370. 25: [function(e, t, i) {
  5371. "use strict";
  5372. t.exports = {
  5373. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5374. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5375. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5376. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5377. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5378. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5379. }
  5380. }
  5381. , {}],
  5382. 26: [function(e, t, i) {
  5383. "use strict";
  5384. t.exports = {
  5385. Texture2D: 0,
  5386. TextureCube: 1
  5387. }
  5388. }
  5389. , {}],
  5390. 27: [function(e, t, i) {
  5391. "use strict";
  5392. t.exports = {
  5393. SMALL: "small",
  5394. LARGE: "large"
  5395. }
  5396. }
  5397. , {}],
  5398. 28: [function(e, t, i) {
  5399. "use strict";
  5400. var n = e("./Viewmode")
  5401. , r = {
  5402. LANDING: {},
  5403. NAVIGATION: "navigation",
  5404. MORE_HELP: "moreHelp",
  5405. TOUR_INTERACTION: {}
  5406. };
  5407. r.LANDING[n.PANORAMA] = "panorama.landing",
  5408. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5409. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5410. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5411. r.TOUR_INTERACTION.standard = "standard.tour",
  5412. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5413. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5414. t.exports = r
  5415. }
  5416. , {
  5417. "./Viewmode": 51
  5418. }],
  5419. 29: [function(e, t, i) {
  5420. "use strict";
  5421. var n = {
  5422. UP: 1,
  5423. DOWN: -1,
  5424. LEFT: "L",
  5425. RIGHT: "R",
  5426. FORWARD: "F",
  5427. BACK: "B",
  5428. reverse: {},
  5429. opposite: function(e) {
  5430. return this.reverse[e.toString()]
  5431. }
  5432. };
  5433. !function() {
  5434. n.reverse[n.UP] = n.DOWN,
  5435. n.reverse[n.DOWN] = n.UP,
  5436. n.reverse[n.LEFT] = n.RIGHT,
  5437. n.reverse[n.RIGHT] = n.LEFT,
  5438. n.reverse[n.FORWARD] = n.BACK,
  5439. n.reverse[n.BACK] = n.FORWARD
  5440. }(),
  5441. t.exports = n
  5442. }
  5443. , {}],
  5444. 30: [function(e, t, i) {
  5445. "use strict";
  5446. var n = e("../util/browser")
  5447. , r = {
  5448. ZERO: 48,
  5449. ONE: 49,
  5450. TWO: 50,
  5451. THREE: 51,
  5452. FOUR: 52,
  5453. FIVE: 53,
  5454. SIX: 54,
  5455. SEVEN: 55,
  5456. EIGHT: 56,
  5457. NINE: 57,
  5458. LEFTARROW: 37,
  5459. UPARROW: 38,
  5460. RIGHTARROW: 39,
  5461. DOWNARROW: 40,
  5462. A: 65,
  5463. B: 66,
  5464. C: 67,
  5465. D: 68,
  5466. E: 69,
  5467. F: 70,
  5468. G: 71,
  5469. H: 72,
  5470. I: 73,
  5471. J: 74,
  5472. K: 75,
  5473. L: 76,
  5474. M: 77,
  5475. N: 78,
  5476. O: 79,
  5477. P: 80,
  5478. Q: 81,
  5479. R: 82,
  5480. S: 83,
  5481. T: 84,
  5482. U: 85,
  5483. V: 86,
  5484. W: 87,
  5485. X: 88,
  5486. Y: 89,
  5487. Z: 90,
  5488. SPACE: 32,
  5489. RETURN: 13,
  5490. SEMICOLON: 186,
  5491. PLUSEQUALS: 187,
  5492. DASHUNDERSCORE: 189,
  5493. OPENBRACKET: 219
  5494. };
  5495. n.detectFirefox() && (r.SEMICOLON = 59,
  5496. r.PLUSEQUALS = 61,
  5497. r.DASHUNDERSCORE = 173),
  5498. t.exports = r
  5499. }
  5500. , {
  5501. "../util/browser": 182
  5502. }],
  5503. 31: [function(e, t, i) {
  5504. "use strict";
  5505. t.exports = {
  5506. EN_US: "en-US",
  5507. ES_MX: "es-MX",
  5508. FR_FR: "fr-FR",
  5509. DE_DE: "de-DE",
  5510. RU_RU: "ru-RU",
  5511. CN_CN: "cn-CN",
  5512. JP_JP: "jp-JP"
  5513. }
  5514. }
  5515. , {}],
  5516. 32: [function(e, t, i) {
  5517. "use strict";
  5518. t.exports = {
  5519. TagActivated: "tag.activated",
  5520. TagDismissed: "tag.dismissed",
  5521. TagNavigation: "tag.navigation"
  5522. }
  5523. }
  5524. , {}],
  5525. 33: [function(e, t, i) {
  5526. "use strict";
  5527. t.exports = {
  5528. ModelAdded: "model-added",
  5529. ActiveModelChanged: "active-model-changed"
  5530. }
  5531. }
  5532. , {}],
  5533. 34: [function(e, t, i) {
  5534. "use strict";
  5535. t.exports = {
  5536. LEFT: 0,
  5537. MIDDLE: 1,
  5538. RIGHT: 2
  5539. }
  5540. }
  5541. , {}],
  5542. 35: [function(e, t, i) {
  5543. "use strict";
  5544. t.exports = {
  5545. PanoRenderComplete: "panorama.render.complete",
  5546. TileRenderFailure: "panorama.tile.render.failed",
  5547. TileRenderSuccess: "panorama.tile.render.success",
  5548. TileUploadAttempted: "panorama.tile.upload.attempted",
  5549. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5550. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5551. }
  5552. }
  5553. , {}],
  5554. 36: [function(e, t, i) {
  5555. "use strict";
  5556. t.exports = {
  5557. BASE: 1,
  5558. STANDARD: 2,
  5559. HIGH: 3,
  5560. ULTRAHIGH: 4
  5561. }
  5562. }
  5563. , {}],
  5564. 37: [function(e, t, i) {
  5565. "use strict";
  5566. t.exports = {
  5567. LoadComplete: "panorama.load.complete",
  5568. LoadFailed: "panorama.load.failed",
  5569. TileLoaded: "panorama.tile.loaded"
  5570. }
  5571. }
  5572. , {}],
  5573. 38: [function(e, t, i) {
  5574. "use strict";
  5575. t.exports = Object.freeze({
  5576. Standard: 0,
  5577. Slow: 1,
  5578. Retain: 2
  5579. })
  5580. }
  5581. , {}],
  5582. 39: [function(e, t, i) {
  5583. "use strict";
  5584. t.exports = Object.freeze({
  5585. Show: 0,
  5586. Hide: 1,
  5587. Retain: 2
  5588. })
  5589. }
  5590. , {}],
  5591. 40: [function(e, t, i) {
  5592. "use strict";
  5593. t.exports = {
  5594. Move: "move",
  5595. MoveComplete: "move.complete",
  5596. ModeChanged: "mode.changed",
  5597. ModeChanging: "mode.changing",
  5598. PanoChosen: "pano.chosen",
  5599. ClosestPanoChanging: "closest.pano.changing",
  5600. WarpStarted: "warp.started",
  5601. WarpInterrupted: "warp.interrupted",
  5602. WarpEnded: "warp.ended",
  5603. FlyinFinished: "flyin.finished",
  5604. FlyingStarted: "flying.started",
  5605. FlyingInterrupted: "flying.interrupted",
  5606. FlyingEnded: "flying.ended",
  5607. Ready: "ready",
  5608. StartInside: "start.inside",
  5609. StartOutside: "start.outside",
  5610. ViewChanged: "view.changed",
  5611. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5612. InputStart: "input.start"
  5613. }
  5614. }
  5615. , {}],
  5616. 41: [function(e, t, i) {
  5617. "use strict";
  5618. t.exports = Object.freeze({
  5619. DEFAULT: 0,
  5620. PANOMARKERS: 1,
  5621. RETICULE: 2,
  5622. TAG: 3
  5623. })
  5624. }
  5625. , {}],
  5626. 42: [function(e, t, i) {
  5627. "use strict";
  5628. t.exports = {
  5629. visibleFloor: 1,
  5630. ghostFloor: 3,
  5631. boundingSkybox: 1,
  5632. panoMarker: 2,
  5633. reticule: 3,
  5634. tagStem: 4,
  5635. tagDisc: 5,
  5636. ribbon: 100
  5637. }
  5638. }
  5639. , {}],
  5640. 43: [function(e, t, i) {
  5641. "use strict";
  5642. t.exports = {
  5643. ContextCreated: "scene-renderer-context-created",
  5644. AfterRender: "after-render",
  5645. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5646. }
  5647. }
  5648. , {}],
  5649. 44: [function(e, t, i) {
  5650. "use strict";
  5651. t.exports = {
  5652. IDLE: "idle",
  5653. BROWSE: "browse",
  5654. EXAMINE: "examine"
  5655. }
  5656. }
  5657. , {}],
  5658. 45: [function(e, t, i) {
  5659. "use strict";
  5660. t.exports = {
  5661. TileDownloadSuccess: "tiledownloader.download.success",
  5662. TileDownloadFailure: "tiledownloader.download.failure",
  5663. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5664. }
  5665. }
  5666. , {}],
  5667. 46: [function(e, t, i) {
  5668. "use strict";
  5669. t.exports = {
  5670. CardboardAndroid: "googlevr",
  5671. GearVR: "gearvr",
  5672. CardboardIOS: "googlevrios",
  5673. Cardboard: "googlevr"
  5674. }
  5675. }
  5676. , {}],
  5677. 47: [function(e, t, i) {
  5678. "use strict";
  5679. t.exports = {
  5680. NONE: 0,
  5681. CONTEXTUAL: 1,
  5682. ANDROID: 2
  5683. }
  5684. }
  5685. , {}],
  5686. 48: [function(e, t, i) {
  5687. "use strict";
  5688. var n = {
  5689. Title: 0,
  5690. Cardboard: 1
  5691. }
  5692. , r = {
  5693. Title: 0,
  5694. Cardboard: 1,
  5695. Gear: 2
  5696. };
  5697. !function() {
  5698. [n, r].forEach(function(e) {
  5699. e.pageCount = Object.keys(e).length
  5700. })
  5701. }(),
  5702. t.exports.ios = n,
  5703. t.exports.standard = r
  5704. }
  5705. , {}],
  5706. 49: [function(e, t, i) {
  5707. "use strict";
  5708. t.exports = {
  5709. Android: "android",
  5710. IOS: "ios",
  5711. Desktop: "desktop",
  5712. UnsupportedAndroid: "android-unsupported"
  5713. }
  5714. }
  5715. , {}],
  5716. 50: [function(e, t, i) {
  5717. "use strict";
  5718. var n = e("three");
  5719. t.exports = {
  5720. UP: new n.Vector3(0,1,0),
  5721. DOWN: new n.Vector3(0,-1,0),
  5722. LEFT: new n.Vector3(-1,0,0),
  5723. RIGHT: new n.Vector3(1,0,0),
  5724. FORWARD: new n.Vector3(0,0,-1),
  5725. BACK: new n.Vector3(0,0,1)
  5726. }
  5727. }
  5728. , {
  5729. three: 217
  5730. }],
  5731. 51: [function(e, t, i) {
  5732. "use strict";
  5733. var n = e("../exception/ViewmodeConvertException")
  5734. , r = e("./coreViewmodes")
  5735. , o = e("../util/common")
  5736. , a = {
  5737. MESH: "mesh",
  5738. OUTDOOR: "outdoor",
  5739. TRANSITIONING: "transitioning",
  5740. toInt: function(e) {
  5741. switch (e) {
  5742. case this.PANORAMA:
  5743. return 1;
  5744. case this.DOLLHOUSE:
  5745. return 2;
  5746. case this.FLOORPLAN:
  5747. return 3;
  5748. case this.OUTDOOR:
  5749. return 4;
  5750. case this.TRANSITIONING:
  5751. return -1
  5752. }
  5753. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5754. },
  5755. fromInt: function(e) {
  5756. switch (e) {
  5757. case "1":
  5758. case 1:
  5759. return this.PANORAMA;
  5760. case "2":
  5761. case 2:
  5762. return this.DOLLHOUSE;
  5763. case "3":
  5764. case 3:
  5765. return this.FLOORPLAN;
  5766. case "4":
  5767. case 4:
  5768. return this.OUTDOOR
  5769. }
  5770. throw new n("No known conversion for int to viewmode for int: " + e)
  5771. },
  5772. convertWorkshopModeInt: function(e) {
  5773. switch (e) {
  5774. case "0":
  5775. case 0:
  5776. case undefined: //xzw add
  5777. return this.PANORAMA;
  5778. case "1":
  5779. case 1:
  5780. return this.FLOORPLAN;
  5781. case "2":
  5782. case 2:
  5783. return this.DOLLHOUSE;
  5784. case "3":
  5785. case 3:
  5786. return this.MESH
  5787. }
  5788. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5789. }
  5790. };
  5791. o.extendObject(a, r),
  5792. t.exports = a
  5793. }
  5794. , {
  5795. "../exception/ViewmodeConvertException": 58,
  5796. "../util/common": 185,
  5797. "./coreViewmodes": 54
  5798. }],
  5799. 52: [function(e, t, i) {
  5800. "use strict";
  5801. t.exports = {
  5802. BLACK: "black",
  5803. STD: "std",
  5804. WALK: "walk"
  5805. }
  5806. }
  5807. , {}],
  5808. 53: [function(e, t, i) {
  5809. "use strict";
  5810. t.exports = {
  5811. ZoomIn: "zoom.in",
  5812. ZoomOut: "zoom.out",
  5813. ZoomMax: "zoom.max",
  5814. ZoomMin: "zoom.min"
  5815. }
  5816. }
  5817. , {}],
  5818. 54: [function(e, t, i) {
  5819. "use strict";
  5820. t.exports = {
  5821. PANORAMA: "panorama",
  5822. DOLLHOUSE: "dollhouse",
  5823. FLOORPLAN: "floorplan"
  5824. }
  5825. }
  5826. , {}],
  5827. 55: [function(e, t, i) {
  5828. "use strict";
  5829. function n(e) {
  5830. this.message = e
  5831. }
  5832. t.exports = n
  5833. }
  5834. , {}],
  5835. 56: [function(e, t, i) {
  5836. "use strict";
  5837. function n(e) {
  5838. r.call(this, e)
  5839. }
  5840. var r = e("./BasicException");
  5841. n.prototype = Object.create(r.prototype),
  5842. t.exports = n
  5843. }
  5844. , {
  5845. "./BasicException": 55
  5846. }],
  5847. 57: [function(e, t, i) {
  5848. "use strict";
  5849. function n(e) {
  5850. r.call(this, e)
  5851. }
  5852. var r = e("./BasicException");
  5853. n.prototype = Object.create(r.prototype),
  5854. t.exports = n
  5855. }
  5856. , {
  5857. "./BasicException": 55
  5858. }],
  5859. 58: [function(e, t, i) {
  5860. "use strict";
  5861. function n(e) {
  5862. r.call(this, e)
  5863. }
  5864. var r = e("./BasicException");
  5865. n.prototype = Object.create(r.prototype),
  5866. t.exports = n
  5867. }
  5868. , {
  5869. "./BasicException": 55
  5870. }],
  5871. 59: [function(e, t, i) {
  5872. (function(i) {
  5873. "use strict";
  5874. function n(e) {
  5875. var t = {};
  5876. if (e) {
  5877. var i = e.flags;
  5878. if (i)
  5879. for (var n in i)
  5880. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5881. return t
  5882. }
  5883. return l.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5884. null
  5885. }
  5886. var r = e("./util/ajax")
  5887. , o = e("./util/showcase")
  5888. , a = e("./util/logger")
  5889. , s = ""
  5890. , l = new a(i)
  5891. , c = {};
  5892. t.exports = {
  5893. loadFeatureFlags: function(e) {
  5894. var t = $.Deferred();
  5895. return r.get(e.urlBase + s, {
  5896. responseType: "json",
  5897. prefetchFrom: "user",
  5898. auth: o.getAuthorizationHeader()
  5899. }).done(function(e) {
  5900. c = n(e),
  5901. c ? t.resolve(c) : t.reject("loading-failed")
  5902. }).fail(function() {
  5903. l.debug("Retrieval of feature flags failed."),
  5904. t.reject("loading-failed")
  5905. }),
  5906. t.promise()
  5907. },
  5908. getFlags: function() {
  5909. return c
  5910. },
  5911. updateDependentSettings: function(e, t) {
  5912. e = e || c,
  5913. e.labels && (t.labels.enabled = !0),
  5914. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5915. e.showcase_sdk && (t.sdkInit = !0),
  5916. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5917. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5918. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5919. e.hide_sc_sharing && (t.share.enabled = !1)
  5920. }
  5921. }
  5922. }
  5923. ).call(this, "/js/featureflags.js")
  5924. }
  5925. , {
  5926. "./util/ajax": 181,
  5927. "./util/logger": 189,
  5928. "./util/showcase": 193
  5929. }],
  5930. 60: [function(e, t, i) {
  5931. "use strict";
  5932. var n = (e("../util/common"),
  5933. {
  5934. status: 0,
  5935. set: function(e) {
  5936. if (isNaN(e))
  5937. return !1;
  5938. var t = $('.progressbar');
  5939. 0 > e && (e = 0);
  5940. e > 100 && (e = 100);
  5941. var width = parseInt(t.css('width').replace("px",""))/100; //获取进度条总长度除以100
  5942. var barperc = e*width;
  5943. var perc = Math.round(e);
  5944. var labelpos = (parseInt(barperc)-15);
  5945. t.find('.bar').css('width',barperc); //已经再跑颜色的百分比
  5946. t.find('.label').css('left', labelpos); //上面跟着的字的百分比
  5947. t.find('.perc').text(perc+'%'); //具体数字的百分比
  5948. this.status = e
  5949. },
  5950. done: function(e) {
  5951. return e || this.status ? (this.status = null,
  5952. this.set(100)) : this
  5953. }
  5954. });
  5955. t.exports.circleLoader = n
  5956. }
  5957. , {
  5958. "../util/common": 185
  5959. }],
  5960. 61: [function(e, t, i) {
  5961. "use strict";
  5962. t.exports = Object.freeze({
  5963. CLOSE: "modal.closer.close"
  5964. })
  5965. }
  5966. , {}],
  5967. 62: [function(e, t, i) {
  5968. "use strict";
  5969. function n(e, t) {
  5970. t && (t.stopPropagation(),
  5971. t.preventDefault()),
  5972. e && this.emit(l.CLOSE, e),
  5973. g.reset()
  5974. }
  5975. function r(e, t) {
  5976. function i() {
  5977. var t = e.offsetHeight >= $("#player").height() && e.offsetWidth >= $("#player").width();
  5978. t !== f && (f = t,
  5979. t ? (e.classList.add("closeByFooter"),
  5980. h.classList.add("closeByFooter")) : (e.classList.remove("closeByFooter"),
  5981. h.classList.remove("closeByFooter")))
  5982. }
  5983. t ? setTimeout(i, o.guiAnimationSpeed) : i()
  5984. }
  5985. var o = e("../../settings")
  5986. , a = (e("../../tag/Media/MediaEvent"),
  5987. e("../../util/browser"))
  5988. , s = e("../../util/common")
  5989. , l = e("./ModalCloserEvent")
  5990. , c = e("events").EventEmitter
  5991. , h = document.getElementsByClassName("footer")[0]
  5992. , u = h.querySelectorAll(".close")[0]
  5993. , d = null
  5994. , p = null
  5995. , f = null
  5996. , g = (a.isMobile(),
  5997. {
  5998. open: function(e) {
  5999. e && (r(e),
  6000. d && u.removeEventListener("click", d, !0),
  6001. d = n.bind(this, e.id),
  6002. u.addEventListener("click", d, !0),
  6003. p && window.removeEventListener("resize", p, !0),
  6004. p = r.bind(this, e),
  6005. window.addEventListener("resize", p, !0))
  6006. },
  6007. reset: function() {
  6008. h.classList.remove("closeByFooter"),
  6009. u.removeEventListener("click", d, !0),
  6010. window.removeEventListener("resize", p, !0),
  6011. d = p = f = null
  6012. }
  6013. });
  6014. s.extendObject(g, c.prototype),
  6015. t.exports = g
  6016. }
  6017. , {
  6018. "../../tag/Media/MediaEvent": 131,
  6019. "../../settings": 166,
  6020. "../../util/browser": 182,
  6021. "../../util/common": 185,
  6022. "./ModalCloserEvent": 61,
  6023. events: 202
  6024. }],
  6025. 63: [function(e, t, i) {
  6026. "use strict";
  6027. function n(e, t, i) {
  6028. var n = new r.GUI({
  6029. width: 400
  6030. })
  6031. , u = n.addFolder("Flydown from Dollhouse");
  6032. u.add(h.flydown, "movementEasing", Object.keys(a)),
  6033. u.add(h.flydown, "movementDelay", 0, 1).step(.01),
  6034. u.add(h.flydown, "rotationEasing", Object.keys(a)),
  6035. u.add(h.flydown, "rotationDelay", 0, 1).step(.01),
  6036. u.add(h.flydown, "modelTextureDelay", 0, 1).step(.01),
  6037. u.add(h.flydown, "skyboxDelay", 0, 1).step(.01),
  6038. u.add(h.dollhouseDefault, "minPolarAngle", 0, o.Math.degToRad(50)),
  6039. u.add(h.dollhouseDefault, "maxPolarAngle", o.Math.degToRad(50), o.Math.degToRad(170));
  6040. var d = n.addFolder("Transition between panos");
  6041. d.add(h.transition, "blur", 0, 10).onFinishChange(function() {}),
  6042. d.add(h.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  6043. h.transition.flyTime = 0,
  6044. d.__controllers.forEach(function(e) {
  6045. e.updateDisplay()
  6046. })
  6047. }),
  6048. d.add(h.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  6049. h.transition.flySpeed = 0,
  6050. d.__controllers.forEach(function(e) {
  6051. e.updateDisplay()
  6052. })
  6053. }),
  6054. d.add(h.transition, "aimTime", 500, 2500).step(50),
  6055. d.add(h.transition, "aimSlowFactor", 1, 3).step(.1),
  6056. d.add(h.transition, "movementEasing", Object.keys(a));
  6057. var p = n.addFolder("Path Display");
  6058. p.add(h.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  6059. p.add(h.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  6060. p.add(h.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  6061. p.add(h.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  6062. p.add(h.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  6063. p.add(h.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  6064. p.add(h.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  6065. p.add(h.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  6066. p.add(h.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  6067. p.add(h.path, "color", Object.keys(l)).onFinishChange(function() {
  6068. h.path.color = l[h.path.color],
  6069. h.path.colorUp = l._desat(h.path.color),
  6070. h.path.colorDown = l.darken(h.path.color)
  6071. }),
  6072. p.add(h, "reticuleColor", Object.keys(l)).onFinishChange(function() {
  6073. h.reticuleColor = l[h.reticuleColor]
  6074. });
  6075. var f = n.addFolder("Warping")
  6076. , g = f.addFolder("Warp/Teleport");
  6077. g.add(h.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  6078. g.add(h.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  6079. g.add(h.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  6080. g.add(h.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  6081. g.add(h.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  6082. g.add(h.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  6083. g.add(h.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  6084. g.add(h.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  6085. g.add(h.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  6086. g.add(h.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  6087. g.add(h.path, "mapGuides").onFinishChange(function() {}),
  6088. g.add(h.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  6089. g.add(h.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  6090. g.add(h.path, "typ", Object.keys(c)).onFinishChange(function() {
  6091. h.path.typ = c[h.path.typ]
  6092. }),
  6093. g.add(h.warp, "loop").onChange(function() {}).onFinishChange(function() {
  6094. t.endlessLoop = h.warp.loop
  6095. }),
  6096. g.add(h.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  6097. g.add(h.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  6098. g.add(h.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  6099. var m = f.addFolder("Long Warp Only");
  6100. m.add(h.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  6101. h.warp.flySpeed = 0,
  6102. m.__controllers.forEach(function(e) {
  6103. e.updateDisplay()
  6104. })
  6105. }),
  6106. m.add(h.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  6107. m.add(h.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  6108. m.add(h.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  6109. m.add(h.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  6110. m.add(h.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  6111. m.add(h.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  6112. m.add(h.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  6113. m.add(h.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  6114. m.add(h.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  6115. var v = n.addFolder("Warp Esoterica");
  6116. v.add(h.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  6117. v.add(h.warp, "blur", .01, 1).onFinishChange(function() {}),
  6118. v.add(h.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  6119. h.warp.minWarpTime = 0,
  6120. v.__controllers.forEach(function(e) {
  6121. e.updateDisplay()
  6122. })
  6123. }),
  6124. v.add(h.warp, "showBunny").onFinishChange(function() {}),
  6125. v.add(h.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  6126. v.add(h.warp, "movementEasing", Object.keys(a));
  6127. var A = n.addFolder("Misc");
  6128. A.add(h, "dollhouseFOV", 10, 180).onChange(function() {
  6129. i.cameras[s.DOLLHOUSE].fov = h.dollhouseFOV
  6130. }),
  6131. A.add(h, "insideFOV", 10, 180).onChange(function() {
  6132. i.cameras[s.PANORAMA].fov = h.insideFOV
  6133. }),
  6134. A.add(h, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  6135. A.add(h, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  6136. A.add(h, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  6137. var y = n.addFolder("Navigation");
  6138. y.add(h.navigation, "panoScores").onFinishChange(function() {
  6139. h.navigation.panoScores || e.panos.forEach(function(e) {
  6140. e.floor.remove(e.text3d),
  6141. e.text3d = null
  6142. })
  6143. }),
  6144. y.add(h.navigation, "mouseDirection"),
  6145. y.add(h.navigation, "filterStrictness", 0, 1),
  6146. y.add(h.navigation, "angleFactor", -60, 0),
  6147. y.add(h.navigation, "directionFactor", 1, 20),
  6148. y.add(h.navigation, "distanceFactor", -5, 5),
  6149. y.add(h.navigation, "optionalityFactor", .1, 10);
  6150. var C = n.addFolder("tags")
  6151. , I = C.addFolder("Tag Creation");
  6152. I.add(h.tags.pole, "enabled").name("poleEnabled"),
  6153. I.add(h.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  6154. I.add(h.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  6155. I.add(h.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  6156. var E = C.addFolder("Visibility");
  6157. E.add(h.tags.visibility, "anyDistance"),
  6158. E.add(h.tags.visibility, "visibleDistance", .1, 30).step(.1),
  6159. E.add(h.tags.visibility, "cameraClearance", 0, 1).step(.01),
  6160. E.add(h.tags.visibility, "hideViaFloor"),
  6161. E.add(h.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  6162. E.add(h.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  6163. var b = C.addFolder("Disc Parameters");
  6164. b.add(h.tags.disc.scale, "nearBound", .1, 10).step(.1),
  6165. b.add(h.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  6166. b.add(h.tags.disc.scale, "linkFarBound").onChange(function(e) {
  6167. e && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - h.tags.disc.scale.linkPercent / 100))
  6168. }),
  6169. b.add(h.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  6170. h.tags.disc.scale.linkFarBound && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - e / 100))
  6171. }),
  6172. b.add(h.tags.disc.scale, "maxSize", 40, 200).step(1),
  6173. b.add(h.tags.disc.scale, "minSize", 20, 100).step(1),
  6174. b.add(h.tags.disc.scale, "responsiveness", 0, 100).step(1);
  6175. var w = C.addFolder("Navigate");
  6176. w.add(h.tags.navigate, "nearestPano").name("nearestPano"),
  6177. w.add(h.tags.navigate, "lineOfSight").name("lineOfSight"),
  6178. w.add(h.tags.navigate, "reactivate").name("reactivate"),
  6179. w.add(h.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  6180. w.add(h.tags.navigate, "tiltTolerance", 0, 50).step(1),
  6181. w.add(h.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  6182. var _ = n.addFolder("Debug");
  6183. _.add(h, "wireframe").onFinishChange(function() {
  6184. e.chunks.forEach(function(t) {
  6185. t.material && (t.wireframeTwin || (t.wireframeTwin = new o.WireframeHelper(t),
  6186. t.wireframeTwin.material.depthWrite = !1,
  6187. t.wireframeTwin.material.depthTest = !1,
  6188. t.wireframeTwin.material.opacity = .5,
  6189. t.wireframeTwin.material.transparent = !0),
  6190. h.wireframe ? e.add(t.wireframeTwin) : e.remove(t.wireframeTwin))
  6191. })
  6192. }),
  6193. _.add(h, "skyboxWireframe").onFinishChange(function() {
  6194. h.skyboxWireframe ? (e.skybox.wireframe = new o.WireframeHelper(e.skybox),
  6195. e.add(e.skybox.wireframe)) : (e.remove(e.skybox.wireframe),
  6196. e.skybox.wireframe = null)
  6197. }),
  6198. _.add(h, "showSweeps").onFinishChange(function() {
  6199. e.setSweepVisibility(h.showSweeps)
  6200. }),
  6201. _.add(h, "showMesh").onFinishChange(function() {
  6202. e.chunks.forEach(function(e) {
  6203. e.visible = h.showMesh
  6204. })
  6205. }),
  6206. _.add(h, "showFloors").onFinishChange(function() {
  6207. e.floors.forEach(function(e) {
  6208. e.collider.children.forEach(function(e) {
  6209. e.material.visible = h.showFloors
  6210. })
  6211. })
  6212. }),
  6213. _.add(h, "showSkyboxes").onFinishChange(function() {
  6214. e.panos.forEach(function(e) {
  6215. e.skyboxMesh.visible = h.showSkyboxes
  6216. })
  6217. }),
  6218. _.add(h, "showNeighbors").onChange(function() {}),
  6219. _.add(e, "alpha", 0, 1)
  6220. }
  6221. var r = e("../lib/dat.gui")
  6222. , o = e("three")
  6223. , a = e("../util/easing")
  6224. , s = e("../enum/Viewmode")
  6225. , l = e("../enum/Colors")
  6226. , c = e("../enum/WarpStyle")
  6227. , h = e("../settings");
  6228. e("../tag/tag");
  6229. r.GUI.prototype.removeFolder = function(e) {
  6230. var t = this.__folders[e];
  6231. t && (t.close(),
  6232. this.__ul.removeChild(t.domElement.parentNode),
  6233. delete this.__folders[e],
  6234. this.onResize())
  6235. }
  6236. ,
  6237. t.exports.toggle = n
  6238. }
  6239. , {
  6240. "../enum/Colors": 19,
  6241. "../enum/Viewmode": 51,
  6242. "../enum/WarpStyle": 52,
  6243. "../lib/dat.gui": 93,
  6244. "../tag/tag": 123,
  6245. "../settings": 166,
  6246. "../util/easing": 186,
  6247. three: 217
  6248. }],
  6249. 64: [function(e, t, i) {
  6250. (function(i) {
  6251. "use strict";
  6252. function n(e, t, i, n) {
  6253. $(".gui-error .error-problem-text").text(e),
  6254. $(".gui-error .error-solution-text").text(t),
  6255. $(".gui-error .error-explanation").text(i),
  6256. $(".gui-error .error-actions").html(n),
  6257. $(window).resize(),
  6258. $(".gui-error").fadeIn(),
  6259. $("#bottom-logo").fadeIn()
  6260. }
  6261. function r(e) {
  6262. 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("");
  6263. n(e, h.ERROR_BROWSER_SOLUTION, h.ERROR_BROWSER_EXPLANATION, t),
  6264. s.isMobile() || $("[rel=tiletip]").tooltip({
  6265. placement: "bottom",
  6266. delay: {
  6267. show: 50,
  6268. hide: 0
  6269. },
  6270. trigger: "hover",
  6271. viewport: {
  6272. selector: "body",
  6273. padding: 10
  6274. }
  6275. })
  6276. }
  6277. function o() {
  6278. var e = s.isMobile() ? "" : '<span class="link install-browser">' + h.ERROR_GENERIC_ACTIONS_2 + "</span>" + h.ERROR_GENERIC_ACTIONS_3
  6279. , t = [h.ERROR_GENERIC_ACTIONS_1, e,].join("");
  6280. n(h.ERROR_GENERIC_PROBLEM, h.ERROR_GENERIC_SOLUTION, "", t),
  6281. s.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  6282. e.preventDefault(),
  6283. e.stopPropagation(),
  6284. r(" ")
  6285. })
  6286. }
  6287. function a(e) {
  6288. if ($("head title").text(c.pageTitle),
  6289. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  6290. $("#gui-loading").fadeOut(250),
  6291. $("#quick-blackout").hide(),
  6292. l.track("showcase_error", {
  6293. error_key: e
  6294. }),
  6295. h.locale || h.init(),
  6296. "webgl-unsupported" === e)
  6297. s.isMobile() ? o() : r(h.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  6298. else if ("webgl-ios" === e)
  6299. 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>.");
  6300. else if ("webgl-safari" === e)
  6301. 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>.");
  6302. else if ("webgl-generic" === e)
  6303. o();
  6304. else if ("missing-urls" === e)
  6305. n(h.ERROR_MISSING_URLS_PROBLEM, "", h.ERROR_MISSING_URLS_EXPLANATION);
  6306. else if ("loading-failed" === e)
  6307. 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>.");
  6308. else {
  6309. if ("loading-failed-maintenance" !== e)
  6310. return void d.error("Unhandled error: " + e);
  6311. n(h.ERROR_MAINTENANCE_PROBLEM, h.ERROR_MAINTENANCE_SOLUTION)
  6312. }
  6313. }
  6314. var s = e("./../util/browser")
  6315. , l = e("./../analytics")
  6316. , c = e("./../settings")
  6317. , h = e("../localization/localize")
  6318. , u = e("./../util/logger")
  6319. , d = new u(i)
  6320. , p = '"https://support.port.com/hc/articles/208220058"';
  6321. t.exports.error = a
  6322. }
  6323. ).call(this, "/js/gui/error.js")
  6324. }
  6325. , {
  6326. "../localization/localize": 108,
  6327. "./../analytics": 4,
  6328. "./../settings": 166,
  6329. "./../util/browser": 182,
  6330. "./../util/logger": 189
  6331. }],
  6332. 65: [function(e, t, i) {
  6333. (function(i) {
  6334. "use strict";
  6335. function n() {
  6336. Ue = [],
  6337. je.floors.visible && Ue.push(".gui-floor", ".gui-floor-title"),
  6338. Ue.push(".hideTarget", ".pinTop.right")
  6339. }
  6340. function r() {
  6341. for (var e in je)
  6342. if (je.hasOwnProperty(e)) {
  6343. var t = je[e];
  6344. if (!t.visible)
  6345. for (var i = 0; i < t.elements.length; i++)
  6346. $(t.elements[i]).hide()
  6347. }
  6348. je.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  6349. je.tourControls.visible === !1 && $("#drawer").addClass("fullWidth"),
  6350. n()
  6351. }
  6352. function o(e, t) {
  6353. var i = !K.isMobile() && Q.zoom.enabled && t.mode === _e.PANORAMA && !e.tourIsPlaying;
  6354. $("#gui-zoomin").toggle(i),
  6355. $("#gui-zoomout").toggle(i)
  6356. }
  6357. function a() {
  6358. c(),
  6359. $(".pinBottom").toggleClass("open"),
  6360. $("#drawer").toggleClass("open"),
  6361. $(".footer").toggleClass("open"),
  6362. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", Re.CLOSE_HIGHLIGHTS),
  6363. Ze("highlights")) : ($("#pullTab .icon").attr("data-original-title", Re.OPEN_HIGHLIGHTS),
  6364. ie.resetDrawer()),
  6365. setTimeout(function() {
  6366. $("#pullTab").toggleClass("opened");
  6367. }, $("#drawer").hasClass("open") ? 0 : Q.highlightAnimationDuration),
  6368. $(".pinBottom").hasClass("open") && s($(".vr-popup")) && $(".vr-popup").is(":visible") && Ae.dismiss()
  6369. }
  6370. function s(e) {
  6371. var t;
  6372. "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  6373. t = e.position().top + e.outerHeight(),
  6374. e.attr("style", "display: none"));
  6375. var i = $("#player").outerHeight()
  6376. , n = i - 130;
  6377. return n < t + 25
  6378. }
  6379. function l(e) {
  6380. "touchstart" === e.type && e.preventDefault(),
  6381. e.stopPropagation()
  6382. }
  6383. function c() {
  6384. W && (W.reload(),
  6385. W.init())
  6386. }
  6387. function h(e) {
  6388. ne.show(e),
  6389. r()
  6390. }
  6391. function u(e) {
  6392. ne.progress(e)
  6393. }
  6394. function d(e, t, i) {
  6395. var n = t.player;
  6396. $("#gui-thumb").fadeOut(2500),
  6397. ne.hide(function() {
  6398. Ge = !1
  6399. }),
  6400. me.init(e, i),
  6401. de.finishSetup(Object.keys(e.tags).length),
  6402. i.on(Te.IMAGE_OPENED, Ze.bind(this, "tag"));
  6403. var s = function() {
  6404. i.dismissExaminedTag(),
  6405. i.disableHovering()
  6406. };
  6407. Ae.on(ye.OPENED, s),
  6408. Ce.on(Me.OPENED, s),
  6409. he.on(ue.OPENED, s),
  6410. fe.on(ge.OPENED, s);
  6411. var l = i.enableHovering.bind(i);
  6412. if (Ae.on(ye.CLOSED, l),
  6413. Ce.on(Me.CLOSED, l),
  6414. he.on(ue.CLOSED, l),
  6415. fe.on(ge.CLOSED, l),
  6416. Q.labels.enabled && Object.keys(e.labels).length,
  6417. (!settings.extractFloor || !settings.extractFloor[number]) && e.floors.length <= 1 || !je.floors.visible ? je.floors.visible = !1 : (y(e, t),
  6418. C(e.currentFloor, n.mode)),
  6419. getQueryVariable('m') === '372'&& (je.floors.visible = 1, y(e,t)),
  6420. r(),
  6421. o(t, t.player),
  6422. $("#gui").fadeIn(1500),
  6423. je.highlight.visible && (2 !== Q.startHighlights || e.has360Views) && setTimeout(function() {
  6424. a(),
  6425. (!e.has360Views && 1 !== Q.startHighlights || e.has360Views && 0 === Q.startHighlights) && setTimeout(a, 2e3)
  6426. }, 2e3),
  6427. !K.isMobile())
  6428. for (var c = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], h = 0; h < c.length; h++)
  6429. $(c[h]).addClass("hasHover");
  6430. O(e),
  6431. de.setupToggling();
  6432. //xzw:
  6433. window.editHotPanel && editHotPanel();
  6434. //czj
  6435. navBorderRadius(e);
  6436. //czj 编辑界面
  6437. //window.EditingInterface && new EditingInterface(n.sceneRenderer);
  6438. window.EditTools && new EditTools(n.sceneRenderer);
  6439. }
  6440. function navBorderRadius(e){
  6441. var pullTab = $("#pullTab"),
  6442. mobileRadius = {
  6443. "bottom":{"border-bottom-left-radius":"10px","border-bottom-right-radius":"10px"},
  6444. "top":{"border-top-left-radius":"10px","border-top-right-radius":"10px"}
  6445. },
  6446. topRadius = {
  6447. "bottom":{"border-top-right-radius":"10px","border-bottom-right-radius":"10px"},
  6448. "top":{"border-bottom-left-radius":"10px","border-top-left-radius":"10px"}
  6449. };
  6450. function BorderRadius(bottom,top){
  6451. $("#gui-modes-map > div:visible:last").css(bottom);
  6452. if(pullTab.is(':visible')){
  6453. $(".viewContainer > div:visible:first").css(top);
  6454. }else{
  6455. $("#gui-modes-map > div:visible:first").css(top);
  6456. }
  6457. }
  6458. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  6459. BorderRadius(mobileRadius.bottom,mobileRadius.top);
  6460. }else{
  6461. BorderRadius(topRadius.bottom,topRadius.top);
  6462. }
  6463. //判断someData里面是否有special字段,如果有就会处理这些特殊的大场景
  6464. if(window.DATA.model.special || window.DATA.special){
  6465. window.specialScene && specialScene.special().afterImplement();
  6466. }
  6467. }
  6468. function p(e) {
  6469. e || (e = 0),
  6470. We = !1,
  6471. window.setTimeout(function() {
  6472. We || (ze = !0,
  6473. $("#gui-spinner").stop(!0, !0).show())
  6474. }
  6475. .bind(this), e)
  6476. }
  6477. function f() {
  6478. $("#gui-spinner").stop(!0, !0),
  6479. $("#gui-spinner").fadeOut(1e3),
  6480. We = !0,
  6481. ze = !1
  6482. }
  6483. function g(e, t) {
  6484. var i = e.mode
  6485. , n = t || e.currentPano;
  6486. $("#gui-modes-dollhouse").toggleClass("active", i === _e.DOLLHOUSE),
  6487. $("#gui-modes-floorplan").toggleClass("active", i === _e.FLOORPLAN),
  6488. $("#gui-modes-inside").toggleClass("active", i === _e.PANORAMA),
  6489. i === _e.PANORAMA ? ($("#view-controllers").slideUp(500),
  6490. Q.show360Views.enabled && !n.isAligned() ? (
  6491. $(".gui-floor").addClass("hidden"),
  6492. $("#gui-modes-outside").addClass("desktop-only")) : (
  6493. $(".gui-floor").removeClass("hidden"),
  6494. $("#gui-modes-outside").removeClass("desktop-only")),
  6495. $("#gui-modes-outside").removeClass("hidden")) : i !== _e.TRANSITIONING && (f(),
  6496. Be = i,
  6497. $("#gui-modes-outside").addClass("hidden"),
  6498. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6499. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(Q.guiAnimationSpeed))
  6500. }
  6501. function m(e, t) {
  6502. var i = t.player;
  6503. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6504. l(e),
  6505. J.updateInteraction(Se.InteractionGui, "inside-button"),
  6506. J.track("USER", {
  6507. event_type: "showcase_gui",
  6508. gui_action: "click_inside_mode_button"
  6509. }),
  6510. t.changeMode(_e.PANORAMA);
  6511. }),
  6512. $("#gui-modes-outside").find("a").on("click", function(e) {
  6513. l(e),
  6514. J.track("showcase_gui", {
  6515. gui_action: "click_outside_mode_button"
  6516. }),
  6517. t.changeMode(Be)
  6518. }),
  6519. $("#gui-modes-floorplan").on("click", function(e) {
  6520. l(e),
  6521. i.mode !== _e.FLOORPLAN && (J.track("showcase_gui", {
  6522. gui_action: "click_floorplan_mode_button"
  6523. }),
  6524. t.changeMode(_e.FLOORPLAN));
  6525. }),
  6526. $("#gui-modes-dollhouse").on("click", function(e) {
  6527. l(e),
  6528. i.mode !== _e.DOLLHOUSE && (J.track("showcase_gui", {
  6529. gui_action: "click_dollhouse_mode_button"
  6530. }),
  6531. t.changeMode(_e.DOLLHOUSE));
  6532. })
  6533. }
  6534. function v(e, t) {
  6535. function i() {
  6536. document.getElementById("vr").classList.remove("hidden"),
  6537. Q.vr.allowWebVR ? K.getVRDisplay().then(function(e) {
  6538. K.supportsFullscreen() ? n(e) : (De.warn("Unable to use WebVR when full screen is not supported"),
  6539. $(".improper-embed").toggleClass("hidden", !1),
  6540. r())
  6541. }, function(e) {
  6542. r()
  6543. }) : r()
  6544. }
  6545. function n(i) {
  6546. De.info(i.displayName + " detected, VR button activates WebVR experience"),
  6547. Ie.init(e.data, t, i, q),
  6548. Ie.on(Ee.OPENED, Ze.bind(gui, "vr")),
  6549. Ie.on(Ee.SHOW_TERMS, fe.show.bind(fe))
  6550. }
  6551. function r() {
  6552. De.info("WebVR support not found, VR button activates native app VR modal"),
  6553. Ae.init(e.data, q),
  6554. Ae.on(ye.OPENED, function() {
  6555. var e = document.getElementById("vr-modal");
  6556. return function() {
  6557. Ze("vr"),
  6558. le.open(e)
  6559. }
  6560. }()),
  6561. Ae.on(ye.CLOSED, le.reset)
  6562. }
  6563. if (Q.vr.enabled && e.supportsVR && !K.valueFromHash("mls", 0)){
  6564. /*********************** 方奕卓 VR功能事件监听 ********************/
  6565. K.isMobile() && $('#vr').css('display', ''); // 显示vr功能按钮
  6566. switch (Q.vr.option) {
  6567. case Pe.CONTEXTUAL:
  6568. i();
  6569. break;
  6570. case Pe.ANDROID:
  6571. K.detectAndroid() && i();
  6572. break;
  6573. case Pe.NONE:
  6574. }
  6575. }
  6576. }
  6577. function A(e, t) {
  6578. $("#play").on("mousedown touchstart", function(e) {
  6579. l(e);
  6580. Ze("tour");
  6581. ve.play();
  6582. J.trackAlways("showcase_gui", {
  6583. gui_action: "play_highlights"
  6584. })
  6585. }),
  6586. window.startAndPlay = function(e) {
  6587. // l(e);
  6588. Ze("tour");
  6589. ve.play();
  6590. J.trackAlways("showcase_gui", {
  6591. gui_action: "play_highlights"
  6592. })
  6593. };
  6594. $("#pause").on("mousedown touchstart", function(e) {
  6595. l(e),
  6596. ve.pause(),
  6597. J.trackAlways("showcase_gui", {
  6598. gui_action: "pause_highlights"
  6599. })
  6600. }),
  6601. $("#gui-zoomin").find("a").on("click", function(e) {
  6602. l(e),
  6603. t.player.zoomInIncrementally()
  6604. }),
  6605. $("#gui-zoomout").find("a").on("click", function(e) {
  6606. l(e),
  6607. t.player.zoomOutIncrementally()
  6608. })
  6609. }
  6610. function y(e, t) {
  6611. for (var i = $(".gui-floor"), n = 0; n < e.floors.length; n++) {
  6612. if(getQueryVariable('m') === '372') continue;
  6613. var r = $('<div class="floorChoice" data-index="' + n + '"></div>').text(e.floors.get(n).name);
  6614. $(".gui-floor").find(".container").prepend(r)
  6615. //cxz 本来一开始是prepend 后来改了append 按顺序插入
  6616. }
  6617. i.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + Re.FLOOR_ALL + "</div>"),
  6618. i.on("click", function(e) {
  6619. l(e),
  6620. Ze("floor"),
  6621. i.toggleClass("open")
  6622. }),
  6623. $(".floorChoice").on("click", function(e) {
  6624. l(e);
  6625. var n = $(this).data("index");
  6626. "all" !== n ? (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6627. t.player.gotoFloor(n),
  6628. J.track("showcase_gui", {
  6629. gui_action: "click_floor_select_button",
  6630. interaction_source: "gui"
  6631. })) : (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6632. Ze("move"),
  6633. t.allFloors(),
  6634. J.track("showcase_gui", {
  6635. gui_action: "click_toggle_all_floors_button",
  6636. interaction_source: "gui"
  6637. })),
  6638. i.removeClass("open")
  6639. })
  6640. }
  6641. function C(e, t) {
  6642. 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()),
  6643. e.model.allFloorsVisible ? ($(".gui-floor-title").text(Re.FLOOR_ALL),
  6644. $(".gui-floor-number").text(Re.FLOOR_ALL),
  6645. $(".floorChoice").removeClass("active"),
  6646. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6647. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6648. $(".floorChoice").removeClass("active"),
  6649. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6650. }
  6651. function I(e) {
  6652. return e.describe().inTransition
  6653. }
  6654. function b(e, t, i) {
  6655. Fe = e.heroLocations.length;
  6656. var n = '<li class="thumbImg" data-index=""><img src=""></li>'
  6657. , r = 100 / Fe + "%"
  6658. , o = $("#thumb-container")
  6659. , a = $("#progressBar");
  6660. $("#status").find(".totalSteps").text(Fe);
  6661. for (var s = 0; s < Fe; s++) {
  6662. var c = e.heroLocations[s]
  6663. , h = $(n);
  6664. var thumbUrl
  6665. if(c.heroLocations){//有子项,选第一张截图
  6666. thumbUrl = manage.dealURL(c.heroLocations[0].thumbUrl)//.replace('https://','').replace('http://','')
  6667. }else{
  6668. thumbUrl = manage.dealURL(c.thumbUrl)//.replace('https://','').replace('http://','')
  6669. }
  6670. h.attr("data-index", s)
  6671. je.highlight.visible && h.find("img").attr("src", thumbUrl)
  6672. if (c.name) {
  6673. var u = $('<div class="overlay"></div>').text(c.name);
  6674. h.prepend(u)
  6675. }
  6676. if (e.has360Views && c.cameraMode === _e.PANORAMA) {
  6677. var d = e.panos.get(c.panoId)
  6678. , p = d && !d.isAligned()
  6679. , 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>';
  6680. h.prepend(f)
  6681. }
  6682. o.append(h),
  6683. a.append('<div class="step" data-idx="' + s + '" style="width:' + r + '"></div>')
  6684. }
  6685. j = 144 * Fe,
  6686. Y = 111 * Fe,
  6687. $(".thumbImg").on("mouseover", function() {
  6688. I(t) || i.showPathToHeroLocation([$(this).data("index"),0])//改
  6689. }),
  6690. $(".thumbImg").on("mouseout", function() {
  6691. t.clearPath()
  6692. }),
  6693. $(".thumbImg").on("click", function(e) {
  6694. l(e);
  6695. var i = $(this);
  6696. J.updateInteraction(Se.InteractionGui, "thumbnail"),
  6697. J.trackAlways("showcase_gui", {
  6698. gui_action: "click_highlight"
  6699. }),
  6700. t.goToHighlight([i.data("index"),0])//改
  6701. }),
  6702. $(".previous").find("a").on("click", function(e) {
  6703. l(e),
  6704. J.trackAlways("showcase_gui", {
  6705. gui_action: "prev_highlight"
  6706. }),
  6707. t.prevHighlight()
  6708. }),
  6709. $(".next").find("a").on("click", function(e) {
  6710. l(e),
  6711. J.trackAlways("showcase_gui", {
  6712. gui_action: "next_highlight"
  6713. }),
  6714. t.nextHighlight()
  6715. }),
  6716. $("#drawer").on("mouseleave", function(e) {
  6717. l(e);
  6718. var t;
  6719. try {
  6720. t = new MouseEvent("mouseup",{
  6721. clientX: e.clientX,
  6722. clientY: e.clientY,
  6723. screenX: e.screenX,
  6724. screenY: e.screenY
  6725. })
  6726. } catch (i) {
  6727. t = document.createEvent("MouseEvents"),
  6728. 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)
  6729. }
  6730. document.dispatchEvent(t)
  6731. }),
  6732. W = new Sly($("#scrollFrame"),{
  6733. horizontal: !0,
  6734. itemNav: "centered",
  6735. smart: !0,
  6736. scrollTrap: !0,
  6737. scrollBy: 1,
  6738. mouseDragging: !0,
  6739. touchDragging: !0,
  6740. speed: 300,
  6741. dragHandle: !0,
  6742. dynamicHandle: !0,
  6743. clickBar: !0,
  6744. scrollBar: $("#scroller"),
  6745. activateOn: null
  6746. }).init(),
  6747. W.on("active", function(e, t) {
  6748. Ve = t,
  6749. Ze("tour"),
  6750. $(".step").removeClass("active"),
  6751. $("#status").find(".curIdx").text(t + 1);
  6752. for (var i = 0; i <= t; i++)
  6753. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6754. }),
  6755. w()
  6756. //add :
  6757. let scrollFrame = $(W.frame)
  6758. scrollFrame.on("wheel.sly", function() {
  6759. lastMoveScrollTime = Date.now()
  6760. })
  6761. let dragstart
  6762. /* scrollFrame.on("pointerdown", function() {
  6763. dragstart = true
  6764. })
  6765. scrollFrame.on("pointerup", function() {
  6766. dragstart = false
  6767. }) */
  6768. scrollFrame.on("pointermove", function() {
  6769. //if(dragstart){
  6770. lastMoveScrollTime = Date.now()
  6771. //}
  6772. })
  6773. }
  6774. function w() {
  6775. var e = $("#player").width() - 20
  6776. , t = $("#scroller")
  6777. , i = $("#drawer")
  6778. , n = $(".pinBottom");
  6779. if ($("#player").width() < 488 || $("#player").height() < 488)
  6780. t.addClass("hidden"),
  6781. i.addClass("noScroll"),
  6782. n.addClass("noScroll");
  6783. else {
  6784. var r = j > e
  6785. , o = !i.hasClass("noScroll")
  6786. , a = r !== o;
  6787. a && (t.toggleClass("hidden"),
  6788. i.toggleClass("noScroll"),
  6789. n.toggleClass("noScroll"))
  6790. }
  6791. }
  6792. function _(e) {
  6793. je.tourControls.visible = true//e.tour_buttons && K.valueFromHash("gt", 1),
  6794. je.coBrand.visible = e.presented_by && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash("mls", !1),
  6795. je.highlight.visible = /* e.highlight_reel && */ 1 !== Q.specialEdition && Q.showHighlights
  6796. }
  6797. function T(e) {
  6798. function t(t, i) {
  6799. return !!e.player_options[t] && e[i || t]
  6800. }
  6801. $(".model-title").text(e.name);
  6802. var i = Q.pageTitle;
  6803. // 2 !== K.valueFromHash("mls", 0) && (i = e.name + " - " + i),
  6804. 2 !== K.valueFromHash("mls", 0) && e.name && (i = e.name),
  6805. document.title = i ,
  6806. K.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  6807. delay: {
  6808. show: 50,
  6809. hide: 0
  6810. },
  6811. trigger: "hover",
  6812. html: !1,
  6813. viewport: {
  6814. selector: "body",
  6815. padding: 10
  6816. }
  6817. }),
  6818. K.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  6819. // 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"),
  6820. de.populate({
  6821. name: t("model_name", "name"),
  6822. coBrand: t("presented_by"),
  6823. description: t("model_summary", "summary") || "暂无内容",
  6824. contactName: t("contact_name"),
  6825. address: t("address"),
  6826. phone: t("contact_phone"),
  6827. formattedPhone: e.formatted_contact_phone,
  6828. email: t("contact_email"),
  6829. url: t("external_url"),
  6830. socialSharing: e.enable_social_sharing && e.is_public
  6831. })
  6832. }
  6833. function x(e, t, i, n, r, o) {
  6834. function a() {
  6835. o.setLoadingStartTime(),
  6836. H(),
  6837. r ? (re.showMessage(t, i, je.coBrand.visible),
  6838. l()) : h(l)
  6839. }
  6840. var s = $.Deferred()
  6841. , l = s.resolve.bind(s);
  6842. return Ge = !0,
  6843. O(e),
  6844. e.data.player_options && _(e.data.player_options),
  6845. 1 === Q.specialEdition && $("body").addClass("specialEdition"),
  6846. Re.localizeGUI(),
  6847. T(e.data),
  6848. r || $(".quick").addClass("hidden"),
  6849. //e.data.image && !r && E(e.data.image),
  6850. n ? (J.impression(),
  6851. a()) : (o.setWaitingStartTime(),
  6852. oe.show(r, a)),
  6853. s
  6854. }
  6855. function S(e, t, i, n, r, a, s) {
  6856. q = s,
  6857. e.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6858. e.supportedModes[_e.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6859. ae.init(),
  6860. re.init(e, a),
  6861. Oe.init(e, t, n),
  6862. $(".icon").on("mouseover", function() {
  6863. t.player && t.player.reticule.hide()
  6864. }),
  6865. m(e, t),
  6866. A(e, t),
  6867. e.data.enable_social_sharing && e.data.is_public && Q.share.enabled && (Ce.init(window.DATA.name/* e.data.name */),
  6868. Ce.on(Me.OPENED, function() {
  6869. var e = document.getElementById("share-modal");
  6870. return function() {
  6871. Ze("share"),
  6872. le.open(e)
  6873. }
  6874. }()),
  6875. Ce.on(Me.CLOSED, le.reset)),
  6876. e.heroLocations.length > 0 ? b(e, t, i) : (je.highlight.visible = !1,
  6877. je.tourControls.visible = !1),
  6878. de.on(pe.OPEN_INFO, Ze.bind(this, "info")),
  6879. z(),
  6880. g(i),
  6881. v(e, r),
  6882. e.on("floor.changed", C),
  6883. e.on("waiting", R.bind(this, e)),
  6884. e.on("waiting-done", P.bind(this, e)),
  6885. i.on(xe.ModeChanged, function(e, n) {
  6886. g(i),
  6887. o(t, i),
  6888. n === _e.PANORAMA && i.currentPano && !i.currentPano.isAligned() && (n = _e.OUTDOOR),
  6889. he.updateMode(n)
  6890. }),
  6891. n.on(Se.Move, Ze.bind(this, "move")),
  6892. i.on(xe.Ready, function() {
  6893. ie.init(n, i, i.tagManager, t),
  6894. i.on(xe.ModeChanged, function(e, t) {
  6895. e !== t && $(".vr-popup").is(":visible") && Ae.dismiss()
  6896. })
  6897. }),
  6898. i.on(xe.PanoChosen, function(e, t) {
  6899. g(i, t),
  6900. he.updateMode(t && !t.isAligned() ? _e.OUTDOOR : _e.PANORAMA)
  6901. }),
  6902. le.on(ce.CLOSE, function(e) {
  6903. switch (e) {
  6904. case "vr-modal":
  6905. Ae.dismiss();
  6906. break;
  6907. case "share-modal":
  6908. Ce.hide();
  6909. break;
  6910. case "terms-modal":
  6911. fe.hide()
  6912. }
  6913. });
  6914. var l = $("#play").eq(0)
  6915. , c = $("#pause").eq(0)
  6916. , h = $(".pinBottom").toArray()
  6917. , u = $("#drawer").eq(0)
  6918. , d = $("#playHead").eq(0)
  6919. , p = $("#progressBar").eq(0)
  6920. , f = $("#thumb-container").eq(0)
  6921. , y = f.children()
  6922. , I = p.children();
  6923. t.on("update.controls", function() {//导览控制
  6924. var n = t.describe();
  6925. if(n.tourIsPlaying || i.isWarping()){
  6926. if(je.tourControls.visible){
  6927. l.hide() //play button
  6928. c.show() //pause button
  6929. }
  6930. if(n.tourInProgress){
  6931. h.forEach(function(e) {
  6932. e.classList.add("playing")
  6933. }),
  6934. u.addClass("playing"),
  6935. d.addClass("playing")
  6936. }
  6937. }else{
  6938. if(je.tourControls.visible){
  6939. l.show(),
  6940. c.hide()
  6941. }
  6942. if(!n.tourInProgress){
  6943. ve.stopTour(),
  6944. h.forEach(function(e) {
  6945. e.classList.remove("playing")
  6946. }),
  6947. u.removeClass("playing"),
  6948. d.removeClass("playing")
  6949. }
  6950. }
  6951. var r, a, s;
  6952. if (null !== n.currentItem) {
  6953. var p, f;
  6954. $("#status").find(".curIdx").text(n.currentItem[0] + 1),
  6955. n.onTheBus ? (p = "active",
  6956. f = "recent") : (f = "active",
  6957. p = "recent");
  6958. var g = null === n.destinationItem || n.currentItem[0] === n.destinationItem[0];
  6959. /* for (r = 0; r < e.heroLocations.length; r += 1)
  6960. s = y.eq(r),
  6961. a = I.eq(r),
  6962. s.removeClass(f),
  6963. a.removeClass(f),
  6964. n.onTheBus && r === n.destinationItem[0] ? (s.addClass(p),
  6965. a.addClass(p),
  6966. W.activate(r)) : n.onTheBus && g && r === n.currentItem[0] ? (s.addClass(p),
  6967. a.addClass(p)) : (s.removeClass(p),
  6968. a.removeClass(p)) */
  6969. for (r = 0; r < e.heroLocations.length; r += 1){
  6970. s = y.eq(r),
  6971. a = I.eq(r),
  6972. s.removeClass(f),
  6973. a.removeClass(f);
  6974. if(n.onTheBus && r === n.destinationItem[0]){
  6975. s.addClass(p)
  6976. a.addClass(p)
  6977. if(Date.now() - lastMoveScrollTime > 2000){ //add 如果一段时间内用户不操作scrollbar,才focus回这个item
  6978. W.activate(r) // scrollbar slide to this
  6979. }
  6980. }else{
  6981. n.onTheBus && g && r === n.currentItem[0] ?
  6982. (s.addClass(p), a.addClass(p)) :
  6983. (s.removeClass(p), a.removeClass(p))
  6984. }
  6985. }
  6986. } else
  6987. for (r = 0; r < e.heroLocations.length; r += 1)
  6988. s = y.eq(r),
  6989. a = I.eq(r),
  6990. s.removeClass("active recent"),
  6991. a.removeClass("active recent");
  6992. o(t, i)
  6993. }),
  6994. document.addEventListener("keydown", function(n) {
  6995. switch (J.updateInteraction(Se.InteractionKey),
  6996. n.which) {
  6997. case we.ZERO:
  6998. Q.debug && e.toggleAlpha();
  6999. break;
  7000. case we.NINE:
  7001. Q.debug && se.toggle();
  7002. break;
  7003. case we.ONE:
  7004. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.PANORAMA);
  7005. break;
  7006. case we.TWO:
  7007. e.outsideAllowed() && !i.isInMode(_e.DOLLHOUSE, _e.TRANSITIONING) && t.changeMode(_e.DOLLHOUSE);
  7008. break;
  7009. case we.THREE:
  7010. e.outsideAllowed() && !i.isInMode(_e.FLOORPLAN, _e.TRANSITIONING) && t.changeMode(_e.FLOORPLAN);
  7011. break;
  7012. case we.FOUR:
  7013. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.OUTDOOR);
  7014. break;
  7015. case we.SPACE:
  7016. je.tourControls.visible && ($("#playHead").hasClass("playing") || Ze("tour"));
  7017. break;
  7018. case we.RETURN:
  7019. Q.debug && e.toggleExplodeUp();
  7020. break;
  7021. case we.P:
  7022. k();
  7023. break;
  7024. case we.U:
  7025. B();
  7026. break;
  7027. case we.X:
  7028. Q.debug && e.toggleExplode();
  7029. break;
  7030. case we.PLUSEQUALS:
  7031. t.player.activatePersistentZooming(!0),
  7032. ie.hideUi();
  7033. break;
  7034. case we.DASHUNDERSCORE:
  7035. t.player.activatePersistentZooming(!1),
  7036. ie.hideUi();
  7037. break;
  7038. case we.SEVEN:
  7039. De.info("Zoom level: " + t.player.zoomLevel + ", FOV: " + t.player.zoomFov);
  7040. break;
  7041. case we.EIGHT:
  7042. t.player.decreaseZoomSpeed();
  7043. break;
  7044. case we.NINE:
  7045. t.player.increaseZoomSpeed()
  7046. }
  7047. return i && i.reticule.hide(),
  7048. !0
  7049. }
  7050. .bind(this)),
  7051. document.addEventListener("keyup", function(e) {
  7052. switch (e.which) {
  7053. case we.PLUSEQUALS:
  7054. t.player.deactivatePersistentZooming();
  7055. break;
  7056. case we.DASHUNDERSCORE:
  7057. t.player.deactivatePersistentZooming()
  7058. }
  7059. }
  7060. .bind(this)),
  7061. F(e),
  7062. L(e, t.player),
  7063. M(i),
  7064. te.setAutoPlay(e.heroCount()),
  7065. he.init(i, a.mode),
  7066. he.on(ue.OPENED, Ze.bind(this, "help")),
  7067. fe.init(),
  7068. fe.on(ge.OPENED, function() {
  7069. var e = document.getElementById("terms-modal");
  7070. return function() {
  7071. Ze("terms"),
  7072. le.open(e)
  7073. }
  7074. }()),
  7075. fe.on(ge.CLOSED, le.reset),
  7076. Q.quickstart.enabled || re.delayLanding(a.mode).then(re.showMessage.bind(this, i, t, je.coBrand.visible)),
  7077. (Q.quickstart.enabled || i.model.outsideAllowed()) && ie.init(n, i, i.tagManager, t),
  7078. Q.profiling.enabled && se.show(),
  7079. ve.init(t)
  7080. }
  7081. function M(e) {
  7082. var t = function(e, t) {
  7083. $(e).find("a").each(function(e, i) {
  7084. t ? $(i).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(i).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  7085. i.style.pointerEvents = t ? "auto" : "none"
  7086. })
  7087. }
  7088. , i = function() {
  7089. e.zoomLevel >= Q.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  7090. e.zoomLevel <= Q.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  7091. };
  7092. e.on(Ne.ZoomMax, function() {
  7093. t("#gui-zoomin", !1),
  7094. t("#gui-zoomout", !0)
  7095. }),
  7096. e.on(Ne.ZoomMin, function() {
  7097. t("#gui-zoomin", !0),
  7098. t("#gui-zoomout", !1)
  7099. }),
  7100. e.on(Ne.ZoomIn, function() {
  7101. t("#gui-zoomout", !0)
  7102. }),
  7103. e.on(Ne.ZoomOut, function() {
  7104. t("#gui-zoomin", !0)
  7105. }),
  7106. i()
  7107. }
  7108. function R(e) {
  7109. O(e)
  7110. }
  7111. function P(e) {
  7112. O(e)
  7113. }
  7114. function O(e) {
  7115. var t = e.waitQueue.length;
  7116. t <= 0 ? f() : Ge || p(Q.modelComponentLoadSpinnerDelay)
  7117. }
  7118. function L(e, t) {
  7119. He = {
  7120. gui: null,
  7121. visible: !1,
  7122. model: e,
  7123. player: t
  7124. }
  7125. }
  7126. function D(e, t) {
  7127. function i() {
  7128. var i = t.toJSON();
  7129. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + e.sid + "&start=" + be.serialize(i),
  7130. t.tagManager.activeTag && (n.linkToLocation += "&tag=" + t.tagManager.activeTag.sid)
  7131. }
  7132. var n = {}
  7133. , r = new Le.GUI({
  7134. autoPlace: !0,
  7135. width: "60%"
  7136. });
  7137. i(),
  7138. t.on(xe.ViewChanged, i),
  7139. r.add(n, "linkToLocation").name(Re.LINK_TO_LOCATION).listen(),
  7140. r.domElement.id = "datLinks";
  7141. var o = [].slice.call(r.domElement.querySelectorAll(".property-name"));
  7142. return o.forEach(function(e) {
  7143. if (!K.detectSafari()) {
  7144. var t = document.createElement("button");
  7145. t.classList.add("btn-deep-link"),
  7146. t.innerText = Re.MENU_COPY,
  7147. e.nextSibling.appendChild(t);
  7148. var i = function() {
  7149. alert(Re.LINK_ALERT_COPY),
  7150. t.hide()
  7151. };
  7152. t.addEventListener("click", function(e) {
  7153. try {
  7154. var t = e.target.parentNode.childNodes[0];
  7155. t.select();
  7156. var n = document.execCommand("copy");
  7157. t.blur(),
  7158. n || i()
  7159. } catch (e) {
  7160. i()
  7161. }
  7162. })
  7163. }
  7164. }),
  7165. $(r.__closeButton).hide(),
  7166. r
  7167. }
  7168. function N(e) {
  7169. He.gui || (He.gui = D(He.model, He.player)),
  7170. He.visible = e,
  7171. e ? $(He.gui.domElement).show() : $(He.gui.domElement).hide()
  7172. }
  7173. function B() {
  7174. N(!He.visible)
  7175. }
  7176. function F(e) {
  7177. ke = {
  7178. gui: null,
  7179. visible: !1,
  7180. model: e
  7181. }
  7182. }
  7183. function V(e) {
  7184. var t = new Le.GUI;
  7185. return t.add(Q, "showSweeps").name("Show sweeps").onFinishChange(function() {
  7186. e.setSweepVisibility(Q.showSweeps)
  7187. }),
  7188. t.add(Q, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  7189. t.add(Q.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  7190. Q.transition.flySpeed = 0,
  7191. t.__controllers.forEach(function(e) {
  7192. e.updateDisplay()
  7193. })
  7194. }),
  7195. t.add(Q.path, "opacity", 0, 1).name("Path opacity"),
  7196. $(t.__closeButton).hide(),
  7197. t
  7198. }
  7199. function U(e) {
  7200. ke.gui || (ke.gui = V(ke.model)),
  7201. ke.visible = e,
  7202. e ? $(ke.gui.domElement).show() : $(ke.gui.domElement).hide()
  7203. }
  7204. function k() {
  7205. U(!ke.visible)
  7206. }
  7207. function H() {
  7208. function e(e) {
  7209. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)/* || e.preventDefault()*/
  7210. }
  7211. $("body").css("touch-action", "none"),
  7212. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {
  7213. // e.preventDefault()
  7214. });
  7215. var t = document.getElementById("terms-text")
  7216. , i = document.getElementById("more-help-wrapper")
  7217. , n = (document.getElementById("navigation-help-wrapper"),
  7218. document.getElementById("help-dialog"),
  7219. document.getElementById("tag-billboards"));
  7220. Q.useWheel && (document.body.addEventListener("mousewheel", e, { passive: false }),
  7221. document.body.addEventListener("DOMMouseScroll", e)),
  7222. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  7223. e.stopPropagation()
  7224. })
  7225. }
  7226. function G(e, t) {
  7227. for (var i = []; e; )
  7228. i.push(e),
  7229. e = e.parentNode;
  7230. for (; t && i.indexOf(t) === -1; )
  7231. t = t.parentNode;
  7232. return t
  7233. }
  7234. function z() {
  7235. var e, t = function(t) {
  7236. e = 0 === t.button || 1 === t.which ? t.target : null
  7237. }, i = function(t) {
  7238. e !== t.target && (e = G(e, t.target));
  7239. var i = document.getElementById("gui-parent");
  7240. if (G(i, e) !== i && (e = null),
  7241. e) {
  7242. var n;
  7243. try {
  7244. n = new MouseEvent("click",t)
  7245. } catch (e) {
  7246. n = document.createEvent("MouseEvents"),
  7247. 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)
  7248. }
  7249. n.syntheticClick = !0,
  7250. e.dispatchEvent(n),
  7251. e = null
  7252. }
  7253. };
  7254. document.body.addEventListener("mousedown", t, !0),
  7255. document.body.addEventListener("mouseup", i, !0),
  7256. document.getElementById("gui-parent").addEventListener("click", function(e) {
  7257. e.syntheticClick || (e.stopPropagation(),
  7258. "A" === e.target.nodeName && e.preventDefault())
  7259. }, !0)
  7260. }
  7261. var lastMoveScrollTime = 0;//add
  7262. var W, j, Y, X, Z, q, K = (e("three"),
  7263. e("../util/ajax"),
  7264. e("../util/browser")), Q = e("../settings"), J = e("../analytics"), ee = (e("../util/transitions"),
  7265. e("../util/camera"),
  7266. e("../util/logger")), te = (e("../objects/Snapshot"),
  7267. 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"),
  7268. e("../tag/Media/MediaEvent")), xe = (e("../enum/PathDiscardMode"),
  7269. e("../enum/PathDisplayMode"),
  7270. e("../enum/DirectorEvents"),
  7271. e("../enum/PlayerEvents")), Se = e("../enum/ControlEvents"), Me = e("./sharing/ShareEvents"), Re = e("../localization/localize"), Pe = (e("../enum/Vectors"),
  7272. e("../enum/WarpStyle"),
  7273. e("../enum/AlignmentType"),
  7274. e("../enum/VROption")), Oe = e("./konami"), Le = e("../lib/dat.gui"), De = new ee(i), Ne = (e("../util/showcase"),
  7275. e("../enum/ZoomEvents")), Be = _e.DOLLHOUSE, Fe = 0, Ve = 0, Ue = [".hideTarget"], ke = null, He = null, Ge = !1, ze = !1, We = !1, je = {
  7276. coBrand: {
  7277. visible: !0,
  7278. elements: [".co-brand", "#loaderCoBrand"]
  7279. },
  7280. help: {
  7281. visible: !0,
  7282. elements: [".nav-help", "#nav-help"]
  7283. },
  7284. tourControls: {
  7285. visible: !0,
  7286. elements: [".next", ".previous", "#play"]
  7287. },
  7288. highlight: {
  7289. visible: !0,
  7290. elements: ["#drawer", "#pullTab"]
  7291. },
  7292. share: {
  7293. visible: !0,
  7294. elements: [".socialButton", "#share"]
  7295. },
  7296. fullScreen: {
  7297. visible: !0,
  7298. elements: ["#gui-fullscreen"]
  7299. },
  7300. floors: {
  7301. visible: !0,
  7302. elements: [".gui-floor"]
  7303. }
  7304. }, Ye = function() {
  7305. var e = document.getElementById("drawer");
  7306. return function() {
  7307. $("#player").height() < 400 && e.classList.contains("open") && a()
  7308. }
  7309. }(), Xe = function() {
  7310. var e = document.getElementById("meta-info");
  7311. return function() {
  7312. $("#player").height() < 400 && e.classList.contains("expand") && de.toggleMeta(!0)
  7313. }
  7314. }(), Ze = function(e) {
  7315. function t() {
  7316. u.classList.contains("expand") && de.toggleMeta(!0)
  7317. }
  7318. function i() {
  7319. fe.hide()
  7320. }
  7321. function n() {
  7322. he.close()
  7323. }
  7324. function r() {
  7325. Ae.dismiss()
  7326. }
  7327. function o() {
  7328. p.hasClass("open") && a(!0)
  7329. }
  7330. function l() {
  7331. Ce.hide()
  7332. }
  7333. function c() {
  7334. f.hasClass("open") && f.removeClass("open")
  7335. }
  7336. function h() {
  7337. d.classList.contains("fadeIn") && (d.classList.contains("landing") ? re.dismissModal() : d.classList.contains("tour") && ve.dismissModal())
  7338. }
  7339. var u = document.getElementById("meta-info")
  7340. , d = document.getElementById("interaction-modal")
  7341. , p = $("#drawer").eq(0)
  7342. , f = $(".gui-floor").eq(0)
  7343. , g = $(".vr-popup").eq(0);
  7344. return function(e) {
  7345. switch (e) {
  7346. case "info":
  7347. i(),
  7348. n(),
  7349. Ye(),
  7350. l(),
  7351. c(),
  7352. r(),
  7353. h();
  7354. break;
  7355. case "terms":
  7356. t(),
  7357. n(),
  7358. o(),
  7359. l(),
  7360. c(),
  7361. r(),
  7362. h();
  7363. break;
  7364. case "help":
  7365. t(),
  7366. i(),
  7367. l(),
  7368. c(),
  7369. r(),
  7370. h();
  7371. break;
  7372. case "vr":
  7373. t(),
  7374. i(),
  7375. l(),
  7376. c(),
  7377. n(),
  7378. h(),
  7379. s(g) && o();
  7380. break;
  7381. case "highlights":
  7382. Xe(),
  7383. i(),
  7384. l(),
  7385. c();
  7386. break;
  7387. case "share":
  7388. t(),
  7389. i(),
  7390. n(),
  7391. c(),
  7392. r(),
  7393. h();
  7394. break;
  7395. case "floor":
  7396. i(),
  7397. l(),
  7398. r();
  7399. break;
  7400. case "view":
  7401. c(),
  7402. l(),
  7403. i(),
  7404. r();
  7405. break;
  7406. case "tour":
  7407. i(),
  7408. l(),
  7409. c(),
  7410. r();
  7411. break;
  7412. case "move":
  7413. i(),
  7414. l(),
  7415. c(),
  7416. r();
  7417. break;
  7418. case "resize":
  7419. t(),
  7420. Ye(),
  7421. c();
  7422. break;
  7423. case "tag":
  7424. i(),
  7425. n(),
  7426. l(),
  7427. c(),
  7428. r()
  7429. }
  7430. }
  7431. }();
  7432. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  7433. $("#gui-fullscreen").toggle(!K.isFullscreen()),
  7434. $("#gui-fullscreen-exit").toggle(!!K.isFullscreen()),
  7435. setTimeout(function() {
  7436. $(".icon:visible").hide().show(0)
  7437. }, 100)
  7438. }),
  7439. $("#gui-fullscreen").find("a").on("click", function(e) {
  7440. l(e),
  7441. K.requestFullscreen($("body")[0]),
  7442. J.track("showcase_gui", {
  7443. gui_action: "click_enter_fullscreen",
  7444. interaction_source: "gui"
  7445. })
  7446. //czj
  7447. //W.reload()
  7448. }),
  7449. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  7450. l(e),
  7451. K.exitFullscreen(),
  7452. J.track("showcase_gui", {
  7453. gui_action: "click_exit_fullscreen",
  7454. interaction_source: "gui"
  7455. })
  7456. })
  7457. $(window).on("resize", function(e) {
  7458. var t = e.target.innerHeight
  7459. , i = e.target.innerWidth;
  7460. t === X && i === Z || (je.highlight.visible && w(),
  7461. Ze("resize"),
  7462. $(".pinTop.right").removeClass("hideUnderMeta"),
  7463. c(),
  7464. X = t,
  7465. Z = i)
  7466. }).resize(),
  7467. K.supportsFullscreen() || $("#gui-fullscreen").hide(),
  7468. $("#pullTab").on("click", function(e) {
  7469. l(e),
  7470. $("#drawer").hasClass("open") ? (J.trackAlways("showcase_gui", {
  7471. gui_action: "hide_highlight_reel"
  7472. }),
  7473. $(this).addClass("open").children("img").attr("src","images/auto.png")) : (J.trackAlways("showcase_gui", {
  7474. gui_action: "show_highlight_reel"
  7475. }),
  7476. $(this).removeClass("open").children("img").attr("src","images/auto-suspend.png"));
  7477. a()
  7478. });
  7479. /***********************方奕卓 热点列表事件监听 ************************/
  7480. if(window.DATA.showHotListSta) {
  7481. $('#hotList').css('display', '');
  7482. $('#hotList').on('click',function(e){
  7483. l(e);
  7484. var hotList = $('#hotListWrap')[0];
  7485. var isActive = hotList.classList.contains('hotListActive');
  7486. if(isActive){
  7487. hotList.classList.remove('hotListActive');
  7488. this.classList.remove('active')
  7489. }else{
  7490. hotList.classList.add('hotListActive');
  7491. this.classList.add('active')
  7492. }
  7493. }),
  7494. $('#hotListContent ul').on('mouseover', function(e){
  7495. l(e);
  7496. var target = e.target;
  7497. var hotList = document.getElementById('hotListWrap');
  7498. if(target.tagName === 'SPAN'){
  7499. var targetParent = target.parentElement.parentElement;
  7500. if(target.offsetWidth + 116 >= targetParent.clientWidth){
  7501. hotList.style.width = target.offsetWidth + 116 + 'px';
  7502. }else{
  7503. hotList.style.width = '';
  7504. }
  7505. }else if(target.tagName === 'LI'){
  7506. var targetParent = target.parentElement;
  7507. if(target.children[0].offsetWidth + 116 >= targetParent.clientWidth){
  7508. hotList.style.width = target.children[0].offsetWidth + 116 + 'px';
  7509. }else{
  7510. hotList.style.width = ''
  7511. }
  7512. }else {
  7513. hotList.style.width = '';
  7514. }
  7515. });
  7516. $('#hotListContent ul').on('click', function(e){
  7517. l(e);
  7518. this.preElem && this.preElem.classList.remove('active');
  7519. if(e.target.tagName === 'SPAN'){
  7520. e.target.parentElement.classList.add('active');
  7521. e.target.parentElement.hot && e.target.parentElement.hot.examine( ); // 打开热点
  7522. this.preElem = e.target.parentElement;
  7523. }else{
  7524. e.target.classList.add('active');
  7525. e.target.hot && e.target.hot.examine( ); // 打开热点
  7526. this.preElem = e.target;
  7527. }
  7528. })
  7529. $('#hotListClose').on('click', function(e){
  7530. l(e);
  7531. var hotList = $('#hotListWrap')[0];
  7532. hotList.classList.remove('hotListActive');
  7533. $('#hotListContent ul .active').removeClass('active');
  7534. $('#hotList')[0].classList.remove('active')
  7535. })
  7536. }
  7537. /*****************************************************************/
  7538. $("#more-menu-button").on("click", function(e) {
  7539. l(e);
  7540. var t = $("#more-menu");
  7541. t.toggleClass("open")
  7542. }),
  7543. t.exports.init = S,
  7544. t.exports.startLoading = x,
  7545. t.exports.endLoading = d,
  7546. t.exports.onProgress = u
  7547. }
  7548. ).call(this, "/js/gui/gui.js")
  7549. }
  7550. , {
  7551. "../analytics": 4,
  7552. "../controls/serializer": 14,
  7553. "../enum/AlignmentType": 17,
  7554. "../enum/BlackoutStyle": 18,
  7555. "../enum/ControlEvents": 21,
  7556. "../enum/DirectorEvents": 23,
  7557. "../enum/Keys": 30,
  7558. "../enum/PathDiscardMode": 38,
  7559. "../enum/PathDisplayMode": 39,
  7560. "../enum/PlayerEvents": 40,
  7561. "../enum/VROption": 47,
  7562. "../enum/Vectors": 50,
  7563. "../enum/Viewmode": 51,
  7564. "../enum/WarpStyle": 52,
  7565. "../enum/ZoomEvents": 53,
  7566. "../lib/dat.gui": 93,
  7567. "../localization/localize": 108,
  7568. "../tag/Media/MediaEvent": 131,
  7569. "../objects/Snapshot": 153,
  7570. "../settings": 166,
  7571. "../util/ajax": 181,
  7572. "../util/browser": 182,
  7573. "../util/camera": 183,
  7574. "../util/logger": 189,
  7575. "../util/showcase": 193,
  7576. "../util/transitions": 195,
  7577. "./closer/ModalCloserEvent": 61,
  7578. "./closer/modalCloser": 62,
  7579. "./help/HelpEvent": 66,
  7580. "./help/help": 67,
  7581. "./helpManager": 68,
  7582. "./immersiveMode": 69,
  7583. "./konami": 70,
  7584. "./landingScreen": 71,
  7585. "./loadingScreen": 72,
  7586. "./memoryUsage": 73,
  7587. "./playButton": 74,
  7588. "./populateModal": 75,
  7589. "./sharing/ShareEvents": 76,
  7590. "./sharing/modal": 77,
  7591. "./terms/TermsEvent": 78,
  7592. "./terms/terms": 79,
  7593. "./title/TitleEvents": 80,
  7594. "./title/tagToggle": 81,
  7595. "./title/titleBar": 82,
  7596. "./tourInteraction": 84,
  7597. "./vr/vrEvent": 85,
  7598. "./vr/vrModal": 87,
  7599. "./webvr/WebVrEvent": 88,
  7600. "./webvr/webVRgui": 89,
  7601. three: 217
  7602. }],
  7603. 66: [function(e, t, i) {
  7604. "use strict";
  7605. t.exports = Object.freeze({
  7606. OPENED: "help.opened",
  7607. CLOSED: "help.closed"
  7608. })
  7609. }
  7610. , {}],
  7611. 67: [function(e, t, i) {
  7612. "use strict";
  7613. function n() {
  7614. g.on("click", function(e) {
  7615. if (S && S !== l.TRANSITIONING) {
  7616. var t = window.getComputedStyle(y).getPropertyValue("opacity") > 0;
  7617. t && !M ? R.close() : r()
  7618. }
  7619. }),
  7620. w.on("click", function(e) {
  7621. R.close()
  7622. }),
  7623. E.on("click", function(e) {
  7624. S && S !== l.TRANSITIONING && (s(),
  7625. o())
  7626. }),
  7627. b.on("click", function(e) {
  7628. s(),
  7629. a()
  7630. })
  7631. }
  7632. function r() {
  7633. S && S !== l.TRANSITIONING && (M = !0,
  7634. setTimeout(function() {
  7635. M = !1
  7636. }, d.help.modalStayDuration),
  7637. R.emit(h.OPENED),
  7638. m.addClass("open " + S),
  7639. g.addClass("open"),
  7640. s(),
  7641. o(),
  7642. y.style.removeProperty ? y.style.removeProperty("display") : y.style.removeAttribute("display"),
  7643. y.classList.add("fadeIn"))
  7644. }
  7645. function o() {
  7646. E.addClass("underline-tab"),
  7647. u.fill(_, c.NAVIGATION, S),
  7648. m.addClass(S)
  7649. }
  7650. function a() {
  7651. b.addClass("underline-tab"),
  7652. u.fill(T, c.MORE_HELP),
  7653. m.addClass("more-help")
  7654. }
  7655. function s(e, t) {
  7656. m.removeClass("more-help " + l.PANORAMA + " " + l.DOLLHOUSE + " " + l.FLOORPLAN + " " + l.OUTDOOR),
  7657. I.forEach(function(e) {
  7658. e.classList.remove("underline-tab")
  7659. })
  7660. }
  7661. var l = e("../../enum/Viewmode")
  7662. , c = e("../../enum/HelpModalType")
  7663. , h = e("./HelpEvent")
  7664. , u = (e("../helpManager"),
  7665. e("./../populateModal"))
  7666. , d = e("../../settings")
  7667. , p = e("../../util/common")
  7668. , f = e("events").EventEmitter
  7669. , g = $(".footer-help").eq(0)
  7670. , m = $("#help-dialog").eq(0)
  7671. , v = document.querySelector("#quick-logo")
  7672. , A = document.querySelector("#loaderCoBrand")
  7673. , y = document.querySelector("#help-dialog")
  7674. , C = document.querySelector(".footer")
  7675. , I = $(".help-tabs").children().toArray()
  7676. , E = $(".navigation-tab").eq(0)
  7677. , b = $(".more-help-tab").eq(0)
  7678. , w = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7679. m.find(".close").eq(0))
  7680. , _ = m.find(".interactions").toArray()
  7681. , T = m.find(".ui-instructions").toArray()
  7682. , x = l.PANORAMA
  7683. , S = l.PANORAMA
  7684. , M = !1
  7685. , R = {
  7686. init: function(e, t) {
  7687. S = t,
  7688. x = t,
  7689. [y, A, v, C].forEach(function(e) {
  7690. e.classList.add(u.deviceType)
  7691. }),
  7692. n()
  7693. },
  7694. close: function() {
  7695. if (m.hasClass("open") && (this.emit(h.CLOSED),
  7696. g.removeClass("open"),
  7697. m.removeClass("open"),
  7698. y.classList.contains("fadeIn"))) {
  7699. y.classList.remove("fadeIn");
  7700. var e = S === l.TRANSITIONING ? x : S;
  7701. u.clear(_, c.NAVIGATION, e)
  7702. }
  7703. },
  7704. updateMode: function(e) {
  7705. x = S,
  7706. S = e
  7707. }
  7708. };
  7709. p.extendObject(R, f.prototype),
  7710. t.exports = R
  7711. }
  7712. , {
  7713. "../../enum/HelpModalType": 28,
  7714. "../../enum/Viewmode": 51,
  7715. "../../settings": 166,
  7716. "../../util/common": 185,
  7717. "../helpManager": 68,
  7718. "./../populateModal": 75,
  7719. "./HelpEvent": 66,
  7720. events: 202
  7721. }],
  7722. 68: [function(e, t, i) {
  7723. (function(i) {
  7724. "use strict";
  7725. var n = e("../util/browser")
  7726. , r = e("./../util/logger")
  7727. , o = e("./../settings")
  7728. , a = new r(i)
  7729. , s = function() {
  7730. var e;
  7731. try {
  7732. return e = window.localStorage.getItem("visitCount") || "0",
  7733. e = (parseFloat(e) + 1).toString(),
  7734. window.localStorage.setItem("visitCount", e),
  7735. a.debug("visitCount = " + e),
  7736. e
  7737. } catch (t) {
  7738. e = "1",
  7739. a.debug("couldn't set local storage")
  7740. }
  7741. }()
  7742. , l = !1;
  7743. t.exports = {
  7744. isHelpDisabled: function() {
  7745. return "0" === n.valueFromHash("help", null) || l
  7746. },
  7747. isLargeHelpEnabled: function() {
  7748. return ("1" === s || "1" === n.valueFromHash("help", null)) && !this.isHelpDisabled()
  7749. },
  7750. isSmallHelpEnabled: function() {
  7751. return "2" === n.valueFromHash("help", null) && !this.isHelpDisabled()
  7752. },
  7753. isHelpEnabled: function() {
  7754. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7755. },
  7756. setAutoPlay: function(e) {
  7757. l = o.warp.auto >= 0 && e > 1
  7758. }
  7759. }
  7760. }
  7761. ).call(this, "/js/gui/helpManager.js")
  7762. }
  7763. , {
  7764. "../util/browser": 182,
  7765. "./../settings": 166,
  7766. "./../util/logger": 189
  7767. }],
  7768. 69: [function(e, t, i) {
  7769. "use strict";
  7770. function n(e, t, i, n) {
  7771. F = n,
  7772. r(e, t, i, F),
  7773. o(),
  7774. N = t.mode
  7775. }
  7776. function r(e, t, i, n) {
  7777. [C.PANORAMA, C.DOLLHOUSE, C.FLOORPLAN].forEach(function(t) {
  7778. e.controls[t].on(v.Move, a),
  7779. e.controls[t].on(v.LongTap, c)
  7780. }),
  7781. M.on("mousewheel DOMMouseScroll", a),
  7782. i.on(m.TagActivated, a),
  7783. i.on(m.TagNavigation, a),
  7784. t.on(A.FlyingEnded, s),
  7785. t.on(A.ModeChanging, function(e, t) {
  7786. B = t !== C.PANORAMA && e !== C.PANORAMA
  7787. }),
  7788. t.on(A.ModeChanged, function(e, i) {
  7789. N = t.mode,
  7790. i !== C.TRANSITIONING ? l() : a("modeChange")
  7791. }),
  7792. n.on(y.TourStart, function() {
  7793. L = !0,
  7794. a()
  7795. }),
  7796. n.on(y.TourEnd, function() {
  7797. L = !1,
  7798. l()
  7799. }),
  7800. n.on(y.ActionInterrupted, function() {
  7801. L = !1
  7802. }),
  7803. R.addEventListener("touchend", function() {
  7804. $("#pullTab").hasClass("opened") && !L && l()
  7805. }, !0)
  7806. }
  7807. function o() {
  7808. p.isMobile() ? (b.forEach(function(e) {
  7809. e.classList.add("mobile")
  7810. }),
  7811. w.click(l)) : (b.forEach(function(e) {
  7812. e.addEventListener("mouseleave", function() {
  7813. !M.is(":hover") && b[0].classList.contains("detectHover") && l()
  7814. }, !0)
  7815. }),
  7816. M.mouseleave(function() {
  7817. b[0].classList.contains("detectHover") && l()
  7818. }))
  7819. }
  7820. function a(e) {
  7821. D || d(e) && _.hasClass("playing") || (clearTimeout(O),
  7822. P = !0,
  7823. g.close(),
  7824. h(e),
  7825. N !== C.DOLLHOUSE && N !== C.FLOORPLAN && (x.hasClass("expand") && !S.hasClass("closed") || 2 === p.valueFromHash("title", 1) ,
  7826. _.hasClass("playing") || (b.forEach(function(e) {
  7827. e.classList.add("detectHover")
  7828. }),
  7829. O = setTimeout(l, f.immersive.timeToShowAgain))))
  7830. }
  7831. function s() {
  7832. _.hasClass("playing") || (clearTimeout(O),
  7833. O = setTimeout(l, f.immersive.timeToShowAgain))
  7834. }
  7835. function l() {
  7836. clearTimeout(O),
  7837. P = !1,
  7838. I.forEach(function(e) {
  7839. e.classList.remove("drawerOpen")
  7840. }),
  7841. L || E.forEach(function(e) {
  7842. e.classList.remove("duringTour")
  7843. }),
  7844. b.forEach(function(e) {
  7845. e.classList.remove("detectHover")
  7846. })
  7847. }
  7848. function c() {
  7849. P ? l() : a(),
  7850. D = !0,
  7851. setTimeout(function() {
  7852. D = !1
  7853. }, f.immersive.uiStayDuration)
  7854. }
  7855. function h(e) {
  7856. !d(e) && L ? E.forEach(function(e) {
  7857. e.classList.remove("drawerOpen"),
  7858. e.classList.add("duringTour")
  7859. }) : _.hasClass("open") ? E.forEach(function(e) {
  7860. e.classList.remove("duringTour"),
  7861. e.classList.add("drawerOpen")
  7862. }) : B || N === C.FLOORPLAN || N === C.DOLLHOUSE || E.forEach(function(e) {
  7863. e.classList.add("fadeOut")
  7864. })
  7865. }
  7866. function u() {
  7867. T.hasClass("duringTour") || (L = !1,
  7868. a("gui"),
  7869. l())
  7870. }
  7871. function d(e) {
  7872. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7873. }
  7874. var p = e("../util/browser")
  7875. , f = e("../settings")
  7876. , g = e("./help/help")
  7877. , m = e("../enum/tagEvents")
  7878. , v = e("../enum/ControlEvents")
  7879. , A = e("../enum/PlayerEvents")
  7880. , y = e("../enum/DirectorEvents")
  7881. , A = e("../enum/PlayerEvents")
  7882. , C = e("../enum/Viewmode")
  7883. , I = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7884. , E = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7885. , b = $("#hover-bottom, #hover-top").toArray()
  7886. , w = ($("#pullTab").eq(0),
  7887. $("#playHead").eq(0),
  7888. $(".pinBottom-container").eq(0))
  7889. , _ = $("#drawer").eq(0)
  7890. , T = $("#drawer-container").eq(0)
  7891. , x = $("#meta-info").eq(0)
  7892. , S = $(".pinTop.left").eq(0)
  7893. , M = $("#player").eq(0)
  7894. , R = document.getElementById("pullTab")
  7895. , P = !1
  7896. , O = null
  7897. , L = !1
  7898. , D = !1
  7899. , N = null
  7900. , B = !1
  7901. , F = null;
  7902. t.exports.init = n,
  7903. t.exports.hideUi = a,
  7904. t.exports.resetDrawer = u
  7905. }
  7906. , {
  7907. "../enum/ControlEvents": 21,
  7908. "../enum/DirectorEvents": 23,
  7909. "../enum/tagEvents": 32,
  7910. "../enum/PlayerEvents": 40,
  7911. "../enum/Viewmode": 51,
  7912. "../settings": 166,
  7913. "../util/browser": 182,
  7914. "./help/help": 67
  7915. }],
  7916. 70: [function(e, t, i) {
  7917. (function(i) {
  7918. "use strict";
  7919. function n(e, t, i) {
  7920. l.debug("konami has the modelInstance");
  7921. var n = [];
  7922. $(window).on("keydown", function(e) {
  7923. n.push(e.which),
  7924. n.length > o.secretPanelWord.length && n.shift(),
  7925. s.equalLists(n, o.secretPanelWord) && (l.debug("Developer mode active."),
  7926. o.debug = !0)
  7927. }),
  7928. $(window).on("keydown", function n(r) {
  7929. o.debug && 72 === r.which && (e && i ? (a.toggle(e, t, i),
  7930. $(window).off("keydown", n)) : console.warn("sorry we're not ready yet"))
  7931. })
  7932. }
  7933. var r = e("./../util/logger")
  7934. , o = e("./../settings")
  7935. , a = e("./debug")
  7936. , s = e("./../util/common")
  7937. , l = (e("./gui"),
  7938. new r(i));
  7939. o.console && $("body").append('<div id="debug-console"></div>'),
  7940. t.exports.init = n
  7941. }
  7942. ).call(this, "/js/gui/konami.js")
  7943. }
  7944. , {
  7945. "./../settings": 166,
  7946. "./../util/common": 185,
  7947. "./../util/logger": 189,
  7948. "./debug": 63,
  7949. "./gui": 65
  7950. }],
  7951. 71: [function(e, t, i) {
  7952. "use strict";
  7953. function n(e, t) {
  7954. E = t.mode === p.PANORAMA && t.pano && !t.pano.isAligned() ? p.OUTDOOR : t.mode
  7955. }
  7956. function r(e) {
  7957. var t = $.Deferred();
  7958. e || t.resolve();
  7959. var i = c.startupFlyinDelay;
  7960. return e === p.PANORAMA && (i += c.dollhouse.transitionTime),
  7961. setTimeout(t.resolve.bind(t), i),
  7962. t
  7963. }
  7964. function o(e, t, i) {
  7965. var n = 0;
  7966. c.quickstart.enabled && (a(i),
  7967. n = c.quickstart.showTextDelay + c.quickstart.fadeOutDelay);
  7968. var r = function() {
  7969. e.once(g.Move, l),
  7970. t.once(f.TourStart, l)
  7971. };
  7972. s(n, r)
  7973. }
  7974. function a(e) {
  7975. return /* e && (y.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  7976. v.before(y),
  7977. A = $(".quick-brand").toArray()),*/
  7978. m.addClass("fadeOut"),
  7979. setTimeout(function() {
  7980. A.forEach(function(e) {
  7981. e.classList.add("fadeIn")
  7982. })
  7983. }, c.quickstart.showTextDelay),
  7984. setTimeout(function() {
  7985. A.forEach(function(e) {
  7986. e.classList.add("fadeOut")
  7987. })
  7988. }, c.quickstart.fadeOutDelay),
  7989. !0
  7990. }
  7991. function s(e, t) {
  7992. setTimeout(function() {
  7993. if (h.isHelpEnabled()) {
  7994. if (t(),
  7995. u.init(),
  7996. C.addClass("fadeIn landing " + u.deviceType),
  7997. h.isSmallHelpEnabled())
  7998. return void C.addClass("small");
  7999. u.fill(I, d.LANDING[E]),
  8000. C.addClass(E)
  8001. }
  8002. }, e)
  8003. //csz 用户引导界面
  8004. var helpData = {
  8005. "pc":["images/pc_step1.png","images/pc_step2.png","images/pc_step3.png"],
  8006. "mobile":["images/phone_step1.png","images/phone_step2.png","images/phone_step3.png"]
  8007. }
  8008. var navIcon = $(".nav-icon .icon");
  8009. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) navIcon.attr("src",helpData.mobile[0]);
  8010. function paging(id){
  8011. id.on("click",function(){
  8012. var navPage = null;
  8013. $(this).attr("data-id") == "plus" ? navPage = +navIcon.attr("data-page")+1 : navPage = +navIcon.attr("data-page")-1;
  8014. if(navPage > helpData.length || navPage < 1) return false
  8015. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  8016. navIcon.attr({"data-page":navPage,"src":helpData.mobile[navPage - 1]});
  8017. }else{
  8018. navIcon.attr({"data-page":navPage,"src":helpData.pc[navPage - 1]});
  8019. }
  8020. })
  8021. };
  8022. paging($(".next-button"));
  8023. paging($(".prev-button"));
  8024. }
  8025. function l() {
  8026. u.clear(I, d.LANDING[E]),
  8027. C.removeClass("fadeIn")
  8028. }
  8029. var c = e("../settings")
  8030. , h = (e("./help/help"),
  8031. e("./helpManager"))
  8032. , u = e("./populateModal")
  8033. , d = e("../enum/HelpModalType")
  8034. , p = e("../enum/Viewmode")
  8035. , f = e("../enum/DirectorEvents")
  8036. , g = e("../enum/PlayerEvents")
  8037. , m = $("#quick-blackout").eq(0)
  8038. , v = $("#quick-logo").eq(0)
  8039. , A = $(".quick-brand").toArray()
  8040. , y = $("#loaderCoBrand").eq(0)
  8041. , C = $("#interaction-modal").eq(0)
  8042. , I = C.find(".interaction").toArray()
  8043. , E = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  8044. "");
  8045. t.exports.delayLanding = r,
  8046. t.exports.showMessage = o,
  8047. t.exports.init = n,
  8048. t.exports.dismissModal = l
  8049. }
  8050. , {
  8051. "../enum/DirectorEvents": 23,
  8052. "../enum/HelpModalType": 28,
  8053. "../enum/PlayerEvents": 40,
  8054. "../enum/Viewmode": 51,
  8055. "../settings": 166,
  8056. "./help/help": 67,
  8057. "./helpManager": 68,
  8058. "./populateModal": 75
  8059. }],
  8060. 72: [function(e, t, i) {
  8061. "use strict";
  8062. var n = e("./circleLoader").circleLoader;
  8063. t.exports = {
  8064. element: $("#gui-loading"),
  8065. hide: function(e) {
  8066. n.done(),
  8067. this.element.fadeOut(1500, e)
  8068. },
  8069. show: function(e) {
  8070. this.element.fadeIn(500, function() {
  8071. this.element.css("display", "table"),
  8072. e && e()
  8073. }
  8074. .bind(this))
  8075. },
  8076. progress: function(e) {
  8077. n.set(e)
  8078. }
  8079. }
  8080. }
  8081. , {
  8082. "./circleLoader": 60
  8083. }],
  8084. 73: [function(e, t, i) {
  8085. "use strict";
  8086. var n = e("../settings")
  8087. , r = $("#memory-info")
  8088. , o = r.find("#memory-gpu")
  8089. , a = !1;
  8090. t.exports = {
  8091. show: function() {
  8092. n.profiling.enabled && (r.show(),
  8093. a = !0)
  8094. },
  8095. hide: function() {
  8096. r.hide(),
  8097. a = !1
  8098. },
  8099. toggle: function() {
  8100. a ? this.hide() : this.show()
  8101. },
  8102. update: function(e) {
  8103. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  8104. }
  8105. }
  8106. }
  8107. , {
  8108. "../settings": 166
  8109. }],
  8110. 74: [function(e, t, i) {
  8111. "use strict";
  8112. var n = e("../util/browser")
  8113. , r = e("../analytics");
  8114. e("../settings");
  8115. t.exports = {
  8116. show: function(e, t) {
  8117. $("#gui-message").fadeOut(500, function() {
  8118. t()
  8119. })
  8120. }
  8121. }
  8122. }
  8123. , {
  8124. "../analytics": 4,
  8125. "../settings": 166,
  8126. "../util/browser": 182
  8127. }],
  8128. 75: [function(e, t, i) {
  8129. "use strict";
  8130. function n(e, t, i, n) {
  8131. function r(e) {
  8132. return e.classList.contains(a)
  8133. }
  8134. var o = i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType];
  8135. //for (var a in o) {
  8136. //var s = e.find(r);
  8137. //for (var l in o[a]) {
  8138. //var c = o[a][l];
  8139. //if ("top-info" === l || "bottom-info" === l) {
  8140. //var h = n ? c : "";
  8141. //czj 注释掉第一次打开的用户引导
  8142. //s.querySelector("." + l).textContent = h
  8143. //} else {
  8144. //var u = n ? c : "";
  8145. //, d = s.querySelector("." + l);
  8146. //d.src = u,
  8147. //n ? d.classList.remove("hidden") : d.classList.add("hidden")
  8148. //}
  8149. //}
  8150. //}
  8151. //var p = Array.prototype.slice.call(e[0].parentElement.querySelectorAll("hr"));
  8152. // p.forEach(function(e) {
  8153. // n ? e.classList.remove("hidden") : e.classList.add("hidden")
  8154. // })
  8155. }
  8156. var r = e("../util/browser")
  8157. , o = e("../localization/localize")
  8158. , a = e("../enum/HelpModalType")
  8159. , s = (e("../enum/HelpModalSize"),
  8160. e("../enum/Viewmode"));
  8161. t.exports = {
  8162. init: function() {
  8163. if (!this.hasInitialized) {
  8164. this.hasInitialized = !0,
  8165. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  8166. this.assets = {},
  8167. this.assets[a.LANDING[s.PANORAMA]] = {
  8168. desktop: {
  8169. left: {
  8170. "top-info": o.ROTATE,
  8171. "big-image": "images/nav_help_mouse_drag_left.png",
  8172. keyboard: "images/nav_help_keyboard_left_right.png"
  8173. },
  8174. middle: {
  8175. "top-info": o.MOVE,
  8176. "big-image": "images/nav_help_mouse_click.png",
  8177. keyboard: "images/nav_help_keyboard_up_down.png"
  8178. },
  8179. right: {
  8180. "top-info": o.ZOOM,
  8181. "big-image": "images/nav_help_mouse_zoom.png",
  8182. keyboard: "images/nav_help_zoom_keys.png"
  8183. }
  8184. },
  8185. mobile: {
  8186. left: {
  8187. "top-info": o.ROTATE,
  8188. "big-image": "images/nav_help_gesture_drag.png"
  8189. },
  8190. middle: {
  8191. "top-info": o.MOVE,
  8192. "big-image": "images/nav_help_gesture_tap.png"
  8193. },
  8194. right: {
  8195. "top-info": o.ZOOM,
  8196. "big-image": "images/nav_help_gesture_pinch.png"
  8197. }
  8198. }
  8199. },
  8200. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  8201. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  8202. desktop: {
  8203. left: {
  8204. "top-info": o.ROTATE,
  8205. "big-image": "images/nav_help_mouse_drag_left.png",
  8206. keyboard: "images/nav_help_keyboard_left_right.png"
  8207. },
  8208. middle: {
  8209. "top-info": o.MOVE,
  8210. "big-image": "images/nav_help_mouse_position_right.png"
  8211. }
  8212. },
  8213. mobile: {
  8214. left: {
  8215. "top-info": o.ROTATE,
  8216. "big-image": "images/nav_help_gesture_drag.png"
  8217. },
  8218. middle: {
  8219. "top-info": o.MOVE,
  8220. "big-image": "images/nav_help_gesture_position_two_finger.png"
  8221. }
  8222. }
  8223. },
  8224. this.assets[a.LANDING[s.FLOORPLAN]] = {
  8225. desktop: {
  8226. left: {
  8227. "top-info": o.MOVE,
  8228. "big-image": "images/nav_help_mouse_position_left.png"
  8229. },
  8230. middle: {
  8231. "top-info": o.ROTATE,
  8232. "big-image": "images/nav_help_mouse_drag_right.png",
  8233. keyboard: "images/nav_help_keyboard_left_right.png"
  8234. }
  8235. },
  8236. mobile: {
  8237. left: {
  8238. "top-info": o.MOVE,
  8239. "big-image": "images/nav_help_gesture_position.png"
  8240. },
  8241. middle: {
  8242. "top-info": o.ROTATE,
  8243. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  8244. }
  8245. }
  8246. };
  8247. var e = {
  8248. "top-info": o.INSIDE,
  8249. "big-image": "images/nav_help_click_inside.png",
  8250. keyboard: "images/nav_help_inside_key.png"
  8251. };
  8252. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  8253. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  8254. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  8255. var t = {
  8256. "top-info": o.INSIDE,
  8257. "big-image": "images/nav_help_tap_inside.png"
  8258. };
  8259. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  8260. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  8261. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  8262. this.assets[a.NAVIGATION] = {},
  8263. this.assets[a.NAVIGATION][s.PANORAMA] = {
  8264. desktop: {
  8265. left: {
  8266. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  8267. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  8268. "big-image": "images/nav_help_mouse_drag_left.png",
  8269. keyboard: "images/nav_help_keyboard_left_right.png"
  8270. },
  8271. middle: {
  8272. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  8273. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  8274. "big-image": "images/nav_help_mouse_click.png",
  8275. keyboard: "images/nav_help_keyboard_up_down.png"
  8276. },
  8277. right: {
  8278. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  8279. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  8280. "big-image": "images/nav_help_mouse_zoom.png",
  8281. keyboard: "images/nav_help_zoom_keys.png"
  8282. }
  8283. },
  8284. mobile: {
  8285. left: {
  8286. "top-info": o.HELP_MOBILE_PANORAMA_1,
  8287. "big-image": "images/nav_help_gesture_drag.png"
  8288. },
  8289. middle: {
  8290. "top-info": o.HELP_MOBILE_PANORAMA_2,
  8291. "big-image": "images/nav_help_gesture_tap.png"
  8292. },
  8293. right: {
  8294. "top-info": o.HELP_MOBILE_3,
  8295. "big-image": "images/nav_help_gesture_pinch.png"
  8296. }
  8297. }
  8298. },
  8299. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  8300. desktop: {
  8301. left: {
  8302. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  8303. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  8304. "big-image": "images/nav_help_mouse_drag_left.png",
  8305. keyboard: "images/nav_help_keyboard_all.png"
  8306. },
  8307. middle: {
  8308. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  8309. "big-image": "images/nav_help_mouse_position_right.png"
  8310. },
  8311. right: {
  8312. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  8313. "big-image": "images/nav_help_mouse_zoom.png"
  8314. }
  8315. },
  8316. mobile: {
  8317. left: {
  8318. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  8319. "big-image": "images/nav_help_gesture_drag.png"
  8320. },
  8321. middle: {
  8322. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  8323. "big-image": "images/nav_help_gesture_position_two_finger.png"
  8324. },
  8325. right: {
  8326. "top-info": o.HELP_MOBILE_3,
  8327. "big-image": "images/nav_help_gesture_pinch.png"
  8328. }
  8329. }
  8330. },
  8331. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  8332. desktop: {
  8333. left: {
  8334. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  8335. "big-image": "images/nav_help_mouse_position_left.png"
  8336. },
  8337. middle: {
  8338. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  8339. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  8340. "big-image": "images/nav_help_mouse_drag_right.png",
  8341. keyboard: "images/nav_help_keyboard_left_right.png"
  8342. },
  8343. right: {
  8344. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  8345. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  8346. "big-image": "images/nav_help_mouse_zoom.png",
  8347. keyboard: "images/nav_help_keyboard_up_down.png"
  8348. }
  8349. },
  8350. mobile: {
  8351. left: {
  8352. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  8353. "big-image": "images/nav_help_gesture_position.png"
  8354. },
  8355. middle: {
  8356. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  8357. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  8358. },
  8359. right: {
  8360. "top-info": o.HELP_MOBILE_3,
  8361. "big-image": "images/nav_help_gesture_pinch.png"
  8362. }
  8363. }
  8364. },
  8365. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  8366. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  8367. "top-info": o.HELP_DESKTOP_360_2A,
  8368. "bottom-info": o.HELP_DESKTOP_360_2B,
  8369. "big-image": "images/nav_help_click_inside.png",
  8370. keyboard: "images/nav_help_inside_key.png"
  8371. },
  8372. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  8373. "top-info": o.HELP_MOBILE_360_2,
  8374. "big-image": "images/nav_help_tap_inside.png"
  8375. },
  8376. this.assets[a.MORE_HELP] = {
  8377. desktop: {
  8378. "more-help-hlr": {
  8379. "top-info": o.HELP_MORE_HLR_A,
  8380. "big-image": "images/nav_help_expand.svg",
  8381. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8382. },
  8383. "more-help-dollhouse": {
  8384. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8385. "big-image": "images/nav_help_dollhouse.svg",
  8386. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  8387. },
  8388. "more-help-floors": {
  8389. "top-info": o.HELP_MORE_FLOORS_A,
  8390. "big-image": "images/nav_help_floor picker.svg",
  8391. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8392. },
  8393. "more-help-tag": {
  8394. "top-info": o.HELP_MORE_TAG_A,
  8395. "big-image": "images/nav_help_tag.svg",
  8396. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  8397. },
  8398. "more-help-zoom": {
  8399. "top-info": o.HELP_MORE_ZOOM_A,
  8400. "big-image": "images/nav_help_zoom.svg",
  8401. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  8402. },
  8403. "more-help-tour": {
  8404. "top-info": o.HELP_MORE_TOUR_A,
  8405. "big-image": "images/nav_help_play.png",
  8406. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8407. },
  8408. "more-help-inside": {
  8409. "top-info": o.HELP_MORE_INSIDE_A,
  8410. "big-image": "images/nav_help_inside.svg",
  8411. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  8412. },
  8413. "more-help-vr": {
  8414. "top-info": o.HELP_MORE_VR_A,
  8415. "big-image": "images/nav_help_vr.svg",
  8416. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  8417. },
  8418. "more-help-360": {
  8419. "top-info": o.HELP_MORE_360_A,
  8420. "big-image": "images/nav_help_360.svg",
  8421. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  8422. },
  8423. "more-help-fullscreen": {
  8424. "top-info": o.HELP_MORE_FULLSCREEN_A,
  8425. "big-image": "images/nav_help_fullscreen.svg",
  8426. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  8427. }
  8428. },
  8429. mobile: {
  8430. "more-help-hlr": {
  8431. "top-info": o.HELP_MORE_HLR_A,
  8432. "big-image": "images/nav_help_expand.svg",
  8433. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8434. },
  8435. "more-help-dollhouse": {
  8436. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8437. "big-image": "images/nav_help_dollhouse.svg",
  8438. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  8439. },
  8440. "more-help-floors": {
  8441. "top-info": o.HELP_MORE_FLOORS_A,
  8442. "big-image": "images/nav_help_floor picker.svg",
  8443. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8444. },
  8445. "more-help-tag": {
  8446. "top-info": o.HELP_MORE_TAG_A,
  8447. "big-image": "images/nav_help_tag.svg",
  8448. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  8449. },
  8450. "more-help-tour": {
  8451. "top-info": o.HELP_MORE_TOUR_A,
  8452. "big-image": "images/nav_help_play.png",
  8453. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8454. },
  8455. "more-help-inside": {
  8456. "top-info": o.HELP_MORE_INSIDE_A,
  8457. "big-image": "images/nav_help_inside.svg",
  8458. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  8459. },
  8460. "more-help-vr": {
  8461. "top-info": o.HELP_MORE_VR_A,
  8462. "big-image": "images/webvr.svg",
  8463. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  8464. },
  8465. "more-help-360": {
  8466. "top-info": o.HELP_MORE_360_A,
  8467. "big-image": "images/nav_help_360.svg",
  8468. "bottom-info": o.HELP_MOBILE_MORE_360_B
  8469. }
  8470. }
  8471. },
  8472. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  8473. desktop: {
  8474. left: {
  8475. "top-info": o.ROTATE,
  8476. "big-image": "images/nav_help_mouse_drag_left.png",
  8477. keyboard: "images/nav_help_keyboard_left_right.png"
  8478. },
  8479. middle: {
  8480. "top-info": o.MOVE,
  8481. "big-image": "images/nav_help_mouse_click.png",
  8482. keyboard: "images/nav_help_keyboard_up_down.png"
  8483. },
  8484. right: {
  8485. "top-info": o.PLAY,
  8486. "big-image": "images/Desktop-help-play-button.svg",
  8487. keyboard: "images/Desktop-help-spacebar-2.svg"
  8488. }
  8489. },
  8490. mobile: {
  8491. left: {
  8492. "top-info": o.ROTATE,
  8493. "big-image": "images/nav_help_gesture_drag.png"
  8494. },
  8495. middle: {
  8496. "top-info": o.MOVE,
  8497. "big-image": "images/nav_help_gesture_tap.png"
  8498. },
  8499. right: {
  8500. "top-info": o.PLAY,
  8501. "big-image": "images/mobile-help-play-button.svg"
  8502. }
  8503. }
  8504. },
  8505. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  8506. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  8507. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  8508. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  8509. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  8510. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  8511. }
  8512. },
  8513. fill: function(e, t, i) {
  8514. n.call(this, e, t, i, !0)
  8515. },
  8516. clear: function(e, t, i) {
  8517. n.call(this, e, t, i, !1)
  8518. }
  8519. }
  8520. }
  8521. , {
  8522. "../enum/HelpModalSize": 27,
  8523. "../enum/HelpModalType": 28,
  8524. "../enum/Viewmode": 51,
  8525. "../localization/localize": 108,
  8526. "../util/browser": 182
  8527. }],
  8528. 76: [function(e, t, i) {
  8529. "use strict";
  8530. t.exports = Object.freeze({
  8531. OPENED: "share.open",
  8532. CLOSED: "share.closed",
  8533. LINK_CLICKED: "share.linked"
  8534. })
  8535. }
  8536. , {}],
  8537. 77: [function(e, t, i) {
  8538. "use strict";
  8539. function n(e) {
  8540. function t(t, i) {
  8541. var n = window.screenY + ($("#player").height() - i) / 2
  8542. , r = window.screenX + ($("#player").width() - t) / 2
  8543. , o = "top=" + n + ",left=" + r + ",width=" + t + ",height=" + i;
  8544. I.emit(l.LINK_CLICKED, {
  8545. channel: e
  8546. }),
  8547. window.open(C[e], "shareWindow", o)
  8548. }
  8549. switch (e) {
  8550. case y.FACEBOOK:
  8551. t(580, 420);
  8552. break;
  8553. case y.TWITTER:
  8554. t(550, 440);
  8555. break;
  8556. case y.MAIL:
  8557. I.emit(l.LINK_CLICKED, {
  8558. channel: "email"
  8559. }),
  8560. window.open(C[e], "_blank");
  8561. break;
  8562. case y.LINKEDIN:
  8563. }
  8564. }
  8565. function r(e) {
  8566. I.emit(l.LINK_CLICKED, {
  8567. channel: "copylink"
  8568. });
  8569. var t = document.createRange();
  8570. t.selectNodeContents(v);
  8571. var i = window.getSelection();
  8572. i.removeAllRanges(),
  8573. i.addRange(t),
  8574. document.execCommand("copy"),
  8575. A.classList.remove("hidden"),
  8576. v.classList.add("highlighted")
  8577. }
  8578. function o(e) {
  8579. e && (e.stopPropagation(),
  8580. e.target === v) || (window.getSelection().removeAllRanges(),
  8581. v.classList.remove("highlighted"),
  8582. A.classList.add("hidden"))
  8583. }
  8584. var a = e("../../util/browser")
  8585. , s = e("../../localization/localize")
  8586. , l = e("./ShareEvents")
  8587. , c = e("../../util/common")
  8588. , h = e("events").EventEmitter
  8589. , u = document.getElementById("sharing")
  8590. , d = document.getElementById("share-modal")
  8591. , p = document.getElementById("share-close")
  8592. , f = document.getElementById("facebook-share")
  8593. , g = document.getElementById("twitter-share")
  8594. , m = document.getElementById("mail-share")
  8595. , v = document.getElementById("share-url-text")
  8596. , A = document.getElementById("copy-success")
  8597. , y = Object.freeze({
  8598. FACEBOOK: "facebook",
  8599. TWITTER: "twitter",
  8600. MAIL: "mail",
  8601. LINKEDIN: "linkedin"
  8602. })
  8603. , C = {};
  8604. C[y.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8605. C[y.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8606. C[y.MAIL] = "mailto:?subject=";
  8607. var I = {
  8608. init: function(e) {
  8609. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8610. C[y.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8611. C[y.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8612. C[y.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8613. u.addEventListener("click", this.toggle.bind(this)),
  8614. p.addEventListener("click", this.hide.bind(this)),
  8615. v.addEventListener("click", r),
  8616. d.addEventListener("click", o),
  8617. f.addEventListener("click", n.bind(this, y.FACEBOOK)),
  8618. g.addEventListener("click", n.bind(this, y.TWITTER)),
  8619. m.addEventListener("click", n.bind(this, y.MAIL)),
  8620. v.textContent = window.location.href + "&utm_source=4",
  8621. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8622. u.classList.remove("hidden")
  8623. },
  8624. show: function() {
  8625. this.emit(l.OPENED),
  8626. d.classList.add("fadeIn")
  8627. },
  8628. hide: function() {
  8629. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8630. document.selection && document.selection.empty(),
  8631. window.getSelection().removeAllRanges(),
  8632. o(),
  8633. d.classList.remove("fadeIn"))
  8634. },
  8635. toggle: function() {
  8636. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8637. }
  8638. };
  8639. c.extendObject(I, h.prototype),
  8640. t.exports = I
  8641. }
  8642. , {
  8643. "../../localization/localize": 108,
  8644. "../../util/browser": 182,
  8645. "../../util/common": 185,
  8646. "./ShareEvents": 76,
  8647. events: 202
  8648. }],
  8649. 78: [function(e, t, i) {
  8650. "use strict";
  8651. t.exports = Object.freeze({
  8652. OPENED: "terms.opened",
  8653. CLOSED: "terms.closed"
  8654. })
  8655. }
  8656. , {}],
  8657. 79: [function(e, t, i) {
  8658. "use strict";
  8659. var n = e("./TermsEvent")
  8660. , r = e("../../localization/localize")
  8661. , o = e("../../analytics")
  8662. , a = e("../../util/ajax")
  8663. , s = e("../../util/common")
  8664. , l = e("events").EventEmitter
  8665. , c = document.getElementById("terms-modal")
  8666. , h = {
  8667. init: function() {
  8668. $(".footer-terms").on("click", function(e) {
  8669. e.preventDefault(),
  8670. this.show()
  8671. }
  8672. .bind(this)),
  8673. $("#terms-modal .close").on("click", this.hide.bind(this))
  8674. },
  8675. show: function() {
  8676. this.emit(n.OPENED),
  8677. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8678. var t = $("#terms-text").html(e);
  8679. o.track("showcase_gui", {
  8680. gui_action: "click_terms_button",
  8681. interaction_source: "gui"
  8682. }),
  8683. t.find("a").attr("target", "_blank")
  8684. }).fail(function() {
  8685. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8686. }),
  8687. c.classList.add("fadeIn")
  8688. },
  8689. hide: function(e) {
  8690. e && e.preventDefault(),
  8691. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8692. c.classList.remove("fadeIn")
  8693. }
  8694. };
  8695. s.extendObject(h, l.prototype),
  8696. t.exports = h
  8697. }
  8698. , {
  8699. "../../analytics": 4,
  8700. "../../localization/localize": 108,
  8701. "../../util/ajax": 181,
  8702. "../../util/common": 185,
  8703. "./TermsEvent": 78,
  8704. events: 202
  8705. }],
  8706. 80: [function(e, t, i) {
  8707. "use strict";
  8708. t.exports = Object.freeze({
  8709. OPEN_INFO: "title.open.info",
  8710. CLOSE_INFO: "title.close.info",
  8711. SHOW_INFO: "title.show.info",
  8712. HIDE_INFO: "title.hide.info",
  8713. LINK_CLICKED: "title.link.click",
  8714. CONTACT_LINK_CLICKED: "title.contact.click",
  8715. ORIGIN_LINK_CLICKED: "title.origin.click"
  8716. })
  8717. }
  8718. , {}],
  8719. 81: [function(e, t, i) {
  8720. "use strict";
  8721. function n(e, t) {
  8722. o.tags.enabled && 0 !== Object.keys(e.tags).length && r(e, t)
  8723. }
  8724. function r(e, t) {
  8725. function i(i) {
  8726. e.shouldShowtags = "show" === this.value,
  8727. e.shouldShowtags ? t.showAlltags(o.tags.startup.fadeInDuration) : t.hideAlltags(o.tags.startup.fadeInDuration)
  8728. }
  8729. document.getElementById("tag-toggles").classList.remove("hidden"),
  8730. document.getElementById("radio-tag-show").checked = !0;
  8731. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8732. n[r].addEventListener("change", i)
  8733. }
  8734. var o = e("../../settings");
  8735. t.exports.init = n
  8736. }
  8737. , {
  8738. "../../settings": 166
  8739. }],
  8740. 82: [function(e, t, i) {
  8741. (function(i) {
  8742. "use strict";
  8743. function n(e, t) {
  8744. return e && u.valueFromHash("title", 1) && 2 !== u.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e, g_weixinObj.title = e,
  8745. e.length > g.minTooltipCharacters && I.parentElement.setAttribute("data-original-title", e),
  8746. t && 1 !== m.specialEdition && m.brand && !m.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8747. document.getElementById("gui-name").classList.add("noCoBrand"),
  8748. document.getElementById("cobrandTitle").classList.add("hidden")),
  8749. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8750. !1)
  8751. }
  8752. function r(e) {
  8753. return e ? (L = !0,
  8754. void (_.innerHTML = e)) : void _.classList.add("hidden")
  8755. }
  8756. function o(e, t, i, n) {
  8757. if (!e && !t && !i || !m.brand || u.valueFromHash("mls", !1))
  8758. return void T.classList.add("hidden");
  8759. L = !0;
  8760. var r = []
  8761. , o = c(r, "<br>");
  8762. if (e && o('<span id="contactName">' + e + "</span>"),
  8763. t) {
  8764. var a = n || t
  8765. , s = u.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>";
  8766. o(s)
  8767. }
  8768. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8769. r[0] = "",
  8770. x.innerHTML = r.join("")
  8771. }
  8772. function a(e) {
  8773. if ("string" == typeof e)
  8774. try {
  8775. e = JSON.parse(e)
  8776. } catch (e) {
  8777. return y.warn("Unable to parse address data"),
  8778. void S.parentElement.classList.add("hidden")
  8779. }
  8780. if (!(e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)))
  8781. return void S.parentElement.classList.add("hidden");
  8782. L = !0;
  8783. var t = []
  8784. , i = c(t, " ");
  8785. e.address_1 && i(e.address_1),
  8786. e.address_2 && i(e.address_2),
  8787. e.city && i(e.city, ", "),
  8788. e.state && i(e.state, ", "),
  8789. e.zip && i(e.zip, e.state ? " " : ", "),
  8790. t[0] = "",
  8791. S.innerText = t.join("")
  8792. }
  8793. function s(e) {
  8794. var t = document.createElement("a");
  8795. return t.id = "url",
  8796. t.target = "_blank",
  8797. t.href = e,
  8798. t.innerText = e,
  8799. t.addEventListener("click", N.emit.bind(N, v.ORIGIN_LINK_CLICKED)),
  8800. t
  8801. }
  8802. function l(e) {
  8803. return !(!e || u.inIframe() && document.referrer === e) && (R.classList.remove("hidden"),
  8804. P.innerHTML = f.WEBVR_LEARN_MORE + ": ",
  8805. P.appendChild(s(e)),
  8806. O.forEach(function(e) {
  8807. e.classList.add("share-link")
  8808. }),
  8809. !0)
  8810. }
  8811. function c(e, t) {
  8812. var i = e
  8813. , n = t;
  8814. return function(e, t) {
  8815. i.push(t || n, e)
  8816. }
  8817. }
  8818. function h() {
  8819. document.getElementById("title-toggle").addEventListener("click", N.toggleTitle.bind(N)),
  8820. L && I.addEventListener("click", N.toggleMeta.bind(N, !1));
  8821. var e = [].slice.call(_.querySelectorAll("a"));
  8822. e.forEach(function(e) {
  8823. e.addEventListener("click", N.emit.bind(N, v.LINK_CLICKED))
  8824. });
  8825. var t = [].slice.call(T.querySelectorAll("a"));
  8826. t.forEach(function(e) {
  8827. e.addEventListener("click", N.emit.bind(N, v.CONTACT_LINK_CLICKED, {
  8828. contact_type: e.getAttribute("id")
  8829. }))
  8830. })
  8831. }
  8832. var u = e("../../util/browser")
  8833. , d = e("../../util/common")
  8834. , p = e("../../util/logger")
  8835. , f = e("../../localization/localize")
  8836. , g = e("./titleBarSettings")
  8837. , m = e("../../settings")
  8838. , v = e("./TitleEvents")
  8839. , A = e("events").EventEmitter
  8840. , y = new p(i)
  8841. , C = document.querySelector(".pinTop.left")
  8842. , I = document.getElementsByClassName("title-container")[0]
  8843. , E = document.getElementById("title-toggle").querySelector("i")
  8844. , b = document.getElementById("meta-info-wrapper")
  8845. , w = document.getElementById("meta-info")
  8846. , _ = document.getElementById("meta-description")
  8847. , T = document.getElementsByClassName("contact-info")[0]
  8848. , x = document.getElementById("contact-data")
  8849. , S = document.getElementById("addressTxt")
  8850. , M = document.getElementById("tag-toggles")
  8851. , R = document.getElementById("share-origin")
  8852. , P = document.getElementById("share-link-wrapper")
  8853. , O = [w, b, I]
  8854. , L = !1
  8855. , D = !1
  8856. , N = {
  8857. populate: function(e) {
  8858. if (n(window.DATA.name, e.coBrand)) {
  8859. if (r(e.description),
  8860. o(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8861. a(e.address),
  8862. L) {
  8863. var t = document.createElement("br");
  8864. M.insertBefore(t, M.firstElementChild)
  8865. }
  8866. e.socialSharing && m.share.enabled && (D = l(e.url))
  8867. }
  8868. },
  8869. finishSetup: function(e) {
  8870. L = L || !!e,
  8871. h(),
  8872. L || (D ? I.classList.add("share-only") : I.classList.add("no-meta"))
  8873. },
  8874. toggleMeta: function(e, t) {
  8875. var title = document.getElementById("model-title");
  8876. t && t.preventDefault();
  8877. var i = w.classList.contains("expand");
  8878. e && !i || (i ? (O.forEach(function(e) {
  8879. e.classList.remove("expand")
  8880. }),
  8881. this.emit(v.CLOSE_INFO),title.classList.remove("expand")) : (O.forEach(function(e) {
  8882. e.classList.add("expand");
  8883. }),
  8884. title.classList.add("expand"),
  8885. this.emit(v.OPEN_INFO)))
  8886. },
  8887. setupToggling: function() {
  8888. b.style.height = w.offsetHeight + "px",
  8889. w.addEventListener("transitionend", function() {
  8890. b.style.height = w.offsetHeight + "px"
  8891. })
  8892. },
  8893. toggleTitle: function(e) {
  8894. e && e.preventDefault(),
  8895. C.classList.contains("closed") ? (C.classList.add("open"),
  8896. E.classList.remove("icon-dpad-right"),
  8897. E.classList.add("icon-dpad-left"),
  8898. this.emit(v.SHOW_INFO),
  8899. setTimeout(function() {
  8900. C.classList.remove("closed"),
  8901. C.classList.remove("open")
  8902. }, g.removeAnimationClasses)) : (C.classList.add("closed"),
  8903. E.classList.remove("icon-dpad-left"),
  8904. E.classList.add("icon-dpad-right"),
  8905. this.emit(v.HIDE_INFO))
  8906. }
  8907. };
  8908. d.extendObject(N, A.prototype),
  8909. t.exports = N
  8910. }
  8911. ).call(this, "/js/gui/title/titleBar.js")
  8912. }
  8913. , {
  8914. "../../localization/localize": 108,
  8915. "../../settings": 166,
  8916. "../../util/browser": 182,
  8917. "../../util/common": 185,
  8918. "../../util/logger": 189,
  8919. "./TitleEvents": 80,
  8920. "./titleBarSettings": 83,
  8921. events: 202
  8922. }],
  8923. 83: [function(e, t, i) {
  8924. "use strict";
  8925. t.exports = Object.freeze({
  8926. minTooltipCharacters: 19,
  8927. removeAnimationClasses: 500
  8928. })
  8929. }
  8930. , {}],
  8931. 84: [function(e, t, i) {
  8932. "use strict";
  8933. function n(e) {
  8934. C = e,
  8935. P.forEach(function(e) {
  8936. b.addEventListener(e, u.bind(this, !1), !0),
  8937. w.addEventListener(e, u.bind(this, !0), !0),
  8938. E.addEventListener(e, stopTour2, !0)
  8939. /* S.forEach(function(t) {//会触发导览停止
  8940. t.addEventListener(e, stopTour, !0)
  8941. }) */
  8942. $("#drawer img").on(e, stopTour)
  8943. })
  8944. document.addEventListener("keydown", u.bind(this, !1), !0)
  8945. C.on(v.TourStart, function() {
  8946. E.classList.add("playing")
  8947. })
  8948. }
  8949. function play() {//r
  8950. settings.playTourNearBy ? C.playTourNearBy() : C.playTour()
  8951. I && clearTimeout(I),
  8952. d(),
  8953. _.removeClass("fadeIn")
  8954. }
  8955. function stopTour2() {//o
  8956. E.classList.contains("playing") && (C.stopTour(),
  8957. _.addClass("fadeIn"),
  8958. setTimeout(function() {
  8959. _.removeClass("fadeIn")
  8960. }, p.tourInteraction.showPauseButton),
  8961. O || (clearTimeout(I),
  8962. I = setTimeout(h, p.tourInteraction.showModal)),
  8963. setTimeout(function() {
  8964. E.classList.remove("playing")
  8965. }, p.tourInteraction.allowNextClick))
  8966. }
  8967. function stopTour() { //a
  8968. C.tourInProgress && (C.stopTour(),
  8969. C.endTourProgress(),
  8970. E.classList.remove("playing"))
  8971. }
  8972. function togglePlay() {//s
  8973. T.is(":visible") ? play() : stopTour2()
  8974. }
  8975. function l() {
  8976. x.hasClass("playing") && (clearTimeout(I),
  8977. C.atEndOfTour() ? c() : _.removeClass("fadeIn"))
  8978. }
  8979. function c() {
  8980. E.classList.remove("playing"),
  8981. h()
  8982. }
  8983. function h() {//去掉导览结束时的提示
  8984. /* if (!p.tourInteraction.disabled) {
  8985. M.removeClass("small landing " + g.FLOORPLAN + " " + g.OUTDOOR + " " + g.PANORAMA),
  8986. M.addClass("fadeIn tour " + m.deviceType);
  8987. var e = p.tourInteraction.smallModal ? y.SMALL : y.LARGE;
  8988. if (!p.tourInteraction.smallModal) {
  8989. var t;
  8990. 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,
  8991. m.fill(R, A.TOUR_INTERACTION[t]),
  8992. M.addClass(t)
  8993. }
  8994. M.addClass(e)
  8995. } */
  8996. }
  8997. function u(e, t) {
  8998. if (t) {
  8999. var i = "keydown" === t.type
  9000. , n = t.which === f.SPACE || C.tourIsPlaying;
  9001. i && n || e || (O = !0),
  9002. C.atEndOfTour() && d(),
  9003. !C.tourIsPlaying && C.tourInProgress && (_.removeClass("fadeIn"), d(), t.which !== f.SPACE && stopTour()),
  9004. i && n && togglePlay() //空格键播放或暂停
  9005. }
  9006. }
  9007. function d() {
  9008. M.removeClass("fadeIn")
  9009. }
  9010. var p = (e("../util/browser"),
  9011. e("../settings"))
  9012. , f = e("../enum/Keys")
  9013. , g = e("../enum/Viewmode")
  9014. , m = (e("./helpManager"),
  9015. e("./populateModal"))
  9016. , v = e("../enum/DirectorEvents")
  9017. , A = e("../enum/HelpModalType")
  9018. , y = e("../enum/HelpModalSize")
  9019. , C = null
  9020. , I = null
  9021. , E = document.getElementById("pause-overlay")
  9022. , b = document.getElementById("player")
  9023. , w = document.getElementById("gui")
  9024. , _ = $("#pause-icon").eq(0)
  9025. , T = $("#play").eq(0)
  9026. , x = $("#playHead").eq(0)
  9027. , S = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  9028. , M = $("#interaction-modal").eq(0)
  9029. , R = $("#interaction-modal .interaction").toArray()
  9030. , P = ["touchstart", "mousedown", "pointerdown"]
  9031. , O = !1;
  9032. t.exports.init = n,
  9033. t.exports.play = play,
  9034. t.exports.pause = stopTour2,
  9035. t.exports.pauseWithoutCTA = stopTour,
  9036. t.exports.togglePlay = togglePlay,
  9037. t.exports.stopTour = l,
  9038. t.exports.dismissModal = d
  9039. }
  9040. , {
  9041. "../enum/DirectorEvents": 23,
  9042. "../enum/HelpModalSize": 27,
  9043. "../enum/HelpModalType": 28,
  9044. "../enum/Keys": 30,
  9045. "../enum/Viewmode": 51,
  9046. "../settings": 166,
  9047. "../util/browser": 182,
  9048. "./helpManager": 68,
  9049. "./populateModal": 75
  9050. }],
  9051. 85: [function(e, t, i) {
  9052. "use strict";
  9053. t.exports = Object.freeze({
  9054. OPENED: "vr.modal.opened",
  9055. LAUNCH: "vr.modal.launch",
  9056. CLOSED: "vr.modal.closed",
  9057. NEXT: "vr.modal.next",
  9058. PREV: "vr.modal.prev",
  9059. STORE: "vr.modal.store",
  9060. falseICECHOSEN: "vr.modal.device"
  9061. })
  9062. }
  9063. , {}],
  9064. 86: [function(e, t, i) {
  9065. "use strict";
  9066. function n(e, t, i) {
  9067. function n(e, t, n, r) {
  9068. function o() {
  9069. return p + "&m=" + t + "&display=" + e
  9070. }
  9071. function s() {
  9072. var e = "&utm_medium=" + (a.inIframe() ? "embed" : "direct")
  9073. , t = "&utm_source=" + u
  9074. , n = "&utm_showcase_session_id=" + i;
  9075. return e + t + n
  9076. }
  9077. function l() {
  9078. return d + "&sids=" + t + "&lsid=" + t + "&ln=" + encodeURIComponent(n) + "&ld=" + encodeURIComponent(r) + "&display=" + e
  9079. }
  9080. return a.valueFromHash("vrcoll", !1) ? l() + s() : o() + s()
  9081. }
  9082. function r(e, t, i, r) {
  9083. var o = "https://api.branch.io/v1/url"
  9084. , a = n(e, t, i, r)
  9085. , s = {
  9086. responseType: "json",
  9087. data: {
  9088. branch_key: h.appConfig.branch_key,
  9089. data: {
  9090. m: t,
  9091. full_url: a,
  9092. $desktop_url: m,
  9093. $og_app_id: "331853976762864119",
  9094. $og_title: i,
  9095. $og_description: r,
  9096. $og_image_url: location.origin + "/api/v1/player/models/" + t + "/thumb",
  9097. $canonical_url: window.location.href
  9098. }
  9099. }
  9100. };
  9101. c.post(o, s).done(function(t) {
  9102. f[e] = t.url
  9103. }).fail(function(t) {
  9104. f[e] = t
  9105. }
  9106. .bind(this, a))
  9107. }
  9108. function o(e, t, i) {
  9109. for (var r in s) {
  9110. var o = s[r]
  9111. , a = n(o, e, t, i);
  9112. f[o] = a
  9113. }
  9114. }
  9115. var u = a.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  9116. , d = g + "/vr/dlist/?ret=" + u
  9117. , p = g + "/vr/show/?ret=" + u
  9118. , m = "";
  9119. switch (e) {
  9120. case l.IOS:
  9121. r(s.CardboardIOS, t.sid, t.name, t.summary);
  9122. break;
  9123. default:
  9124. o(t.sid, t.name, t.summary)
  9125. }
  9126. }
  9127. function r(e) {
  9128. var t = f[e];
  9129. window.open(t, "_blank")
  9130. }
  9131. function o(e) {
  9132. var t = u[e];
  9133. window.open(t, "_blank")
  9134. }
  9135. var a = e("../../util/browser")
  9136. , s = e("../../enum/VRApps")
  9137. , l = e("../../enum/VRPlatforms")
  9138. , c = e("../../util/ajax")
  9139. , h = e("../../settings")
  9140. , u = {};
  9141. u[s.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  9142. u[s.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  9143. u[s.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=";
  9144. for (var d in s) {
  9145. var p = s[d];
  9146. u[p] += encodeURIComponent(document.referrer + "&display=" + p)
  9147. }
  9148. var f = {}
  9149. , g = function() {
  9150. var e = window.location.host;
  9151. return e.indexOf(".port.com") === -1 && e.indexOf("localhost") === -1 && (e = "my.port.com"),
  9152. "https://" + e
  9153. }();
  9154. t.exports.init = n,
  9155. t.exports.launch = r,
  9156. t.exports.launchStore = o
  9157. }
  9158. , {
  9159. "../../enum/VRApps": 46,
  9160. "../../enum/VRPlatforms": 49,
  9161. "../../settings": 166,
  9162. "../../util/ajax": 181,
  9163. "../../util/browser": 182
  9164. }],
  9165. 87: [function(e, t, i) {
  9166. "use strict";
  9167. function n(e) {
  9168. var t;
  9169. switch (e) {
  9170. case m.IOS:
  9171. return t = p.iosVersion(),
  9172. t.major > 9 || 9 === t.major && t.minor >= 1;
  9173. case m.Android:
  9174. return t = p.androidVersion(),
  9175. t.major > 4 || 4 === t.major && t.minor > 4 || 4 === t.major && 4 === t.minor && t.patch >= 4
  9176. }
  9177. return !1
  9178. }
  9179. function r(e, t) {
  9180. function i(e) {
  9181. K.emit(A.STORE, {
  9182. type: e
  9183. }),
  9184. f.launchStore(e)
  9185. }
  9186. function r(e) {
  9187. switch (e !== _.pageCount && (a(e),
  9188. N.text(e + 1 + " / " + _.pageCount)),
  9189. e) {
  9190. case _.Title:
  9191. O.css("display", "none"),
  9192. L.text(u[e]),
  9193. o(s);
  9194. break;
  9195. case _.Cardboard:
  9196. O.css("display", "block"),
  9197. L.text(u[e]),
  9198. M.filter(".cardboard").off(),
  9199. M.filter(".gearvr").off(),
  9200. c(e, s),
  9201. h(H, X, Z);
  9202. break;
  9203. case _.Gear:
  9204. L.text(u[e]),
  9205. c(e, s),
  9206. T.addClass("lastPage"),
  9207. h(G, X, Z);
  9208. break;
  9209. case _.pageCount:
  9210. T.removeClass("fadeIn"),
  9211. K.emit(A.CLOSED)
  9212. }
  9213. B.filter("[src='']").hide()
  9214. }
  9215. var s = function() {
  9216. return p.detectAndroid() ? p.detectAndroidMobile() && n(m.Android) ? (T.addClass("supported"),
  9217. w = ".show-supported",
  9218. m.Android) : (T.addClass("unsupported"),
  9219. w = ".show-unsupported",
  9220. m.UnsupportedAndroid) : p.detectIPhone() || p.detectIPod() ? (T.addClass("ios"),
  9221. w = ".show-ios",
  9222. _ = v.ios,
  9223. m.IOS) : (T.addClass("desktop"),
  9224. w = ".show-desktop",
  9225. m.Desktop)
  9226. }();
  9227. f.init(s, e, t),
  9228. s !== m.Desktop && T.addClass("mobile");
  9229. var l = function(e) {
  9230. K.emit(A.LAUNCH, {
  9231. vr_platform: s,
  9232. vr_app: e
  9233. }),
  9234. f.launch(e)
  9235. };
  9236. q.cardboardAndroid = l.bind(this, g.CardboardAndroid),
  9237. q.gear = l.bind(this, g.GearVR),
  9238. q.cardboardIOS = l.bind(this, g.CardboardIOS),
  9239. d(),
  9240. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  9241. $(w).show();
  9242. var u = [C.VR_LEARN_MORE_CAPS, C.VR_NEXT_CAPS, C.VR_GOT_IT_CAPS]
  9243. , y = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  9244. s === m.IOS && (u.splice(1, 1),
  9245. y.splice(1, 1)),
  9246. $("#vr").on("click", function(e) {
  9247. e.preventDefault();
  9248. player.FlyToMode("panorama", ()=>{
  9249. if(!window.vrEnabled) { // 开启VR
  9250. window.vrEnabled = true;
  9251. this.classList.add('active');
  9252. $('#gui div').not('#vrOff').addClass('vrHide');
  9253. $('#vrOffImg').css({'display':'inline-block'});
  9254. }else{
  9255. }
  9256. })
  9257. });
  9258. let exitVR = function(){
  9259. $('#gui div').not('#vrOff').removeClass('vrHide');
  9260. $('#vrOffImg').css({'display':'none'});
  9261. $('#player canvas').css({width:'', 'height': ''}); // 清楚vr下给canvas设置的宽高, 避免横竖屏切换的时候出现宽高错误的现象
  9262. $('#vr').removeClass('active'); // 清除vr按钮的激活样式
  9263. }
  9264. $('#vrOff').on('click', function(){
  9265. window.vrEnabled = false;
  9266. exitVR()
  9267. })
  9268. window.bus.addEventListener('exitWebXR',(e)=>{
  9269. exitVR()
  9270. })
  9271. var I = "https://my.port.com/vr/show/?m=" + e.sid;
  9272. s === m.IOS ? $(".cardboardLink").on("click", i.bind(this, g.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, g.CardboardAndroid)),
  9273. $(".gearLink").on("click", i.bind(this, g.GearVR)),
  9274. $("span.modelLink").text(I),
  9275. O.on("click", function(e) {
  9276. K.emit(A.PREV),
  9277. b--,
  9278. r(b)
  9279. }),
  9280. L.on("click", function(e) {
  9281. L.text();
  9282. K.emit(A.NEXT, {
  9283. nextAction: y[b]
  9284. }),
  9285. b++,
  9286. r(b)
  9287. }),
  9288. T.find(".close").on("click", K.dismiss)
  9289. }
  9290. function o(e) {
  9291. switch (e) {
  9292. case m.Android:
  9293. M.filter(".cardboard").off().on("click", q.cardboardAndroid),
  9294. M.filter(".gearvr").off().on("click", q.gear),
  9295. s(H, G, "logo-button", "same-line");
  9296. break;
  9297. case m.UnsupportedAndroid:
  9298. s("", z, "", "");
  9299. break;
  9300. case m.IOS:
  9301. M.filter(".cardboard").off().on("click", q.cardboardIOS),
  9302. s(H, "", "logo-button", "");
  9303. break;
  9304. case m.Desktop:
  9305. M.filter(".cardboard").off().on("click", l.bind(this, null, F, U)),
  9306. M.filter(".gearvr").off().on("click", l.bind(this, G, V, null)),
  9307. s(H, G, "logo-button", "same-line"),
  9308. Q.cardboard()
  9309. }
  9310. }
  9311. function a(e) {
  9312. $(".p1, .p2, .p3").hide(),
  9313. x.insertAfter(S),
  9314. T.removeClass("front-page"),
  9315. T.removeClass("details-page"),
  9316. T.removeClass("lastPage"),
  9317. M.removeClass("logo-button"),
  9318. M.removeClass("same-line"),
  9319. S.removeClass("headsetOptions"),
  9320. R.attr("src", ""),
  9321. R.filter(".second").removeClass("gear"),
  9322. R.css("display", "inline-block"),
  9323. R.off(),
  9324. P.filter(".second").css("display", ""),
  9325. D.css("display", "none"),
  9326. $(".p" + (e + 1) + w).show(),
  9327. R.filter(".third").insertBefore(P.filter(".third"))
  9328. }
  9329. function s(e, t, i, n) {
  9330. T.addClass("front-page"),
  9331. R.filter(".first").attr("src", e),
  9332. R.filter(".second").attr("src", t),
  9333. M.filter(".first").addClass(i),
  9334. M.filter(".second").addClass(i),
  9335. M.addClass(n),
  9336. ".show-desktop" === w && S.insertAfter(x)
  9337. }
  9338. function l(e, t, i) {
  9339. S.addClass("headsetOptions"),
  9340. M.off(),
  9341. R.filter(".second").attr("src", t),
  9342. D.css("display", "block"),
  9343. P.filter(".second").css("display", "none"),
  9344. D.on("click", function() {
  9345. a(_.Title),
  9346. o(m.Desktop)
  9347. }),
  9348. e && (K.emit(A.falseICECHOSEN, {
  9349. name: g.GearVR
  9350. }),
  9351. R.filter(".first").attr("src", e),
  9352. R.filter(".second").addClass("gear"),
  9353. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  9354. Q.gearvr()),
  9355. i && (K.emit(A.falseICECHOSEN, {
  9356. name: g.Cardboard
  9357. }),
  9358. R.filter(".third").attr("src", i),
  9359. R.filter(".third").show(),
  9360. R.filter(".third").insertAfter(R.filter(".second")),
  9361. R.filter(".third").addClass("link"),
  9362. R.filter(".second").addClass("link"),
  9363. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  9364. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid)),
  9365. Q.cardboard())
  9366. }
  9367. function c(e, t) {
  9368. switch (t) {
  9369. case m.IOS:
  9370. X = Y,
  9371. Z = j;
  9372. break;
  9373. case m.Desktop:
  9374. e === _.Cardboard ? (X = F,
  9375. Z = U,
  9376. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  9377. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid))) : (X = V,
  9378. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  9379. Z = "");
  9380. break;
  9381. default:
  9382. e === _.Cardboard ? (X = z,
  9383. Z = j) : (X = k,
  9384. Z = W)
  9385. }
  9386. }
  9387. function h(e, t, i) {
  9388. T.find(".inner").addClass("details-page"),
  9389. T.addClass("details-page"),
  9390. R.filter(".first").attr("src", e),
  9391. R.filter(".second").attr("src", t),
  9392. R.filter(".third").attr("src", i)
  9393. }
  9394. function u() {
  9395. T.hasClass("fadeIn") && (T.removeClass("fadeIn"),
  9396. K.emit(A.CLOSED))
  9397. }
  9398. function d() {
  9399. var e = p.aspectRatio() > 1 && p.isMobile();
  9400. T.toggleClass("landscape", e).toggleClass("portrait", !e),
  9401. T.toggleClass("tiny", $("#player").height() <= y.narrowLandscapeHeight),
  9402. T.toggleClass("tinier", $("#player").height() <= y.reallyNarrowLandscapeHeight)
  9403. }
  9404. var p = e("../../util/browser")
  9405. , f = e("./vrLink")
  9406. , g = e("../../enum/VRApps")
  9407. , m = e("../../enum/VRPlatforms")
  9408. , v = e("../../enum/VRPages")
  9409. , A = e("./vrEvent")
  9410. , y = (e("../../settings"),
  9411. e("../../constants"))
  9412. , C = e("../../localization/localize")
  9413. , I = e("../../util/common")
  9414. , E = e("events").EventEmitter
  9415. , b = 0
  9416. , w = null
  9417. , _ = v.standard
  9418. , T = $(".vr-popup")
  9419. , x = T.find(".vr-popup-body")
  9420. , S = T.find(".vr-images")
  9421. , M = T.find(".img-container")
  9422. , R = T.find(".vr-sm-image")
  9423. , P = M.find(".vr-img-caption")
  9424. , O = $(".vr-buttons").find(".prev-button")
  9425. , L = $(".vr-buttons").find(".next-button")
  9426. , D = S.find(".front-close")
  9427. , N = $(".vr-page")
  9428. , B = T.find("img")
  9429. , F = "images/apple-store.png"
  9430. , V = "images/badge-oculus.png"
  9431. , U = "images/badge-cardboard.png"
  9432. , k = "images/logo-samsung.png"
  9433. , H = "images/headset-cardboard.png"
  9434. , G = "images/headset-gearvr.png"
  9435. , z = "images/ico-android-robot.png"
  9436. , W = "images/ico-gearvr.png"
  9437. , j = "images/ico-vr.png"
  9438. , Y = "images/apple-logo-white.svg"
  9439. , X = null
  9440. , Z = null
  9441. , q = {}
  9442. , K = {
  9443. init: r,
  9444. dismiss: u,
  9445. isDeviceSupported: n
  9446. };
  9447. I.extendObject(K, E.prototype),
  9448. $(window).resize(d);
  9449. var Q = function() {
  9450. var e = P.filter(".first").find(".cardboard")
  9451. , t = P.filter(".first").find(".gearvr");
  9452. return {
  9453. cardboard: function() {
  9454. t.addClass("hidden"),
  9455. e.removeClass("hidden")
  9456. },
  9457. gearvr: function() {
  9458. e.addClass("hidden"),
  9459. t.removeClass("hidden")
  9460. }
  9461. }
  9462. }();
  9463. t.exports = K
  9464. }
  9465. , {
  9466. "../../constants": 8,
  9467. "../../enum/VRApps": 46,
  9468. "../../enum/VRPages": 48,
  9469. "../../enum/VRPlatforms": 49,
  9470. "../../localization/localize": 108,
  9471. "../../settings": 166,
  9472. "../../util/browser": 182,
  9473. "../../util/common": 185,
  9474. "./vrEvent": 85,
  9475. "./vrLink": 86,
  9476. events: 202
  9477. }],
  9478. 88: [function(e, t, i) {
  9479. "use strict";
  9480. t.exports = Object.freeze({
  9481. OPENED: "webvr.modal.opened",
  9482. SHOW_TERMS: "webvr.footer.show.terms"
  9483. })
  9484. }
  9485. , {}],
  9486. 89: [function(e, t, i) {
  9487. (function(i) {
  9488. "use strict";
  9489. function n(e, t, i, n) {
  9490. function r(e) {
  9491. e.preventDefault(),
  9492. a(e.currentTarget.id)
  9493. }
  9494. function a(e) {
  9495. ne[e](),
  9496. Object.keys(ne).map(function(t, i) {
  9497. $("#" + t).toggleClass("tabs-underlined", t === e)
  9498. })
  9499. }
  9500. y = i,
  9501. v = t,
  9502. w.init(E.Android, e, n),
  9503. m();
  9504. var l = new RegExp("daydream","i")
  9505. , c = l.test(y.displayName);
  9506. c ? (a("tabdaydream"),
  9507. B.filter(".device-headset-side").attr("src", H),
  9508. D.find(".title").text(x.localizeText("WEBVR_FOR_DAYDREAM"))) : (a("tabcardboard"),
  9509. B.filter(".device-headset-side").attr("src", Y),
  9510. D.find(".title").text(x.localizeText("WEBVR_FOR_CARDBOARD"))),
  9511. $("#vr").on("click", function(e) {
  9512. e.preventDefault(),
  9513. g("click_webvr_button"),
  9514. L.is(":hidden") && (ie.emit(_.OPENED),
  9515. o())
  9516. }),
  9517. $(".webvr-popup .close").on("click", function(e) {
  9518. e.preventDefault(),
  9519. D.hasClass("hidden") ? (g("webvr_help_close"),
  9520. p()) : s()
  9521. }),
  9522. $("#tabcardboard").on("click", r),
  9523. $("#tabdaydream").on("click", r),
  9524. $("#tabnative").on("click", r),
  9525. $(".webvr-popup .open-with-app").on("click", function(e) {
  9526. e.preventDefault(),
  9527. g("webvr_learn_more"),
  9528. a("tabnative"),
  9529. p()
  9530. }),
  9531. $(".webvr-popup .help").on("click", function(e) {
  9532. e.preventDefault(),
  9533. g(D.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  9534. p()
  9535. }),
  9536. $(".webvr-popup .terms").on("click", function(e) {
  9537. e.preventDefault(),
  9538. g("webvr_click_terms"),
  9539. s(),
  9540. ie.emit(_.SHOW_TERMS)
  9541. }),
  9542. F.on("click", function(e) {
  9543. e.preventDefault(),
  9544. g(ee),
  9545. window.open(J, "_blank")
  9546. }),
  9547. V.on("click", function(e) {
  9548. e.preventDefault(),
  9549. g("webvr_phone_link"),
  9550. window.open(te, "_blank")
  9551. }),
  9552. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  9553. e.preventDefault(),
  9554. g("webvr_cardboard_link"),
  9555. w.launch(b.CardboardAndroid)
  9556. }),
  9557. $(".webvr-popup .badge-oculus").on("click", function(e) {
  9558. e.preventDefault(),
  9559. g("webvr_oculus_link"),
  9560. w.launch(b.GearVR)
  9561. })
  9562. }
  9563. function r() {
  9564. function e() {
  9565. y.isPresenting || (f(),
  9566. window.removeEventListener("vrdisplaypresentchange", e))
  9567. }
  9568. R.info("Headset mounted"),
  9569. v.suspend();
  9570. var t = document.createElement("canvas");
  9571. for (t.getContext("webgl"),
  9572. t.className = "webvr-canvas",
  9573. document.bgColor = "#000",
  9574. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  9575. document.body.removeChild(document.body.firstChild);
  9576. document.body.appendChild(t),
  9577. g("webvr_enter_app"),
  9578. y.requestPresent([{
  9579. source: t,
  9580. predistorted: !0
  9581. }]).catch(function(t) {
  9582. R.error("Failed to present: " + t),
  9583. g("webvr_exit_calibrate"),
  9584. e()
  9585. }),
  9586. A.then(function() {
  9587. window.dispatchEvent(new Event("vrapp-start"))
  9588. }),
  9589. window.addEventListener("vrdisplaypresentchange", e)
  9590. }
  9591. function o() {
  9592. O.fadeOut(I.guiAnimationSpeed),
  9593. L.fadeIn(I.guiAnimationSpeed),
  9594. a()
  9595. }
  9596. function a() {
  9597. if (!A) {
  9598. var e = C.valueFromHash("webvr") || I.appConfig.webvr_version
  9599. , t = "https://static.port.com/webvr/" + e + "/js/main.js";
  9600. A = new Promise(function(e, i) {
  9601. var n = document.createElement("script");
  9602. n.type = "text/javascript",
  9603. n.src = t,
  9604. n.onload = e,
  9605. document.head.appendChild(n)
  9606. }
  9607. )
  9608. }
  9609. D.find(".enter-button").on("click", r)
  9610. }
  9611. function s() {
  9612. g("webvr_modal_close"),
  9613. D.find(".enter-button").off("click", r),
  9614. L.fadeOut(I.guiAnimationSpeed, function() {
  9615. D.toggleClass("hidden", !1),
  9616. N.toggleClass("hidden", !0),
  9617. C.exitFullscreen()
  9618. }),
  9619. O.fadeIn(I.guiAnimationSpeed)
  9620. }
  9621. function l() {
  9622. k.toggleClass("hidden", !1),
  9623. U.toggleClass("hidden", !0)
  9624. }
  9625. function c() {
  9626. k.toggleClass("hidden", !0),
  9627. U.toggleClass("hidden", !1)
  9628. }
  9629. function h() {
  9630. B.filter(".device-headset").attr("src", G),
  9631. B.filter(".device-phone").attr("src", z),
  9632. J = Z,
  9633. ee = K,
  9634. F.text(x.localizeText("WEBVR_DAYDREAM_VIEW")),
  9635. V.text(x.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9636. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9637. c()
  9638. }
  9639. function u() {
  9640. B.filter(".badge-cardboard").attr("src", j),
  9641. B.filter(".badge-oculus").attr("src", X),
  9642. l()
  9643. }
  9644. function d() {
  9645. B.filter(".device-headset").attr("src", Y),
  9646. B.filter(".device-phone").attr("src", W),
  9647. J = q,
  9648. ee = Q,
  9649. F.text(x.localizeText("VR_GOOGLE_CARDBOARD")),
  9650. V.text(x.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9651. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9652. c()
  9653. }
  9654. function p() {
  9655. D.toggleClass("hidden"),
  9656. N.toggleClass("hidden")
  9657. }
  9658. function f() {
  9659. R.info("exiting webVR"),
  9660. g("webvr_exit_app"),
  9661. window.location.search.indexOf("&qs=1") === -1 ? window.location = window.location + "&qs=1" : window.location = window.location
  9662. }
  9663. function g(e) {
  9664. var t = C.isLandscape() ? "landscape" : "portrait";
  9665. T.trackAlways("showcase_gui", {
  9666. gui_action: e,
  9667. orientation: t
  9668. })
  9669. }
  9670. function m() {
  9671. var e = C.isLandscape();
  9672. L.toggleClass("landscape", e).toggleClass("portrait", !e)
  9673. }
  9674. var v, A, y, C = e("../../util/browser"), I = e("../../settings"), E = (e("./../gui"),
  9675. e("../../enum/VRPlatforms")), b = e("../../enum/VRApps"), w = e("./../vr/vrLink"), _ = e("./WebVrEvent"), T = e("../../analytics"), x = (e("../../constants"),
  9676. 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 = {
  9677. init: n
  9678. }, ne = {
  9679. tabcardboard: d,
  9680. tabdaydream: h,
  9681. tabnative: u
  9682. };
  9683. S.extendObject(ie, P.prototype),
  9684. $(window).resize(m),
  9685. t.exports = ie
  9686. }
  9687. ).call(this, "/js/gui/webvr/webVRgui.js")
  9688. }
  9689. , {
  9690. "../../analytics": 4,
  9691. "../../constants": 8,
  9692. "../../enum/VRApps": 46,
  9693. "../../enum/VRPlatforms": 49,
  9694. "../../localization/localize": 108,
  9695. "../../settings": 166,
  9696. "../../util/browser": 182,
  9697. "../../util/common": 185,
  9698. "../../util/logger": 189,
  9699. "./../gui": 65,
  9700. "./../vr/vrLink": 86,
  9701. "./WebVrEvent": 88,
  9702. events: 202
  9703. }],
  9704. 90: [function(e, t, i) {
  9705. "use strict";
  9706. function n(e, t, i, n, o) {
  9707. n || 0 === n ? this.floorId = n : this.floorId = -1,
  9708. this.roomId = o || "",
  9709. this.labelId = e,
  9710. this.position = (new r.Vector3).copy(t),
  9711. this.text = i
  9712. }
  9713. var r = e("three")
  9714. , o = e("../util/browser");
  9715. n.prototype.build = function() {
  9716. var e = window.document.createElement("div");
  9717. o.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9718. var t = window.document.createElement("div");
  9719. t.setAttribute("class", "gui-floorplan-label-text");
  9720. var i = window.document.createTextNode(this.text);
  9721. t.appendChild(i),
  9722. e.appendChild(t),
  9723. window.document.body.appendChild(e),
  9724. this.labelGui = e,
  9725. this.textBlock = t,
  9726. $(this.labelGui).hide();
  9727. var n = window.getComputedStyle(this.labelGui);
  9728. this.initialTransform = n.transform || n.webkitTransform
  9729. }
  9730. ,
  9731. t.exports = n
  9732. }
  9733. , {
  9734. "../util/browser": 182,
  9735. three: 217
  9736. }],
  9737. 91: [function(e, t, i) {
  9738. "use strict";
  9739. function n() {
  9740. this.player = null,
  9741. this.modelManager = null,
  9742. this.container = null
  9743. }
  9744. var r = e("three")
  9745. , o = (e("../util/common"),
  9746. e("../enum/PlayerEvents"))
  9747. , a = (e("../enum/DirectorEvents"),
  9748. e("../enum/ModelManagerEvents"))
  9749. , s = e("../settings")
  9750. , l = e("../enum/Viewmode")
  9751. , c = (e("../enum/WarpStyle"),
  9752. e("../util/transitions"),
  9753. e("../util/lerp"),
  9754. e("../util/browser"));
  9755. //场景初始化
  9756. n.prototype.init = function(e, t, i) {
  9757. this.player = e,
  9758. this.modelManager = t,
  9759. this.container = i,
  9760. this.updateModel(),
  9761. this.bindEvents()
  9762. }
  9763. ,
  9764. n.prototype.bindEvents = function() {
  9765. this.modelManager.on(a.ActiveModelChanged, this.updateModel.bind(this)),
  9766. this.player.on(o.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9767. this.player.on(o.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9768. this.player.on(o.StartInside, this.handleStartInside.bind(this)),
  9769. this.player.on(o.StartOutside, this.handleStartOutside.bind(this))
  9770. }
  9771. ,
  9772. n.prototype.updateModel = function() {
  9773. this.model = this.modelManager.getActiveModel()
  9774. }
  9775. ,
  9776. n.prototype.handlePlayerViewChanged = function() {
  9777. this.updateLabelVisibility(),
  9778. this.updateLabelDisplay()
  9779. }
  9780. ,
  9781. n.prototype.getLabelsForFloor = function(e, t) {
  9782. return t = t || [],
  9783. t.length = 0,
  9784. this.model.labels.forEach(function(i) {
  9785. this.labelVisibleForFloor(i, e) && t.push(i)
  9786. }
  9787. .bind(this)),
  9788. t
  9789. }
  9790. ,
  9791. n.prototype.getLabelsForCurrentFloor = function(e) {
  9792. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9793. }
  9794. ,
  9795. n.prototype.labelVisibleForFloor = function(e, t) {
  9796. var i = c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.mobile || !c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.desktop;
  9797. if (!this.model.showingLabels || !e.labelGui || !i)
  9798. return !1;
  9799. var n = e.floorId === this.model.floors.size() - 1;
  9800. return this.model.allFloorsVisible ? n : e.floorId === t
  9801. }
  9802. ,
  9803. n.prototype.updateLabelVisibility = function(e) {
  9804. this.model.labels.forEach(function(e) {
  9805. 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)
  9806. }
  9807. .bind(this))
  9808. }
  9809. ,
  9810. n.prototype.showAllLabels = function(e, t) {
  9811. this.model.labels.forEach(function(i) {
  9812. this.showLabel(i, e, t)
  9813. }
  9814. .bind(this))
  9815. }
  9816. ,
  9817. n.prototype.hideAllLabels = function(e, t) {
  9818. this.model.labels.forEach(function(i) {
  9819. this.hideLabel(i, e, t)
  9820. }
  9821. .bind(this))
  9822. }
  9823. ,
  9824. n.prototype.showLabel = function(e, t, i) {
  9825. this.model.showingLabels && (e.visible || (e.visible = !0,
  9826. e.labelGui.style.display = "block",
  9827. e.labelGui.style.opacity = 0,
  9828. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9829. }
  9830. ,
  9831. n.prototype.hideLabel = function(e, t, i) {
  9832. e.visible && (e.visible = !1,
  9833. c.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9834. }
  9835. ,
  9836. n.prototype.supportedMode = function() {
  9837. return this.player.mode === l.FLOORPLAN
  9838. }
  9839. ,
  9840. n.prototype.updateLabelDisplay = function() {
  9841. var e = (new r.Vector3,
  9842. new r.Vector3,
  9843. []);
  9844. return function() {
  9845. var t = this.player.getLabelScaleFactor()
  9846. , i = .6
  9847. , n = 1.2
  9848. , r = (1 - t) * n + i
  9849. , o = c.isMobile() ? s.labels.zoomTruncateThreshhold.mobile : s.labels.zoomTruncateThreshhold.desktop;
  9850. this.getLabelsForCurrentFloor(e);
  9851. for (var a = 0; a < e.length; a++) {
  9852. var l = e[a];
  9853. this.supportedMode() && l.labelGui && (this.updateProjectedGuiElement(l.labelGui, l.textBlock, l.position, r, r),
  9854. 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)
  9855. }
  9856. }
  9857. }(),
  9858. n.prototype.updateProjectedGuiElement = function() {
  9859. var e = new r.Vector3;
  9860. new r.Vector3;
  9861. return function(t, i, n, r, o) {
  9862. i.style.fontSize = 100 * o + "%";
  9863. var a = $("#player").width()
  9864. , s = $("#player").height()
  9865. , l = .5 * a
  9866. , c = .5 * s;
  9867. e.copy(n),
  9868. e.project(this.player.camera);
  9869. var h = e.x * l + l
  9870. , u = -(e.y * c) + c;
  9871. h -= t.offsetWidth / 2,
  9872. u -= t.offsetHeight / 2,
  9873. t.style.left = h + "px",
  9874. t.style.top = u + "px"
  9875. }
  9876. }(),
  9877. n.prototype.handleStartInside = function(e) {
  9878. this.updateLabelVisibility()
  9879. }
  9880. ,
  9881. n.prototype.handleStartOutside = function() {
  9882. this.updateLabelVisibility()
  9883. }
  9884. ,
  9885. t.exports = n
  9886. }
  9887. , {
  9888. "../enum/DirectorEvents": 23,
  9889. "../enum/ModelManagerEvents": 33,
  9890. "../enum/PlayerEvents": 40,
  9891. "../enum/Viewmode": 51,
  9892. "../enum/WarpStyle": 52,
  9893. "../settings": 166,
  9894. "../util/browser": 182,
  9895. "../util/common": 185,
  9896. "../util/lerp": 188,
  9897. "../util/transitions": 195,
  9898. three: 217
  9899. }],
  9900. 92: [function(e, t, i) {
  9901. "use strict";
  9902. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9903. if (null == this)
  9904. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9905. if ("function" != typeof e)
  9906. throw new TypeError("predicate must be a function");
  9907. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9908. if (t = i[o],
  9909. e.call(r, t, o, i))
  9910. return o;
  9911. return -1
  9912. }
  9913. ),
  9914. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9915. value: function(e) {
  9916. if (null == this)
  9917. throw new TypeError('"this" is null or not defined');
  9918. var t = Object(this)
  9919. , i = t.length >>> 0;
  9920. if ("function" != typeof e)
  9921. throw new TypeError("predicate must be a function");
  9922. for (var n = arguments[1], r = 0; r < i; ) {
  9923. var o = t[r];
  9924. if (e.call(n, o, r, t))
  9925. return o;
  9926. r++
  9927. }
  9928. }
  9929. })
  9930. }
  9931. , {}],
  9932. 93: [function(e, t, i) {
  9933. "use strict";
  9934. var n = n || {};
  9935. t.exports = n,
  9936. n.gui = n.gui || {},
  9937. n.utils = n.utils || {},
  9938. n.controllers = n.controllers || {},
  9939. n.dom = n.dom || {},
  9940. n.color = n.color || {},
  9941. n.utils.css = function() {
  9942. return {
  9943. load: function(e, t) {
  9944. t = t || document;
  9945. var i = t.createElement("link");
  9946. i.type = "text/css",
  9947. i.rel = "stylesheet",
  9948. i.href = e,
  9949. t.getElementsByTagName("head")[0].appendChild(i)
  9950. },
  9951. inject: function(e, t) {
  9952. t = t || document;
  9953. var i = document.createElement("style");
  9954. i.type = "text/css",
  9955. i.innerHTML = e,
  9956. t.getElementsByTagName("head")[0].appendChild(i)
  9957. }
  9958. }
  9959. }(),
  9960. n.utils.common = function() {
  9961. var e = Array.prototype.forEach
  9962. , t = Array.prototype.slice;
  9963. return {
  9964. BREAK: {},
  9965. extend: function(e) {
  9966. return this.each(t.call(arguments, 1), function(t) {
  9967. for (var i in t)
  9968. this.isUndefined(t[i]) || (e[i] = t[i])
  9969. }, this),
  9970. e
  9971. },
  9972. defaults: function(e) {
  9973. return this.each(t.call(arguments, 1), function(t) {
  9974. for (var i in t)
  9975. this.isUndefined(e[i]) && (e[i] = t[i])
  9976. }, this),
  9977. e
  9978. },
  9979. compose: function() {
  9980. var e = t.call(arguments);
  9981. return function() {
  9982. for (var i = t.call(arguments), n = e.length - 1; n >= 0; n--)
  9983. i = [e[n].apply(this, i)];
  9984. return i[0]
  9985. }
  9986. },
  9987. each: function(t, i, n) {
  9988. if (t)
  9989. if (e && t.forEach && t.forEach === e)
  9990. t.forEach(i, n);
  9991. else if (t.length === t.length + 0) {
  9992. for (var r = 0, o = t.length; r < o; r++)
  9993. if (r in t && i.call(n, t[r], r) === this.BREAK)
  9994. return
  9995. } else
  9996. for (var r in t)
  9997. if (i.call(n, t[r], r) === this.BREAK)
  9998. return
  9999. },
  10000. defer: function(e) {
  10001. setTimeout(e, 0)
  10002. },
  10003. toArray: function(e) {
  10004. return e.toArray ? e.toArray() : t.call(e)
  10005. },
  10006. isUndefined: function(e) {
  10007. return void 0 === e
  10008. },
  10009. isNull: function(e) {
  10010. return null === e
  10011. },
  10012. isNaN: function(e) {
  10013. return e !== e
  10014. },
  10015. isArray: Array.isArray || function(e) {
  10016. return e.constructor === Array
  10017. }
  10018. ,
  10019. isObject: function(e) {
  10020. return e === Object(e)
  10021. },
  10022. isNumber: function(e) {
  10023. return e === e + 0
  10024. },
  10025. isString: function(e) {
  10026. return e === e + ""
  10027. },
  10028. isBoolean: function(e) {
  10029. return e === !1 || e === !0
  10030. },
  10031. isFunction: function(e) {
  10032. return "[object Function]" === Object.prototype.toString.call(e)
  10033. }
  10034. }
  10035. }(),
  10036. n.controllers.Controller = function(e) {
  10037. var t = function(e, t) {
  10038. this.initialValue = e[t],
  10039. this.domElement = document.createElement("div"),
  10040. this.object = e,
  10041. this.property = t,
  10042. this.__onChange = void 0,
  10043. this.__onFinishChange = void 0
  10044. };
  10045. return e.extend(t.prototype, {
  10046. onChange: function(e) {
  10047. return this.__onChange = e,
  10048. this
  10049. },
  10050. onFinishChange: function(e) {
  10051. return this.__onFinishChange = e,
  10052. this
  10053. },
  10054. setValue: function(e) {
  10055. return this.object[this.property] = e,
  10056. this.__onChange && this.__onChange.call(this, e),
  10057. this.updateDisplay(),
  10058. this
  10059. },
  10060. getValue: function() {
  10061. return this.object[this.property]
  10062. },
  10063. updateDisplay: function() {
  10064. return this
  10065. },
  10066. isModified: function() {
  10067. return this.initialValue !== this.getValue()
  10068. }
  10069. }),
  10070. t
  10071. }(n.utils.common),
  10072. n.dom.dom = function(e) {
  10073. function t(t) {
  10074. if ("0" === t || e.isUndefined(t))
  10075. return 0;
  10076. var i = t.match(r);
  10077. return e.isNull(i) ? 0 : parseFloat(i[1])
  10078. }
  10079. var i = {
  10080. HTMLEvents: ["change"],
  10081. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  10082. KeyboardEvents: ["keydown"]
  10083. }
  10084. , n = {};
  10085. e.each(i, function(t, i) {
  10086. e.each(t, function(e) {
  10087. n[e] = i
  10088. })
  10089. });
  10090. var r = /(\d+(\.\d+)?)px/
  10091. , o = {
  10092. makeSelectable: function(e, t) {
  10093. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  10094. return !1
  10095. }
  10096. : function() {}
  10097. ,
  10098. e.style.MozUserSelect = t ? "auto" : "none",
  10099. e.style.KhtmlUserSelect = t ? "auto" : "none",
  10100. e.unselectable = t ? "on" : "off")
  10101. },
  10102. makeFullscreen: function(t, i, n) {
  10103. e.isUndefined(i) && (i = !0),
  10104. e.isUndefined(n) && (n = !0),
  10105. t.style.position = "absolute",
  10106. i && (t.style.left = 0,
  10107. t.style.right = 0),
  10108. n && (t.style.top = 0,
  10109. t.style.bottom = 0)
  10110. },
  10111. fakeEvent: function(t, i, r, o) {
  10112. r = r || {};
  10113. var a = n[i];
  10114. if (!a)
  10115. throw new Error("Event type " + i + " not supported.");
  10116. var s = document.createEvent(a);
  10117. switch (a) {
  10118. case "MouseEvents":
  10119. var l = r.x || r.clientX || 0
  10120. , c = r.y || r.clientY || 0;
  10121. s.initMouseEvent(i, r.bubbles || !1, r.cancelable || !0, window, r.clickCount || 1, 0, 0, l, c, !1, !1, !1, !1, 0, null);
  10122. break;
  10123. case "KeyboardEvents":
  10124. var h = s.initKeyboardEvent || s.initKeyEvent;
  10125. e.defaults(r, {
  10126. cancelable: !0,
  10127. ctrlKey: !1,
  10128. altKey: !1,
  10129. shiftKey: !1,
  10130. metaKey: !1,
  10131. keyCode: void 0,
  10132. charCode: void 0
  10133. }),
  10134. h(i, r.bubbles || !1, r.cancelable, window, r.ctrlKey, r.altKey, r.shiftKey, r.metaKey, r.keyCode, r.charCode);
  10135. break;
  10136. default:
  10137. s.initEvent(i, r.bubbles || !1, r.cancelable || !0)
  10138. }
  10139. e.defaults(s, o),
  10140. t.dispatchEvent(s)
  10141. },
  10142. bind: function(e, t, i, n) {
  10143. return n = n || !1,
  10144. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  10145. o
  10146. },
  10147. unbind: function(e, t, i, n) {
  10148. return n = n || !1,
  10149. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  10150. o
  10151. },
  10152. addClass: function(e, t) {
  10153. if (void 0 === e.className)
  10154. e.className = t;
  10155. else if (e.className !== t) {
  10156. var i = e.className.split(/ +/);
  10157. i.indexOf(t) == -1 && (i.push(t),
  10158. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  10159. }
  10160. return o
  10161. },
  10162. removeClass: function(e, t) {
  10163. if (t)
  10164. if (void 0 === e.className)
  10165. ;
  10166. else if (e.className === t)
  10167. e.removeAttribute("class");
  10168. else {
  10169. var i = e.className.split(/ +/)
  10170. , n = i.indexOf(t);
  10171. n != -1 && (i.splice(n, 1),
  10172. e.className = i.join(" "))
  10173. }
  10174. else
  10175. e.className = void 0;
  10176. return o
  10177. },
  10178. hasClass: function(e, t) {
  10179. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  10180. },
  10181. getWidth: function(e) {
  10182. var i = getComputedStyle(e);
  10183. return t(i["border-left-width"]) + t(i["border-right-width"]) + t(i["padding-left"]) + t(i["padding-right"]) + t(i.width)
  10184. },
  10185. getHeight: function(e) {
  10186. var i = getComputedStyle(e);
  10187. return t(i["border-top-width"]) + t(i["border-bottom-width"]) + t(i["padding-top"]) + t(i["padding-bottom"]) + t(i.height)
  10188. },
  10189. getOffset: function(e) {
  10190. var t = {
  10191. left: 0,
  10192. top: 0
  10193. };
  10194. if (e.offsetParent)
  10195. do
  10196. t.left += e.offsetLeft,
  10197. t.top += e.offsetTop;
  10198. while (e = e.offsetParent);return t
  10199. },
  10200. isActive: function(e) {
  10201. return e === document.activeElement && (e.type || e.href)
  10202. }
  10203. };
  10204. return o
  10205. }(n.utils.common),
  10206. n.controllers.OptionController = function(e, t, i) {
  10207. var n = function(e, r, o) {
  10208. n.superclass.call(this, e, r);
  10209. var a = this;
  10210. if (this.__select = document.createElement("select"),
  10211. i.isArray(o)) {
  10212. var s = {};
  10213. i.each(o, function(e) {
  10214. s[e] = e
  10215. }),
  10216. o = s
  10217. }
  10218. i.each(o, function(e, t) {
  10219. var i = document.createElement("option");
  10220. i.innerHTML = t,
  10221. i.setAttribute("value", e),
  10222. a.__select.appendChild(i)
  10223. }),
  10224. this.updateDisplay(),
  10225. t.bind(this.__select, "change", function() {
  10226. var e = this.options[this.selectedIndex].value;
  10227. a.setValue(e)
  10228. }),
  10229. this.domElement.appendChild(this.__select)
  10230. };
  10231. return n.superclass = e,
  10232. i.extend(n.prototype, e.prototype, {
  10233. setValue: function(e) {
  10234. var t = n.superclass.prototype.setValue.call(this, e);
  10235. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10236. t
  10237. },
  10238. updateDisplay: function() {
  10239. return this.__select.value = this.getValue(),
  10240. n.superclass.prototype.updateDisplay.call(this)
  10241. }
  10242. }),
  10243. n
  10244. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10245. n.controllers.NumberController = function(e, t) {
  10246. function i(e) {
  10247. return e = e.toString(),
  10248. e.indexOf(".") > -1 ? e.length - e.indexOf(".") - 1 : 0
  10249. }
  10250. var n = function(e, r, o) {
  10251. n.superclass.call(this, e, r),
  10252. o = o || {},
  10253. this.__min = o.min,
  10254. this.__max = o.max,
  10255. this.__step = o.step,
  10256. 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,
  10257. this.__precision = i(this.__impliedStep)
  10258. };
  10259. return n.superclass = e,
  10260. t.extend(n.prototype, e.prototype, {
  10261. setValue: function(e) {
  10262. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  10263. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  10264. n.superclass.prototype.setValue.call(this, e)
  10265. },
  10266. min: function(e) {
  10267. return this.__min = e,
  10268. this
  10269. },
  10270. max: function(e) {
  10271. return this.__max = e,
  10272. this
  10273. },
  10274. step: function(e) {
  10275. return this.__step = e,
  10276. this.__impliedStep = e,
  10277. this.__precision = i(e),
  10278. this
  10279. }
  10280. }),
  10281. n
  10282. }(n.controllers.Controller, n.utils.common),
  10283. n.controllers.NumberControllerBox = function(e, t, i) {
  10284. function n(e, t) {
  10285. var i = Math.pow(10, t);
  10286. return Math.round(e * i) / i
  10287. }
  10288. var r = function(e, n, o) {
  10289. function a() {
  10290. var e = parseFloat(d.__input.value);
  10291. i.isNaN(e) || d.setValue(e)
  10292. }
  10293. function s() {
  10294. a(),
  10295. d.__onFinishChange && d.__onFinishChange.call(d, d.getValue())
  10296. }
  10297. function l(e) {
  10298. t.bind(window, "mousemove", c),
  10299. t.bind(window, "mouseup", h),
  10300. u = e.clientY
  10301. }
  10302. function c(e) {
  10303. var t = u - e.clientY;
  10304. d.setValue(d.getValue() + t * d.__impliedStep),
  10305. u = e.clientY
  10306. }
  10307. function h() {
  10308. t.unbind(window, "mousemove", c),
  10309. t.unbind(window, "mouseup", h)
  10310. }
  10311. this.__truncationSuspended = !1,
  10312. r.superclass.call(this, e, n, o);
  10313. var u, d = this;
  10314. this.__input = document.createElement("input"),
  10315. this.__input.setAttribute("type", "text"),
  10316. t.bind(this.__input, "change", a),
  10317. t.bind(this.__input, "blur", s),
  10318. t.bind(this.__input, "mousedown", l),
  10319. t.bind(this.__input, "keydown", function(e) {
  10320. 13 === e.keyCode && (d.__truncationSuspended = !0,
  10321. this.blur(),
  10322. d.__truncationSuspended = !1)
  10323. }),
  10324. this.updateDisplay(),
  10325. this.domElement.appendChild(this.__input)
  10326. };
  10327. return r.superclass = e,
  10328. i.extend(r.prototype, e.prototype, {
  10329. updateDisplay: function() {
  10330. return this.__input.value = this.__truncationSuspended ? this.getValue() : n(this.getValue(), this.__precision),
  10331. r.superclass.prototype.updateDisplay.call(this)
  10332. }
  10333. }),
  10334. r
  10335. }(n.controllers.NumberController, n.dom.dom, n.utils.common),
  10336. n.controllers.NumberControllerSlider = function(e, t, i, n, r) {
  10337. function o(e, t, i, n, r) {
  10338. return n + (r - n) * ((e - t) / (i - t))
  10339. }
  10340. var a = function(e, i, n, r, s) {
  10341. function l(e) {
  10342. t.bind(window, "mousemove", c),
  10343. t.bind(window, "mouseup", h),
  10344. c(e)
  10345. }
  10346. function c(e) {
  10347. e.preventDefault();
  10348. var i = t.getOffset(u.__background)
  10349. , n = t.getWidth(u.__background);
  10350. return u.setValue(o(e.clientX, i.left, i.left + n, u.__min, u.__max)),
  10351. !1
  10352. }
  10353. function h() {
  10354. t.unbind(window, "mousemove", c),
  10355. t.unbind(window, "mouseup", h),
  10356. u.__onFinishChange && u.__onFinishChange.call(u, u.getValue())
  10357. }
  10358. a.superclass.call(this, e, i, {
  10359. min: n,
  10360. max: r,
  10361. step: s
  10362. });
  10363. var u = this;
  10364. this.__background = document.createElement("div"),
  10365. this.__foreground = document.createElement("div"),
  10366. t.bind(this.__background, "mousedown", l),
  10367. t.addClass(this.__background, "slider"),
  10368. t.addClass(this.__foreground, "slider-fg"),
  10369. this.updateDisplay(),
  10370. this.__background.appendChild(this.__foreground),
  10371. this.domElement.appendChild(this.__background)
  10372. };
  10373. return a.superclass = e,
  10374. a.useDefaultStyles = function() {
  10375. i.inject(r)
  10376. }
  10377. ,
  10378. n.extend(a.prototype, e.prototype, {
  10379. updateDisplay: function() {
  10380. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  10381. return this.__foreground.style.width = 100 * e + "%",
  10382. a.superclass.prototype.updateDisplay.call(this)
  10383. }
  10384. }),
  10385. a
  10386. }(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}"),
  10387. n.controllers.FunctionController = function(e, t, i) {
  10388. var n = function(e, i, r) {
  10389. n.superclass.call(this, e, i);
  10390. var o = this;
  10391. this.__button = document.createElement("div"),
  10392. this.__button.innerHTML = void 0 === r ? "Fire" : r,
  10393. t.bind(this.__button, "click", function(e) {
  10394. return e.preventDefault(),
  10395. o.fire(),
  10396. !1
  10397. }),
  10398. t.addClass(this.__button, "button"),
  10399. this.domElement.appendChild(this.__button)
  10400. };
  10401. return n.superclass = e,
  10402. i.extend(n.prototype, e.prototype, {
  10403. fire: function() {
  10404. this.__onChange && this.__onChange.call(this),
  10405. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10406. this.getValue().call(this.object)
  10407. }
  10408. }),
  10409. n
  10410. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10411. n.controllers.BooleanController = function(e, t, i) {
  10412. var n = function(e, i) {
  10413. function r() {
  10414. o.setValue(!o.__prev)
  10415. }
  10416. n.superclass.call(this, e, i);
  10417. var o = this;
  10418. this.__prev = this.getValue(),
  10419. this.__checkbox = document.createElement("input"),
  10420. this.__checkbox.setAttribute("type", "checkbox"),
  10421. t.bind(this.__checkbox, "change", r, !1),
  10422. this.domElement.appendChild(this.__checkbox),
  10423. this.updateDisplay()
  10424. };
  10425. return n.superclass = e,
  10426. i.extend(n.prototype, e.prototype, {
  10427. setValue: function(e) {
  10428. var t = n.superclass.prototype.setValue.call(this, e);
  10429. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10430. this.__prev = this.getValue(),
  10431. t
  10432. },
  10433. updateDisplay: function() {
  10434. return this.getValue() === !0 ? (this.__checkbox.setAttribute("checked", "checked"),
  10435. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  10436. n.superclass.prototype.updateDisplay.call(this)
  10437. }
  10438. }),
  10439. n
  10440. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10441. n.color.toString = function(e) {
  10442. return function(t) {
  10443. if (1 == t.a || e.isUndefined(t.a)) {
  10444. for (var i = t.hex.toString(16); i.length < 6; )
  10445. i = "0" + i;
  10446. return "#" + i
  10447. }
  10448. return "rgba(" + Math.round(t.r) + "," + Math.round(t.g) + "," + Math.round(t.b) + "," + t.a + ")"
  10449. }
  10450. }(n.utils.common),
  10451. n.color.interpret = function(e, t) {
  10452. var i, n, r = function() {
  10453. n = !1;
  10454. var e = arguments.length > 1 ? t.toArray(arguments) : arguments[0];
  10455. return t.each(o, function(r) {
  10456. if (r.litmus(e))
  10457. return t.each(r.conversions, function(r, o) {
  10458. if (i = r.read(e),
  10459. n === !1 && i !== !1)
  10460. return n = i,
  10461. i.conversionName = o,
  10462. i.conversion = r,
  10463. t.BREAK
  10464. }),
  10465. t.BREAK
  10466. }),
  10467. n
  10468. }, o = [{
  10469. litmus: t.isString,
  10470. conversions: {
  10471. THREE_CHAR_HEX: {
  10472. read: function(e) {
  10473. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  10474. return null !== t && {
  10475. space: "HEX",
  10476. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  10477. }
  10478. },
  10479. write: e
  10480. },
  10481. SIX_CHAR_HEX: {
  10482. read: function(e) {
  10483. var t = e.match(/^#([A-F0-9]{6})$/i);
  10484. return null !== t && {
  10485. space: "HEX",
  10486. hex: parseInt("0x" + t[1].toString())
  10487. }
  10488. },
  10489. write: e
  10490. },
  10491. CSS_RGB: {
  10492. read: function(e) {
  10493. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  10494. return null !== t && {
  10495. space: "RGB",
  10496. r: parseFloat(t[1]),
  10497. g: parseFloat(t[2]),
  10498. b: parseFloat(t[3])
  10499. }
  10500. },
  10501. write: e
  10502. },
  10503. CSS_RGBA: {
  10504. read: function(e) {
  10505. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  10506. return null !== t && {
  10507. space: "RGB",
  10508. r: parseFloat(t[1]),
  10509. g: parseFloat(t[2]),
  10510. b: parseFloat(t[3]),
  10511. a: parseFloat(t[4])
  10512. }
  10513. },
  10514. write: e
  10515. }
  10516. }
  10517. }, {
  10518. litmus: t.isNumber,
  10519. conversions: {
  10520. HEX: {
  10521. read: function(e) {
  10522. return {
  10523. space: "HEX",
  10524. hex: e,
  10525. conversionName: "HEX"
  10526. }
  10527. },
  10528. write: function(e) {
  10529. return e.hex
  10530. }
  10531. }
  10532. }
  10533. }, {
  10534. litmus: t.isArray,
  10535. conversions: {
  10536. RGB_ARRAY: {
  10537. read: function(e) {
  10538. return 3 == e.length && {
  10539. space: "RGB",
  10540. r: e[0],
  10541. g: e[1],
  10542. b: e[2]
  10543. }
  10544. },
  10545. write: function(e) {
  10546. return [e.r, e.g, e.b]
  10547. }
  10548. },
  10549. RGBA_ARRAY: {
  10550. read: function(e) {
  10551. return 4 == e.length && {
  10552. space: "RGB",
  10553. r: e[0],
  10554. g: e[1],
  10555. b: e[2],
  10556. a: e[3]
  10557. }
  10558. },
  10559. write: function(e) {
  10560. return [e.r, e.g, e.b, e.a]
  10561. }
  10562. }
  10563. }
  10564. }, {
  10565. litmus: t.isObject,
  10566. conversions: {
  10567. RGBA_OBJ: {
  10568. read: function(e) {
  10569. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b) && t.isNumber(e.a)) && {
  10570. space: "RGB",
  10571. r: e.r,
  10572. g: e.g,
  10573. b: e.b,
  10574. a: e.a
  10575. }
  10576. },
  10577. write: function(e) {
  10578. return {
  10579. r: e.r,
  10580. g: e.g,
  10581. b: e.b,
  10582. a: e.a
  10583. }
  10584. }
  10585. },
  10586. RGB_OBJ: {
  10587. read: function(e) {
  10588. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b)) && {
  10589. space: "RGB",
  10590. r: e.r,
  10591. g: e.g,
  10592. b: e.b
  10593. }
  10594. },
  10595. write: function(e) {
  10596. return {
  10597. r: e.r,
  10598. g: e.g,
  10599. b: e.b
  10600. }
  10601. }
  10602. },
  10603. HSVA_OBJ: {
  10604. read: function(e) {
  10605. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v) && t.isNumber(e.a)) && {
  10606. space: "HSV",
  10607. h: e.h,
  10608. s: e.s,
  10609. v: e.v,
  10610. a: e.a
  10611. }
  10612. },
  10613. write: function(e) {
  10614. return {
  10615. h: e.h,
  10616. s: e.s,
  10617. v: e.v,
  10618. a: e.a
  10619. }
  10620. }
  10621. },
  10622. HSV_OBJ: {
  10623. read: function(e) {
  10624. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v)) && {
  10625. space: "HSV",
  10626. h: e.h,
  10627. s: e.s,
  10628. v: e.v
  10629. }
  10630. },
  10631. write: function(e) {
  10632. return {
  10633. h: e.h,
  10634. s: e.s,
  10635. v: e.v
  10636. }
  10637. }
  10638. }
  10639. }
  10640. }];
  10641. return r
  10642. }(n.color.toString, n.utils.common),
  10643. n.GUI = n.gui.GUI = function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f) {
  10644. function g(e, t, i, o) {
  10645. if (void 0 === t[i])
  10646. throw new Error("Object " + t + ' has no property "' + i + '"');
  10647. var a;
  10648. if (o.color)
  10649. a = new h(t,i);
  10650. else {
  10651. var s = [t, i].concat(o.factoryArgs);
  10652. a = n.apply(e, s)
  10653. }
  10654. o.before instanceof r && (o.before = o.before.__li),
  10655. A(e, a),
  10656. p.addClass(a.domElement, "c");
  10657. var l = document.createElement("span");
  10658. p.addClass(l, "property-name"),
  10659. l.innerHTML = a.property;
  10660. var c = document.createElement("div");
  10661. c.appendChild(l),
  10662. c.appendChild(a.domElement);
  10663. var u = m(e, c, o.before);
  10664. return p.addClass(u, V.CLASS_CONTROLLER_ROW),
  10665. p.addClass(u, typeof a.getValue()),
  10666. v(e, u, a),
  10667. e.__controllers.push(a),
  10668. a
  10669. }
  10670. function m(e, t, i) {
  10671. var n = document.createElement("li");
  10672. return t && n.appendChild(t),
  10673. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10674. e.onResize(),
  10675. n
  10676. }
  10677. function v(e, t, i) {
  10678. if (i.__li = t,
  10679. i.__gui = e,
  10680. f.extend(i, {
  10681. options: function(t) {
  10682. return arguments.length > 1 ? (i.remove(),
  10683. g(e, i.object, i.property, {
  10684. before: i.__li.nextElementSibling,
  10685. factoryArgs: [f.toArray(arguments)]
  10686. })) : f.isArray(t) || f.isObject(t) ? (i.remove(),
  10687. g(e, i.object, i.property, {
  10688. before: i.__li.nextElementSibling,
  10689. factoryArgs: [t]
  10690. })) : void 0
  10691. },
  10692. name: function(e) {
  10693. return i.__li.firstElementChild.firstElementChild.innerHTML = e,
  10694. i
  10695. },
  10696. listen: function() {
  10697. return i.__gui.listen(i),
  10698. i
  10699. },
  10700. remove: function() {
  10701. return i.__gui.remove(i),
  10702. i
  10703. }
  10704. }),
  10705. i instanceof l) {
  10706. var n = new s(i.object,i.property,{
  10707. min: i.__min,
  10708. max: i.__max,
  10709. step: i.__step
  10710. });
  10711. f.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10712. var t = i[e]
  10713. , r = n[e];
  10714. i[e] = n[e] = function() {
  10715. var e = Array.prototype.slice.call(arguments);
  10716. return t.apply(i, e),
  10717. r.apply(n, e)
  10718. }
  10719. }),
  10720. p.addClass(t, "has-slider"),
  10721. i.domElement.insertBefore(n.domElement, i.domElement.firstElementChild)
  10722. } else if (i instanceof s) {
  10723. var r = function(t) {
  10724. return f.isNumber(i.__min) && f.isNumber(i.__max) ? (i.remove(),
  10725. g(e, i.object, i.property, {
  10726. before: i.__li.nextElementSibling,
  10727. factoryArgs: [i.__min, i.__max, i.__step]
  10728. })) : t
  10729. };
  10730. i.min = f.compose(r, i.min),
  10731. i.max = f.compose(r, i.max)
  10732. } else
  10733. i instanceof o ? (p.bind(t, "click", function() {
  10734. p.fakeEvent(i.__checkbox, "click")
  10735. }),
  10736. p.bind(i.__checkbox, "click", function(e) {
  10737. e.stopPropagation()
  10738. })) : i instanceof a ? (p.bind(t, "click", function() {
  10739. p.fakeEvent(i.__button, "click")
  10740. }),
  10741. p.bind(t, "mouseover", function() {
  10742. p.addClass(i.__button, "hover")
  10743. }),
  10744. p.bind(t, "mouseout", function() {
  10745. p.removeClass(i.__button, "hover")
  10746. })) : i instanceof h && (p.addClass(t, "color"),
  10747. i.updateDisplay = f.compose(function(e) {
  10748. return t.style.borderLeftColor = i.__color.toString(),
  10749. e
  10750. }, i.updateDisplay),
  10751. i.updateDisplay());
  10752. i.setValue = f.compose(function(t) {
  10753. return e.getRoot().__preset_select && i.isModified() && T(e.getRoot(), !0),
  10754. t
  10755. }, i.setValue)
  10756. }
  10757. function A(e, t) {
  10758. var i = e.getRoot()
  10759. , n = i.__rememberedObjects.indexOf(t.object);
  10760. if (n != -1) {
  10761. var r = i.__rememberedObjectIndecesToControllers[n];
  10762. if (void 0 === r && (r = {},
  10763. i.__rememberedObjectIndecesToControllers[n] = r),
  10764. r[t.property] = t,
  10765. i.load && i.load.remembered) {
  10766. var o, a = i.load.remembered;
  10767. if (a[e.preset])
  10768. o = a[e.preset];
  10769. else {
  10770. if (!a[L])
  10771. return;
  10772. o = a[L]
  10773. }
  10774. if (o[n] && void 0 !== o[n][t.property]) {
  10775. var s = o[n][t.property];
  10776. t.initialValue = s,
  10777. t.setValue(s)
  10778. }
  10779. }
  10780. }
  10781. }
  10782. function y(e, t) {
  10783. return document.location.href + "." + t
  10784. }
  10785. function C(e) {
  10786. var t = e.__save_row = document.createElement("li");
  10787. p.addClass(e.domElement, "has-save"),
  10788. e.__ul.insertBefore(t, e.__ul.firstChild),
  10789. p.addClass(t, "save-row");
  10790. var i = document.createElement("span");
  10791. i.innerHTML = "&nbsp;",
  10792. p.addClass(i, "button gears");
  10793. var n = document.createElement("span");
  10794. n.innerHTML = "Save",
  10795. p.addClass(n, "button"),
  10796. p.addClass(n, "save");
  10797. var r = document.createElement("span");
  10798. r.innerHTML = "New",
  10799. p.addClass(r, "button"),
  10800. p.addClass(r, "save-as");
  10801. var o = document.createElement("span");
  10802. o.innerHTML = "Revert",
  10803. p.addClass(o, "button"),
  10804. p.addClass(o, "revert");
  10805. var a = e.__preset_select = document.createElement("select");
  10806. if (e.load && e.load.remembered ? f.each(e.load.remembered, function(t, i) {
  10807. w(e, i, i == e.preset)
  10808. }) : w(e, L, !1),
  10809. p.bind(a, "change", function() {
  10810. for (var t = 0; t < e.__preset_select.length; t++)
  10811. e.__preset_select[t].innerHTML = e.__preset_select[t].value;
  10812. e.preset = this.value
  10813. }),
  10814. t.appendChild(a),
  10815. t.appendChild(i),
  10816. t.appendChild(n),
  10817. t.appendChild(r),
  10818. t.appendChild(o),
  10819. D) {
  10820. var s = document.getElementById("dg-save-locally")
  10821. , l = document.getElementById("dg-local-explain");
  10822. s.style.display = "block";
  10823. var c = document.getElementById("dg-local-storage");
  10824. "true" === localStorage.getItem(y(e, "isLocal")) && c.setAttribute("checked", "checked");
  10825. var h = function() {
  10826. l.style.display = e.useLocalStorage ? "block" : "none"
  10827. };
  10828. h(),
  10829. p.bind(c, "change", function() {
  10830. e.useLocalStorage = !e.useLocalStorage,
  10831. h()
  10832. })
  10833. }
  10834. var u = document.getElementById("dg-new-constructor");
  10835. p.bind(u, "keydown", function(e) {
  10836. !e.metaKey || 67 !== e.which && 67 != e.keyCode || S.hide()
  10837. }),
  10838. p.bind(i, "click", function() {
  10839. u.innerHTML = JSON.stringify(e.getSaveObject(), void 0, 2),
  10840. S.show(),
  10841. u.focus(),
  10842. u.select()
  10843. }),
  10844. p.bind(n, "click", function() {
  10845. e.save()
  10846. }),
  10847. p.bind(r, "click", function() {
  10848. var t = prompt("Enter a new preset name.");
  10849. t && e.saveAs(t)
  10850. }),
  10851. p.bind(o, "click", function() {
  10852. e.revert()
  10853. })
  10854. }
  10855. function I(e) {
  10856. function t(t) {
  10857. return t.preventDefault(),
  10858. r = t.clientX,
  10859. p.addClass(e.__closeButton, V.CLASS_DRAG),
  10860. p.bind(window, "mousemove", i),
  10861. p.bind(window, "mouseup", n),
  10862. !1
  10863. }
  10864. function i(t) {
  10865. return t.preventDefault(),
  10866. e.width += r - t.clientX,
  10867. e.onResize(),
  10868. r = t.clientX,
  10869. !1
  10870. }
  10871. function n() {
  10872. p.removeClass(e.__closeButton, V.CLASS_DRAG),
  10873. p.unbind(window, "mousemove", i),
  10874. p.unbind(window, "mouseup", n)
  10875. }
  10876. e.__resize_handle = document.createElement("div"),
  10877. f.extend(e.__resize_handle.style, {
  10878. width: "6px",
  10879. marginLeft: "-3px",
  10880. height: "200px",
  10881. cursor: "ew-resize",
  10882. position: "absolute"
  10883. });
  10884. var r;
  10885. p.bind(e.__resize_handle, "mousedown", t),
  10886. p.bind(e.__closeButton, "mousedown", t),
  10887. e.domElement.insertBefore(e.__resize_handle, e.domElement.firstElementChild)
  10888. }
  10889. function E(e, t) {
  10890. e.domElement.style.width = t + "px",
  10891. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10892. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10893. }
  10894. function b(e, t) {
  10895. var i = {};
  10896. return f.each(e.__rememberedObjects, function(n, r) {
  10897. var o = {}
  10898. , a = e.__rememberedObjectIndecesToControllers[r];
  10899. f.each(a, function(e, i) {
  10900. o[i] = t ? e.initialValue : e.getValue()
  10901. }),
  10902. i[r] = o
  10903. }),
  10904. i
  10905. }
  10906. function w(e, t, i) {
  10907. var n = document.createElement("option");
  10908. n.innerHTML = t,
  10909. n.value = t,
  10910. e.__preset_select.appendChild(n),
  10911. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10912. }
  10913. function _(e) {
  10914. for (var t = 0; t < e.__preset_select.length; t++)
  10915. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10916. }
  10917. function T(e, t) {
  10918. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10919. t ? i.innerHTML = i.value + "*" : i.innerHTML = i.value
  10920. }
  10921. function x(e) {
  10922. 0 != e.length && u(function() {
  10923. x(e)
  10924. }),
  10925. f.each(e, function(e) {
  10926. e.updateDisplay()
  10927. })
  10928. }
  10929. e.inject(i);
  10930. var S, M, R = "dg", P = 72, O = 20, L = "Default", D = function() {
  10931. try {
  10932. return "localStorage"in window && null !== window.localStorage
  10933. } catch (e) {
  10934. return !1
  10935. }
  10936. }(), N = !0, B = !1, F = [], V = function(e) {
  10937. function t() {
  10938. var e = i.getRoot();
  10939. e.width += 1,
  10940. f.defer(function() {
  10941. e.width -= 1
  10942. })
  10943. }
  10944. var i = this;
  10945. this.domElement = document.createElement("div"),
  10946. this.__ul = document.createElement("ul"),
  10947. this.domElement.appendChild(this.__ul),
  10948. p.addClass(this.domElement, R),
  10949. this.__folders = {},
  10950. this.__controllers = [],
  10951. this.__rememberedObjects = [],
  10952. this.__rememberedObjectIndecesToControllers = [],
  10953. this.__listening = [],
  10954. e = e || {},
  10955. e = f.defaults(e, {
  10956. autoPlace: !0,
  10957. width: V.DEFAULT_WIDTH
  10958. }),
  10959. e = f.defaults(e, {
  10960. resizable: e.autoPlace,
  10961. hideable: e.autoPlace
  10962. }),
  10963. f.isUndefined(e.load) ? e.load = {
  10964. preset: L
  10965. } : e.preset && (e.load.preset = e.preset),
  10966. f.isUndefined(e.parent) && e.hideable && F.push(this),
  10967. e.resizable = f.isUndefined(e.parent) && e.resizable,
  10968. e.autoPlace && f.isUndefined(e.scrollable) && (e.scrollable = !0);
  10969. var n, r = D && "true" === localStorage.getItem(y(this, "isLocal"));
  10970. if (Object.defineProperties(this, {
  10971. parent: {
  10972. get: function() {
  10973. return e.parent
  10974. }
  10975. },
  10976. scrollable: {
  10977. get: function() {
  10978. return e.scrollable
  10979. }
  10980. },
  10981. autoPlace: {
  10982. get: function() {
  10983. return e.autoPlace
  10984. }
  10985. },
  10986. preset: {
  10987. get: function() {
  10988. return i.parent ? i.getRoot().preset : e.load.preset
  10989. },
  10990. set: function(t) {
  10991. i.parent ? i.getRoot().preset = t : e.load.preset = t,
  10992. _(this),
  10993. i.revert()
  10994. }
  10995. },
  10996. width: {
  10997. get: function() {
  10998. return e.width
  10999. },
  11000. set: function(t) {
  11001. e.width = t,
  11002. E(i, t)
  11003. }
  11004. },
  11005. name: {
  11006. get: function() {
  11007. return e.name
  11008. },
  11009. set: function(t) {
  11010. e.name = t,
  11011. a && (a.innerHTML = e.name)
  11012. }
  11013. },
  11014. closed: {
  11015. get: function() {
  11016. return e.closed
  11017. },
  11018. set: function(t) {
  11019. e.closed = t,
  11020. e.closed ? p.addClass(i.__ul, V.CLASS_CLOSED) : p.removeClass(i.__ul, V.CLASS_CLOSED),
  11021. this.onResize(),
  11022. i.__closeButton && (i.__closeButton.innerHTML = t ? V.TEXT_OPEN : V.TEXT_CLOSED)
  11023. }
  11024. },
  11025. load: {
  11026. get: function() {
  11027. return e.load
  11028. }
  11029. },
  11030. useLocalStorage: {
  11031. get: function() {
  11032. return r
  11033. },
  11034. set: function(e) {
  11035. D && (r = e,
  11036. e ? p.bind(window, "unload", n) : p.unbind(window, "unload", n),
  11037. localStorage.setItem(y(i, "isLocal"), e))
  11038. }
  11039. }
  11040. }),
  11041. f.isUndefined(e.parent)) {
  11042. if (e.closed = !1,
  11043. p.addClass(this.domElement, V.CLASS_MAIN),
  11044. p.makeSelectable(this.domElement, !1),
  11045. D && r) {
  11046. i.useLocalStorage = !0;
  11047. var o = localStorage.getItem(y(this, "gui"));
  11048. o && (e.load = JSON.parse(o))
  11049. }
  11050. this.__closeButton = document.createElement("div"),
  11051. this.__closeButton.innerHTML = V.TEXT_CLOSED,
  11052. p.addClass(this.__closeButton, V.CLASS_CLOSE_BUTTON),
  11053. this.domElement.appendChild(this.__closeButton),
  11054. p.bind(this.__closeButton, "click", function() {
  11055. i.closed = !i.closed
  11056. })
  11057. } else {
  11058. void 0 === e.closed && (e.closed = !0);
  11059. var a = document.createTextNode(e.name);
  11060. p.addClass(a, "controller-name");
  11061. var s = m(i, a)
  11062. , l = function(e) {
  11063. return e.preventDefault(),
  11064. i.closed = !i.closed,
  11065. !1
  11066. };
  11067. p.addClass(this.__ul, V.CLASS_CLOSED),
  11068. p.addClass(s, "title"),
  11069. p.bind(s, "click", l),
  11070. e.closed || (this.closed = !1)
  11071. }
  11072. e.autoPlace && (f.isUndefined(e.parent) && (N && (M = document.createElement("div"),
  11073. p.addClass(M, R),
  11074. p.addClass(M, V.CLASS_AUTO_PLACE_CONTAINER),
  11075. document.body.appendChild(M),
  11076. N = !1),
  11077. M.appendChild(this.domElement),
  11078. p.addClass(this.domElement, V.CLASS_AUTO_PLACE)),
  11079. this.parent || E(i, e.width)),
  11080. p.bind(window, "resize", function() {
  11081. i.onResize()
  11082. }),
  11083. p.bind(this.__ul, "webkitTransitionEnd", function() {
  11084. i.onResize()
  11085. }),
  11086. p.bind(this.__ul, "transitionend", function() {
  11087. i.onResize()
  11088. }),
  11089. p.bind(this.__ul, "oTransitionEnd", function() {
  11090. i.onResize()
  11091. }),
  11092. this.onResize(),
  11093. e.resizable && I(this),
  11094. n = function() {
  11095. D && "true" === localStorage.getItem(y(i, "isLocal")) && localStorage.setItem(y(i, "gui"), JSON.stringify(i.getSaveObject()))
  11096. }
  11097. ,
  11098. this.saveToLocalStorageIfPossible = n;
  11099. i.getRoot();
  11100. e.parent || t()
  11101. };
  11102. return V.toggleHide = function() {
  11103. B = !B,
  11104. f.each(F, function(e) {
  11105. e.domElement.style.zIndex = B ? -999 : 999,
  11106. e.domElement.style.opacity = B ? 0 : 1
  11107. })
  11108. }
  11109. ,
  11110. V.CLASS_AUTO_PLACE = "a",
  11111. V.CLASS_AUTO_PLACE_CONTAINER = "ac",
  11112. V.CLASS_MAIN = "main",
  11113. V.CLASS_CONTROLLER_ROW = "cr",
  11114. V.CLASS_TOO_TALL = "taller-than-window",
  11115. V.CLASS_CLOSED = "closed",
  11116. V.CLASS_CLOSE_BUTTON = "close-button",
  11117. V.CLASS_DRAG = "drag",
  11118. V.DEFAULT_WIDTH = 245,
  11119. V.TEXT_CLOSED = "Close Controls",
  11120. V.TEXT_OPEN = "Open Controls",
  11121. p.bind(window, "keydown", function(e) {
  11122. "text" === document.activeElement.type || e.which !== P && e.keyCode != P || V.toggleHide()
  11123. }, !1),
  11124. f.extend(V.prototype, {
  11125. add: function(e, t) {
  11126. return g(this, e, t, {
  11127. factoryArgs: Array.prototype.slice.call(arguments, 2)
  11128. })
  11129. },
  11130. addColor: function(e, t) {
  11131. return g(this, e, t, {
  11132. color: !0
  11133. })
  11134. },
  11135. remove: function(e) {
  11136. this.__ul.removeChild(e.__li),
  11137. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  11138. var t = this;
  11139. f.defer(function() {
  11140. t.onResize()
  11141. })
  11142. },
  11143. destroy: function() {
  11144. this.autoPlace && M.removeChild(this.domElement)
  11145. },
  11146. addFolder: function(e) {
  11147. if (void 0 !== this.__folders[e])
  11148. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  11149. var t = {
  11150. name: e,
  11151. parent: this
  11152. };
  11153. t.autoPlace = this.autoPlace,
  11154. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  11155. t.load = this.load.folders[e]);
  11156. var i = new V(t);
  11157. this.__folders[e] = i;
  11158. var n = m(this, i.domElement);
  11159. return p.addClass(n, "folder"),
  11160. i
  11161. },
  11162. open: function() {
  11163. this.closed = !1
  11164. },
  11165. close: function() {
  11166. this.closed = !0
  11167. },
  11168. onResize: function() {
  11169. var e = this.getRoot();
  11170. if (e.scrollable) {
  11171. var t = p.getOffset(e.__ul).top
  11172. , i = 0;
  11173. f.each(e.__ul.childNodes, function(t) {
  11174. e.autoPlace && t === e.__save_row || (i += p.getHeight(t))
  11175. }),
  11176. $("#player").height() - t - O < i ? (p.addClass(e.domElement, V.CLASS_TOO_TALL),
  11177. e.__ul.style.height = $("#player").height() - t - O + "px") : (p.removeClass(e.domElement, V.CLASS_TOO_TALL),
  11178. e.__ul.style.height = "auto")
  11179. }
  11180. e.__resize_handle && f.defer(function() {
  11181. e.__resize_handle.style.height = e.__ul.offsetHeight + "px"
  11182. }),
  11183. e.__closeButton && (e.__closeButton.style.width = e.width + "px")
  11184. },
  11185. remember: function() {
  11186. if (f.isUndefined(S) && (S = new d,
  11187. S.domElement.innerHTML = t),
  11188. this.parent)
  11189. throw new Error("You can only call remember on a top level GUI.");
  11190. var e = this;
  11191. f.each(Array.prototype.slice.call(arguments), function(t) {
  11192. 0 == e.__rememberedObjects.length && C(e),
  11193. e.__rememberedObjects.indexOf(t) == -1 && e.__rememberedObjects.push(t)
  11194. }),
  11195. this.autoPlace && E(this, this.width)
  11196. },
  11197. getRoot: function() {
  11198. for (var e = this; e.parent; )
  11199. e = e.parent;
  11200. return e
  11201. },
  11202. getSaveObject: function() {
  11203. var e = this.load;
  11204. return e.closed = this.closed,
  11205. this.__rememberedObjects.length > 0 && (e.preset = this.preset,
  11206. e.remembered || (e.remembered = {}),
  11207. e.remembered[this.preset] = b(this)),
  11208. e.folders = {},
  11209. f.each(this.__folders, function(t, i) {
  11210. e.folders[i] = t.getSaveObject()
  11211. }),
  11212. e
  11213. },
  11214. save: function() {
  11215. this.load.remembered || (this.load.remembered = {}),
  11216. this.load.remembered[this.preset] = b(this),
  11217. T(this, !1),
  11218. this.saveToLocalStorageIfPossible()
  11219. },
  11220. saveAs: function(e) {
  11221. this.load.remembered || (this.load.remembered = {},
  11222. this.load.remembered[L] = b(this, !0)),
  11223. this.load.remembered[e] = b(this),
  11224. this.preset = e,
  11225. w(this, e, !0),
  11226. this.saveToLocalStorageIfPossible()
  11227. },
  11228. revert: function(e) {
  11229. f.each(this.__controllers, function(t) {
  11230. this.getRoot().load.remembered ? A(e || this.getRoot(), t) : t.setValue(t.initialValue)
  11231. }, this),
  11232. f.each(this.__folders, function(e) {
  11233. e.revert(e)
  11234. }),
  11235. e || T(this.getRoot(), !1)
  11236. },
  11237. listen: function(e) {
  11238. var t = 0 == this.__listening.length;
  11239. this.__listening.push(e),
  11240. t && x(this.__listening)
  11241. }
  11242. }),
  11243. V
  11244. }(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) {
  11245. return function(s, l) {
  11246. var c = s[l];
  11247. 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,{
  11248. min: arguments[2],
  11249. max: arguments[3]
  11250. }) : a.isString(c) ? new n(s,l) : a.isFunction(c) ? new r(s,l,"") : a.isBoolean(c) ? new o(s,l) : void 0
  11251. }
  11252. }(n.controllers.OptionController, n.controllers.NumberControllerBox, n.controllers.NumberControllerSlider, n.controllers.StringController = function(e, t, i) {
  11253. var n = function(e, i) {
  11254. function r() {
  11255. a.setValue(a.__input.value)
  11256. }
  11257. function o() {
  11258. a.__onFinishChange && a.__onFinishChange.call(a, a.getValue())
  11259. }
  11260. n.superclass.call(this, e, i);
  11261. var a = this;
  11262. this.__input = document.createElement("input"),
  11263. this.__input.setAttribute("type", "text"),
  11264. t.bind(this.__input, "keyup", r),
  11265. t.bind(this.__input, "change", r),
  11266. t.bind(this.__input, "blur", o),
  11267. t.bind(this.__input, "keydown", function(e) {
  11268. 13 === e.keyCode && this.blur()
  11269. }),
  11270. this.updateDisplay(),
  11271. this.domElement.appendChild(this.__input)
  11272. };
  11273. return n.superclass = e,
  11274. i.extend(n.prototype, e.prototype, {
  11275. updateDisplay: function() {
  11276. return t.isActive(this.__input) || (this.__input.value = this.getValue()),
  11277. n.superclass.prototype.updateDisplay.call(this)
  11278. }
  11279. }),
  11280. n
  11281. }(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) {
  11282. function o(e, t, i, n) {
  11283. e.style.background = "",
  11284. r.each(l, function(r) {
  11285. e.style.cssText += "background: " + r + "linear-gradient(" + t + ", " + i + " 0%, " + n + " 100%); "
  11286. })
  11287. }
  11288. function a(e) {
  11289. e.style.background = "",
  11290. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  11291. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11292. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11293. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11294. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  11295. }
  11296. var s = function(e, l) {
  11297. function c(e) {
  11298. p(e),
  11299. t.bind(window, "mousemove", p),
  11300. t.bind(window, "mouseup", h)
  11301. }
  11302. function h() {
  11303. t.unbind(window, "mousemove", p),
  11304. t.unbind(window, "mouseup", h)
  11305. }
  11306. function u() {
  11307. var e = n(this.value);
  11308. e !== !1 ? (g.__color.__state = e,
  11309. g.setValue(g.__color.toOriginal())) : this.value = g.__color.toString()
  11310. }
  11311. function d() {
  11312. t.unbind(window, "mousemove", f),
  11313. t.unbind(window, "mouseup", d)
  11314. }
  11315. function p(e) {
  11316. e.preventDefault();
  11317. var i = t.getWidth(g.__saturation_field)
  11318. , n = t.getOffset(g.__saturation_field)
  11319. , r = (e.clientX - n.left + document.body.scrollLeft) / i
  11320. , o = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  11321. return o > 1 ? o = 1 : o < 0 && (o = 0),
  11322. r > 1 ? r = 1 : r < 0 && (r = 0),
  11323. g.__color.v = o,
  11324. g.__color.s = r,
  11325. g.setValue(g.__color.toOriginal()),
  11326. !1
  11327. }
  11328. function f(e) {
  11329. e.preventDefault();
  11330. var i = t.getHeight(g.__hue_field)
  11331. , n = t.getOffset(g.__hue_field)
  11332. , r = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  11333. return r > 1 ? r = 1 : r < 0 && (r = 0),
  11334. g.__color.h = 360 * r,
  11335. g.setValue(g.__color.toOriginal()),
  11336. !1
  11337. }
  11338. s.superclass.call(this, e, l),
  11339. this.__color = new i(this.getValue()),
  11340. this.__temp = new i(0);
  11341. var g = this;
  11342. this.domElement = document.createElement("div"),
  11343. t.makeSelectable(this.domElement, !1),
  11344. this.__selector = document.createElement("div"),
  11345. this.__selector.className = "selector",
  11346. this.__saturation_field = document.createElement("div"),
  11347. this.__saturation_field.className = "saturation-field",
  11348. this.__field_knob = document.createElement("div"),
  11349. this.__field_knob.className = "field-knob",
  11350. this.__field_knob_border = "2px solid ",
  11351. this.__hue_knob = document.createElement("div"),
  11352. this.__hue_knob.className = "hue-knob",
  11353. this.__hue_field = document.createElement("div"),
  11354. this.__hue_field.className = "hue-field",
  11355. this.__input = document.createElement("input"),
  11356. this.__input.type = "text",
  11357. this.__input_textShadow = "0 1px 1px ",
  11358. t.bind(this.__input, "keydown", function(e) {
  11359. 13 === e.keyCode && u.call(this)
  11360. }),
  11361. t.bind(this.__input, "blur", u),
  11362. t.bind(this.__selector, "mousedown", function(e) {
  11363. t.addClass(this, "drag").bind(window, "mouseup", function(e) {
  11364. t.removeClass(g.__selector, "drag")
  11365. })
  11366. });
  11367. var m = document.createElement("div");
  11368. r.extend(this.__selector.style, {
  11369. width: "122px",
  11370. height: "102px",
  11371. padding: "3px",
  11372. backgroundColor: "#222",
  11373. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  11374. }),
  11375. r.extend(this.__field_knob.style, {
  11376. position: "absolute",
  11377. width: "12px",
  11378. height: "12px",
  11379. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  11380. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  11381. borderRadius: "12px",
  11382. zIndex: 1
  11383. }),
  11384. r.extend(this.__hue_knob.style, {
  11385. position: "absolute",
  11386. width: "15px",
  11387. height: "2px",
  11388. borderRight: "4px solid #fff",
  11389. zIndex: 1
  11390. }),
  11391. r.extend(this.__saturation_field.style, {
  11392. width: "100px",
  11393. height: "100px",
  11394. border: "1px solid #555",
  11395. marginRight: "3px",
  11396. display: "inline-block",
  11397. cursor: "pointer"
  11398. }),
  11399. r.extend(m.style, {
  11400. width: "100%",
  11401. height: "100%",
  11402. background: "none"
  11403. }),
  11404. o(m, "top", "rgba(0,0,0,0)", "#000"),
  11405. r.extend(this.__hue_field.style, {
  11406. width: "15px",
  11407. height: "100px",
  11408. display: "inline-block",
  11409. border: "1px solid #555",
  11410. cursor: "ns-resize"
  11411. }),
  11412. a(this.__hue_field),
  11413. r.extend(this.__input.style, {
  11414. outline: "none",
  11415. textAlign: "center",
  11416. color: "#fff",
  11417. border: 0,
  11418. fontWeight: "bold",
  11419. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  11420. }),
  11421. t.bind(this.__saturation_field, "mousedown", c),
  11422. t.bind(this.__field_knob, "mousedown", c),
  11423. t.bind(this.__hue_field, "mousedown", function(e) {
  11424. f(e),
  11425. t.bind(window, "mousemove", f),
  11426. t.bind(window, "mouseup", d)
  11427. }),
  11428. this.__saturation_field.appendChild(m),
  11429. this.__selector.appendChild(this.__field_knob),
  11430. this.__selector.appendChild(this.__saturation_field),
  11431. this.__selector.appendChild(this.__hue_field),
  11432. this.__hue_field.appendChild(this.__hue_knob),
  11433. this.domElement.appendChild(this.__input),
  11434. this.domElement.appendChild(this.__selector),
  11435. this.updateDisplay()
  11436. };
  11437. s.superclass = e,
  11438. r.extend(s.prototype, e.prototype, {
  11439. updateDisplay: function() {
  11440. var e = n(this.getValue());
  11441. if (e !== !1) {
  11442. var t = !1;
  11443. r.each(i.COMPONENTS, function(i) {
  11444. if (!r.isUndefined(e[i]) && !r.isUndefined(this.__color.__state[i]) && e[i] !== this.__color.__state[i])
  11445. return t = !0,
  11446. {}
  11447. }, this),
  11448. t && r.extend(this.__color.__state, e)
  11449. }
  11450. r.extend(this.__temp.__state, this.__color.__state),
  11451. this.__temp.a = 1;
  11452. var a = this.__color.v < .5 || this.__color.s > .5 ? 255 : 0
  11453. , s = 255 - a;
  11454. r.extend(this.__field_knob.style, {
  11455. marginLeft: 100 * this.__color.s - 7 + "px",
  11456. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  11457. backgroundColor: this.__temp.toString(),
  11458. border: this.__field_knob_border + "rgb(" + a + "," + a + "," + a + ")"
  11459. }),
  11460. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  11461. this.__temp.s = 1,
  11462. this.__temp.v = 1,
  11463. o(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  11464. r.extend(this.__input.style, {
  11465. backgroundColor: this.__input.value = this.__color.toString(),
  11466. color: "rgb(" + a + "," + a + "," + a + ")",
  11467. textShadow: this.__input_textShadow + "rgba(" + s + "," + s + "," + s + ",.7)"
  11468. })
  11469. }
  11470. });
  11471. var l = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  11472. return s
  11473. }(n.controllers.Controller, n.dom.dom, n.color.Color = function(e, t, i, n) {
  11474. function r(e, t, i) {
  11475. Object.defineProperty(e, t, {
  11476. get: function() {
  11477. return "RGB" === this.__state.space ? this.__state[t] : (a(this, t, i),
  11478. this.__state[t])
  11479. },
  11480. set: function(e) {
  11481. "RGB" !== this.__state.space && (a(this, t, i),
  11482. this.__state.space = "RGB"),
  11483. this.__state[t] = e
  11484. }
  11485. })
  11486. }
  11487. function o(e, t) {
  11488. Object.defineProperty(e, t, {
  11489. get: function() {
  11490. return "HSV" === this.__state.space ? this.__state[t] : (s(this),
  11491. this.__state[t])
  11492. },
  11493. set: function(e) {
  11494. "HSV" !== this.__state.space && (s(this),
  11495. this.__state.space = "HSV"),
  11496. this.__state[t] = e
  11497. }
  11498. })
  11499. }
  11500. function a(e, i, r) {
  11501. if ("HEX" === e.__state.space)
  11502. e.__state[i] = t.component_from_hex(e.__state.hex, r);
  11503. else {
  11504. if ("HSV" !== e.__state.space)
  11505. throw "Corrupted color state";
  11506. n.extend(e.__state, t.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  11507. }
  11508. }
  11509. function s(e) {
  11510. var i = t.rgb_to_hsv(e.r, e.g, e.b);
  11511. n.extend(e.__state, {
  11512. s: i.s,
  11513. v: i.v
  11514. }),
  11515. n.isNaN(i.h) ? n.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = i.h
  11516. }
  11517. var l = function() {
  11518. if (this.__state = e.apply(this, arguments),
  11519. this.__state === !1)
  11520. throw "Failed to interpret color arguments";
  11521. this.__state.a = this.__state.a || 1
  11522. };
  11523. return l.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  11524. n.extend(l.prototype, {
  11525. toString: function() {
  11526. return i(this)
  11527. },
  11528. toOriginal: function() {
  11529. return this.__state.conversion.write(this)
  11530. }
  11531. }),
  11532. r(l.prototype, "r", 2),
  11533. r(l.prototype, "g", 1),
  11534. r(l.prototype, "b", 0),
  11535. o(l.prototype, "h"),
  11536. o(l.prototype, "s"),
  11537. o(l.prototype, "v"),
  11538. Object.defineProperty(l.prototype, "a", {
  11539. get: function() {
  11540. return this.__state.a
  11541. },
  11542. set: function(e) {
  11543. this.__state.a = e
  11544. }
  11545. }),
  11546. Object.defineProperty(l.prototype, "hex", {
  11547. get: function() {
  11548. return "HEX" !== !this.__state.space && (this.__state.hex = t.rgb_to_hex(this.r, this.g, this.b)),
  11549. this.__state.hex
  11550. },
  11551. set: function(e) {
  11552. this.__state.space = "HEX",
  11553. this.__state.hex = e
  11554. }
  11555. }),
  11556. l
  11557. }(n.color.interpret, n.color.math = function() {
  11558. var e;
  11559. return {
  11560. hsv_to_rgb: function(e, t, i) {
  11561. var n = Math.floor(e / 60) % 6
  11562. , r = e / 60 - Math.floor(e / 60)
  11563. , o = i * (1 - t)
  11564. , a = i * (1 - r * t)
  11565. , s = i * (1 - (1 - r) * t)
  11566. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  11567. return {
  11568. r: 255 * l[0],
  11569. g: 255 * l[1],
  11570. b: 255 * l[2]
  11571. }
  11572. },
  11573. rgb_to_hsv: function(e, t, i) {
  11574. var n, r, o = Math.min(e, t, i), a = Math.max(e, t, i), s = a - o;
  11575. return 0 == a ? {
  11576. h: NaN,
  11577. s: 0,
  11578. v: 0
  11579. } : (r = s / a,
  11580. n = e == a ? (t - i) / s : t == a ? 2 + (i - e) / s : 4 + (e - t) / s,
  11581. n /= 6,
  11582. n < 0 && (n += 1),
  11583. {
  11584. h: 360 * n,
  11585. s: r,
  11586. v: a / 255
  11587. })
  11588. },
  11589. rgb_to_hex: function(e, t, i) {
  11590. var n = this.hex_with_component(0, 2, e);
  11591. return n = this.hex_with_component(n, 1, t),
  11592. n = this.hex_with_component(n, 0, i)
  11593. },
  11594. component_from_hex: function(e, t) {
  11595. return e >> 8 * t & 255
  11596. },
  11597. hex_with_component: function(t, i, n) {
  11598. return n << (e = 8 * i) | t & ~(255 << e)
  11599. }
  11600. }
  11601. }(), n.color.toString, n.utils.common), n.color.interpret, n.utils.common), n.utils.requestAnimationFrame = function() {
  11602. return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  11603. window.setTimeout(e, 1e3 / 60)
  11604. }
  11605. }(), n.dom.CenteredDiv = function(e, t) {
  11606. var i = function() {
  11607. this.backgroundElement = document.createElement("div"),
  11608. t.extend(this.backgroundElement.style, {
  11609. backgroundColor: "rgba(0,0,0,0.8)",
  11610. top: 0,
  11611. left: 0,
  11612. display: "none",
  11613. zIndex: "1000",
  11614. opacity: 0,
  11615. WebkitTransition: "opacity 0.2s linear"
  11616. }),
  11617. e.makeFullscreen(this.backgroundElement),
  11618. this.backgroundElement.style.position = "fixed",
  11619. this.domElement = document.createElement("div"),
  11620. t.extend(this.domElement.style, {
  11621. position: "fixed",
  11622. display: "none",
  11623. zIndex: "1001",
  11624. opacity: 0,
  11625. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  11626. }),
  11627. document.body.appendChild(this.backgroundElement),
  11628. document.body.appendChild(this.domElement);
  11629. var i = this;
  11630. e.bind(this.backgroundElement, "click", function() {
  11631. i.hide()
  11632. })
  11633. };
  11634. return i.prototype.show = function() {
  11635. var e = this;
  11636. this.backgroundElement.style.display = "block",
  11637. this.domElement.style.display = "block",
  11638. this.domElement.style.opacity = 0,
  11639. this.domElement.style.webkitTransform = "scale(1.1)",
  11640. this.layout(),
  11641. t.defer(function() {
  11642. e.backgroundElement.style.opacity = 1,
  11643. e.domElement.style.opacity = 1,
  11644. e.domElement.style.webkitTransform = "scale(1)"
  11645. })
  11646. }
  11647. ,
  11648. i.prototype.hide = function() {
  11649. var t = this
  11650. , i = function() {
  11651. t.domElement.style.display = "none",
  11652. t.backgroundElement.style.display = "none",
  11653. e.unbind(t.domElement, "webkitTransitionEnd", i),
  11654. e.unbind(t.domElement, "transitionend", i),
  11655. e.unbind(t.domElement, "oTransitionEnd", i)
  11656. };
  11657. e.bind(this.domElement, "webkitTransitionEnd", i),
  11658. e.bind(this.domElement, "transitionend", i),
  11659. e.bind(this.domElement, "oTransitionEnd", i),
  11660. this.backgroundElement.style.opacity = 0,
  11661. this.domElement.style.opacity = 0,
  11662. this.domElement.style.webkitTransform = "scale(1.1)"
  11663. }
  11664. ,
  11665. i.prototype.layout = function() {
  11666. this.domElement.style.left = $("#player").width() / 2 - e.getWidth(this.domElement) / 2 + "px",
  11667. this.domElement.style.top = $("#player").height() / 2 - e.getHeight(this.domElement) / 2 + "px"
  11668. }
  11669. ,
  11670. i
  11671. }(n.dom.dom, n.utils.common), n.dom.dom, n.utils.common)
  11672. }
  11673. , {}],
  11674. 94: [function(e, t, i) {
  11675. (function(e) {
  11676. "use strict";
  11677. function i(t) {
  11678. function i(e) {
  11679. 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++) {
  11680. var n = _((t[i] * e + 50) / 100);
  11681. n < 1 ? n = 1 : n > 255 && (n = 255),
  11682. T[G[i]] = n
  11683. }
  11684. 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++) {
  11685. var a = _((r[o] * e + 50) / 100);
  11686. a < 1 ? a = 1 : a > 255 && (a = 255),
  11687. x[G[o]] = a
  11688. }
  11689. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11690. for (var h = 0; h < 8; h++)
  11691. S[l] = 1 / (T[G[l]] * s[c] * s[h] * 8),
  11692. M[l] = 1 / (x[G[l]] * s[c] * s[h] * 8),
  11693. l++
  11694. }
  11695. function n(e, t) {
  11696. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  11697. for (var a = 1; a <= e[o]; a++)
  11698. r[t[n]] = [],
  11699. r[t[n]][0] = i,
  11700. r[t[n]][1] = o,
  11701. n++,
  11702. i++;
  11703. i *= 2
  11704. }
  11705. return r
  11706. }
  11707. function r() {
  11708. C = n(z, W),
  11709. I = n(X, Z),
  11710. E = n(j, Y),
  11711. b = n(q, K)
  11712. }
  11713. function o() {
  11714. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11715. for (var n = e; n < t; n++)
  11716. P[32767 + n] = i,
  11717. R[32767 + n] = [],
  11718. R[32767 + n][1] = i,
  11719. R[32767 + n][0] = n;
  11720. for (var r = -(t - 1); r <= -e; r++)
  11721. P[32767 + r] = i,
  11722. R[32767 + r] = [],
  11723. R[32767 + r][1] = i,
  11724. R[32767 + r][0] = t - 1 + r;
  11725. e <<= 1,
  11726. t <<= 1
  11727. }
  11728. }
  11729. function a() {
  11730. for (var e = 0; e < 256; e++)
  11731. H[e] = 19595 * e,
  11732. H[e + 256 >> 0] = 38470 * e,
  11733. H[e + 512 >> 0] = 7471 * e + 32768,
  11734. H[e + 768 >> 0] = -11059 * e,
  11735. H[e + 1024 >> 0] = -21709 * e,
  11736. H[e + 1280 >> 0] = 32768 * e + 8421375,
  11737. H[e + 1536 >> 0] = -27439 * e,
  11738. H[e + 1792 >> 0] = -5329 * e
  11739. }
  11740. function s(e) {
  11741. for (var t = e[0], i = e[1] - 1; i >= 0; )
  11742. t & 1 << i && (N |= 1 << B),
  11743. i--,
  11744. B--,
  11745. B < 0 && (255 == N ? (l(255),
  11746. l(0)) : l(N),
  11747. B = 7,
  11748. N = 0)
  11749. }
  11750. function l(e) {
  11751. D.push(e)
  11752. }
  11753. function c(e) {
  11754. l(e >> 8 & 255),
  11755. l(255 & e)
  11756. }
  11757. function h(e, t) {
  11758. var i, n, r, o, a, s, l, c, h, u = 0, d = 8, p = 64;
  11759. for (h = 0; h < d; ++h) {
  11760. i = e[u],
  11761. n = e[u + 1],
  11762. r = e[u + 2],
  11763. o = e[u + 3],
  11764. a = e[u + 4],
  11765. s = e[u + 5],
  11766. l = e[u + 6],
  11767. c = e[u + 7];
  11768. var f = i + c
  11769. , g = i - c
  11770. , m = n + l
  11771. , v = n - l
  11772. , A = r + s
  11773. , y = r - s
  11774. , C = o + a
  11775. , I = o - a
  11776. , E = f + C
  11777. , b = f - C
  11778. , w = m + A
  11779. , _ = m - A;
  11780. e[u] = E + w,
  11781. e[u + 4] = E - w;
  11782. var T = .707106781 * (_ + b);
  11783. e[u + 2] = b + T,
  11784. e[u + 6] = b - T,
  11785. E = I + y,
  11786. w = y + v,
  11787. _ = v + g;
  11788. var x = .382683433 * (E - _)
  11789. , S = .5411961 * E + x
  11790. , M = 1.306562965 * _ + x
  11791. , R = .707106781 * w
  11792. , P = g + R
  11793. , L = g - R;
  11794. e[u + 5] = L + S,
  11795. e[u + 3] = L - S,
  11796. e[u + 1] = P + M,
  11797. e[u + 7] = P - M,
  11798. u += 8
  11799. }
  11800. for (u = 0,
  11801. h = 0; h < d; ++h) {
  11802. i = e[u],
  11803. n = e[u + 8],
  11804. r = e[u + 16],
  11805. o = e[u + 24],
  11806. a = e[u + 32],
  11807. s = e[u + 40],
  11808. l = e[u + 48],
  11809. c = e[u + 56];
  11810. var D = i + c
  11811. , N = i - c
  11812. , B = n + l
  11813. , F = n - l
  11814. , V = r + s
  11815. , U = r - s
  11816. , k = o + a
  11817. , H = o - a
  11818. , G = D + k
  11819. , z = D - k
  11820. , W = B + V
  11821. , j = B - V;
  11822. e[u] = G + W,
  11823. e[u + 32] = G - W;
  11824. var Y = .707106781 * (j + z);
  11825. e[u + 16] = z + Y,
  11826. e[u + 48] = z - Y,
  11827. G = H + U,
  11828. W = U + F,
  11829. j = F + N;
  11830. var X = .382683433 * (G - j)
  11831. , Z = .5411961 * G + X
  11832. , q = 1.306562965 * j + X
  11833. , K = .707106781 * W
  11834. , Q = N + K
  11835. , J = N - K;
  11836. e[u + 40] = J + Z,
  11837. e[u + 24] = J - Z,
  11838. e[u + 8] = Q + q,
  11839. e[u + 56] = Q - q,
  11840. u++
  11841. }
  11842. var $;
  11843. for (h = 0; h < p; ++h)
  11844. $ = e[h] * t[h],
  11845. O[h] = $ > 0 ? $ + .5 | 0 : $ - .5 | 0;
  11846. return O
  11847. }
  11848. function u() {
  11849. c(65504),
  11850. c(16),
  11851. l(74),
  11852. l(70),
  11853. l(73),
  11854. l(70),
  11855. l(0),
  11856. l(1),
  11857. l(1),
  11858. l(0),
  11859. c(1),
  11860. c(1),
  11861. l(0),
  11862. l(0)
  11863. }
  11864. function d(e, t) {
  11865. c(65472),
  11866. c(17),
  11867. l(8),
  11868. c(t),
  11869. c(e),
  11870. l(3),
  11871. l(1),
  11872. l(17),
  11873. l(0),
  11874. l(2),
  11875. l(17),
  11876. l(1),
  11877. l(3),
  11878. l(17),
  11879. l(1)
  11880. }
  11881. function p() {
  11882. c(65499),
  11883. c(132),
  11884. l(0);
  11885. for (var e = 0; e < 64; e++)
  11886. l(T[e]);
  11887. l(1);
  11888. for (var t = 0; t < 64; t++)
  11889. l(x[t])
  11890. }
  11891. function f() {
  11892. c(65476),
  11893. c(418),
  11894. l(0);
  11895. for (var e = 0; e < 16; e++)
  11896. l(z[e + 1]);
  11897. for (var t = 0; t <= 11; t++)
  11898. l(W[t]);
  11899. l(16);
  11900. for (var i = 0; i < 16; i++)
  11901. l(j[i + 1]);
  11902. for (var n = 0; n <= 161; n++)
  11903. l(Y[n]);
  11904. l(1);
  11905. for (var r = 0; r < 16; r++)
  11906. l(X[r + 1]);
  11907. for (var o = 0; o <= 11; o++)
  11908. l(Z[o]);
  11909. l(17);
  11910. for (var a = 0; a < 16; a++)
  11911. l(q[a + 1]);
  11912. for (var s = 0; s <= 161; s++)
  11913. l(K[s])
  11914. }
  11915. function g() {
  11916. c(65498),
  11917. c(12),
  11918. l(3),
  11919. l(1),
  11920. l(0),
  11921. l(2),
  11922. l(17),
  11923. l(3),
  11924. l(17),
  11925. l(0),
  11926. l(63),
  11927. l(0)
  11928. }
  11929. function m(e, t, i, n, r) {
  11930. for (var o, a = r[0], l = r[240], c = 16, u = 63, d = 64, p = h(e, t), f = 0; f < d; ++f)
  11931. L[G[f]] = p[f];
  11932. var g = L[0] - i;
  11933. i = L[0],
  11934. 0 == g ? s(n[0]) : (o = 32767 + g,
  11935. s(n[P[o]]),
  11936. s(R[o]));
  11937. for (var m = 63; m > 0 && 0 == L[m]; m--)
  11938. ;
  11939. if (0 == m)
  11940. return s(a),
  11941. i;
  11942. for (var v, A = 1; A <= m; ) {
  11943. for (var y = A; 0 == L[A] && A <= m; ++A)
  11944. ;
  11945. var C = A - y;
  11946. if (C >= c) {
  11947. v = C >> 4;
  11948. for (var I = 1; I <= v; ++I)
  11949. s(l);
  11950. C &= 15
  11951. }
  11952. o = 32767 + L[A],
  11953. s(r[(C << 4) + P[o]]),
  11954. s(R[o]),
  11955. A++
  11956. }
  11957. return m != u && s(a),
  11958. i
  11959. }
  11960. function v() {
  11961. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11962. k[t] = e(t)
  11963. }
  11964. function A(e) {
  11965. if (e <= 0 && (e = 1),
  11966. e > 100 && (e = 100),
  11967. w != e) {
  11968. var t = 0;
  11969. t = e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e),
  11970. i(t),
  11971. w = e
  11972. }
  11973. }
  11974. function y() {
  11975. var e = (new Date).getTime();
  11976. t || (t = 50),
  11977. v(),
  11978. r(),
  11979. o(),
  11980. a(),
  11981. A(t);
  11982. (new Date).getTime() - e
  11983. }
  11984. var C, I, E, b, w, _ = (Math.round,
  11985. 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];
  11986. this.encode = function(t, i) {
  11987. var n = ((new Date).getTime(),
  11988. i.quality);
  11989. n && A(n),
  11990. D = new Array,
  11991. N = 0,
  11992. B = 7,
  11993. c(65496),
  11994. u(),
  11995. p(),
  11996. d(t.width, t.height),
  11997. f(),
  11998. g();
  11999. var r = 0
  12000. , o = 0
  12001. , a = 0;
  12002. N = 0,
  12003. B = 7,
  12004. this.encode.displayName = "_encode_";
  12005. 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; ) {
  12006. for (l = 0; l < G; ) {
  12007. for (w = G * z + l,
  12008. _ = w,
  12009. T = -1,
  12010. x = 0,
  12011. R = 0; R < 64; R++)
  12012. x = (k ? 63 - R : R) >> 3,
  12013. T = 4 * (7 & R),
  12014. _ = w + x * G + T,
  12015. z + x >= L && (_ -= G * (z + 1 + x - L)),
  12016. l + T >= G && (_ -= l + T - G + 4),
  12017. h = P[_++],
  12018. v = P[_++],
  12019. y = P[_++],
  12020. F[R] = (H[h] + H[v + 256 >> 0] + H[y + 512 >> 0] >> 16) - 128,
  12021. V[R] = (H[h + 768 >> 0] + H[v + 1024 >> 0] + H[y + 1280 >> 0] >> 16) - 128,
  12022. U[R] = (H[h + 1280 >> 0] + H[v + 1536 >> 0] + H[y + 1792 >> 0] >> 16) - 128;
  12023. r = m(F, S, r, C, E),
  12024. o = m(V, M, o, I, b),
  12025. a = m(U, M, a, I, b),
  12026. l += 32
  12027. }
  12028. z += W
  12029. }
  12030. if (B >= 0) {
  12031. var j = [];
  12032. j[1] = B + 1,
  12033. j[0] = (1 << B + 1) - 1,
  12034. s(j)
  12035. }
  12036. return c(65497),
  12037. new e(D)
  12038. }
  12039. ,
  12040. y()
  12041. }
  12042. function n(e, t) {
  12043. t = t || {},
  12044. t.quality = t.quality || 50;
  12045. var n = t.quality
  12046. , r = new i(n)
  12047. , o = r.encode(e, t);
  12048. return {
  12049. data: o,
  12050. width: e.width,
  12051. height: e.height
  12052. }
  12053. }
  12054. t.exports.encode = n
  12055. }
  12056. ).call(this, e("buffer").Buffer)
  12057. }
  12058. , {
  12059. buffer: 198
  12060. }],
  12061. 95: [function(e, t, i) {
  12062. "use strict";
  12063. !function() {
  12064. if ("performance"in window == !1 && (window.performance = {}),
  12065. Date.now = Date.now || function() {
  12066. return (new Date).getTime()
  12067. }
  12068. ,
  12069. "now"in window.performance == !1) {
  12070. var e = Date.now();
  12071. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  12072. window.performance.now = function() {
  12073. return Date.now() - e
  12074. }
  12075. }
  12076. }()
  12077. }
  12078. , {}],
  12079. 96: [function(e, t, i) {
  12080. "use strict";
  12081. var n = e("three");
  12082. n.EffectComposer = function(e, t) {
  12083. if (this.renderer = e,
  12084. void 0 === t) {
  12085. var i = {
  12086. minFilter: n.LinearFilter,
  12087. magFilter: n.LinearFilter,
  12088. format: n.RGBAFormat,
  12089. stencilBuffer: !1
  12090. }
  12091. , r = e.getSize();
  12092. t = new n.WebGLRenderTarget(r.width,r.height,i)
  12093. }
  12094. this.renderTarget1 = t,
  12095. this.renderTarget2 = t.clone(),
  12096. this.writeBuffer = this.renderTarget1,
  12097. this.readBuffer = this.renderTarget2,
  12098. this.passes = [],
  12099. void 0 === n.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  12100. this.copyPass = new n.ShaderPass(n.CopyShader)
  12101. }
  12102. ,
  12103. n.EffectComposer.prototype = {
  12104. swapBuffers: function() {
  12105. var e = this.readBuffer;
  12106. this.readBuffer = this.writeBuffer,
  12107. this.writeBuffer = e
  12108. },
  12109. addPass: function(e) {
  12110. this.passes.push(e)
  12111. },
  12112. insertPass: function(e, t) {
  12113. this.passes.splice(t, 0, e)
  12114. },
  12115. render: function(e) {
  12116. this.writeBuffer = this.renderTarget1,
  12117. this.readBuffer = this.renderTarget2;
  12118. var t, i, r = !1, o = this.passes.length;
  12119. for (i = 0; i < o; i++)
  12120. if (t = this.passes[i],
  12121. t.enabled) {
  12122. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, r),
  12123. t.needsSwap) {
  12124. if (r) {
  12125. var a = this.renderer.context;
  12126. a.stencilFunc(a.NOTEQUAL, 1, 4294967295),
  12127. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  12128. a.stencilFunc(a.EQUAL, 1, 4294967295)
  12129. }
  12130. this.swapBuffers()
  12131. }
  12132. t instanceof n.MaskPass ? r = !0 : t instanceof n.ClearMaskPass && (r = !1)
  12133. }
  12134. },
  12135. reset: function(e) {
  12136. if (void 0 === e) {
  12137. var t = this.renderer.getSize();
  12138. e = this.renderTarget1.clone(),
  12139. e.setSize(t.width, t.height)
  12140. }
  12141. this.renderTarget1.dispose(),
  12142. this.renderTarget2.dispose(),
  12143. this.renderTarget1 = e,
  12144. this.renderTarget2 = e.clone(),
  12145. this.writeBuffer = this.renderTarget1,
  12146. this.readBuffer = this.renderTarget2
  12147. },
  12148. setSize: function(e, t) {
  12149. this.renderTarget1.setSize(e, t),
  12150. this.renderTarget2.setSize(e, t)
  12151. this.passes.forEach(a=>{//add for TransitionPass
  12152. a.setSize && a.setSize(e, t)
  12153. })
  12154. }
  12155. }
  12156. }
  12157. , {
  12158. three: 217
  12159. }],
  12160. 97: [function(e, t, i) {
  12161. "use strict";
  12162. var n = e("three");
  12163. n.MaskPass = function(e, t) {
  12164. this.scene = e,
  12165. this.camera = t,
  12166. this.enabled = !0,
  12167. this.clear = !0,
  12168. this.needsSwap = !1,
  12169. this.inverse = !1
  12170. }
  12171. ,
  12172. n.MaskPass.prototype = {
  12173. render: function(e, t, i, n) {
  12174. var r = e.context;
  12175. r.colorMask(!1, !1, !1, !1),
  12176. r.depthMask(!1);
  12177. var o, a;
  12178. this.inverse ? (o = 0,
  12179. a = 1) : (o = 1,
  12180. a = 0),
  12181. r.enable(r.STENCIL_TEST),
  12182. r.stencilOp(r.REPLACE, r.REPLACE, r.REPLACE),
  12183. r.stencilFunc(r.ALWAYS, o, 4294967295),
  12184. r.clearStencil(a),
  12185. e.render(this.scene, this.camera, i, this.clear),
  12186. e.render(this.scene, this.camera, t, this.clear),
  12187. r.colorMask(!0, !0, !0, !0),
  12188. r.depthMask(!0),
  12189. r.stencilFunc(r.EQUAL, 1, 4294967295),
  12190. r.stencilOp(r.KEEP, r.KEEP, r.KEEP)
  12191. }
  12192. },
  12193. n.ClearMaskPass = function() {
  12194. this.enabled = !0
  12195. }
  12196. ,
  12197. n.ClearMaskPass.prototype = {
  12198. render: function(e, t, i, n) {
  12199. var r = e.context;
  12200. r.disable(r.STENCIL_TEST)
  12201. }
  12202. }
  12203. }
  12204. , {
  12205. three: 217
  12206. }],
  12207. 98: [function(e, t, i) {
  12208. "use strict";
  12209. var n = e("three");
  12210. n.RenderPass = function(e, t, i, r, o) {
  12211. this.scene = e,
  12212. this.camera = t,
  12213. this.overrideMaterial = i,
  12214. this.clearColor = r,
  12215. this.clearAlpha = void 0 !== o ? o : 1,
  12216. this.oldClearColor = new n.Color,
  12217. this.oldClearAlpha = 1,
  12218. this.enabled = !0,
  12219. this.clear = !0,
  12220. this.needsSwap = !1
  12221. }
  12222. ,
  12223. n.RenderPass.prototype = {
  12224. render: function(e, t, i, n) {
  12225. this.scene.overrideMaterial = this.overrideMaterial,
  12226. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  12227. this.oldClearAlpha = e.getClearAlpha(),
  12228. e.setClearColor(this.clearColor, this.clearAlpha)),
  12229. e.render(this.scene, this.camera, i, this.clear),
  12230. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  12231. this.scene.overrideMaterial = null
  12232. }
  12233. }
  12234. }
  12235. , {
  12236. three: 217
  12237. }],
  12238. 99: [function(e, t, i) {
  12239. "use strict";
  12240. var n = e("three");
  12241. n.ShaderPass = function(e, t) {
  12242. this.textureID = void 0 !== t ? t : "tDiffuse",
  12243. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  12244. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  12245. this.material = new n.ShaderMaterial({
  12246. defines: e.defines || {},
  12247. uniforms: this.uniforms,
  12248. vertexShader: e.vertexShader,
  12249. fragmentShader: e.fragmentShader
  12250. })),
  12251. this.renderToScreen = !1,
  12252. this.enabled = !0,
  12253. this.needsSwap = !0,
  12254. this.clear = !1,
  12255. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  12256. this.scene = new n.Scene,
  12257. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  12258. this.scene.add(this.quad)
  12259. }
  12260. ,
  12261. n.ShaderPass.prototype = {
  12262. render: function(e, t, i, n) {
  12263. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  12264. this.quad.material = this.material,
  12265. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  12266. }
  12267. }
  12268. }
  12269. , {
  12270. three: 217
  12271. }],
  12272. 100: [function(e, t, i) {
  12273. "use strict";
  12274. var n = e("three");
  12275. n.CopyShader = {
  12276. uniforms: {
  12277. tDiffuse: {
  12278. type: "t",
  12279. value: null
  12280. },
  12281. opacity: {
  12282. type: "f",
  12283. value: 1
  12284. }
  12285. },
  12286. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12287. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  12288. }
  12289. }
  12290. , {
  12291. three: 217
  12292. }],
  12293. 101: [function(e, t, i) {
  12294. "use strict";
  12295. var n = e("three");
  12296. n.HorizontalBlurShader = {
  12297. uniforms: {
  12298. tDiffuse: {
  12299. type: "t",
  12300. value: null
  12301. },
  12302. h: {
  12303. type: "f",
  12304. value: 1 / 512
  12305. }
  12306. },
  12307. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12308. 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")
  12309. }
  12310. }
  12311. , {
  12312. three: 217
  12313. }],
  12314. 102: [function(e, t, i) {
  12315. "use strict";
  12316. var n = e("three");
  12317. n.VerticalBlurShader = {
  12318. uniforms: {
  12319. tDiffuse: {
  12320. type: "t",
  12321. value: null
  12322. },
  12323. v: {
  12324. type: "f",
  12325. value: 1 / 512
  12326. }
  12327. },
  12328. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12329. 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")
  12330. }
  12331. }
  12332. , {
  12333. three: 217
  12334. }],
  12335. 103: [function(e, t, i) {
  12336. "use strict";
  12337. var n = e("three");
  12338. !function() {
  12339. if ("performance"in window == 0 && (window.performance = {}),
  12340. "now"in window.performance == 0) {
  12341. var e = Date.now();
  12342. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  12343. window.performance.now = function() {
  12344. return Date.now() - e
  12345. }
  12346. }
  12347. }(),
  12348. n.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  12349. var t, i = this.extensions, r = this.context;
  12350. if (e === n.RepeatWrapping)
  12351. return r.REPEAT;
  12352. if (e === n.ClampToEdgeWrapping)
  12353. return r.CLAMP_TO_EDGE;
  12354. if (e === n.MirroredRepeatWrapping)
  12355. return r.MIRRORED_REPEAT;
  12356. if (e === n.NearestFilter)
  12357. return r.NEAREST;
  12358. if (e === n.NearestMipMapNearestFilter)
  12359. return r.NEAREST_MIPMAP_NEAREST;
  12360. if (e === n.NearestMipMapLinearFilter)
  12361. return r.NEAREST_MIPMAP_LINEAR;
  12362. if (e === n.LinearFilter)
  12363. return r.LINEAR;
  12364. if (e === n.LinearMipMapNearestFilter)
  12365. return r.LINEAR_MIPMAP_NEAREST;
  12366. if (e === n.LinearMipMapLinearFilter)
  12367. return r.LINEAR_MIPMAP_LINEAR;
  12368. if (e === n.UnsignedByteType)
  12369. return r.UNSIGNED_BYTE;
  12370. if (e === n.UnsignedShort4444Type)
  12371. return r.UNSIGNED_SHORT_4_4_4_4;
  12372. if (e === n.UnsignedShort5551Type)
  12373. return r.UNSIGNED_SHORT_5_5_5_1;
  12374. if (e === n.UnsignedShort565Type)
  12375. return r.UNSIGNED_SHORT_5_6_5;
  12376. if (e === n.ByteType)
  12377. return r.BYTE;
  12378. if (e === n.ShortType)
  12379. return r.SHORT;
  12380. if (e === n.UnsignedShortType)
  12381. return r.UNSIGNED_SHORT;
  12382. if (e === n.IntType)
  12383. return r.INT;
  12384. if (e === n.UnsignedIntType)
  12385. return r.UNSIGNED_INT;
  12386. if (e === n.FloatType)
  12387. return r.FLOAT;
  12388. if (t = i.get("OES_texture_half_float"),
  12389. null !== t && e === n.HalfFloatType)
  12390. return t.HALF_FLOAT_OES;
  12391. if (e === n.AlphaFormat)
  12392. return r.ALPHA;
  12393. if (e === n.RGBFormat)
  12394. return r.RGB;
  12395. if (e === n.RGBAFormat)
  12396. return r.RGBA;
  12397. if (e === n.LuminanceFormat)
  12398. return r.LUMINANCE;
  12399. if (e === n.LuminanceAlphaFormat)
  12400. return r.LUMINANCE_ALPHA;
  12401. if (e === n.AddEquation)
  12402. return r.FUNC_ADD;
  12403. if (e === n.SubtractEquation)
  12404. return r.FUNC_SUBTRACT;
  12405. if (e === n.ReverseSubtractEquation)
  12406. return r.FUNC_REVERSE_SUBTRACT;
  12407. if (e === n.ZeroFactor)
  12408. return r.ZERO;
  12409. if (e === n.OneFactor)
  12410. return r.ONE;
  12411. if (e === n.SrcColorFactor)
  12412. return r.SRC_COLOR;
  12413. if (e === n.OneMinusSrcColorFactor)
  12414. return r.ONE_MINUS_SRC_COLOR;
  12415. if (e === n.SrcAlphaFactor)
  12416. return r.SRC_ALPHA;
  12417. if (e === n.OneMinusSrcAlphaFactor)
  12418. return r.ONE_MINUS_SRC_ALPHA;
  12419. if (e === n.DstAlphaFactor)
  12420. return r.DST_ALPHA;
  12421. if (e === n.OneMinusDstAlphaFactor)
  12422. return r.ONE_MINUS_DST_ALPHA;
  12423. if (e === n.DstColorFactor)
  12424. return r.DST_COLOR;
  12425. if (e === n.OneMinusDstColorFactor)
  12426. return r.ONE_MINUS_DST_COLOR;
  12427. if (e === n.SrcAlphaSaturateFactor)
  12428. return r.SRC_ALPHA_SATURATE;
  12429. if (t = i.get("WEBGL_compressed_texture_s3tc"),
  12430. null !== t) {
  12431. if (e === n.RGB_S3TC_DXT1_Format)
  12432. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  12433. if (e === n.RGBA_S3TC_DXT1_Format)
  12434. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  12435. if (e === n.RGBA_S3TC_DXT3_Format)
  12436. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  12437. if (e === n.RGBA_S3TC_DXT5_Format)
  12438. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  12439. }
  12440. if (t = i.get("WEBGL_compressed_texture_pvrtc"),
  12441. null !== t) {
  12442. if (e === n.RGB_PVRTC_4BPPV1_Format)
  12443. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  12444. if (e === n.RGB_PVRTC_2BPPV1_Format)
  12445. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  12446. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  12447. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  12448. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  12449. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  12450. }
  12451. if (t = i.get("WEBGL_compressed_texture_etc1"),
  12452. null !== t && e === n.RGB_ETC1_Format)
  12453. return t.COMPRESSED_RGB_ETC1_WEBGL;
  12454. if (t = i.get("EXT_blend_minmax"),
  12455. null !== t) {
  12456. if (e === n.MinEquation)
  12457. return t.MIN_EXT;
  12458. if (e === n.MaxEquation)
  12459. return t.MAX_EXT
  12460. }
  12461. return 0
  12462. }
  12463. ,
  12464. n.WebGLState = function(e, t, i) {
  12465. var r = this
  12466. , o = new n.Vector4
  12467. , a = e.getParameter(e.MAX_VERTEX_ATTRIBS)
  12468. , s = new Uint8Array(a)
  12469. , l = new Uint8Array(a)
  12470. , c = new Uint8Array(a)
  12471. , h = {}
  12472. , u = null
  12473. , d = null
  12474. , p = null
  12475. , f = null
  12476. , g = null
  12477. , m = null
  12478. , v = null
  12479. , A = null
  12480. , y = !1
  12481. , C = null
  12482. , I = null
  12483. , E = null
  12484. , b = null
  12485. , w = null
  12486. , _ = null
  12487. , T = null
  12488. , x = null
  12489. , S = null
  12490. , M = null
  12491. , R = null
  12492. , P = null
  12493. , O = null
  12494. , L = null
  12495. , D = null
  12496. , N = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  12497. , B = void 0
  12498. , F = {}
  12499. , V = new n.Vector4
  12500. , U = null
  12501. , k = null
  12502. , H = new n.Vector4
  12503. , G = new n.Vector4;
  12504. this.init = function() {
  12505. this.clearColor(0, 0, 0, 1),
  12506. this.clearDepth(1),
  12507. this.clearStencil(0),
  12508. this.enable(e.DEPTH_TEST),
  12509. e.depthFunc(e.LEQUAL),
  12510. e.frontFace(e.CCW),
  12511. e.cullFace(e.BACK),
  12512. this.enable(e.CULL_FACE),
  12513. this.enable(e.BLEND),
  12514. e.blendEquation(e.FUNC_ADD),
  12515. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  12516. }
  12517. ,
  12518. this.initAttributes = function() {
  12519. for (var e = 0, t = s.length; e < t; e++)
  12520. s[e] = 0
  12521. }
  12522. ,
  12523. this.enableAttribute = function(i) {
  12524. if (s[i] = 1,
  12525. 0 === l[i] && (e.enableVertexAttribArray(i),
  12526. l[i] = 1),
  12527. 0 !== c[i]) {
  12528. var n = t.get("ANGLE_instanced_arrays");
  12529. n.vertexAttribDivisorANGLE(i, 0),
  12530. c[i] = 0
  12531. }
  12532. }
  12533. ,
  12534. this.enableAttributeAndDivisor = function(t, i, n) {
  12535. s[t] = 1,
  12536. 0 === l[t] && (e.enableVertexAttribArray(t),
  12537. l[t] = 1),
  12538. c[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  12539. c[t] = i)
  12540. }
  12541. ,
  12542. this.disableUnusedAttributes = function() {
  12543. for (var t = 0, i = l.length; t < i; t++)
  12544. l[t] !== s[t] && (e.disableVertexAttribArray(t),
  12545. l[t] = 0)
  12546. }
  12547. ,
  12548. this.enable = function(t) {
  12549. h[t] !== !0 && (e.enable(t),
  12550. h[t] = !0)
  12551. }
  12552. ,
  12553. this.disable = function(t) {
  12554. h[t] !== !1 && (e.disable(t),
  12555. h[t] = !1)
  12556. }
  12557. ,
  12558. this.getCompressedTextureFormats = function() {
  12559. if (null === u && (u = [],
  12560. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  12561. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  12562. u.push(i[n]);
  12563. return u
  12564. }
  12565. ,
  12566. this.setBlending = function(t, r, o, a, s, l, c, h) {
  12567. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  12568. t === d && h === y || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12569. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  12570. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12571. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12572. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12573. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12574. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12575. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12576. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  12577. d = t,
  12578. y = h),
  12579. t === n.CustomBlending ? (s = s || r,
  12580. l = l || o,
  12581. c = c || a,
  12582. r === p && s === m || (e.blendEquationSeparate(i(r), i(s)),
  12583. p = r,
  12584. m = s),
  12585. o === f && a === g && l === v && c === A || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  12586. f = o,
  12587. g = a,
  12588. v = l,
  12589. A = c)) : (p = null,
  12590. f = null,
  12591. g = null,
  12592. m = null,
  12593. v = null,
  12594. A = null)
  12595. }
  12596. ,
  12597. this.setDepthFunc = function(t) {
  12598. if (C !== t) {
  12599. if (t)
  12600. switch (t) {
  12601. case n.NeverDepth:
  12602. e.depthFunc(e.NEVER);
  12603. break;
  12604. case n.AlwaysDepth:
  12605. e.depthFunc(e.ALWAYS);
  12606. break;
  12607. case n.LessDepth:
  12608. e.depthFunc(e.LESS);
  12609. break;
  12610. case n.LessEqualDepth:
  12611. e.depthFunc(e.LEQUAL);
  12612. break;
  12613. case n.EqualDepth:
  12614. e.depthFunc(e.EQUAL);
  12615. break;
  12616. case n.GreaterEqualDepth:
  12617. e.depthFunc(e.GEQUAL);
  12618. break;
  12619. case n.GreaterDepth:
  12620. e.depthFunc(e.GREATER);
  12621. break;
  12622. case n.NotEqualDepth:
  12623. e.depthFunc(e.NOTEQUAL);
  12624. break;
  12625. default:
  12626. e.depthFunc(e.LEQUAL)
  12627. }
  12628. else
  12629. e.depthFunc(e.LEQUAL);
  12630. C = t
  12631. }
  12632. }
  12633. ,
  12634. this.setDepthTest = function(t) {
  12635. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  12636. }
  12637. ,
  12638. this.setDepthWrite = function(t) {
  12639. I !== t && (e.depthMask(t),
  12640. I = t)
  12641. }
  12642. ,
  12643. this.setColorWrite = function(t) {
  12644. E !== t && (e.colorMask(t, t, t, t),
  12645. E = t)
  12646. }
  12647. ,
  12648. this.setStencilFunc = function(t, i, n) {
  12649. w === t && _ === i && T === n || (e.stencilFunc(t, i, n),
  12650. w = t,
  12651. _ = i,
  12652. T = n)
  12653. }
  12654. ,
  12655. this.setStencilOp = function(t, i, n) {
  12656. x === t && S === i && M === n || (e.stencilOp(t, i, n),
  12657. x = t,
  12658. S = i,
  12659. M = n)
  12660. }
  12661. ,
  12662. this.setStencilTest = function(t) {
  12663. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  12664. }
  12665. ,
  12666. this.setStencilWrite = function(t) {
  12667. b !== t && (e.stencilMask(t),
  12668. b = t)
  12669. }
  12670. ,
  12671. this.setFlipSided = function(t) {
  12672. R !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  12673. R = t)
  12674. }
  12675. ,
  12676. this.setLineWidth = function(t) {
  12677. t !== P && (e.lineWidth(t),
  12678. P = t)
  12679. }
  12680. ,
  12681. this.setPolygonOffset = function(t, i, n) {
  12682. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  12683. !t || O === i && L === n || (e.polygonOffset(i, n),
  12684. O = i,
  12685. L = n)
  12686. }
  12687. ,
  12688. this.getScissorTest = function() {
  12689. return D
  12690. }
  12691. ,
  12692. this.setScissorTest = function(t) {
  12693. D = t,
  12694. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  12695. }
  12696. ,
  12697. this.activeTexture = function(t) {
  12698. void 0 === t && (t = e.TEXTURE0 + N - 1),
  12699. B !== t && (e.activeTexture(t),
  12700. B = t)
  12701. }
  12702. ,
  12703. this.bindTexture = function(t, i) {
  12704. void 0 === B && r.activeTexture();
  12705. var n = F[B];
  12706. void 0 === n && (n = {
  12707. type: void 0,
  12708. texture: void 0
  12709. },
  12710. F[B] = n),
  12711. n.type === t && n.texture === i || (e.bindTexture(t, i),
  12712. n.type = t,
  12713. n.texture = i)
  12714. }
  12715. ,
  12716. this.compressedTexImage2D = function() {
  12717. try {
  12718. e.compressedTexImage2D.apply(e, arguments)
  12719. } catch (e) {
  12720. console.error(e)
  12721. }
  12722. }
  12723. ,
  12724. this.texImage2D = function() {
  12725. try {
  12726. e.texImage2D.apply(e, arguments)
  12727. } catch (e) {
  12728. console.error(e)
  12729. }
  12730. }
  12731. ,
  12732. this.clearColor = function(t, i, n, r) {
  12733. o.set(t, i, n, r),
  12734. V.equals(o) === !1 && (e.clearColor(t, i, n, r),
  12735. V.copy(o))
  12736. }
  12737. ,
  12738. this.clearDepth = function(t) {
  12739. U !== t && (e.clearDepth(t),
  12740. U = t)
  12741. }
  12742. ,
  12743. this.clearStencil = function(t) {
  12744. k !== t && (e.clearStencil(t),
  12745. k = t)
  12746. }
  12747. ,
  12748. this.scissor = function(t) {
  12749. H.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  12750. H.copy(t))
  12751. }
  12752. ,
  12753. this.viewport = function(t) {
  12754. G.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  12755. G.copy(t))
  12756. }
  12757. ,
  12758. this.reset = function() {
  12759. for (var t = 0; t < l.length; t++)
  12760. 1 === l[t] && (e.disableVertexAttribArray(t),
  12761. l[t] = 0);
  12762. h = {},
  12763. u = null,
  12764. B = void 0,
  12765. F = {},
  12766. d = null,
  12767. E = null,
  12768. I = null,
  12769. b = null,
  12770. R = null
  12771. }
  12772. }
  12773. }
  12774. , {
  12775. three: 217
  12776. }],
  12777. 104: [function(e, t, i) {
  12778. (function(i, n) {
  12779. "use strict";
  12780. function r(e) {
  12781. this.urls = e;
  12782. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12783. this.builder = a.loadProto(t),
  12784. this.decoder = this.builder.build("binary_mesh")
  12785. }
  12786. var o = e("three")
  12787. , a = e("protobufjs")
  12788. , s = e("../util/logger")
  12789. , l = (e("../util/common"),
  12790. e("../util/ajax"))
  12791. , c = e("../objects/Chunk")
  12792. , h = new s(n);
  12793. r.prototype = {
  12794. constructor: r,
  12795. load: function(e, t, i, n) {
  12796. return h.time("download"),
  12797. l.get(e, {
  12798. responseType: "arraybuffer"
  12799. }).done(function(r) {
  12800. h.timeEnd("download"),
  12801. this.parse(r, e, t, i, n)
  12802. }
  12803. .bind(this)).fail(n)
  12804. },
  12805. parse: function(e, t, i, n, r) {
  12806. var o = this.readProtobuf(e);
  12807. if (!o)
  12808. return r();
  12809. try {
  12810. h.time("convert to webgl"),
  12811. this.convertProtobufToSceneObject(o, t, i, n, r),
  12812. h.timeEnd("convert to webgl")
  12813. } catch (e) {
  12814. return h.error("failed parsing .dam"),
  12815. h.error(e.message),
  12816. r()
  12817. }
  12818. },
  12819. readProtobuf: function(e) {
  12820. var t;
  12821. try {
  12822. h.time("parse proto"),
  12823. t = this.decoder.decode(e),
  12824. h.timeEnd("parse proto")
  12825. } catch (e) {
  12826. return h.error("failed parsing proto for .dam"),
  12827. h.error(e.message),
  12828. null
  12829. }
  12830. return t
  12831. },
  12832. convertProtobufToSceneObject: function(e, t, i, n, r) {
  12833. function a(e) {
  12834. var i = new o.BufferGeometry;
  12835. return i.addAttribute("position", new o.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12836. e.vertices.uv.length > 0 && i.addAttribute("uv", new o.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12837. i.setIndex(new o.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12838. i.applyMatrix(s),
  12839. i.computeBoundingBox(),
  12840. new c({
  12841. geometry: i,
  12842. textureName: e.material_name,
  12843. name: e.chunk_name,
  12844. meshUrl: t
  12845. })
  12846. }
  12847. if (0 === e.chunk.length)
  12848. return h.warn("No chunks in damfile..."),
  12849. i([]);
  12850. var s = new o.Matrix4;
  12851. s.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12852. var l = e.chunk.map(a);
  12853. return l ? i(l) : (h.error(".dam protobuf came out with no chunks..."),
  12854. r())
  12855. }
  12856. },
  12857. t.exports = r
  12858. }
  12859. ).call(this, e("buffer").Buffer, "/js/loaders/DamLoader.js")
  12860. }
  12861. , {
  12862. "../objects/Chunk": 144,
  12863. "../util/ajax": 181,
  12864. "../util/common": 185,
  12865. "../util/logger": 189,
  12866. buffer: 198,
  12867. protobufjs: 214,
  12868. three: 217
  12869. }],
  12870. 105: [function(e, t, i) {
  12871. (function(i) {
  12872. "use strict";
  12873. var n = (e("three"),
  12874. e("../settings"),
  12875. e("../util/browser"),
  12876. e("./DamLoader"))
  12877. , r = e("../util/logger")
  12878. , o = (e("../ab"),
  12879. new r(i));
  12880. t.exports = {
  12881. getLoaders: function() {
  12882. return [["_50k", ".dam", n], ["", ".dam", n]]
  12883. },
  12884. load: function(e, t, i, n, r, a) {
  12885. var s = this.getLoaders();
  12886. a = a || 0;
  12887. var l = s[a];
  12888. if (!l)
  12889. return void (r && r("No suitable model file found..."));
  12890. var c = l[0]
  12891. , h = l[1]
  12892. , u = new l[2](t)
  12893. , d = t.get(e + c + h);
  12894. d ? (o.debug("Trying " + c + h),
  12895. u.load(d, i, n, function() {
  12896. this.load(e, t, i, n, r, ++a)
  12897. }
  12898. .bind(this))) : (o.debug("Skipping " + h + ", not available"),
  12899. this.load(e, t, i, n, r, ++a))
  12900. }
  12901. }
  12902. }
  12903. ).call(this, "/js/loaders/ModelLoader.js")
  12904. }
  12905. , {
  12906. "../ab": 3,
  12907. "../settings": 166,
  12908. "../util/browser": 182,
  12909. "../util/logger": 189,
  12910. "./DamLoader": 104,
  12911. three: 217
  12912. }],
  12913. 106: [function(e, t, i) {
  12914. (function(i) {
  12915. "use strict";
  12916. var n = e("../util/common")
  12917. , r = e("../util/texture")
  12918. , o = e("../util/browser")
  12919. , a = e("../util/logger")
  12920. , s = e("../settings")
  12921. , l = new a(i);
  12922. t.exports = {
  12923. load: function(e, t) {
  12924. function i(e, i) {
  12925. e || (t.push(i),
  12926. p++,
  12927. d.notify(p, a),
  12928. p === a && d.resolve())
  12929. }
  12930. if (!e.chunks[0] || !e.chunks[0].meshUrl)
  12931. return $.when();
  12932. var a = n.countUnique(e.chunks.map(function(e) {
  12933. return e.textureName
  12934. }))
  12935. , c = e.chunks[0].meshUrl.indexOf("_50k") !== -1 ? "_50k" : ""
  12936. , h = "_50k" === c ? "high" : "low";
  12937. s.minimalMemoryMode && "high" === h && (o.detectSamsungS6() ? (l.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12938. h = "low") : a > s.maxMobileTextures && (l.warn("Model probably too large for mobile, turning down quality."),
  12939. h = "low"));
  12940. //经常没有low的贴图,这里要不要去掉转low的?? xzw
  12941. var u = e.data.job.uuid + c + "_texture_jpg_" + h + "/"
  12942. , d = $.Deferred()
  12943. , p = 0;
  12944. return e.chunks.forEach(function(t) {
  12945. if (!t.material.map && t.textureName) {
  12946. var n = e.urls.get(u + t.textureName);
  12947. t.setTextureMap(r.load(n, i.bind(this, r.isLoaded(n))))
  12948. }
  12949. }),
  12950. d.promise()
  12951. }
  12952. }
  12953. }
  12954. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12955. }
  12956. , {
  12957. "../settings": 166,
  12958. "../util/browser": 182,
  12959. "../util/common": 185,
  12960. "../util/logger": 189,
  12961. "../util/texture": 194
  12962. }],
  12963. 107: [function(e, t, i) {
  12964. (function(i, n) {
  12965. "use strict";
  12966. function r(e) {
  12967. this.model = e,
  12968. this.modelDataPath = this.model.urls.get("vision.modeldata")+"?m="+new Date().getTime(),
  12969. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12970. var t = i("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12971. , n = o.loadProto(t);
  12972. this.decoder = n.build("VisionModeldata")
  12973. }
  12974. var o = e("protobufjs")
  12975. , a = e("../util/ajax")
  12976. , s = (e("../util/common"),
  12977. e("../util/math"))
  12978. , l = e("../util/logger")
  12979. , c = new l(n);
  12980. r.prototype.load = function() {
  12981. return this.modelDataPath ? (c.info("Using vision.modeldata"),
  12982. this.loadVisionModelData()) : this.sweepLocationsPath ? (c.warn("Using sweep_locations.csv"),
  12983. this.loadSweepLocationsCSV()) : (c.warn("No sweep file found"),
  12984. $.when([]))
  12985. }
  12986. ,
  12987. r.prototype.loadVisionModelData = function() {
  12988. return a.get(this.modelDataPath, {
  12989. responseType: "arraybuffer"
  12990. }).then(function(e) {
  12991. var t;
  12992. try {
  12993. t = this.decoder.decode(e)
  12994. } catch (e) {
  12995. return c.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12996. this.loadSweepLocationsCSV()
  12997. }
  12998. var i = t.sweepLocations.map(function(e) {
  12999. return {
  13000. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  13001. position: {
  13002. x: e.pose.translation.x,
  13003. y: e.pose.translation.y,
  13004. z: e.pose.translation.z
  13005. },
  13006. quaternion: {
  13007. x: e.pose.rotation.x,
  13008. y: e.pose.rotation.y,
  13009. z: e.pose.rotation.z,
  13010. w: e.pose.rotation.w
  13011. },
  13012. puck: {
  13013. x: e.puck.x,
  13014. y: e.puck.y,
  13015. z: e.puck.z
  13016. },
  13017. floor: window.sceneFrom == 'kankan' ? e.subgroup : e.group,
  13018. neighbours: e.visibles,
  13019. alignmentType: e.alignment_type
  13020. }
  13021. }).map(function(e) {
  13022. return e.position = s.convertVisionVector(e.position),
  13023. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  13024. e.puck = s.convertVisionVector(e.puck),
  13025. e
  13026. });
  13027. return i.forEach(function(e) {
  13028. e.neighbours = e.neighbours.map(function(e) {
  13029. return i[e].uuid
  13030. })
  13031. }),
  13032. i
  13033. }
  13034. .bind(this), function() {
  13035. return c.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  13036. this.loadSweepLocationsCSV()
  13037. }
  13038. .bind(this))
  13039. }
  13040. ,
  13041. r.prototype.loadSweepLocationsCSV = function() {
  13042. return a.get(this.sweepLocationsPath).then(function(e) {
  13043. var t = e.split("\n").map(function(e) {
  13044. return e.split(", ")
  13045. }).filter(function(e) {
  13046. return e.length > 1
  13047. }).map(function(e) {
  13048. return {
  13049. uuid: e[0],
  13050. position: {
  13051. x: parseFloat(e[1]),
  13052. y: parseFloat(e[2]),
  13053. z: parseFloat(e[3])
  13054. },
  13055. quaternion: {
  13056. x: parseFloat(e[4]),
  13057. y: parseFloat(e[5]),
  13058. z: parseFloat(e[6]),
  13059. w: parseFloat(e[7])
  13060. }
  13061. }
  13062. }).map(function(e) {
  13063. return e.position = s.convertVisionVector(e.position),
  13064. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  13065. e
  13066. });
  13067. return t
  13068. }).fail(function() {
  13069. c.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  13070. })
  13071. }
  13072. ,
  13073. t.exports = r
  13074. }
  13075. ).call(this, e("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  13076. }
  13077. , {
  13078. "../util/ajax": 181,
  13079. "../util/common": 185,
  13080. "../util/logger": 189,
  13081. "../util/math": 190,
  13082. buffer: 198,
  13083. protobufjs: 214
  13084. }],
  13085. 108: [function(e, t, i) {
  13086. (function(i) {
  13087. "use strict";
  13088. function n() {
  13089. this.locale = null
  13090. }
  13091. var r = e("../settings")
  13092. , o = e("../util/common")
  13093. , a = e("../util/logger")
  13094. , s = e("../enum/Locale")
  13095. , l = new a(i);
  13096. n.prototype.init = function() {
  13097. var t;
  13098. switch (r.languageTag) {
  13099. case null:
  13100. case "en":
  13101. case s.EN_US:
  13102. this.locale = s.EN_US,
  13103. t = e("./strings-en-US");
  13104. break;
  13105. case "es":
  13106. case s.ES_MX:
  13107. this.locale = s.ES_MX,
  13108. t = e("./strings-es-MX");
  13109. break;
  13110. case "fr":
  13111. case s.FR_FR:
  13112. this.locale = s.FR_FR,
  13113. t = e("./strings-fr-FR");
  13114. break;
  13115. case "de":
  13116. case s.DE_DE:
  13117. this.locale = s.DE_DE,
  13118. t = e("./strings-de-DE");
  13119. break;
  13120. case "ru":
  13121. case s.RU_RU:
  13122. this.locale = s.RU_RU,
  13123. t = e("./strings-ru-RU");
  13124. break;
  13125. case "cn":
  13126. case s.CN_CN:
  13127. this.locale = s.CN_CN,
  13128. t = e("./strings-cn-CN");
  13129. break;
  13130. case "jp":
  13131. case s.JP_JP:
  13132. this.locale = s.JP_JP,
  13133. t = e("./strings-jp-JP");
  13134. break;
  13135. default:
  13136. l.info("Unsupported language tag, defaulting to 'en-US'"),
  13137. this.locale = s.EN_US,
  13138. t = e("./strings-en-US")
  13139. }
  13140. l.info("Using locale '" + this.locale + "'"),
  13141. o.extendObject(this, t)
  13142. }
  13143. ,
  13144. n.prototype.localizeGUI = function() {
  13145. var e = document.querySelector("#gui-parent");
  13146. this.localizeTree(e),
  13147. this.localizeLoadingText()
  13148. }
  13149. ,
  13150. n.prototype.localizeLoadingText = function() {
  13151. // var e = document.querySelector("#loader-cont")
  13152. // , t = e.getAttribute("title");
  13153. // e.removeAttribute("title"),
  13154. // e.setAttribute("data-status", t),
  13155. // e.classList.add(this.locale),
  13156. document.querySelector("#help-dialog").classList.add(this.locale),
  13157. document.querySelector("#interaction-modal").classList.add(this.locale),
  13158. document.querySelector("#gui").classList.add(this.locale);
  13159. }
  13160. ,
  13161. n.prototype.localizeTree = function(e) {
  13162. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  13163. if (e.nodeType === Node.TEXT_NODE)
  13164. t = e.data.match(n),
  13165. t && (i = t[1],
  13166. e.data = this.localizeText(i) || i);
  13167. else if (e.nodeType === Node.ELEMENT_NODE) {
  13168. var r = e.getAttribute("title");
  13169. r && (t = r.match(n),
  13170. t && (i = t[1],
  13171. e.setAttribute("title", this.localizeText(i) || i)))
  13172. }
  13173. for (e = e.firstChild; e; )
  13174. this.localizeTree(e),
  13175. e = e.nextSibling
  13176. }
  13177. ,
  13178. n.prototype.localizeText = function(t) {
  13179. var i = this[t];
  13180. return i || this.locale === s.EN_US || (l.warn("Localization key '" + t + "' not available for locale '" + this.locale + "', defaulting to English."),
  13181. i = e("./strings-en-US")[t]),
  13182. i || l.warn("Localization key '" + t + "' not available for locale 'en-US'"),
  13183. i
  13184. }
  13185. ,
  13186. t.exports = new n
  13187. }
  13188. ).call(this, "/js/localization/localize.js")
  13189. }
  13190. , {
  13191. "../enum/Locale": 31,
  13192. "../settings": 166,
  13193. "../util/common": 185,
  13194. "../util/logger": 189,
  13195. "./strings-cn-CN": 109,
  13196. "./strings-de-DE": 110,
  13197. "./strings-en-US": 111,
  13198. "./strings-es-MX": 112,
  13199. "./strings-fr-FR": 113,
  13200. "./strings-jp-JP": 114,
  13201. "./strings-ru-RU": 115
  13202. }],
  13203. 109: [function(e, t, i) {
  13204. "use strict";
  13205. t.exports = {
  13206. PAGE_TITLE: "",
  13207. LOADING: "正在加载",
  13208. PRESENTED_BY_CAPS: "呈现者:",
  13209. POWERED_BY: "技术支持:",
  13210. POWERED_BY_CAPS: "技术支持:",
  13211. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  13212. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  13213. PRESENTED_BY: "呈现者:",
  13214. MORE: "更多 ",
  13215. LESS: "更少 ",
  13216. TAG_CONTENT: "tag™ 内容",
  13217. SHOW: "显示",
  13218. HIDE: "隐藏",
  13219. DOLLHOUSE: "场景屋",
  13220. FLOOR_PLAN: "楼层平面图",
  13221. OPEN_HIGHLIGHTS: "打开精彩片段",
  13222. CLOSE_HIGHLIGHTS: "关闭",
  13223. PREVIOUS: "上一个",
  13224. PLAY: "播放",
  13225. PAUSE: "暂停",
  13226. NEXT: "下一个",
  13227. EXPLORE_3D_SPACE: "探索 3D 空间",
  13228. VIEW_DOLLHOUSE: "观看场景屋",
  13229. SOCIAL_SHARING: "分享这个空间",
  13230. VIEW_IN_VR: "以 VR 观看",
  13231. VIEW_FULLSCREEN: "全屏观看",
  13232. EXIT_FULLSCREEN: " 退出全屏",
  13233. ZOOM_IN: "放大",
  13234. ZOOM_OUT: "缩小",
  13235. FLOOR_NAME: "楼层",
  13236. FLOOR_ALL: "ALL",
  13237. FLOOR_Lang: ["Floor",""],
  13238. TERMS: "条款",
  13239. PORT_TERMS: "port 条款",
  13240. TERMS_OF_USE: "使用条款",
  13241. CLOSE_TERMS: "关闭",
  13242. TERMS_TEXT_FILE: "terms-cn-CN.html",
  13243. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  13244. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  13245. WEBVR_ENTER_WEBVR: "进入 VR",
  13246. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  13247. WEBVR_LEARN_MORE: "了解更多",
  13248. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  13249. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  13250. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  13251. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  13252. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  13253. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  13254. VR_LEARN_MORE_CAPS: "了解更多",
  13255. VR_PREVIOUS_CAPS: "上一个’,",
  13256. VR_NEXT_CAPS: "下一个",
  13257. VR_GOT_IT_CAPS: "明白了",
  13258. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  13259. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  13260. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  13261. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  13262. VR_WHAT_YOU_NEED: "关于...您需要什么",
  13263. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  13264. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  13265. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  13266. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  13267. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13268. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13269. VR_APP: "port VR 应用程序",
  13270. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13271. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13272. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  13273. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  13274. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  13275. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  13276. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  13277. VR_ANDROID_DVICES: "Android 设备",
  13278. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  13279. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  13280. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  13281. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  13282. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  13283. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  13284. VR_DOWNLOAD_HERE: "在此下载",
  13285. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  13286. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  13287. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  13288. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  13289. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  13290. SHARE_TO: "分享到",
  13291. SHARE_LINK: "直接链接",
  13292. SHARE_EXPLORE: "探索",
  13293. SHARE_AT: "在",
  13294. SHARE_WITH: "使用",
  13295. SHARE_3D: "以 3D",
  13296. SHARE_COPIED: "已复制!",
  13297. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  13298. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  13299. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  13300. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  13301. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  13302. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  13303. ERROR_GENERIC_ACTIONS_3: " 或",
  13304. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  13305. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  13306. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  13307. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  13308. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  13309. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  13310. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  13311. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  13312. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  13313. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  13314. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  13315. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  13316. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  13317. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  13318. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  13319. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  13320. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  13321. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  13322. LINK_TO_LOCATION: "地点链接",
  13323. MENU_COPY: "复制",
  13324. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  13325. ROTATE: "旋转",
  13326. MOVE: "移动",
  13327. INSIDE: "内部",
  13328. ZOOM: "缩放",
  13329. HELP: "小帮手",
  13330. HELP_NAVIGATION_TAB: "导航",
  13331. HELP_MORE_HELP_TAB: "更多帮助",
  13332. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  13333. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  13334. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  13335. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  13336. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  13337. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  13338. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  13339. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  13340. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  13341. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  13342. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  13343. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  13344. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  13345. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  13346. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  13347. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  13348. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  13349. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  13350. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  13351. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  13352. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  13353. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  13354. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  13355. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  13356. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  13357. HELP_MORE_HLR_A: "精彩片段集锦",
  13358. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  13359. HELP_MORE_DOLLHOUSE_A: "场景屋",
  13360. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  13361. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  13362. HELP_MORE_FLOORS_A: "楼层选择器",
  13363. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  13364. HELP_MORE_TAG_A: "tag™ 贴文",
  13365. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  13366. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  13367. HELP_MORE_ZOOM_A: "缩放控件",
  13368. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  13369. HELP_MORE_TOUR_A: "导览控件",
  13370. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  13371. HELP_MORE_INSIDE_A: "内部视图",
  13372. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  13373. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  13374. HELP_MORE_VR_A: "VR 模式",
  13375. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  13376. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  13377. HELP_MORE_360_A: "360° 视图",
  13378. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  13379. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  13380. HELP_MORE_FULLSCREEN_A: "全屏",
  13381. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  13382. CLOSE: "关闭"
  13383. }
  13384. }
  13385. , {}],
  13386. 110: [function(e, t, i) {
  13387. "use strict";
  13388. t.exports = {
  13389. PAGE_TITLE: "",
  13390. LOADING: "Lädt",
  13391. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  13392. POWERED_BY: "Angetrieben von",
  13393. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  13394. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  13395. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  13396. PRESENTED_BY: "Präsentiert von ",
  13397. MORE: "Mehr ",
  13398. LESS: "Weniger ",
  13399. TAG_CONTENT: "tag™ Inhalt",
  13400. SHOW: "Anzeigen",
  13401. HIDE: "Verbergen",
  13402. DOLLHOUSE: "Puppenhaus",
  13403. FLOOR_PLAN: "Grundriss",
  13404. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  13405. CLOSE_HIGHLIGHTS: "Schließen",
  13406. PREVIOUS: "Vorheriges",
  13407. PLAY: "Abspielen",
  13408. PAUSE: "Pausieren",
  13409. NEXT: "Nächstes",
  13410. EXPLORE_3D_SPACE: "Innenraum betreten",
  13411. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  13412. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  13413. VIEW_IN_VR: "In VR ansehen",
  13414. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  13415. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  13416. ZOOM_IN: "Vergrößern",
  13417. ZOOM_OUT: "Verkleinern",
  13418. FLOOR_NAME: "Etage ",
  13419. FLOOR_ALL: "Alle",
  13420. TERMS: "Bedingungen",
  13421. PORT_TERMS: "port Bedingungen",
  13422. TERMS_OF_USE: "Nutzungsbedingungen",
  13423. TERMS_TEXT_FILE: "terms-de-DE.html",
  13424. CLOSE_TERMS: "Schließen",
  13425. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  13426. HELP: "Hilfe",
  13427. HELP_NAVIGATION_TAB: "Navigation",
  13428. HELP_MORE_HELP_TAB: "Hilfe-Details",
  13429. CLOSE: "Schließen",
  13430. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  13431. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  13432. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13433. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  13434. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  13435. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  13436. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  13437. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  13438. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  13439. 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.",
  13440. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13441. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  13442. 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.",
  13443. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  13444. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13445. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  13446. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  13447. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  13448. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  13449. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  13450. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  13451. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  13452. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  13453. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  13454. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  13455. HELP_MORE_HLR_A: "Liste das Highlight",
  13456. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  13457. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  13458. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13459. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13460. HELP_MORE_FLOORS_A: "Etage auswählen",
  13461. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  13462. HELP_MORE_TAG_A: "tag™ Posts",
  13463. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  13464. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  13465. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  13466. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  13467. HELP_MORE_TOUR_A: "Tour Steuerung",
  13468. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  13469. HELP_MORE_INSIDE_A: "Innenansicht",
  13470. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  13471. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  13472. HELP_MORE_VR_A: "VR Modus",
  13473. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  13474. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  13475. HELP_MORE_360_A: "360° Views Ansicht ",
  13476. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13477. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13478. HELP_MORE_FULLSCREEN_A: "Vollbild",
  13479. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  13480. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  13481. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  13482. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  13483. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  13484. WEBVR_LEARN_MORE: "Mehr Infos",
  13485. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13486. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13487. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13488. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  13489. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  13490. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13491. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13492. VR_APP: "port VR App",
  13493. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  13494. 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",
  13495. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  13496. VR_APP_FOR_ANDROID: "port VR app für Android",
  13497. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  13498. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13499. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  13500. VR_PREVIOUS_CAPS: "ZURÜCK",
  13501. VR_NEXT_CAPS: "WEITER",
  13502. VR_GOT_IT_CAPS: "VERSTANDEN",
  13503. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  13504. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  13505. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  13506. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  13507. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  13508. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  13509. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13510. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13511. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13512. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  13513. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  13514. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  13515. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  13516. VR_ANDROID_DVICES: "Android Geräte",
  13517. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  13518. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  13519. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  13520. VR_DOWNLOAD_HERE: "Hier runterladen",
  13521. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  13522. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  13523. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  13524. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  13525. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  13526. SHARE_TO: "Teilen auf",
  13527. SHARE_LINK: "Direkter Link",
  13528. SHARE_EXPLORE: "Umsehen",
  13529. SHARE_AT: "auf",
  13530. SHARE_WITH: "mit",
  13531. SHARE_3D: "in 3D",
  13532. SHARE_COPIED: "Kopiert!",
  13533. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  13534. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  13535. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  13536. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  13537. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13538. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  13539. ERROR_GENERIC_ACTIONS_3: " oder ",
  13540. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13541. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  13542. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  13543. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  13544. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  13545. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  13546. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  13547. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  13548. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  13549. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  13550. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  13551. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  13552. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  13553. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  13554. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13555. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13556. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  13557. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  13558. LINK_TO_LOCATION: "Link zu",
  13559. MENU_COPY: "Kopieren",
  13560. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  13561. ROTATE: "Drehen",
  13562. INSIDE: "Drinnen",
  13563. MOVE: "Bewegen",
  13564. ZOOM: "Vergrößern"
  13565. }
  13566. }
  13567. , {}],
  13568. 111: [function(e, t, i) {
  13569. "use strict";
  13570. t.exports = {
  13571. PAGE_TITLE: "",
  13572. LOADING: "Loading",
  13573. PRESENTED_BY_CAPS: "PRESENTED BY",
  13574. POWERED_BY: "powered by ",
  13575. POWERED_BY_CAPS: "POWERED BY",
  13576. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  13577. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  13578. PRESENTED_BY: "Presented by ",
  13579. MORE: "More ",
  13580. LESS: "Less ",
  13581. TAG_CONTENT: "tag™ Content",
  13582. SHOW: "Show",
  13583. HIDE: "Hide",
  13584. DOLLHOUSE: "Dollhouse",
  13585. FLOOR_PLAN: "Floor plan",
  13586. OPEN_HIGHLIGHTS: "Open Highlights",
  13587. CLOSE_HIGHLIGHTS: "Close",
  13588. PREVIOUS: "Previous",
  13589. PLAY: "Play",
  13590. PAUSE: "Pause",
  13591. NEXT: "Next",
  13592. EXPLORE_3D_SPACE: "Explore 3D Space",
  13593. VIEW_DOLLHOUSE: "View dollhouse",
  13594. SOCIAL_SHARING: "Share this Space",
  13595. VIEW_IN_VR: "View in VR",
  13596. VIEW_FULLSCREEN: "全屏",
  13597. EXIT_FULLSCREEN: "退出全屏",
  13598. ZOOM_IN: "Zoom in",
  13599. ZOOM_OUT: "Zoom out",
  13600. FLOOR_NAME: "Floor ",
  13601. FLOOR_ALL: "全部",
  13602. TERMS: "Terms",
  13603. PORT_TERMS: "port terms",
  13604. TERMS_OF_USE: "Terms of Use",
  13605. TERMS_TEXT_FILE: "terms-en-US.html",
  13606. CLOSE_TERMS: "Close",
  13607. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  13608. HELP: "Help",
  13609. HELP_NAVIGATION_TAB: "Navigation",
  13610. HELP_MORE_HELP_TAB: "More Help",
  13611. CLOSE: "Close",
  13612. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  13613. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  13614. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  13615. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  13616. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  13617. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  13618. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  13619. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  13620. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  13621. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  13622. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  13623. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  13624. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  13625. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  13626. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  13627. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  13628. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  13629. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  13630. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  13631. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  13632. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  13633. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  13634. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  13635. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  13636. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  13637. HELP_MORE_HLR_A: "Highlight Reel",
  13638. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  13639. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  13640. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  13641. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  13642. HELP_MORE_FLOORS_A: "Floor Selector",
  13643. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  13644. HELP_MORE_TAG_A: "tag™ Posts",
  13645. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  13646. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  13647. HELP_MORE_ZOOM_A: "Zoom Controls",
  13648. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  13649. HELP_MORE_TOUR_A: "Tour Controls",
  13650. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  13651. HELP_MORE_INSIDE_A: "Inside View",
  13652. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  13653. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  13654. HELP_MORE_VR_A: "VR Mode",
  13655. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  13656. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  13657. HELP_MORE_360_A: "360° Views",
  13658. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  13659. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  13660. HELP_MORE_FULLSCREEN_A: "Full screen",
  13661. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  13662. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  13663. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  13664. WEBVR_FOR_DAYDREAM: "For Daydream View",
  13665. WEBVR_ENTER_WEBVR: "ENTER VR",
  13666. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  13667. WEBVR_LEARN_MORE: "Learn more",
  13668. WEBVR_VIEW_SPACE: "View Space in VR",
  13669. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13670. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  13671. VR_VIEW_SPACE: "View Space in Virtual Reality",
  13672. VR_LEARN_MORE_CAPS: "LEARN MORE",
  13673. VR_PREVIOUS_CAPS: "PREVIOUS",
  13674. VR_NEXT_CAPS: "NEXT",
  13675. VR_GOT_IT_CAPS: "GOT IT",
  13676. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  13677. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13678. VR_SHOW_IOS_1: "Tap to view the space in VR",
  13679. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  13680. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13681. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13682. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13683. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  13684. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  13685. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13686. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13687. VR_APP: "port VR App",
  13688. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13689. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13690. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  13691. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  13692. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  13693. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13694. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13695. VR_ANDROID_DVICES: "Android Devices",
  13696. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  13697. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  13698. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  13699. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  13700. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  13701. VR_APP_OPEN: "Open with the port VR app instead",
  13702. VR_DOWNLOAD_HERE: "Download here",
  13703. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  13704. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  13705. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  13706. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  13707. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  13708. SHARE_TO: "Share to",
  13709. SHARE_LINK: "Direct Link",
  13710. SHARE_EXPLORE: "Explore ",
  13711. SHARE_AT: "at",
  13712. SHARE_WITH: "with",
  13713. SHARE_3D: " in 3D",
  13714. SHARE_COPIED: "Copied!",
  13715. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  13716. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  13717. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  13718. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  13719. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  13720. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  13721. ERROR_GENERIC_ACTIONS_3: " or ",
  13722. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  13723. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  13724. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  13725. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  13726. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  13727. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  13728. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  13729. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  13730. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  13731. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  13732. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  13733. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  13734. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  13735. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  13736. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  13737. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  13738. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  13739. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  13740. LINK_TO_LOCATION: "Link to location",
  13741. MENU_COPY: "Copy",
  13742. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  13743. ROTATE: "Rotate",
  13744. INSIDE: "Inside",
  13745. MOVE: "Move",
  13746. ZOOM: "Zoom"
  13747. }
  13748. }
  13749. , {}],
  13750. 112: [function(e, t, i) {
  13751. "use strict";
  13752. t.exports = {
  13753. PAGE_TITLE: "",
  13754. LOADING: "Cargando",
  13755. PRESENTED_BY_CAPS: "PRESENTADO POR",
  13756. POWERED_BY: "potenciando por ",
  13757. POWERED_BY_CAPS: "POTENCIADO POR ",
  13758. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  13759. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  13760. PRESENTED_BY: "Presentado por ",
  13761. MORE: "Más ",
  13762. LESS: "Menos ",
  13763. TAG_CONTENT: "Contenido de tag™",
  13764. SHOW: "Mostrar",
  13765. HIDE: "Ocultar",
  13766. DOLLHOUSE: "Dollhouse",
  13767. FLOOR_PLAN: "Planos",
  13768. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  13769. CLOSE_HIGHLIGHTS: "Cerrar",
  13770. PREVIOUS: "Anterior",
  13771. PLAY: "Play",
  13772. PAUSE: "Pausa",
  13773. NEXT: "Siguiente",
  13774. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  13775. VIEW_DOLLHOUSE: "Ver dollhouse",
  13776. SOCIAL_SHARING: "Compartir este espacio",
  13777. VIEW_IN_VR: "Ver en realidad virtual",
  13778. VIEW_FULLSCREEN: "Ver en pantalla completa",
  13779. EXIT_FULLSCREEN: "Salir de pantalla completa",
  13780. ZOOM_IN: "Acercar",
  13781. ZOOM_OUT: "Alejar",
  13782. FLOOR_NAME: "Piso ",
  13783. FLOOR_ALL: "Todas",
  13784. TERMS: "Condiciones",
  13785. PORT_TERMS: "port términos de uso",
  13786. TERMS_OF_USE: "Términos de uso",
  13787. TERMS_TEXT_FILE: "terms-es-MX.html",
  13788. CLOSE_TERMS: "Cerrar",
  13789. 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.",
  13790. HELP: "Ayuda",
  13791. HELP_NAVIGATION_TAB: "Navegación",
  13792. HELP_MORE_HELP_TAB: "Más Ayuda",
  13793. CLOSE: "Cerrar",
  13794. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13795. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13796. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13797. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13798. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13799. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13800. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13801. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13802. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13803. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13804. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13805. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13806. 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.",
  13807. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13808. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13809. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13810. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13811. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13812. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13813. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13814. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13815. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13816. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13817. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13818. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13819. HELP_MORE_HLR_A: "Galería destacada",
  13820. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13821. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13822. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13823. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13824. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13825. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13826. HELP_MORE_TAG_A: "tag™ Posts",
  13827. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13828. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13829. HELP_MORE_ZOOM_A: "Controles de zoom",
  13830. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13831. HELP_MORE_TOUR_A: "Controles de recorrido",
  13832. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13833. HELP_MORE_INSIDE_A: "Vista interior",
  13834. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13835. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13836. HELP_MORE_VR_A: "Modo de realidad virtual",
  13837. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13838. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13839. HELP_MORE_360_A: "360° Views",
  13840. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13841. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13842. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13843. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13844. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13845. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13846. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13847. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13848. WEBVR_LEARN_MORE: "Más información",
  13849. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13850. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13851. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13852. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13853. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13854. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13855. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13856. VR_APP: "port VR App",
  13857. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13858. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13859. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13860. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13861. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13862. VR_PREVIOUS_CAPS: "ANTERIOR",
  13863. VR_NEXT_CAPS: "SIGUIENTE",
  13864. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13865. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13866. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13867. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13868. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13869. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13870. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13871. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13872. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13873. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13874. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13875. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13876. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13877. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13878. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13879. VR_ANDROID_DVICES: "Dispositivos Android",
  13880. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13881. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13882. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13883. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13884. VR_DOWNLOAD_HERE: "Descargar aquí",
  13885. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13886. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13887. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13888. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13889. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13890. SHARE_TO: "Compartir en",
  13891. SHARE_LINK: "Enlace directo",
  13892. SHARE_EXPLORE: "Explorar ",
  13893. SHARE_AT: "en",
  13894. SHARE_WITH: "con",
  13895. SHARE_3D: " en 3D",
  13896. SHARE_COPIED: "¡Copiado!",
  13897. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13898. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13899. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13900. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13901. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13902. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13903. ERROR_GENERIC_ACTIONS_3: " o ",
  13904. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13905. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13906. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13907. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13908. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13909. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13910. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13911. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13912. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13913. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13914. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13915. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13916. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13917. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13918. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13919. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13920. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13921. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13922. LINK_TO_LOCATION: "Enlace a la ubicación",
  13923. MENU_COPY: "Copiar",
  13924. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13925. ROTATE: "Girar",
  13926. INSIDE: "Interior",
  13927. MOVE: "Moverse",
  13928. ZOOM: "Acercar o alejar"
  13929. }
  13930. }
  13931. , {}],
  13932. 113: [function(e, t, i) {
  13933. "use strict";
  13934. t.exports = {
  13935. PAGE_TITLE: "",
  13936. LOADING: "Chargement",
  13937. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13938. POWERED_BY: "alimenté par ",
  13939. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13940. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13941. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13942. PRESENTED_BY: "Présenté par ",
  13943. MORE: "Plus ",
  13944. LESS: "Moins ",
  13945. TAG_CONTENT: "Contenu tag™",
  13946. SHOW: "Montrer",
  13947. HIDE: "Cacher",
  13948. DOLLHOUSE: "Dollhouse",
  13949. FLOOR_PLAN: "Plan de sol",
  13950. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13951. CLOSE_HIGHLIGHTS: "Fermer",
  13952. PREVIOUS: "Précédent",
  13953. PLAY: "Lecture",
  13954. PAUSE: "Pause",
  13955. NEXT: "Suivant",
  13956. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13957. VIEW_DOLLHOUSE: "Voir dollhouse",
  13958. SOCIAL_SHARING: "Partager cet espace",
  13959. VIEW_IN_VR: "Voir en VR",
  13960. VIEW_FULLSCREEN: "Plein écran",
  13961. EXIT_FULLSCREEN: "Fermer plein écran",
  13962. ZOOM_IN: "Zoom avant",
  13963. ZOOM_OUT: "Zoom arrière",
  13964. FLOOR_NAME: "Étage ",
  13965. FLOOR_ALL: "Tous",
  13966. TERMS: "Mentions légales",
  13967. PORT_TERMS: "port mentions légales",
  13968. TERMS_OF_USE: "Conditions d'utilisation",
  13969. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13970. CLOSE_TERMS: "Fermer",
  13971. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13972. HELP: "Aide",
  13973. HELP_NAVIGATION_TAB: "Navigation",
  13974. HELP_MORE_HELP_TAB: "Aide",
  13975. CLOSE: "Fermer",
  13976. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13977. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13978. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13979. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13980. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13981. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13982. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13983. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13984. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13985. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13986. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13987. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13988. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13989. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13990. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13991. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13992. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13993. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13994. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13995. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13996. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13997. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13998. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13999. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  14000. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  14001. HELP_MORE_HLR_A: "Carrousel",
  14002. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  14003. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  14004. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  14005. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  14006. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  14007. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  14008. HELP_MORE_TAG_A: "tag™ Posts",
  14009. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  14010. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  14011. HELP_MORE_ZOOM_A: "Commandes de zoom",
  14012. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  14013. HELP_MORE_TOUR_A: "Commandes de la visite",
  14014. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  14015. HELP_MORE_INSIDE_A: "Vue intérieure",
  14016. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  14017. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  14018. HELP_MORE_VR_A: "Mode RV",
  14019. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  14020. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  14021. HELP_MORE_360_A: "Vues 360°",
  14022. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  14023. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  14024. HELP_MORE_FULLSCREEN_A: "Plein écran",
  14025. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  14026. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  14027. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  14028. WEBVR_ENTER_WEBVR: "ENTRER VR",
  14029. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  14030. WEBVR_LEARN_MORE: "En savoir plus",
  14031. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  14032. WEBVR_DAYDREAM_VIEW: "Daydream View",
  14033. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  14034. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  14035. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  14036. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  14037. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  14038. VR_NEXT_CAPS: "SUIVANT",
  14039. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  14040. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  14041. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  14042. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  14043. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  14044. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  14045. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  14046. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  14047. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  14048. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  14049. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  14050. VR_GOOGLE_DAYDREAM: "Google Daydream",
  14051. VR_APP: "port VR App",
  14052. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  14053. VR_COMPATIBLE_IPHONES_1: "iPhones",
  14054. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  14055. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  14056. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  14057. 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",
  14058. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  14059. VR_ANDROID_DVICES: "Appareils Android",
  14060. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  14061. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  14062. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  14063. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  14064. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  14065. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  14066. VR_DOWNLOAD_HERE: "Télécharger ici",
  14067. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  14068. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  14069. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  14070. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  14071. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  14072. SHARE_TO: "Partager sur",
  14073. SHARE_LINK: "Lien direct",
  14074. SHARE_EXPLORE: "Explorer ",
  14075. SHARE_AT: "à",
  14076. SHARE_WITH: "avec",
  14077. SHARE_3D: " en 3D",
  14078. SHARE_COPIED: "Copié!",
  14079. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  14080. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  14081. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  14082. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  14083. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  14084. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  14085. ERROR_GENERIC_ACTIONS_3: " ou ",
  14086. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  14087. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  14088. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  14089. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  14090. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  14091. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  14092. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  14093. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  14094. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  14095. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  14096. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  14097. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  14098. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  14099. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  14100. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  14101. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  14102. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  14103. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  14104. LINK_TO_LOCATION: "Lien vers l'emplacement",
  14105. MENU_COPY: "Copie",
  14106. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  14107. ROTATE: "Faire pivoter",
  14108. INSIDE: "Intérieure",
  14109. MOVE: "Se déplacer",
  14110. ZOOM: "Zoom"
  14111. }
  14112. }
  14113. , {}],
  14114. 114: [function(e, t, i) {
  14115. "use strict";
  14116. t.exports = {
  14117. PAGE_TITLE: "",
  14118. LOADING: "読み込み中",
  14119. PRESENTED_BY_CAPS: "PRESENTED BY",
  14120. POWERED_BY: "powered by",
  14121. POWERED_BY_CAPS: "POWERED BY",
  14122. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  14123. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  14124. PRESENTED_BY: "Presented by ",
  14125. MORE: "全て表示 ",
  14126. LESS: "閉じる ",
  14127. TAG_CONTENT: "tag™コンテンツ ",
  14128. SHOW: "表示",
  14129. HIDE: "非表示",
  14130. DOLLHOUSE: "ドールハウス",
  14131. FLOOR_PLAN: "フロアプラン",
  14132. OPEN_HIGHLIGHTS: "ハイライトを開く",
  14133. CLOSE_HIGHLIGHTS: "閉じる",
  14134. PREVIOUS: "前へ",
  14135. PLAY: "再生",
  14136. PAUSE: "一時停止",
  14137. NEXT: "次へ",
  14138. EXPLORE_3D_SPACE: "3DSpaceの探索",
  14139. VIEW_DOLLHOUSE: "ドールハウスの表示",
  14140. SOCIAL_SHARING: "このSpaceを共有する",
  14141. VIEW_IN_VR: "VRで表示",
  14142. VIEW_FULLSCREEN: "フルスクリーン表示",
  14143. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  14144. ZOOM_IN: "ズームイン",
  14145. ZOOM_OUT: "ズームアウト",
  14146. FLOOR_NAME: "フロア ",
  14147. FLOOR_ALL: "すべて",
  14148. TERMS: "規約",
  14149. PORT_TERMS: "port規約",
  14150. TERMS_OF_USE: "利用規約",
  14151. CLOSE_TERMS: "閉じる",
  14152. TERMS_TEXT_FILE: "terms-jp-JP.html",
  14153. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  14154. WEBVR_FOR_DAYDREAM: "Daydream View用",
  14155. WEBVR_ENTER_WEBVR: "VRに入る",
  14156. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  14157. WEBVR_LEARN_MORE: "もっと詳しく",
  14158. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  14159. WEBVR_DAYDREAM_VIEW: "Daydream View",
  14160. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  14161. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  14162. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  14163. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  14164. VR_LEARN_MORE_CAPS: "もっと詳しく",
  14165. VR_PREVIOUS_CAPS: "前へ",
  14166. VR_NEXT_CAPS: "次へ",
  14167. VR_GOT_IT_CAPS: "了解",
  14168. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  14169. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  14170. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  14171. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  14172. VR_WHAT_YOU_NEED: "必要なもの",
  14173. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  14174. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  14175. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  14176. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  14177. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  14178. VR_GOOGLE_DAYDREAM: "Google Daydream",
  14179. VR_APP: "port VRアプリ",
  14180. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  14181. VR_COMPATIBLE_IPHONES_1: "iPhone",
  14182. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  14183. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  14184. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  14185. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  14186. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  14187. VR_ANDROID_DVICES: "Androidデバイス",
  14188. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  14189. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  14190. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  14191. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  14192. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  14193. VR_APP_OPEN: "port VRアプリで開く",
  14194. VR_DOWNLOAD_HERE: "ここからダウンロード",
  14195. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  14196. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  14197. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  14198. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  14199. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  14200. SHARE_TO: "共有先",
  14201. SHARE_LINK: "ダイレクトリンク",
  14202. SHARE_EXPLORE: "探索",
  14203. SHARE_AT: "場所",
  14204. SHARE_WITH: "使用アプリ",
  14205. SHARE_3D: "3Dで",
  14206. SHARE_COPIED: "コピーされました!",
  14207. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  14208. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  14209. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  14210. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  14211. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  14212. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  14213. ERROR_GENERIC_ACTIONS_3: "または",
  14214. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  14215. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  14216. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  14217. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  14218. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  14219. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  14220. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  14221. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  14222. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  14223. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  14224. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  14225. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  14226. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  14227. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  14228. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  14229. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  14230. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  14231. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  14232. LINK_TO_LOCATION: "ロケーションへのリンク",
  14233. MENU_COPY: "コピー",
  14234. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  14235. ROTATE: "回転",
  14236. MOVE: "移動",
  14237. INSIDE: "内側",
  14238. ZOOM: "ズーム",
  14239. HELP: "ヘルプ",
  14240. HELP_NAVIGATION_TAB: "ナビゲーション",
  14241. HELP_MORE_HELP_TAB: "その他のヘルプ",
  14242. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  14243. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  14244. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  14245. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  14246. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  14247. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  14248. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  14249. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  14250. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  14251. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  14252. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  14253. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  14254. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  14255. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  14256. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  14257. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  14258. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  14259. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  14260. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  14261. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  14262. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  14263. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  14264. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  14265. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  14266. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  14267. HELP_MORE_HLR_A: "ハイライト",
  14268. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  14269. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  14270. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  14271. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  14272. HELP_MORE_FLOORS_A: "フロアセレクター",
  14273. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  14274. HELP_MORE_TAG_A: "tag™ Posts",
  14275. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  14276. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  14277. HELP_MORE_ZOOM_A: "ズームコントロール",
  14278. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  14279. HELP_MORE_TOUR_A: "ツアーコントロール",
  14280. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  14281. HELP_MORE_INSIDE_A: "内側ビュー",
  14282. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  14283. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  14284. HELP_MORE_VR_A: "VRモード",
  14285. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  14286. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  14287. HELP_MORE_360_A: "360° Views",
  14288. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  14289. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  14290. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  14291. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  14292. CLOSE: "閉じる"
  14293. }
  14294. }
  14295. , {}],
  14296. 115: [function(e, t, i) {
  14297. "use strict";
  14298. t.exports = {
  14299. PAGE_TITLE: "",
  14300. LOADING: "Загрузка",
  14301. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  14302. POWERED_BY: "разработано на платформе ",
  14303. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  14304. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  14305. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  14306. PRESENTED_BY: "Представлено ",
  14307. MORE: "Больше ",
  14308. LESS: "Меньше ",
  14309. TAG_CONTENT: "tag™ Контент",
  14310. SHOW: "Показать",
  14311. HIDE: "Скрыть",
  14312. DOLLHOUSE: "Dollhouse",
  14313. FLOOR_PLAN: "Планировка",
  14314. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  14315. CLOSE_HIGHLIGHTS: "Закрыть",
  14316. PREVIOUS: "Предыдущий",
  14317. PLAY: "Воспроизвести",
  14318. PAUSE: "Пауза",
  14319. NEXT: "Следующий",
  14320. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  14321. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  14322. SOCIAL_SHARING: "Поделиться этой моделью",
  14323. VIEW_IN_VR: "Посмотреть в VR",
  14324. VIEW_FULLSCREEN: "Полный экран",
  14325. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  14326. ZOOM_IN: "Увеличить",
  14327. ZOOM_OUT: "Уменьшить",
  14328. FLOOR_NAME: "Этаж ",
  14329. FLOOR_ALL: "Все",
  14330. TERMS: "Условия",
  14331. PORT_TERMS: "Правила пользования",
  14332. TERMS_OF_USE: "Условия использования",
  14333. TERMS_TEXT_FILE: "terms-ru-RU.html",
  14334. CLOSE_TERMS: "Закрыть",
  14335. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  14336. HELP: "Помощь",
  14337. HELP_NAVIGATION_TAB: "Навигация",
  14338. HELP_MORE_HELP_TAB: "Доп. Помощь",
  14339. CLOSE: "Закрыть",
  14340. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  14341. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  14342. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  14343. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  14344. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  14345. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  14346. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  14347. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  14348. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  14349. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  14350. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  14351. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  14352. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  14353. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  14354. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  14355. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  14356. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  14357. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  14358. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  14359. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  14360. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  14361. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  14362. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  14363. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  14364. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  14365. HELP_MORE_HLR_A: "Фотоколлаж",
  14366. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  14367. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  14368. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  14369. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  14370. HELP_MORE_FLOORS_A: "Выбор Этажа",
  14371. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  14372. HELP_MORE_TAG_A: "tag™ Posts",
  14373. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  14374. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  14375. HELP_MORE_ZOOM_A: "Масштаб",
  14376. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  14377. HELP_MORE_TOUR_A: "Управление Туром",
  14378. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  14379. HELP_MORE_INSIDE_A: "Вид Изнутри",
  14380. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  14381. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  14382. HELP_MORE_VR_A: "Режим VR",
  14383. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  14384. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  14385. HELP_MORE_360_A: "360° Views",
  14386. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  14387. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  14388. HELP_MORE_FULLSCREEN_A: "Полный экран",
  14389. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  14390. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  14391. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  14392. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  14393. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  14394. WEBVR_LEARN_MORE: "Узнать больше",
  14395. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  14396. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  14397. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  14398. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  14399. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  14400. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  14401. VR_GOOGLE_DAYDREAM: "Google Daydream",
  14402. VR_APP: "port VR App",
  14403. VR_APP_OPEN: "Или открыть через приложение port VR",
  14404. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  14405. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  14406. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  14407. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  14408. VR_VIEW_SPACE: "Запустить модель в VR",
  14409. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  14410. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  14411. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  14412. VR_GOT_IT_CAPS: "ЯСНО",
  14413. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  14414. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  14415. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  14416. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  14417. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  14418. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  14419. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  14420. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  14421. VR_COMPATIBLE_IPHONES_1: "iPhones",
  14422. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  14423. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  14424. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  14425. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  14426. VR_ANDROID_DVICES: "Android устройства",
  14427. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  14428. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  14429. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  14430. VR_DOWNLOAD_HERE: "Скачать здесь",
  14431. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  14432. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  14433. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  14434. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  14435. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  14436. SHARE_TO: "Поделиться",
  14437. SHARE_LINK: "Прямая ссылка",
  14438. SHARE_EXPLORE: "просмотреть",
  14439. SHARE_AT: "на",
  14440. SHARE_WITH: "с",
  14441. SHARE_3D: "в 3D",
  14442. SHARE_COPIED: "Скопировано!",
  14443. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  14444. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  14445. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  14446. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  14447. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  14448. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  14449. ERROR_GENERIC_ACTIONS_3: " или ",
  14450. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  14451. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  14452. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  14453. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  14454. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  14455. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  14456. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  14457. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  14458. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  14459. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  14460. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  14461. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  14462. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  14463. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  14464. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  14465. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  14466. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  14467. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  14468. LINK_TO_LOCATION: "Ссылка на местоположение",
  14469. MENU_COPY: "Копировать",
  14470. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  14471. ROTATE: "Вращать",
  14472. MOVE: "Передвигаться",
  14473. INSIDE: "Вид изнутри",
  14474. ZOOM: "Масштаб"
  14475. }
  14476. }
  14477. , {}],
  14478. 116: [function(e, t, i) {//main.js
  14479. (function(t) {
  14480. "use strict";
  14481. var modelProgressBase = 0.4;
  14482. var progressUpdate = function(e){ // 0 <= e <= 1
  14483. console.log('e1:'+e)
  14484. e = Math.round(modelProgressBase * e * 100);
  14485. console.log('e2:'+e)
  14486. var t = $('.progressbar');
  14487. t.find('.bar').css('width',e+'%');
  14488. t.find('.label').css('left', t.width() * e / 100 - 15 + 'px' ); //上面跟着的字的百分比
  14489. t.find('.perc').text(e +'%'); //具体数字的百分比
  14490. }
  14491. $('#gui-loading').fadeIn(200);
  14492. progressUpdate(0.1)
  14493. var fileName = g_version ? 'modeldata.js' : 'someData.json' ;
  14494. $.ajax(g_Prefix + "data/"+window.number+"/"+fileName+"?"+randomTime().getTime(),{dataType: "json"}).done( function(e){ //改
  14495. var data = matcher(e);
  14496. data.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}",window.number);
  14497. data.user = {
  14498. "is_authenticated": false,
  14499. "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"]
  14500. }
  14501. try{//处理一下导览数据
  14502. data.model.images = data.model.images.filter(e=>{
  14503. if(!e.locations && !e.thumbnail_signed_src)return; //旧的曾有导览数据是错误的,将它删除
  14504. if(e.locations)e.locations = e.locations.filter(e=>e)
  14505. if(e.locations && e.locations.length == 0)return;
  14506. return e
  14507. })
  14508. }catch(e){console.log(e) }
  14509. window.DATA = data;
  14510. window.DATA.puckHeight || window.DATA.info && window.DATA.info.puckHeight && (window.DATA.puckHeight = window.DATA.info.puckHeight);
  14511. window.PuckHeightHelper && (window.DATA.puckHeight = window.PuckHeightHelper.normalizeConfig(window.DATA.puckHeight));
  14512. data.model.summary = data.summary
  14513. data.model.name = data.name
  14514. for(let i in data){
  14515. data[i] == "false" && (data[i] = false)
  14516. }
  14517. progressUpdate(0.7);
  14518. StartLoad(); //xzw someData.js是我整合的 原本在html里 但这样每个场景的html都不一样了
  14519. if(data.weixinDesc){
  14520. g_weixinObj.desc = data.weixinDesc;
  14521. }
  14522. if(data.shareImgUrl){
  14523. g_weixinObj.imgUrl = data.shareImgUrl
  14524. }
  14525. window.wx && manage.weixinShare();
  14526. //初始画面
  14527. data.camera_start && data.camera_start.thumbImg && E(manage.dealURL(data.camera_start.thumbImg))
  14528. function E(e) {
  14529. $("<img/>").attr("src", e).on("load", function() {
  14530. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  14531. $(this).remove()
  14532. })
  14533. }
  14534. //背景
  14535. settings.transparentBg = settings.transparentBg || data.transparentBg || false,
  14536. settings.bgImg = settings.bgImg || data.bgImg || null
  14537. if(settings.bgImg){
  14538. $("#player").css({'background-image': "url("+settings.bgImg+")",
  14539. "background-position": "center center"
  14540. })
  14541. }
  14542. {//初始化导览时间
  14543. if(DATA.tourBlackSpeed == void 0)DATA.tourBlackSpeed = 100
  14544. window._settings.warp.teleportTime = settings.teleportTime / DATA.tourBlackSpeed * 100;
  14545. if(DATA.tourWalkSpeed == void 0)DATA.tourWalkSpeed = 100
  14546. if(DATA.tourRotTime == '' || DATA.tourRotTime == void 0){
  14547. DATA.tourRotTime = settings.tourRotTime; //默认停留2秒
  14548. }
  14549. settings.playTourNearBy = !DATA.tourFromStart
  14550. }
  14551. {//其他
  14552. _settings.floorPlanAngle = DATA.floorPlanAngle || 0
  14553. _settings.angleShift2d = DATA.angleShift2d || 0
  14554. if(DATA.insideLookLimit){
  14555. _settings.insideLookLimitDown = DATA.insideLookLimit[0]
  14556. _settings.insideLookLimitUp = DATA.insideLookLimit[1]
  14557. }
  14558. /* _settings.upDownAngleLimitPanos = {
  14559. 25:{up:30},
  14560. 26:{up:30},
  14561. 27:{up:30},
  14562. 28:{up:30},
  14563. 29:{up:30},
  14564. 30:{up:30},
  14565. 31:{up:30},
  14566. 32:{up:30},
  14567. 33:{up:24},
  14568. 34:{up:30},
  14569. 35:{up:30},
  14570. 36:{up:30},
  14571. 37:{up:30},
  14572. 38:{up:30},
  14573. 39:{up:30}
  14574. } */
  14575. }
  14576. if (data.showCad){
  14577. $.ajax({
  14578. url: '//super.4dage.com/data/'+ window.number +'/floor.json',
  14579. method: 'GET',
  14580. success(res) {
  14581. grendCAD(res, document.documentElement, data.cadSignColor, data.cadBorderColor, data.cadBorderWidth)
  14582. }
  14583. })
  14584. }
  14585. }).fail(e=>{
  14586. alert("缺少someData文件,请检查场景码是否正确。")
  14587. })
  14588. function StartLoad(){//当加载完data后
  14589. function i() {
  14590. var e = window.number//Y.getModelIDFromQueryString();
  14591. if (!e)
  14592. return b(null, "loading-failed");
  14593. var t = Y.parseSidUrl(e)
  14594. , i = l()
  14595. , a = c()
  14596. , s = o()
  14597. , u = V.quickstart.enabled
  14598. , g = null
  14599. , m = null
  14600. , v = null
  14601. , w = null
  14602. , T = null
  14603. , x = null
  14604. , S = null
  14605. , M = null
  14606. , R = null
  14607. , P = null
  14608. , O = null
  14609. , L = null
  14610. , N = new ue;
  14611. r(s);
  14612. h({ //MP开头写法
  14613. urlBase: t.urlBase
  14614. }).then(function() {
  14615. return re.init(),
  14616. d(t, e) //getModel and load
  14617. }).then(function(e) {
  14618. progressUpdate(0.9)
  14619. return P = e,
  14620. p(P, V.appConfig.segment_key, V.appConfig.keen_write_key, V.appConfig.keen_project_id, {
  14621. startSource: i,
  14622. autoplay: V.autoplay,
  14623. quickstart: u
  14624. }),
  14625. P.urls.init()
  14626. }).then(function() {
  14627. return P.loadPanos()
  14628. }).then(function() {
  14629. m = X.getStartCameraOptions(P, P.panos),
  14630. S = A(P),
  14631. O = y(u, m.mode),
  14632. v = O.controls,
  14633. w = O.player,
  14634. T = O.director,
  14635. x = O.tagManager,
  14636. M = O.tileDownloader,
  14637. R = O.qualityManager,
  14638. L = O.panoRenderer,
  14639. C(P, S, O, s),
  14640. w.director = T,//xzw add
  14641. P.supportsTiles && M.start(),
  14642. !u || m.mode === D.PANORAMA && m.pano || (de.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14643. u = !1);
  14644. var e = null;
  14645. if (u) {
  14646. de.warn("Quickstart engaged. Hold on to your knickers.");
  14647. var t = v.controls[D.PANORAMA];
  14648. g = new ie(R,S.scene,S.camera,t,s),
  14649. _(S, s, P),
  14650. e = g.load(m).then(function() {
  14651. S.addComponent(g),
  14652. S.once(le.AfterRender, function() {
  14653. de.warn("First render after quickstart load finished.")
  14654. })
  14655. })
  14656. }
  14657. window.flyToFirst = function(){//xzw add
  14658. var pano = w.model.panos.get("8d778e19657f433fb9cf8947d823bb70");
  14659. var q = new _x.Quaternion(0.7099827027821568,-0.07708150183830938,0.6958985789714591,0.07555241737970636);
  14660. var lookAtPoint = new _x.Vector3(0,0,-1).applyQuaternion(q).add(pano.position);
  14661. w.flyToPano({pano:pano, lookAtPoint:lookAtPoint})
  14662. };
  14663. return $.when(e, U.startLoading(P, w, T, V.autoplay, u, N))
  14664. }).then(function() {
  14665. return f(P, U.onProgress, i, !u, a)
  14666. }).then(function() {
  14667. if (m.quickstart = u,
  14668. I(P, S, O, s),
  14669. S.started || _(S, s, P),
  14670. H.modelLoaded(P, w, v, V.autoplay),
  14671. E(w, P, m, V.autoplay).done(function() {
  14672. T.autoTour()
  14673. }),
  14674. !P.supportsTiles) {
  14675. var e = new Z(P,w);
  14676. e.start()
  14677. }
  14678. u && (S.removeComponent(g),
  14679. g.destroy(),
  14680. m.pano.enter()),
  14681. U.init(P, T, w, v, S, m, H.getSessionId()),
  14682. U.endLoading(P, T, x),
  14683. S.once(le.AfterRender, function() {
  14684. N.setAppReadyTime();
  14685. var e = N.calcFullLoadingTime();
  14686. de.warn("Total load time: " + e / 1e3),
  14687. H.loadComplete(e),
  14688. de.warn("First render after model load finished.")
  14689. try {
  14690. window.evt && window.dispatchEvent(window.evt);
  14691. parent.postMessage({
  14692. cmd: "loaded",
  14693. }, "*")
  14694. } catch (err) {}
  14695. }),
  14696. S.on(le.MemoryUsageUpdated, n)
  14697. }).fail(b.bind(this, e))
  14698. }
  14699. function n(e) {
  14700. ce.update(e)
  14701. }
  14702. function r(e) {
  14703. de.info("Version", "2.25.6-0-gd87e5b1"),
  14704. q.defaultMaxListeners = 1e3,
  14705. a(e),
  14706. s()
  14707. }
  14708. function o() {
  14709. return document.getElementById("player")
  14710. }
  14711. function a(e) {
  14712. e.addEventListener("dragenter", T, !1),
  14713. e.addEventListener("dragover", T, !1)
  14714. }
  14715. function s() {
  14716. F.valueFromHash("title", !0) || $(document).ready(function() {
  14717. var e = $(".model-title");
  14718. e.hide()
  14719. })
  14720. }
  14721. function l() {
  14722. return F.valueFromHash("play", !1) ? "autoplay" : F.inIframe() ? "click" : "fullpage"
  14723. }
  14724. function c() {
  14725. return {
  14726. panoElementsToLoad: 6,
  14727. modelElementsToLoad: 0,
  14728. totalElementsLoaded: 0,
  14729. totalElementsToLoad: 0,
  14730. totalPercentageLoaded: 0,
  14731. progressCallback: null
  14732. }
  14733. }
  14734. function h(e) {
  14735. return K.loadFeatureFlags(e).done(function(e) {
  14736. K.updateDependentSettings(e, V)
  14737. })
  14738. }
  14739. // function u(e) {
  14740. // return Q.get(e.urlBase + "/api/v1/config/showcase", {
  14741. // responseType: "json",
  14742. // prefetchFrom: "config"
  14743. // }).then(function(e) {
  14744. // return e ? void j.extendObject(V.appConfig, e) : {}
  14745. // }, function(e) {
  14746. // return de.warn("Failed loading runtime config, using defaults."),
  14747. // $.when({})
  14748. // })
  14749. // }
  14750. function d(e, t) {
  14751. var i = B.getModel({
  14752. url: t,
  14753. floors: F.valueFromHash("f", !0),
  14754. autoload: !1
  14755. })
  14756. ;
  14757. return $.when(i, n).then(null, function(e) {
  14758. return this
  14759. })
  14760. }
  14761. function p(e, t, i, n, r) {
  14762. de.info("Model data loaded"),
  14763. de.debug("UUID: " + e.data.job.uuid),
  14764. J.init(K.getFlags()),
  14765. i && H.initKeen({
  14766. token: i,
  14767. appId: n
  14768. }),
  14769. H.initSegment({
  14770. model: e.sid,
  14771. version: "2.25.6-0-gd87e5b1",
  14772. startSource: r.startSource,
  14773. token: t,
  14774. autoplay: r.autoplay,
  14775. quickstart: r.quickstart
  14776. })
  14777. }
  14778. function f(e, t, i, n, r) {
  14779. return r.progressCallback = t,
  14780. H.sessionStart(),
  14781. e.load(n).progress(g.bind(this, r))
  14782. }
  14783. function g(e, t) {
  14784. e.modelElementsToLoad = t[1],
  14785. v(e),
  14786. m(e)
  14787. }
  14788. function m(e) {
  14789. e.totalElementsLoaded++,
  14790. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14791. //----许钟文-----------------模型进度条向后调整
  14792. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0);
  14793. e.totalPercentageLoaded = modelProgressBase + (1-modelProgressBase)*e.totalPercentageLoaded;
  14794. //console.log('pro:'+e.totalPercentageLoaded)
  14795. //---------------------------
  14796. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14797. }
  14798. function v(e) {
  14799. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14800. }
  14801. function A(e) {
  14802. var t = new x.PerspectiveCamera;
  14803. t.layers.enable(he.PANOMARKERS),
  14804. t.layers.enable(he.RETICULE),
  14805. t.layers.enable(he.TAG);
  14806. var i = new x.Scene
  14807. , n = new x.AmbientLight(16777215);
  14808. i.add(n),
  14809. i.plane = new x.Mesh(new x.PlaneBufferGeometry(1e5,1e5),new x.RawShaderMaterial({
  14810. side: x.DoubleSide
  14811. })),
  14812. i.plane.position.y = 0,
  14813. i.plane.rotateX(-Math.PI / 2),
  14814. i.plane.material.visible = !1,
  14815. i.add(i.plane),
  14816. i.updateMatrixWorld(),
  14817. V.showScreenshotLocations && e.data.images.forEach(function(e) {
  14818. if (e.metadata && e.metadata.camera_position) {
  14819. var t = e.metadata.camera_position
  14820. , n = new x.Mesh(new x.BoxGeometry(.3,.3,.3));
  14821. n.position = t.clone(),
  14822. i.add(n);
  14823. var r = e.metadata.camera_quaternion
  14824. , o = new x.Vector3(0,0,-1).applyQuaternion(r);
  14825. i.add(new x.ArrowHelper(o,t.clone(),1,16711680))
  14826. }
  14827. }),
  14828. V.showAxis && (i.add(new x.ArrowHelper(new x.Vector3(0,1,0),new x.Vector3(0,0,0),1,255)),
  14829. i.add(new x.ArrowHelper(new x.Vector3(0,0,1),new x.Vector3(0,0,0),1,16711680)),
  14830. i.add(new x.ArrowHelper(new x.Vector3(1,0,0),new x.Vector3(0,0,0),1,65280)));
  14831. //背景
  14832. if(!settings.transparentBg && !settings.bgImg){
  14833. i.skybox = new W
  14834. i.add(i.skybox)
  14835. }
  14836. var r = new te(i,t,z);
  14837. return r
  14838. }
  14839. function y(e, t) {
  14840. var i = e ? 1 : 1e3
  14841. , n = J.tilegen || J.imgopt ? 6 : 2;
  14842. n = F.valueFromHash("tileconc", n);
  14843. var r = new ne
  14844. , o = new ae({
  14845. concurrentDownloads: n
  14846. })
  14847. , a = new se
  14848. , s = new P
  14849. , l = new M
  14850. , c = new S(t)
  14851. , h = new R
  14852. , u = new O(i)
  14853. , d = new L
  14854. , p = new oe;
  14855. return {
  14856. qualityManager: r,
  14857. panoRenderer: a,
  14858. tileDownloader: o,
  14859. player: c,
  14860. director: l,
  14861. modelManager: s,
  14862. tagManager: p,
  14863. displayController: u,
  14864. labelDisplayController: d,
  14865. controls: h
  14866. }
  14867. }
  14868. function C(e, t, i, n) {
  14869. var r = i.controls
  14870. , o = i.qualityManager
  14871. , a = i.panoRenderer
  14872. , s = i.tileDownloader
  14873. , l = i.modelManager;
  14874. r.init(n, l),
  14875. ee.init(i.director, r, i.player, l, t),
  14876. o.init(l),
  14877. s.init(o),
  14878. a.init(t, s, o),
  14879. l.init(s, a, o),
  14880. l.addModel(e),
  14881. t.addComponent(G)
  14882. }
  14883. function I(e, t, i, n) {
  14884. var r = i.qualityManager
  14885. , o = i.panoRenderer
  14886. , a = i.tileDownloader
  14887. , s = i.modelManager
  14888. , l = i.player
  14889. , c = i.director
  14890. , h = i.tagManager
  14891. , u = i.displayController
  14892. , d = i.labelDisplayController
  14893. , p = i.controls;
  14894. t.scene.add(e),
  14895. t.qualityManager = r;
  14896. var f = {
  14897. camera: t.camera,
  14898. director: c,
  14899. modelManager: s,
  14900. tileDownloader: a,
  14901. panoRenderer: o,
  14902. qualityManager: r,
  14903. tagManager: h,
  14904. container: n,
  14905. controls: p
  14906. };
  14907. l.init(f),
  14908. l.setScene(t.scene),
  14909. h.init(s, l),
  14910. c.init(l, s),
  14911. u.init(c, l, s, h, n),
  14912. d.init(l, s, n),
  14913. z.bindEvents(l),
  14914. t.addComponent(h),
  14915. t.addComponent(l),
  14916. t.addComponent(o),
  14917. l.sceneRenderer = t; //xzw add 方便resize
  14918. }
  14919. function E(e, t, i, n) {
  14920. return de.info("Starting player in " + i.mode),
  14921. H.report(t.sid, "started-playing", n, i.quickstart),
  14922. e.start(i)
  14923. }
  14924. function b(e, t) {
  14925. de.error(t),
  14926. k.error(t),
  14927. H.report(e, "error-" + t)
  14928. }
  14929. function w(e) {
  14930. var t = F.details();
  14931. t && "Safari" === t.name && t.version > 500 && t.version < 600 ? (k.error("webgl-safari"),
  14932. H.report(e, "error-webgl-safari")) : (k.error("webgl-generic"),
  14933. H.report(e, "error-webgl-generic"))
  14934. }
  14935. function _(e, t, i) {
  14936. try {
  14937. e.start(t)
  14938. } catch (e) {
  14939. throw de.warn(e.message),
  14940. w(i.sid),
  14941. e
  14942. }
  14943. }
  14944. function T(e) {
  14945. e.stopPropagation(),
  14946. e.preventDefault()
  14947. }
  14948. //czj 判断someData 有没有hoticon字段 修改热点的样式
  14949. if (window.DATA.hoticon){
  14950. g_HotImage = {
  14951. point: window.DATA.hoticon.default || "https://super.4dage.com/images/4dagePoint2.png",
  14952. point2: window.DATA.hoticon.higt || "https://super.4dage.com/images/4dagePoint.png"
  14953. } ;
  14954. }
  14955. //czj 判断someData 有没有backgroundMusic 添加音乐
  14956. if (window.DATA.backgroundMusic && window.isLocal) {
  14957. window.DATA.backgroundMusic = manage.dealURL(window.DATA.backgroundMusic)
  14958. }else if (g_version === "one"){
  14959. window.DATA.backgroundMusic = manage.dealURL( g_Prefix+"/audio/"+"audio"+window.number + "/background.mp3")
  14960. }
  14961. if (window.DATA.backgroundMusic) {
  14962. SoundManager.setSrc('bgm', window.DATA.backgroundMusic )
  14963. $("#volume").show();
  14964. }
  14965. //隐藏公司logo
  14966. if(window.DATA.loadlogo){
  14967. showLogo();
  14968. }
  14969. // 隐藏顶部介绍
  14970. window.DATA.topText && topTextHide();
  14971. e("./lib/three75-shim"),
  14972. e("./lib/array-polyfill"),
  14973. e("./lib/performance-polyfill"),
  14974. e("./lib/shaders/CopyShader.js"),
  14975. e("./lib/shaders/HorizontalBlurShader.js"),
  14976. e("./lib/shaders/VerticalBlurShader.js"),
  14977. e("./lib/postprocessing/EffectComposer.js"),
  14978. e("./lib/postprocessing/RenderPass.js"),
  14979. e("./lib/postprocessing/MaskPass.js"),
  14980. e("./lib/postprocessing/ShaderPass.js"),
  14981. window.Promise || (window.Promise = e("promise-polyfill"));
  14982. var x = e("three")
  14983. , _x = e("three")
  14984. , S = (e("./util/sentry"),
  14985. e("./player"))
  14986. , M = e("./director")
  14987. , R = e("./controls/CameraControls")
  14988. , P = e("./model/ModelManager")
  14989. , O = e("./DisplayController")
  14990. , L = e("./label/LabelDisplayController")
  14991. , D = e("./enum/Viewmode")
  14992. , N = e("./util/logger")
  14993. , B = e("./showcase")
  14994. , F = e("./util/browser")
  14995. , V = e("./settings")
  14996. , U = e("./gui/gui")
  14997. , k = e("./gui/error")
  14998. , H = e("./analytics")
  14999. , G = e("./util/transitions")
  15000. , z = e("./effects")
  15001. , W = e("./objects/Skybox")
  15002. , j = e("./util/common")
  15003. , Y = (e("./util/PanoramaCollection"),
  15004. e("./util/math"),
  15005. e("./util/showcase"))
  15006. , X = e("./util/camera")
  15007. , Z = (e("./objects/Panorama"),
  15008. e("./cameras/PanoramaCamera"),
  15009. e("./preloaders"))
  15010. , q = e("events").EventEmitter
  15011. , K = e("./featureflags")
  15012. , Q = (e("./util/lerp"),
  15013. e("./util/ajax"))
  15014. , J = e("./ab")
  15015. , ee = e("./sdk/automation.js")
  15016. , te = e("./scene/SceneRenderer")
  15017. , ie = e("./scene/QuickstartManager")
  15018. , ne = e("./tile/QualityManager.js")
  15019. , re = e("./localization/localize")
  15020. , oe = e("./tag/tagManager")
  15021. , ae = e("./tile/TileDownloader")
  15022. , se = e("./tile/PanoRenderer")
  15023. , le = (e("./enum/PanoSizeClass"),
  15024. e("./enum/PanoramaEvents"),
  15025. e("./enum/SceneRendererEvents"))
  15026. , ce = e("./gui/memoryUsage")
  15027. , he = e("./enum/RenderLayers")
  15028. , ue = e("./TimingData")
  15029. , de = new N(t);
  15030. N.level = V.logLevel,
  15031. N.consoleEnabled = V.console,
  15032. i()
  15033. }
  15034. }
  15035. ).call(this, "/js/main.js")
  15036. }
  15037. , {
  15038. "./DisplayController": 1,
  15039. "./TimingData": 2,
  15040. "./ab": 3,
  15041. "./analytics": 4,
  15042. "./cameras/PanoramaCamera": 7,
  15043. "./controls/CameraControls": 9,
  15044. "./director": 15,
  15045. "./effects": 16,
  15046. "./enum/PanoSizeClass": 36,
  15047. "./enum/PanoramaEvents": 37,
  15048. "./enum/RenderLayers": 41,
  15049. "./enum/SceneRendererEvents": 43,
  15050. "./enum/Viewmode": 51,
  15051. "./featureflags": 59,
  15052. "./gui/error": 64,
  15053. "./gui/gui": 65,
  15054. "./gui/memoryUsage": 73,
  15055. "./label/LabelDisplayController": 91,
  15056. "./lib/array-polyfill": 92,
  15057. "./lib/performance-polyfill": 95,
  15058. "./lib/postprocessing/EffectComposer.js": 96,
  15059. "./lib/postprocessing/MaskPass.js": 97,
  15060. "./lib/postprocessing/RenderPass.js": 98,
  15061. "./lib/postprocessing/ShaderPass.js": 99,
  15062. "./lib/shaders/CopyShader.js": 100,
  15063. "./lib/shaders/HorizontalBlurShader.js": 101,
  15064. "./lib/shaders/VerticalBlurShader.js": 102,
  15065. "./lib/three75-shim": 103,
  15066. "./localization/localize": 108,
  15067. "./tag/tagManager": 124,
  15068. "./model/ModelManager": 140,
  15069. "./objects/Panorama": 148,
  15070. "./objects/Skybox": 152,
  15071. "./player": 155,
  15072. "./preloaders": 156,
  15073. "./scene/QuickstartManager": 157,
  15074. "./scene/SceneRenderer": 158,
  15075. "./sdk/automation.js": 164,
  15076. "./settings": 166,
  15077. "./showcase": 168,
  15078. "./tile/PanoRenderer": 169,
  15079. "./tile/QualityManager.js": 170,
  15080. "./tile/TileDownloader": 171,
  15081. "./util/PanoramaCollection": 178,
  15082. "./util/ajax": 181,
  15083. "./util/browser": 182,
  15084. "./util/camera": 183,
  15085. "./util/common": 185,
  15086. "./util/lerp": 188,
  15087. "./util/logger": 189,
  15088. "./util/math": 190,
  15089. "./util/sentry": 192,
  15090. "./util/showcase": 193,
  15091. "./util/transitions": 195,
  15092. events: 202,
  15093. "promise-polyfill": 213,
  15094. three: 217
  15095. }],
  15096. 117: [function(e, t, i) {
  15097. "use strict";
  15098. function n(e) {
  15099. e = e || {}
  15100. r.RawShaderMaterial.call(this, a.extendObject({
  15101. fragmentShader: o.cube.fragmentShader,
  15102. vertexShader: o.cube.vertexShader,
  15103. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  15104. name: "CubemapMaterial",
  15105. }, e))
  15106. }
  15107. var r = e("three")
  15108. , o = e("../shaders")
  15109. , a = e("../util/common");
  15110. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  15111. n.prototype.constructor = n,
  15112. t.exports = n
  15113. }
  15114. , {
  15115. "../shaders": 167,
  15116. "../util/common": 185,
  15117. three: 217
  15118. }],
  15119. 118: [function(e, t, i) {
  15120. "use strict";
  15121. function n(e) {
  15122. e = e || {}
  15123. r.RawShaderMaterial.call(this, a.extendObject({
  15124. fragmentShader: o.model.fragmentShader,
  15125. vertexShader: o.model.vertexShader,
  15126. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  15127. name: "ModelTextureMaterial",
  15128. }, e))
  15129. }
  15130. var r = e("three")
  15131. , o = e("../shaders")
  15132. , a = e("../util/common");
  15133. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  15134. n.prototype.constructor = n,
  15135. n.prototype.setProjectedPanos = function(e, t, i) {
  15136. i && (this.uniforms.progress.value = 0),
  15137. e.ensureSkyboxReadyForRender(),
  15138. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  15139. this.uniforms.pano0Position.value.copy(e.position),
  15140. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  15141. t.ensureSkyboxReadyForRender(),
  15142. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  15143. this.uniforms.pano1Position.value.copy(t.position),
  15144. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  15145. }
  15146. /* n.prototype.setEyeDir = function(dir, pos) {//加
  15147. this.uniforms.eyeDir.value.copy(dir)
  15148. this.uniforms.eyePos.value.copy(pos)
  15149. }
  15150. n.prototype.setBendCameraQua = function(matrix) {//加
  15151. this.uniforms.cameraDeltaMatrix.value.copy(matrix)
  15152. } */
  15153. ,
  15154. t.exports = n
  15155. }
  15156. , {
  15157. "../shaders": 167,
  15158. "../util/common": 185,
  15159. three: 217
  15160. }],
  15161. 119: [function(e, t, i) {
  15162. (function(i) {
  15163. "use strict";
  15164. function n(e, t, i, n) {
  15165. this.div = null,
  15166. this.body = null,
  15167. this.label = e,
  15168. this.description = t,
  15169. this.parsedDescription = [],
  15170. this.media = i || {
  15171. type: null
  15172. },
  15173. this.loadingSpinner = null,
  15174. this.parser = new r({
  15175. supportLinks: !u.valueFromHash("mls"),
  15176. keepLinkLabels: !0
  15177. }),
  15178. this.state = I.CLOSED,
  15179. this.orientation = "",
  15180. this.initialTransform = "",
  15181. this.hovering = !1,
  15182. this.openTransition = null,
  15183. this.closeTransition = null,
  15184. this.openPromise = null,
  15185. this.closePromise = null,
  15186. this.animationTransition = null,
  15187. this.animationScale = 0
  15188. }
  15189. var r = e("../Parser/DescriptionParser")
  15190. , o = e("../Media/Link")
  15191. , a = e("../Media/Image")
  15192. , s = e("../Media/EmbedlyPlayer")
  15193. , l = e("../Media/EmbedlyEmbed")
  15194. , c = e("../../util/transitions")
  15195. , h = e("../../util/lerp")
  15196. , u = e("../../util/browser")
  15197. , d = e("./BillboardEvent")
  15198. , p = e("../Media/MediaEvent")
  15199. , f = e("../Parser/DescriptionChunkType")
  15200. , g = e("events").EventEmitter
  15201. , m = e("./billboardSettings")
  15202. , v = e("./overlaySettings")
  15203. , A = e("../../util/logger")
  15204. , y = new A(i)
  15205. , C = document.getElementById("tag-billboards");
  15206. C.addEventListener("touchend", function(e) {
  15207. C.style.pointerEvents = "none"
  15208. }),
  15209. C.addEventListener("touchcancel", function(e) {
  15210. C.style.pointerEvents = "none"
  15211. });
  15212. var I = {
  15213. CLOSED: "closed",
  15214. OPENING: "opening",
  15215. OPEN: "open",
  15216. CLOSING: "closing",
  15217. ACTIVE: "active"
  15218. };
  15219. n.prototype = Object.create(g.prototype),
  15220. n.prototype.build = function(e) {
  15221. this.parsedDescription = this.parser.parse(this.description);
  15222. var t = document.createElement("div");
  15223. t.className = "tag-container has-hotzone",
  15224. this.div = t,
  15225. this.body = document.createElement("div"),
  15226. this.body.className = "tag-body";
  15227. var i = document.createElement("div");
  15228. i.classList.add("tag-content");
  15229. var n = document.createElement("div");
  15230. n.classList.add("tag-text-content");
  15231. var r = document.createElement("div");
  15232. r.className = "tag-label",
  15233. r.textContent = this.label,
  15234. n.appendChild(r);
  15235. var o = document.createElement("div");
  15236. o.className = "tag-desc",
  15237. n.appendChild(o),
  15238. i.appendChild(n),
  15239. this.body.appendChild(i),
  15240. this.appendDescriptionElements(this.parsedDescription, o),
  15241. this.appendMedia(),
  15242. t.appendChild(this.body),
  15243. C.appendChild(t),
  15244. this.bindEvents(t, this.body)
  15245. }
  15246. ,
  15247. n.prototype.bindEvents = function(e, t) {
  15248. var i = function(e) {
  15249. return function(t) {
  15250. if (!this.div.classList.contains("overlay")) {
  15251. var i, n = document.getElementById("player");
  15252. try {
  15253. i = new MouseEvent(e,t)
  15254. } catch (n) {
  15255. i = document.createEvent("MouseEvents"),
  15256. 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)
  15257. }
  15258. n.dispatchEvent(i)
  15259. }
  15260. }
  15261. };
  15262. t.addEventListener("mousedown", function(e) {
  15263. e.stopPropagation()
  15264. }),
  15265. t.addEventListener("mouseup", function(e) {
  15266. e.stopPropagation()
  15267. }),
  15268. e.addEventListener("touchstart", function(e) {
  15269. C.style.pointerEvents = "auto"
  15270. }),
  15271. e.addEventListener("mousedown", i("mousedown").bind(this)),
  15272. e.addEventListener("mouseup", i("mouseup").bind(this)),
  15273. t.addEventListener("mouseover", function(t) {
  15274. this.state === I.OPEN && e.classList.remove("has-hotzone")
  15275. }
  15276. .bind(this)),
  15277. e.addEventListener("mouseenter", function(e) {
  15278. this.state !== I.CLOSING && (this.hovering = !0,
  15279. this.emit(d.ENTER))
  15280. }
  15281. .bind(this)),
  15282. e.addEventListener("mouseleave", function(e) {
  15283. this.hovering = !1,
  15284. this.emit(d.LEAVE)
  15285. }
  15286. .bind(this)),
  15287. e.addEventListener("gesturestart", function(e) {
  15288. e.preventDefault()
  15289. });
  15290. var n = e.querySelector(".tag-text-content")
  15291. , r = 0;
  15292. n.addEventListener("touchstart", function(e) {
  15293. r = e.changedTouches[0].clientY
  15294. }),
  15295. n.addEventListener("touchmove", function(t) {
  15296. function i(e) {
  15297. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight === 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  15298. }
  15299. return e.classList.contains("overlay") ? i(this.querySelector(".tag-desc")) : void i(this)
  15300. }),
  15301. e.addEventListener("touchmove", function(e) {
  15302. 0 === (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  15303. })
  15304. }
  15305. ,
  15306. n.prototype.appendDescriptionElements = function(e, t) {
  15307. e.length > 0 && this.div.classList.add("has-text"),
  15308. e.forEach(function(e, i) {
  15309. switch (e.type) {
  15310. case f.TEXT:
  15311. t.appendChild(this.createTextElement(e.text));
  15312. break;
  15313. case f.LINK:
  15314. t.appendChild(this.createLinkElement(e.link))
  15315. }
  15316. }
  15317. .bind(this))
  15318. }
  15319. ,
  15320. n.prototype.appendLoadingSpinner = function() {
  15321. this.loadingSpinner = document.createElement("div"),
  15322. this.loadingSpinner.classList.add("loading-spinner");
  15323. var e = document.createElement("div");
  15324. e.classList.add("gui-spinner-icon"),
  15325. this.loadingSpinner.appendChild(e),
  15326. this.body.appendChild(this.loadingSpinner)
  15327. }
  15328. ,
  15329. n.prototype.onMediaLoadFinished = function() {
  15330. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  15331. this.applyOrientation(this.orientation),
  15332. this.loadingSpinner = null)
  15333. }
  15334. ,
  15335. n.prototype.appendMedia = function() {
  15336. if (this.media && this.media.type && "error" !== this.media.type && (!u.valueFromHash("mls", 0) || this.media.type === f.IMAGE)) {
  15337. this.appendLoadingSpinner();
  15338. var e = document.createElement("div");
  15339. e.classList.add("tag-media-content");
  15340. var t = document.createElement("i");
  15341. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  15342. t.classList.add(e)
  15343. }),
  15344. this.body.appendChild(t),
  15345. this.body.appendChild(e),
  15346. this.media.type) {
  15347. case f.IMAGE:
  15348. e.appendChild(this.createImageElement(this.media, this.body));
  15349. break;
  15350. case f.VIDEO:
  15351. e.appendChild(this.createVideoElement(this.media, this.body));
  15352. break;
  15353. case f.RICH:
  15354. e.appendChild(this.createEmbedElement(this.media, this.body))
  15355. }
  15356. }
  15357. }
  15358. ,
  15359. n.prototype.createTextElement = function(e) {
  15360. var t = document.createElement("span");
  15361. return t.textContent = e,
  15362. t
  15363. }
  15364. ;
  15365. n.prototype.createLinkElement = function(e) {
  15366. var t = new o(e);
  15367. return t.on(p.LINK_CLICK, this.emit.bind(this, p.LINK_CLICK)),
  15368. t.createDomElement()
  15369. }
  15370. ,
  15371. n.prototype.createImageElement = function(e, t) {
  15372. function i() {
  15373. function e() {
  15374. m || (r.classList.remove("view-image"),
  15375. c.classList.add("overlay"),
  15376. i(),
  15377. window.addEventListener("resize", b),
  15378. c.addEventListener("click", a),
  15379. g.addEventListener("click", l),
  15380. f.addEventListener("click", s),
  15381. m = !0,
  15382. o.emit(p.IMAGE_OPENED))
  15383. }
  15384. function i() {
  15385. t.classList.add("show-info"),
  15386. h.classList.remove("collapsible"),
  15387. h.style.height = "";
  15388. var e = parseFloat(getComputedStyle(I).lineHeight)
  15389. , i = y + e
  15390. , r = c.clientWidth - 2 * v.boundaryWidth - C
  15391. , a = c.clientHeight - 2 * v.boundaryHeight - C - i
  15392. , s = a
  15393. , l = s * n.aspect;
  15394. l > r && (l = r,
  15395. s = l / n.aspect),
  15396. s > a && (s = a,
  15397. l = s * n.aspect),
  15398. l += C,
  15399. s += C + i,
  15400. t.style.width = l + "px",
  15401. t.style.height = s + "px",
  15402. u.style.paddingTop = e + C + "px",
  15403. o.description.length > 0 && (h.classList.add("collapsible"),
  15404. h.style.height = h.clientHeight + 12 + "px",
  15405. E.style.height = "calc(100% - " + I.clientHeight + "px)")
  15406. }
  15407. function a(e) {
  15408. e.target === c && s()
  15409. }
  15410. function s() {
  15411. m && (m = !1,
  15412. r.classList.add("view-image"),
  15413. c.classList.remove("overlay"),
  15414. h.style.height = "",
  15415. u.style.paddingTop = "",
  15416. t.style.width = "",
  15417. t.style.height = "",
  15418. window.removeEventListener("resize", b),
  15419. c.removeEventListener("click", a),
  15420. g.removeEventListener("click", l),
  15421. f.removeEventListener("click", s),
  15422. o.emit(p.IMAGE_CLOSED),
  15423. o.close(!0))
  15424. }
  15425. function l(e) {
  15426. t.classList.toggle("show-info")
  15427. }
  15428. var c = o.div
  15429. , h = c.getElementsByClassName("tag-content")[0]
  15430. , u = c.getElementsByClassName("tag-media-content")[0]
  15431. , f = t.getElementsByClassName("close")[0]
  15432. , g = h.getElementsByClassName("tag-label")[0];
  15433. c.classList.add("has-image"),
  15434. r.classList.add("view-image"),
  15435. c.classList.add(n.aspect >= 1 ? "image-landscape" : "image-portrait"),
  15436. o.applyOrientation(o.orientation);
  15437. var m = !1
  15438. , A = getComputedStyle(h)
  15439. , y = parseFloat(A.paddingTop) + parseFloat(A.paddingBottom)
  15440. , C = 2 * parseFloat(getComputedStyle(u).paddingLeft)
  15441. , I = h.querySelector(".tag-label")
  15442. , E = h.querySelector(".tag-desc")
  15443. , b = function() {
  15444. var e, t, n = 0;
  15445. return function() {
  15446. clearInterval(e),
  15447. clearTimeout(t),
  15448. e = setInterval(function() {
  15449. var e = c.clientHeight;
  15450. n !== e && (i(),
  15451. n = e)
  15452. }, 100),
  15453. t = setTimeout(clearInterval.bind(this, e), 1e3)
  15454. }
  15455. }();
  15456. n.on(p.IMAGE_OPENING, e),
  15457. o.on(d.ACTIVATE, e),
  15458. o.on(p.IMAGE_CLOSED, n.onClosed.bind(n)),
  15459. o.on(d.CLOSING, s)
  15460. }
  15461. var n = new a
  15462. , r = n.createDomElement();
  15463. this.once(d.OPENED, function() {
  15464. n.load(e.src).then(i).catch(function(t) {
  15465. y.warn("Failed to load image:", e.src),
  15466. y.warn("with error:", t)
  15467. }).then(this.onMediaLoadFinished.bind(this))
  15468. });
  15469. var o = this;
  15470. return r
  15471. }
  15472. ,
  15473. n.prototype.createVideoElement = function(e, t) {
  15474. var i = new s({
  15475. autoPlay: !0,
  15476. autoResume: !0,
  15477. startMuted: !1,
  15478. loop: !1
  15479. })
  15480. , n = i.createDomElement();
  15481. return this.once(d.OPENED, function() {
  15482. i.load(e.src).then(function() {
  15483. this.div.classList.add("has-video"),
  15484. this.state !== I.OPEN && this.state !== I.ACTIVE || (i.show(),
  15485. i.play()),
  15486. this.on(d.OPENING, i.show.bind(i)),
  15487. this.on(d.OPENED, i.play.bind(i)),
  15488. this.on(d.CLOSING, i.pause.bind(i)),
  15489. this.on(d.CLOSED, i.hide.bind(i))
  15490. }
  15491. .bind(this)).catch(function(t) {
  15492. y.warn("Failed to embed video:", e.src),
  15493. y.warn("with error:", t)
  15494. }).then(this.onMediaLoadFinished.bind(this))
  15495. }
  15496. .bind(this)),
  15497. n
  15498. }
  15499. ,
  15500. n.prototype.createEmbedElement = function(e, t) {
  15501. var i = new l
  15502. , n = i.createDomElement();
  15503. return this.once(d.OPENED, function() {
  15504. i.load(e.src).then(function() {
  15505. this.div.classList.add("has-embed"),
  15506. this.state !== I.OPEN && this.state !== I.ACTIVE || i.show(),
  15507. this.applyOrientation(this.orientation),
  15508. this.on(d.OPENING, i.show.bind(i)),
  15509. this.on(d.CLOSED, i.hide.bind(i))
  15510. }
  15511. .bind(this)).catch(function(t) {
  15512. y.warn("Failed to embed:", e.src),
  15513. y.warn("with error:", t)
  15514. }).then(this.onMediaLoadFinished.bind(this))
  15515. }
  15516. .bind(this)),
  15517. n
  15518. }
  15519. ,
  15520. n.prototype.open = function(e) {
  15521. return this.openPromise = $.Deferred(),
  15522. this.state === I.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  15523. this.openTransition ? e && this.setActiveState() : this.openTransition = c.setTimeout(function() {
  15524. this.state !== I.OPEN && (this.emit(d.OPENING),
  15525. e && this.emit(d.ACTIVATING),
  15526. this.state = I.OPENING,
  15527. this.animateOpen(function() {
  15528. e && this.setActiveState(),
  15529. this.openPromise.resolve()
  15530. }
  15531. .bind(this)))
  15532. }
  15533. .bind(this), m.animation.openDelay),
  15534. c.cancel(this.closeTransition),
  15535. this.closePromise && this.closePromise.reject(),
  15536. this.closeTransition = void 0,
  15537. this.openPromise.promise())
  15538. }
  15539. ,
  15540. n.prototype.close = function(e) {
  15541. return this.closePromise = $.Deferred(),
  15542. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = c.setTimeout(function() {
  15543. this.state !== I.CLOSED && (this.emit(d.CLOSING),
  15544. this.state = I.CLOSING,
  15545. this.animateClose())
  15546. }
  15547. .bind(this), m.animation.closeDelay)),
  15548. c.cancel(this.openTransition),
  15549. this.openPromise && this.openPromise.reject(),
  15550. this.openTransition = void 0,
  15551. this.closePromise.resolve(),
  15552. this.closePromise.promise())
  15553. }
  15554. ,
  15555. n.prototype.setActiveState = function() {
  15556. this.state !== I.CLOSED && (this.state = I.ACTIVE,
  15557. this.emit(d.ACTIVATE),
  15558. this.div.classList.remove("has-hotzone"))
  15559. }
  15560. ,
  15561. n.prototype.animateOpen = function(e) {
  15562. if (this.state === I.OPENING) {
  15563. if (c.cancel(this.animationTransition),
  15564. u.detectSamsungNative())
  15565. return this.boardOrientation = null,
  15566. this.div.style.visibility = "visible",
  15567. this.emit(d.OPENED),
  15568. this.state = I.OPEN,
  15569. void (e && e());
  15570. this.div.style.webkitTransform = "scale(0)",
  15571. this.div.style.transform = "scale(0)",
  15572. this.div.style.visibility = "visible",
  15573. this.animationTransition = c.start(h.property(this, "animationScale", 1), m.animation.openDuration, function() {
  15574. this.emit(d.OPENED),
  15575. this.state = I.OPEN,
  15576. e && e()
  15577. }
  15578. .bind(this))
  15579. }
  15580. }
  15581. ,
  15582. n.prototype.animateClose = function(e) {
  15583. this.state === I.CLOSING && (c.cancel(this.animationTransition),
  15584. this.animationTransition = c.start(h.property(this, "animationScale", 0), m.animation.closeDuration, function() {
  15585. this.emit(d.CLOSED),
  15586. this.state = I.CLOSED,
  15587. this.div.style.visibility = "hidden",
  15588. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  15589. e && e()
  15590. }
  15591. .bind(this)))
  15592. }
  15593. ,
  15594. n.prototype.needsUpdate = function() {
  15595. return this.state !== I.CLOSED
  15596. }
  15597. ,
  15598. n.prototype.update = function(e, t) {
  15599. if (this.needsUpdate()) {
  15600. var i = (this.updateOrientation(e),
  15601. this.calcScale(t))
  15602. , n = {
  15603. x: (e.x + 1) * $("#player").width() / 2,
  15604. y: (e.y + 1) * $("#player").height() / 2
  15605. };
  15606. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  15607. this.div.style.webkitTransform = this.div.screenTransform,
  15608. this.div.style.transform = this.div.screenTransform
  15609. }
  15610. }
  15611. ,
  15612. n.prototype.getDimensions = function() {
  15613. return this.div.getBoundingClientRect()
  15614. }
  15615. ,
  15616. n.prototype.calcScale = function(e) {
  15617. return Math.sqrt(e / 40) * m.boardToDiscRatio
  15618. }
  15619. ,
  15620. n.prototype.updateOrientation = function(e) {
  15621. if (this.state !== I.ACTIVE) {
  15622. var t = 1 / 3
  15623. , i = e.y < -t ? 0 : e.y < t ? 1 : 2
  15624. , n = e.x < -t ? 0 : e.x < t ? 1 : 2
  15625. , r = "";
  15626. r += 0 === n ? "right" : 2 === n ? "left" : "",
  15627. r += 0 === i ? "-down" : 2 === i ? "-up" : "",
  15628. 1 === n && (r = 0 === i ? "bottom" : 2 === i ? "top" : "",
  15629. 1 === i && (r = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  15630. 1 === n && 1 === i && r === this.orientation || this.applyOrientation(r)
  15631. }
  15632. }
  15633. ,
  15634. n.prototype.applyOrientation = function(e) {
  15635. this.div.style.transform = this.div.style.webkitTransform = "",
  15636. this.div.classList.remove("tag-container-" + this.orientation),
  15637. this.div.classList.add("tag-container-" + e);
  15638. var t = window.getComputedStyle(this.div);
  15639. this.initialTransform = t.transform || t.webkitTransform,
  15640. "none" === this.initialTransform && (this.initialTransform = "");
  15641. var i = t.transform.slice(7, -1).split(",")
  15642. , n = -i[4]
  15643. , r = -i[5];
  15644. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  15645. this.div.style.transformOrigin = n + "px " + r + "px",
  15646. this.orientation = e
  15647. }
  15648. ,
  15649. t.exports = n
  15650. }
  15651. ).call(this, "/js/tag/Billboard/Billboard.js")
  15652. }
  15653. , {
  15654. "../../util/browser": 182,
  15655. "../../util/lerp": 188,
  15656. "../../util/logger": 189,
  15657. "../../util/transitions": 195,
  15658. "../Media/EmbedlyEmbed": 125,
  15659. "../Media/EmbedlyPlayer": 126,
  15660. "../Media/Image": 128,
  15661. "../Media/Link": 129,
  15662. "../Media/MediaEvent": 131,
  15663. "../Parser/DescriptionChunkType": 133,
  15664. "../Parser/DescriptionParser": 134,
  15665. "./BillboardEvent": 120,
  15666. "./billboardSettings": 121,
  15667. "./overlaySettings": 122,
  15668. events: 202
  15669. }],
  15670. 120: [function(e, t, i) {
  15671. "use strict";
  15672. t.exports = Object.freeze({
  15673. ENTER: "billboard.enter",
  15674. LEAVE: "billboard.leave",
  15675. OPENING: "billboard.opening",
  15676. OPENED: "billboard.open",
  15677. CLOSING: "billboard.closing",
  15678. CLOSED: "billboard.closed",
  15679. ACTIVATING: "billboard.activating",
  15680. ACTIVATE: "billboard.activate"
  15681. })
  15682. }
  15683. , {}],
  15684. 121: [function(e, t, i) {
  15685. "use strict";
  15686. t.exports = Object.freeze({
  15687. animation: Object.freeze({
  15688. hoverOnClosing: !1,
  15689. openDelay: 100,
  15690. closeDelay: 50,
  15691. openDuration: 200,
  15692. closeDuration: 100
  15693. }),
  15694. boardToDiscRatio: 1.2
  15695. })
  15696. }
  15697. , {}],
  15698. 122: [function(e, t, i) {
  15699. "use strict";
  15700. t.exports = Object.freeze({
  15701. boundaryWidth: 30,
  15702. boundaryHeight: 0
  15703. })
  15704. }
  15705. , {}],
  15706. 123: [function(e, t, i) {//tag
  15707. (function(i) {
  15708. "use strict";
  15709. function n(e, t, i) {
  15710. var n = i.version || "0";
  15711. "0" !== n && I.info("tag defined using version " + n),
  15712. this.model = e,
  15713. this.sid = t,
  15714. this.color = (new r.Color).set(i.color || l.tagDefault),
  15715. this.hoverColor = l._darken(this.color, .2),
  15716. this.floor = null,
  15717. this.floorIndex = i.floor,
  15718. this.mode = s.PANORAMA,
  15719. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  15720. this.obj3d = null,
  15721. this.disc = null,
  15722. this.materials = {
  15723. disc: null,
  15724. pole: null
  15725. },
  15726. this.position = (new r.Vector3).copy(i.position),
  15727. this.discPosition = (new r.Vector3).copy(i.stem.direction),
  15728. this.discWorldPosition = null,
  15729. this.discScale = .05,
  15730. this.poleEnabled = i.stem.enabled,
  15731. this.billboard = new o(i.label,i.description,i.media,this),
  15732. this.visibleTransition = null,
  15733. this.hoveringDisc = !1
  15734. }
  15735. var r = e("three")
  15736. , o = e("./Billboard/Billboard")
  15737. , a = e("../settings")
  15738. , s = e("../enum/Viewmode")
  15739. , l = e("../enum/Colors")
  15740. , c = e("../enum/RenderLayers")
  15741. , h = e("../enum/RenderOrder")
  15742. , u = (e("../util/common"),
  15743. e("../util/math"))
  15744. , d = e("../util/texture")
  15745. , p = e("../objects/Panorama")
  15746. , f = e("../shaders")
  15747. , g = e("../util/transitions")
  15748. , m = e("../util/lerp")
  15749. , v = e("../util/easing")
  15750. , A = e("./Billboard/BillboardEvent")
  15751. , y = e("events").EventEmitter
  15752. , C = e("../util/logger")
  15753. , I = new C(i)
  15754. , 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==")
  15755. , 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")
  15756. , w = new r.PlaneBufferGeometry(1,1);
  15757. n.prototype = Object.create(y.prototype),
  15758. n.raycaster = new r.Raycaster,
  15759. n.prototype.bindEvents = function() {
  15760. this.billboard.on(A.ENTER, this.setHoverState.bind(this)),
  15761. this.billboard.on(A.LEAVE, this.setFreeState.bind(this))
  15762. }
  15763. ,
  15764. n.prototype.build = function() {
  15765. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  15766. this.floor && (this.billboard.build(this.model.sid),
  15767. this.obj3d = this.buildObject3D(),
  15768. this.floor.add(this.obj3d)),
  15769. this
  15770. }
  15771. ,
  15772. n.prototype.buildObject3D = function() {
  15773. var e = new r.Object3D;
  15774. e.position.copy(this.position);
  15775. var t = r.UniformsUtils.clone(f.tagDisc.uniforms);
  15776. t.bg.value = b,
  15777. t.mask.value = E,
  15778. t.color.value.copy(this.color),
  15779. this.materials.disc = new r.RawShaderMaterial({
  15780. transparent: !0,
  15781. vertexShader: f.tagDisc.vertexShader,
  15782. fragmentShader: f.tagDisc.fragmentShader,
  15783. uniforms: t
  15784. }),
  15785. this.disc = new r.Mesh(w,this.materials.disc),
  15786. this.disc.layers.set(c.TAG),
  15787. this.disc.position.copy(this.discPosition),
  15788. this.disc.renderOrder = h.tagDisc,
  15789. this.disc.tag = this;
  15790. var i = this.buildPole();
  15791. return i.layers.set(c.TAG),
  15792. i.renderOrder = h.tagStem,
  15793. e.add(i),
  15794. e.layers.set(c.TAG),
  15795. e.add(this.disc)
  15796. }
  15797. ,
  15798. n.prototype.buildPole = function() {
  15799. var e = new r.BufferGeometry
  15800. , t = new Float32Array(6);
  15801. return t[0] = t[1] = t[2] = 0,
  15802. t[3] = this.discPosition.x,
  15803. t[4] = this.discPosition.y,
  15804. t[5] = this.discPosition.z,
  15805. e.addAttribute("position", new r.BufferAttribute(t,3)),
  15806. this.materials.pole = new r.LineBasicMaterial({
  15807. linewidth: a.tags.pole.width,
  15808. color: a.tags.pole.color,
  15809. opacity: 0,
  15810. visible: this.poleEnabled,
  15811. transparent: !0,
  15812. depthWrite: !1
  15813. }),
  15814. new r.Line(e,this.materials.pole)
  15815. }
  15816. ,
  15817. n.prototype.setFreeState = function(e) {
  15818. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  15819. this.materials.disc.uniforms.color.value = this.color
  15820. }
  15821. .bind(this))
  15822. }
  15823. ,
  15824. n.prototype.setHoverState = function(e) {
  15825. this.billboard.open(e),
  15826. this.materials.disc.uniforms.color.value = this.hoverColor
  15827. }
  15828. ,
  15829. n.prototype.hide = function(e, t) {
  15830. var i = $.Deferred();
  15831. if (0 === this.materials.disc.uniforms.opacity.value && !g.isRunning(this.visibleTransition))
  15832. return i.resolve().promise();
  15833. e = e || 0,
  15834. t = t || 0,
  15835. g.cancel(this.visibleTransition);
  15836. var n = this.materials.disc.uniforms.opacity.value / a.tags.disc.opacity
  15837. , r = t + e
  15838. , o = t / r;
  15839. return this.visibleTransition = g.start(function(e) {
  15840. var t = m.property(e.materials.disc.uniforms.opacity, "value", 0)
  15841. , i = m.property(e.materials.pole, "opacity", 0);
  15842. return function(n) {
  15843. t(n),
  15844. e.materials.pole && i(n)
  15845. }
  15846. }(this), r * n, function() {
  15847. i.resolve()
  15848. }, o, v[a.warp.blendEasing]),
  15849. i.promise()
  15850. }
  15851. ,
  15852. n.prototype.show = function(e, t) {
  15853. var i = $.Deferred();
  15854. if (this.materials.disc.uniforms.opacity.value === a.tags.disc.opacity && !g.isRunning(this.visibleTransition))
  15855. return i.resolve().promise();
  15856. e = e || 0,
  15857. t = t || 0,
  15858. g.cancel(this.visibleTransition);
  15859. var n = (a.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) / a.tags.disc.opacity
  15860. , r = t + e
  15861. , o = t / r;
  15862. return this.visibleTransition = g.start(function(e) {
  15863. var t = m.property(e.materials.disc.uniforms.opacity, "value", a.tags.disc.opacity)
  15864. , i = m.property(e.materials.pole, "opacity", a.tags.pole.opacity);
  15865. return function(n) {
  15866. t(n),
  15867. e.materials.pole && i(n)
  15868. }
  15869. }(this), r * n, function() {
  15870. i.resolve()
  15871. }, o, v[a.warp.blendEasing]),
  15872. i.promise()
  15873. }
  15874. ,
  15875. n.prototype.closestPanoTowardTag = function(e, t) {
  15876. var i = []
  15877. , o = []
  15878. , l = this.disc.getWorldPosition();
  15879. if (e === s.PANORAMA) {
  15880. var c = .5
  15881. , h = t.position.clone().sub(l).normalize();
  15882. i.push(p.filters.isPanoAligned()),
  15883. i.push(p.filters.isNeighbourPanoTo(t)),
  15884. i.push(p.filters.inPanoDirection(l, h, c)),
  15885. o.push(p.scoreFunctions.direction(l, h))
  15886. }
  15887. var u = new r.Vector3
  15888. , d = function(e) {
  15889. u.copy(l).sub(e.position);
  15890. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
  15891. , i = a.tags.navigate.tiltTolerance;
  15892. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  15893. }
  15894. , f = function(e) {
  15895. return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  15896. };
  15897. i.push(f, d),
  15898. o.push(p.scoreFunctions.distanceSquared(this, -2));
  15899. var g = this.model.panos.sortByScore(i, o);
  15900. if (a.tags.navigate.lineOfSight) {
  15901. for (var m = 0; m < g.length; m++) {
  15902. var v = g[m].item
  15903. , A = v.position.distanceTo(l);
  15904. if (!a.tags.visibility.anyDistance && A > a.tags.visibility.visibleDistance)
  15905. return null;
  15906. n.raycaster.set(v.position, l.clone().sub(v.position).normalize());
  15907. var y = n.raycaster.intersectObjects(this.model.colliders);
  15908. if (0 === y.length || y[0].distance > A)
  15909. return v
  15910. }
  15911. return null
  15912. }
  15913. return g.length > 0 && g[0].item
  15914. }
  15915. ,
  15916. n.prototype.examine = function(e) {
  15917. var t = e.mode
  15918. , i = a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano) || e.currentPano
  15919. , n = this.disc.getWorldPosition();
  15920. this.billboard.setActiveState();
  15921. var o = function() {
  15922. var t = this.billboard.getDimensions()
  15923. , n = new r.Vector3;
  15924. u.convertScreenPositionToNDC(t.left + t.width / 2, t.top + t.height / 2, n),
  15925. n.unproject(e.camera),
  15926. e.flyToPano({
  15927. pano: i,
  15928. lookAtPoint: n
  15929. })
  15930. }
  15931. .bind(this);
  15932. if (t === s.PANORAMA)
  15933. if (i !== e.currentPano) {
  15934. var l = {
  15935. pano: i,
  15936. lookAtPoint: n,
  15937. duration: null,
  15938. maxDistanceOverride: null,
  15939. skipWarpingCheck: !1
  15940. };
  15941. e.flyToPano(l, o)
  15942. } else
  15943. setTimeout(function() {
  15944. this.billboard.open().then(function() {
  15945. o()
  15946. })
  15947. }
  15948. .bind(this), 0);
  15949. else {
  15950. var c = {
  15951. pano: i
  15952. };
  15953. if (n) {
  15954. var h = (new r.Matrix4).lookAt(i.position, n, new r.Vector3(0,1,0));
  15955. c.quaternion = (new r.Quaternion).setFromRotationMatrix(h)
  15956. }
  15957. c.callback = o,
  15958. c.duration = 1500,
  15959. c.mode = s.PANORAMA,
  15960. e.flyToNewMode(c)
  15961. }
  15962. }
  15963. ,
  15964. n.prototype.update = function(e, t) {
  15965. var i = new r.Vector3;
  15966. return function(e, t) {
  15967. this.discWorldPosition = this.disc.getWorldPosition(),
  15968. this.updateDisc(e, t),
  15969. this.billboard.needsUpdate() && (i.copy(this.discWorldPosition).project(t),
  15970. i.z < 1 && (i.y *= -1,
  15971. this.billboard.update(i, this.getDiscRadius(i, t))))
  15972. }
  15973. }(),
  15974. n.prototype.updateDisc = function(e, t) {
  15975. var i = new r.Vector3
  15976. , o = new r.Vector3
  15977. , l = new r.Vector3
  15978. , c = new r.Vector3
  15979. , h = new r.Vector3;
  15980. return function(e, t) {
  15981. var u = a.tags.visibility
  15982. , d = a.tags.disc.scale
  15983. , p = e === s.DOLLHOUSE || e === s.FLOORPLAN ? a.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  15984. 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)),
  15985. this.obj3d.visible) {
  15986. this.disc.quaternion.copy(t.quaternion);
  15987. var f = d.maxSize - (d.maxSize - d.minSize) * r.Math.smoothstep(p, d.nearBound, d.farBound);
  15988. i.copy(this.discWorldPosition).project(t),
  15989. o.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(i),
  15990. l.set(f / 2, 0, 0).add(o),
  15991. c.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(l),
  15992. h.copy(c).unproject(t);
  15993. var g = h.distanceTo(this.discWorldPosition)
  15994. , m = 1 + a.tags.disc.scale.responsiveness / 100 * (n.viewportScale() - 1);
  15995. this.discScale = g * m,
  15996. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15997. }
  15998. }
  15999. }(),
  16000. n.prototype.getDiscRadius = function(e, t) {
  16001. var i = new r.Vector3;
  16002. return function(e, t) {
  16003. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  16004. Math.abs(e.x - i.x) * $("#player").width()
  16005. }
  16006. }(),
  16007. n.prototype.tagVisibleOnCurrentFloor = function(e) {
  16008. return !(e === s.DOLLHOUSE || e === s.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  16009. }
  16010. ,
  16011. n.prototype.offScreen = function(e, t) {
  16012. var i = e.getWorldPosition().project(t);
  16013. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  16014. }
  16015. ,
  16016. n.viewportScale = function() {
  16017. return n.viewportWidth === $("#player").width() && n.viewportHeight === $("#player").height() || (n.viewportWidth = $("#player").width(),
  16018. n.viewportHeight = $("#player").height(),
  16019. n.currentViewportScale = Math.sqrt(Math.min(n.viewportWidth, n.viewportHeight) / a.tags.disc.scale.baseViewportSize)),
  16020. n.currentViewportScale
  16021. }
  16022. ,
  16023. t.exports = n
  16024. }
  16025. ).call(this, "/js/tag/tag.js")
  16026. }
  16027. , {
  16028. "../enum/Colors": 19,
  16029. "../enum/RenderLayers": 41,
  16030. "../enum/RenderOrder": 42,
  16031. "../enum/Viewmode": 51,
  16032. "../objects/Panorama": 148,
  16033. "../settings": 166,
  16034. "../shaders": 167,
  16035. "../util/common": 185,
  16036. "../util/easing": 186,
  16037. "../util/lerp": 188,
  16038. "../util/logger": 189,
  16039. "../util/math": 190,
  16040. "../util/texture": 194,
  16041. "../util/transitions": 195,
  16042. "./Billboard/Billboard": 119,
  16043. "./Billboard/BillboardEvent": 120,
  16044. events: 202,
  16045. three: 217
  16046. }],
  16047. 124: [function(e, t, i) {
  16048. (function(i) {
  16049. "use strict";
  16050. function n() {
  16051. this.tagState = y.IDLE,
  16052. this.intersectTag = null,
  16053. this.hoveredTag = null,
  16054. this.activeTag = null,
  16055. this.tagDiscs = [],
  16056. this.raycaster = new r.Raycaster,
  16057. this.modelManager = null,
  16058. this.player = null,
  16059. this.totaltags = 0,
  16060. this.navigatingViaTag = !1,
  16061. this.enabled = !1
  16062. }
  16063. var r = e("three")
  16064. , o = e("../util/logger")
  16065. , a = e("../util/common")
  16066. , s = e("../controls/serializer")
  16067. , l = e("../objects/Snapshot")
  16068. , c = e("../settings")
  16069. , h = e("./Billboard/BillboardEvent")
  16070. , u = e("./Media/MediaEvent")
  16071. , d = e("./Media/LinkType")
  16072. , p = e("../enum/Viewmode")
  16073. , f = e("../enum/WarpStyle")
  16074. , g = e("../enum/BlackoutStyle")
  16075. , m = e("../enum/ModelManagerEvents")
  16076. , v = e("../enum/tagEvents")
  16077. , A = e("../enum/PlayerEvents")
  16078. , y = (e("../util/lerp"),
  16079. e("../enum/TagStates"))
  16080. , C = e("events").EventEmitter
  16081. , I = new o(i);
  16082. a.extend(n, C),
  16083. n.prototype.init = function(e, t) {
  16084. this.modelManager = e,
  16085. this.player = t,
  16086. this.updateModel(),
  16087. this.bindEvents()
  16088. }
  16089. ,
  16090. n.prototype.update = function(e) {
  16091. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  16092. }
  16093. ,
  16094. n.prototype.updateTags = function(e, t, i, n) {
  16095. for (var r in this.model.tags)
  16096. this.model.tags[r].update(e, t, i, n)
  16097. }
  16098. ,
  16099. n.prototype.updateModel = function() {
  16100. this.model = this.modelManager.getActiveModel(),
  16101. this.gettagsFromModel(),
  16102. this.totaltags = Object.keys(this.model.tags).length
  16103. }
  16104. ,
  16105. n.prototype.gettagsFromModel = function() {
  16106. this.tagDiscs = [];
  16107. for (var e in this.model.tags) {
  16108. var t = this.model.tags[e].disc;
  16109. t && this.tagDiscs.push(t)
  16110. }
  16111. }
  16112. ,
  16113. n.prototype.bindEvents = function() {
  16114. function e() {
  16115. Object.keys(this.model.tags).forEach(function(e) {
  16116. var t = this.model.tags[e];
  16117. t.bindEvents(),
  16118. t.billboard.on(u.LINK_CLICK, function(e) {
  16119. e.type === d.NAVIGATION && this.navigateViaLink(e.url)
  16120. }
  16121. .bind(this)),
  16122. t.billboard.on(u.IMAGE_OPENED, function() {
  16123. this.tagState = y.EXAMINE,
  16124. this.emit(u.IMAGE_OPENED)
  16125. }
  16126. .bind(this)),
  16127. t.billboard.on(h.CLOSING, this.dismissExaminedTag.bind(this))
  16128. }
  16129. .bind(this))
  16130. }
  16131. this.modelManager.on(m.ActiveModelChanged, this.updateModel.bind(this)),
  16132. this.modelManager.on(m.ActiveModelChanged, e.bind(this)),
  16133. this.player.on(A.ModeChanging, this.onPlayerModeChanging.bind(this)),
  16134. this.player.on(A.PanoChosen, this.onPanoChange.bind(this)),
  16135. this.player.on(A.Ready, this.onPlayerReady.bind(this)),
  16136. this.player.on(A.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  16137. this.player.on(A.WarpStarted, this.handleWarpStart.bind(this)),
  16138. this.player.on(A.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  16139. e.call(this)
  16140. }
  16141. ,
  16142. n.prototype.navigateViaLink = function(e) {
  16143. var t = s.deserialize(e);
  16144. if (t)
  16145. if (t.mode === p.PANORAMA) {
  16146. try {
  16147. this.player.model.panos.get(t.panoId)
  16148. } catch (e) {
  16149. return void I.warn("Unable to find panorama location", t.panoId)
  16150. }
  16151. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, f.BLACK)
  16152. } else {
  16153. var i = {
  16154. cameraMode: t.mode,
  16155. position: t.position,
  16156. quaternion: t.quaternion,
  16157. scanId: t.panoId,
  16158. orthoZoom: t.zoom,
  16159. floorVisibility: t.floorVisibility,
  16160. thumbUrl: null,
  16161. name: null
  16162. };
  16163. this.player.flyToNewMode({
  16164. mode: t.mode,
  16165. duration: c.warp.outsideTime,
  16166. warpDest: new l(i),
  16167. force: !0
  16168. })
  16169. }
  16170. }
  16171. ,
  16172. n.prototype.handleWarpStart = function(e, t, i, n) {
  16173. this.dismissExaminedTag(),
  16174. t === f.BLACK && (null !== n && void 0 !== n || (n = c.warp.teleportTime),
  16175. e && (i = g.END),
  16176. this.hideShowTagsForBlackoutStyle(i, n))
  16177. }
  16178. ,
  16179. n.prototype.handleWarpInterruption = function(e, t, i) {
  16180. null !== i && void 0 !== i || (i = c.warp.teleportTime),
  16181. this.hideShowTagsForBlackoutStyle(t, i)
  16182. }
  16183. ,
  16184. n.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  16185. var i = 0
  16186. , n = 0
  16187. , r = t / 2;
  16188. switch (null !== e && void 0 !== e || (e = g.MIDDLE),
  16189. e) {
  16190. case g.END:
  16191. this.hideAlltags(r);
  16192. break;
  16193. case g.BEGINNING:
  16194. this.hideAlltags().done(this.showAlltags.bind(this, r));
  16195. break;
  16196. case g.NONE:
  16197. break;
  16198. case g.MIDDLE:
  16199. i = r,
  16200. n = r,
  16201. this.hideAlltags(n),
  16202. setTimeout(function() {
  16203. this.showAlltags(i)
  16204. }
  16205. .bind(this), n);
  16206. break;
  16207. case g.FADEIN:
  16208. setTimeout(function() {
  16209. this.showAlltags(r)
  16210. }
  16211. .bind(this), r)
  16212. }
  16213. }
  16214. ,
  16215. n.prototype.onPlayerModeChanging = function(e, t) {
  16216. t !== p.PANORAMA && this.dismissExaminedTag(),
  16217. t === p.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = p.OUTDOOR);
  16218. var i = t !== p.OUTDOOR;
  16219. i !== this.model.tagsShown && (i ? this.showAlltags(c.tags.startup.fadeInDuration) : this.hideAlltags(c.tags.startup.fadeInDuration))
  16220. }
  16221. ,
  16222. n.prototype.onPanoChange = function(e, t) {
  16223. var i = this.navigatingViaTag;
  16224. if (this.navigatingViaTag = !1,
  16225. !i) {
  16226. this.dismissExaminedTag();
  16227. var n = e && !e.isAligned() ? p.OUTDOOR : p.PANORAMA
  16228. , r = t && !t.isAligned() ? p.OUTDOOR : p.PANORAMA;
  16229. n !== r && (r === p.PANORAMA ? this.showAlltags(c.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(c.tags.startup.fadeInDuration))
  16230. }
  16231. }
  16232. ,
  16233. n.prototype.onPlayerReady = function(e, t, i) {
  16234. this.startAlltags(e, t ? i : null)
  16235. }
  16236. ,
  16237. n.prototype.onPlayerFlyingEnded = function(e, t) {
  16238. this.updateClosestTags(e)
  16239. }
  16240. ,
  16241. n.prototype.dismissExaminedTag = function() {
  16242. this.activeTag && this.tagState === y.EXAMINE && this.dismissActiveTag(),
  16243. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  16244. this.hoveredTag = null)
  16245. }
  16246. ,
  16247. n.prototype.startAlltags = function(e, t) {
  16248. this.model.shouldShowtags = c.tags.enabled,
  16249. this.enabled = !0,
  16250. e || (this.showAlltags(c.tags.startup.fadeInDuration, c.tags.startup.fadeInDelay),
  16251. t && setTimeout(function() {
  16252. this.activateTag(this.model.getTagBySid(t))
  16253. }
  16254. .bind(this), c.tags.startup.fadeInDuration / 2))
  16255. }
  16256. ,
  16257. n.prototype.showAlltags = function(e, t, i) {
  16258. function n() {
  16259. o++,
  16260. o === this.totaltags && (this.model.tagsShown = !0,
  16261. r.resolve())
  16262. }
  16263. var r = $.Deferred();
  16264. if (!i && this.player.mode === p.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  16265. return r.resolve().promise();
  16266. var o = 0;
  16267. for (var a in this.model.tags) {
  16268. var s = this.model.tags[a];
  16269. s.show(e, t).done(n.bind(this))
  16270. }
  16271. return r.promise()
  16272. }
  16273. ,
  16274. n.prototype.hideAlltags = function(e, t) {
  16275. function i() {
  16276. r++,
  16277. r === this.totaltags && (this.model.tagsShown = !1,
  16278. n.resolve())
  16279. }
  16280. var n = $.Deferred()
  16281. , r = 0;
  16282. for (var o in this.model.tags) {
  16283. var a = this.model.tags[o];
  16284. a.hide(e, t).done(i.bind(this)),
  16285. a === this.activeTag && this.dismissActiveTag()
  16286. }
  16287. return n.promise()
  16288. }
  16289. ,
  16290. n.prototype.enableHovering = function() {
  16291. this.enabled = !0
  16292. }
  16293. ,
  16294. n.prototype.disableHovering = function() {
  16295. this.enabled = !1
  16296. }
  16297. ,
  16298. n.prototype.activateTag = function(e, t) {
  16299. t = t || y.EXAMINE,
  16300. this.activeTag = e,
  16301. this.activeTag.hoveringDisc = !0,
  16302. this.activeTag.setHoverState(t === y.EXAMINE),
  16303. this.tagState = t,
  16304. this.emit(v.TagActivated, e)
  16305. }
  16306. ,
  16307. n.prototype.dismissActiveTag = function() {
  16308. this.activeTag.hoveringDisc = !1,
  16309. this.activeTag.setFreeState(!0);
  16310. var e = this.activeTag;
  16311. this.activeTag = null,
  16312. this.tagState = y.IDLE,
  16313. this.emit(v.TagDismissed, e)
  16314. }
  16315. ,
  16316. n.prototype.clickedOnTag = function(e) {
  16317. var t = function() {
  16318. this.navigatingViaTag = !0,
  16319. this.activeTag.examine(this.player),
  16320. this.emit(v.TagNavigation, this.activeTag)
  16321. }
  16322. .bind(this);
  16323. return this.tagState !== y.EXAMINE ? (this.activateTag(this.intersectTag, y.EXAMINE),
  16324. this.activeTag = this.intersectTag,
  16325. t(),
  16326. !0) : (this.dismissActiveTag(),
  16327. !1)
  16328. }
  16329. ,
  16330. n.prototype.intersecttag = function() {
  16331. var e = new r.Vector3
  16332. , t = new r.Vector3
  16333. , i = new r.Vector3;
  16334. return function(n, r, o) {
  16335. if (!this.enabled)
  16336. return null;
  16337. var a = null
  16338. , s = this.tagDiscs.filter(function(e) {
  16339. return e.parent.visible
  16340. });
  16341. if (s.length > 0) {
  16342. var l = this.model.floors.reduce(function(e, t) {
  16343. return t.hidden ? e : e.concat(t.collider.children)
  16344. }, s);
  16345. e.set(n.x, n.y, -1).unproject(o),
  16346. t.set(n.x, n.y, 1).unproject(o),
  16347. i.copy(t).sub(e).normalize(),
  16348. this.raycaster.set(e, i);
  16349. var c = this.raycaster.intersectObjects(l);
  16350. c.length > 0 && s.indexOf(c[0].object) !== -1 && (a = c[0].object.tag)
  16351. }
  16352. return this.intersectTag = a,
  16353. r && (this.activeTag && a !== this.activeTag && (this.tagState === y.BROWSE || this.tagState === y.EXAMINE && a) && this.dismissActiveTag(),
  16354. a && a !== this.activeTag && (a.listeners(h.ENTER).length < 1 && (a.billboard.on(h.ENTER, function() {
  16355. this.hoveredTag = a
  16356. }
  16357. .bind(this)),
  16358. a.billboard.on(h.LEAVE, function() {
  16359. this.hoveredTag = null
  16360. }
  16361. .bind(this))),
  16362. this.activateTag(a, y.BROWSE))),
  16363. a
  16364. }
  16365. }(),
  16366. n.prototype.rankedtagInDirection = function() {
  16367. var e = []
  16368. , t = []
  16369. , i = new r.Vector3
  16370. , n = new r.Vector3
  16371. , o = new r.Vector3;
  16372. return function(r, a, s, l) {
  16373. var c = 0;
  16374. t.length = 0;
  16375. for (var h = 0; h < this.closesttags.length; h++) {
  16376. var u = this.closesttags[h];
  16377. n.copy(u.position),
  16378. n.add(u.discPosition),
  16379. i.copy(a),
  16380. i.sub(n).negate(),
  16381. i.normalize();
  16382. var d = i.dot(l);
  16383. if (d >= 0) {
  16384. o.copy(n),
  16385. o.project(s);
  16386. var p = this.intersecttag(o, !1, s);
  16387. if (p) {
  16388. if (c >= e.length)
  16389. for (var f = 0; f < 64; f++)
  16390. e.push({
  16391. tag: u,
  16392. dot: d
  16393. });
  16394. var g = e[c];
  16395. g.tag = u,
  16396. g.dot = d,
  16397. g.position = math.projectPositionToCanvas(n, s),
  16398. t.push(g),
  16399. c++
  16400. }
  16401. }
  16402. }
  16403. return t.sort(function(e, t) {
  16404. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  16405. }),
  16406. r < t.length ? t[r].tag : null
  16407. }
  16408. }(),
  16409. n.prototype.updateClosestTags = function() {
  16410. var e = new r.Vector3
  16411. , t = 30;
  16412. return function(i) {
  16413. this.closesttags || (this.closesttags = []),
  16414. this.closesttags.length = 0;
  16415. var n = this.model.tags;
  16416. if (n)
  16417. for (var r in n)
  16418. if (n.hasOwnProperty(r)) {
  16419. var o = n[r]
  16420. , a = o.position;
  16421. e.copy(i),
  16422. e.sub(a).negate();
  16423. var s = e.lengthSq();
  16424. s < t && this.closesttags.push(o)
  16425. }
  16426. }
  16427. }(),
  16428. t.exports = n
  16429. }
  16430. ).call(this, "/js/tag/tagManager.js")
  16431. }
  16432. , {
  16433. "../controls/serializer": 14,
  16434. "../enum/BlackoutStyle": 18,
  16435. "../enum/tagEvents": 32,
  16436. "../enum/ModelManagerEvents": 33,
  16437. "../enum/PlayerEvents": 40,
  16438. "../enum/TagStates": 44,
  16439. "../enum/Viewmode": 51,
  16440. "../enum/WarpStyle": 52,
  16441. "../objects/Snapshot": 153,
  16442. "../settings": 166,
  16443. "../util/common": 185,
  16444. "../util/lerp": 188,
  16445. "../util/logger": 189,
  16446. "./Billboard/BillboardEvent": 120,
  16447. "./Media/LinkType": 130,
  16448. "./Media/MediaEvent": 131,
  16449. events: 202,
  16450. three: 217
  16451. }],
  16452. 125: [function(e, t, i) {
  16453. (function(i) {
  16454. "use strict";
  16455. function n() {
  16456. this.embedWrapper = null,
  16457. this.embedElement = null
  16458. }
  16459. var r = e("../../util/ajax")
  16460. , o = e("./mediaSettings")
  16461. , a = e("../../settings")
  16462. , s = e("../../util/logger")
  16463. , l = new s(i);
  16464. n.prototype.createDomElement = function() {
  16465. return this.embedWrapper = document.createElement("div"),
  16466. this.embedWrapper.classList.add("tag-embed"),
  16467. this.embedWrapper.classList.add("hidden"),
  16468. this.embedWrapper
  16469. }
  16470. ,
  16471. n.prototype.load = function(e) {
  16472. var t = "https://api.embedly.com/1/oembed?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + o.maxEmbedWidth;
  16473. return new Promise(function(e, i) {
  16474. r.get(t).then(function(t) {
  16475. if (t = JSON.parse(t),
  16476. t.html && t.html.indexOf("<script") === -1) {
  16477. this.embedWrapper.innerHTML = t.html;
  16478. var n = Math.min(t.width, o.maxEmbedWidth) || o.maxEmbedWidth;
  16479. if (this.embedWrapper.style.width = n + "px",
  16480. t.height) {
  16481. var r = t.height / t.width;
  16482. this.embedWrapper.style.height = n * r + "px"
  16483. }
  16484. this.embedElement = this.embedWrapper.firstChild;
  16485. var a = [];
  16486. try {
  16487. a = [].slice.call(this.embedElement.querySelectorAll("a"))
  16488. } catch (e) {
  16489. l.debug("Error getting `a` elements for embed; was it an iframe?")
  16490. }
  16491. a.forEach(function(e) {
  16492. e.setAttribute("target", "_blank")
  16493. }),
  16494. this.embedElement.classList.add("hidden"),
  16495. this.embedWrapper.classList.remove("hidden"),
  16496. e()
  16497. } else
  16498. i("Not a valid embed")
  16499. }
  16500. .bind(this), function(e) {
  16501. i(e.response)
  16502. })
  16503. }
  16504. .bind(this))
  16505. }
  16506. ,
  16507. n.prototype.show = function() {
  16508. this.embedElement && this.embedElement.classList.remove("hidden")
  16509. }
  16510. ,
  16511. n.prototype.hide = function() {
  16512. this.embedElement && this.embedElement.classList.add("hidden")
  16513. }
  16514. ,
  16515. t.exports = n
  16516. }
  16517. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  16518. }
  16519. , {
  16520. "../../settings": 166,
  16521. "../../util/ajax": 181,
  16522. "../../util/logger": 189,
  16523. "./mediaSettings": 132
  16524. }],
  16525. 126: [function(e, t, i) {
  16526. (function(i) {
  16527. "use strict";
  16528. function n(e) {
  16529. o.call(this),
  16530. this.options = e,
  16531. this.playerControls = null,
  16532. this.state = s.NOT_READY
  16533. }
  16534. var r = e("../../util/browser")
  16535. , o = e("./EmbedlyEmbed")
  16536. , a = e("../../util/logger")
  16537. , s = (new a(i),
  16538. Object.freeze({
  16539. NOT_READY: "player.not.ready",
  16540. CUED: "player.cued",
  16541. PLAYING: "player.playing",
  16542. PAUSED: "player.paused"
  16543. }));
  16544. n.prototype = Object.create(o.prototype),
  16545. n.prototype.createDomElement = function() {
  16546. return this.embedWrapper = document.createElement("div"),
  16547. this.embedWrapper.classList.add("tag-video"),
  16548. this.embedWrapper.classList.add("hidden"),
  16549. this.embedWrapper
  16550. }
  16551. ,
  16552. n.prototype.load = function(e) {
  16553. var t = function() {
  16554. function e(e) {
  16555. this.playerState = s.CUED,
  16556. this.options.startMuted && this.playerControls.mute()
  16557. }
  16558. function t(e) {
  16559. this.playerState = e
  16560. }
  16561. function i(e) {
  16562. this.playerControls.setCurrentTime(0),
  16563. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  16564. }
  16565. this.playerControls = new playerjs.Player(this.embedElement),
  16566. this.playerControls.on("ready", e.bind(this)),
  16567. this.playerControls.on("play", t.bind(this, s.PLAYING)),
  16568. this.playerControls.on("pause", t.bind(this, s.PAUSED)),
  16569. this.playerControls.on("ended", i.bind(this))
  16570. }
  16571. .bind(this);
  16572. return o.prototype.load.call(this, e).then(t.bind(this))
  16573. }
  16574. ,
  16575. n.prototype.play = function() {
  16576. var e = r.isMobile();
  16577. return function() {
  16578. this.playerState !== s.NOT_READY && this.playerControls && !e && (this.state === s.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  16579. }
  16580. }(),
  16581. n.prototype.pause = function() {
  16582. this.playerState !== s.NOT_READY && this.playerControls && this.playerControls.pause()
  16583. }
  16584. ,
  16585. t.exports = n
  16586. }
  16587. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  16588. }
  16589. , {
  16590. "../../util/browser": 182,
  16591. "../../util/logger": 189,
  16592. "./EmbedlyEmbed": 125
  16593. }],
  16594. 127: [function(e, t, i) {
  16595. (function(i) {
  16596. "use strict";
  16597. function n(e) {
  16598. function t() {
  16599. return a.debug("requesting file from embedly:", e.href),
  16600. r.get(e.href, {
  16601. responseType: e.responseType
  16602. }).then(function(t) {
  16603. return a.debug("requesting file finished:", e.href),
  16604. t
  16605. })
  16606. }
  16607. function i() {}
  16608. return s = new Promise(function(e, n) {
  16609. s.catch(i).then(function() {
  16610. t().then(e, n)
  16611. })
  16612. }
  16613. )
  16614. }
  16615. var r = e("../../util/ajax")
  16616. , o = (e("./mediaSettings"),
  16617. e("../../util/logger"))
  16618. , a = new o(i)
  16619. , s = Promise.resolve();
  16620. t.exports.enqueue = n
  16621. }
  16622. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  16623. }
  16624. , {
  16625. "../../util/ajax": 181,
  16626. "../../util/logger": 189,
  16627. "./mediaSettings": 132
  16628. }],
  16629. 128: [function(e, t, i) {
  16630. (function(i) {
  16631. "use strict";
  16632. function n() {
  16633. this.imageWrapper = null,
  16634. this.width = 0,
  16635. this.height = 0,
  16636. this.aspect = 1
  16637. }
  16638. var r = e("./MediaEvent")
  16639. , o = e("./EmbedlyQueue")
  16640. , a = e("events").EventEmitter
  16641. , s = e("../../util/logger")
  16642. , l = e("../../settings");
  16643. new s(i);
  16644. n.prototype = Object.create(a.prototype),
  16645. n.prototype.createDomElement = function() {
  16646. return this.imageWrapper = document.createElement("div"),
  16647. this.imageWrapper.classList.add("tag-image"),
  16648. this.imageWrapper.classList.add("hidden"),
  16649. this.imageWrapper.addEventListener("click", function(e) {
  16650. e.stopPropagation(),
  16651. this.emit(r.IMAGE_OPENING),
  16652. this.imageWrapper.style.pointerEvents = "none"
  16653. }
  16654. .bind(this)),
  16655. this.imageWrapper
  16656. }
  16657. ,
  16658. n.prototype.onClosed = function() {
  16659. this.imageWrapper.style.pointerEvents = "auto"
  16660. }
  16661. ,
  16662. n.prototype.load = function(e) {
  16663. var t = Math.max(window.screen.height, window.screen.width)
  16664. , i = "https://i.embed.ly/1/display/resize?key=" + l.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  16665. return new Promise(function(e, t) {
  16666. function n(t) {
  16667. var i = t.target;
  16668. this.width = i.naturalWidth,
  16669. this.height = i.naturalHeight,
  16670. this.aspect = this.width / this.height;
  16671. var n = t.target.src;
  16672. this.imageWrapper.style.backgroundImage = 'url("' + n + '")',
  16673. this.imageWrapper.style.width = this.width + "px",
  16674. this.imageWrapper.style.height = this.height + "px",
  16675. this.imageWrapper.classList.remove("hidden"),
  16676. e()
  16677. }
  16678. o.enqueue({
  16679. href: i,
  16680. responseType: "arraybuffer"
  16681. }).then(function(e) {
  16682. var t = new Uint8Array(e)
  16683. , i = new Blob([t])
  16684. , r = new window.Image;
  16685. r.addEventListener("load", n.bind(this));
  16686. var o = URL.createObjectURL(i);
  16687. r.src = o
  16688. }
  16689. .bind(this), t)
  16690. }
  16691. .bind(this))
  16692. }
  16693. ,
  16694. t.exports = n
  16695. }
  16696. ).call(this, "/js/tag/Media/Image.js")
  16697. }
  16698. , {
  16699. "../../settings": 166,
  16700. "../../util/logger": 189,
  16701. "./EmbedlyQueue": 127,
  16702. "./MediaEvent": 131,
  16703. events: 202
  16704. }],
  16705. 129: [function(e, t, i) {
  16706. "use strict";
  16707. function n(e) {
  16708. this.label = e.label,
  16709. this.href = e.url,
  16710. this.type = this.updateLinkForType(),
  16711. this.domElement = null,
  16712. this.id = c++
  16713. }
  16714. var r = e("./LinkType")
  16715. , o = e("./MediaEvent")
  16716. , a = e("../../util/browser")
  16717. , s = e("../../analytics")
  16718. , l = e("events").EventEmitter
  16719. , c = 0;
  16720. n.prototype = Object.create(l.prototype),
  16721. n.prototype.updateLinkForType = function() {
  16722. function e(e) {
  16723. var t = new RegExp("[#&?]start=([^#&?]*)")
  16724. , i = t.exec(e);
  16725. return i[1]
  16726. }
  16727. function t(e) {
  16728. return e + "&play=1"
  16729. }
  16730. var i = a.valueFromHash("m") || a.valueFromHash("model");
  16731. 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),
  16732. r.NAVIGATION) : (this.href = t(this.href),
  16733. r.MODEL) : r.EXT_LINK
  16734. }
  16735. ;
  16736. var h = {};
  16737. n.prototype.createDomElement = function() {
  16738. function e(e) {
  16739. switch (e.stopPropagation(),
  16740. h[this.id] = !0,
  16741. s.trackAlways("click_tag_link", {
  16742. link_type: this.type,
  16743. link_count: c,
  16744. links_clicked: Object.keys(h).length
  16745. }),
  16746. this.type) {
  16747. case r.MODEL:
  16748. window.location.replace(this.href);
  16749. break;
  16750. case r.EXT_LINK:
  16751. window.open(this.href, "_blank")
  16752. }
  16753. this.emit(o.LINK_CLICK, {
  16754. type: this.type,
  16755. url: this.href
  16756. })
  16757. }
  16758. if (this.domElement = document.createElement("a"),
  16759. this.domElement.classList.add("tag-link"),
  16760. this.domElement.textContent = this.label,
  16761. this.type === r.EXT_LINK) {
  16762. this.domElement.textContent += " ";
  16763. var t = document.createElement("i");
  16764. t.classList.add("icon-ext-link"),
  16765. t.title = "Link to external web site",
  16766. this.domElement.appendChild(t)
  16767. }
  16768. return this.domElement.addEventListener("click", e.bind(this)),
  16769. this.domElement
  16770. }
  16771. ,
  16772. t.exports = n
  16773. }
  16774. , {
  16775. "../../analytics": 4,
  16776. "../../util/browser": 182,
  16777. "./LinkType": 130,
  16778. "./MediaEvent": 131,
  16779. events: 202
  16780. }],
  16781. 130: [function(e, t, i) {
  16782. "use strict";
  16783. t.exports = {
  16784. NAVIGATION: "navigation",
  16785. MODEL: "model",
  16786. EXT_LINK: "ext-link"
  16787. }
  16788. }
  16789. , {}],
  16790. 131: [function(e, t, i) {
  16791. "use strict";
  16792. t.exports = Object.freeze({
  16793. LINK_CLICK: "mtmedia.link",
  16794. IMAGE_LOADED: "mtmedia.image.loaded",
  16795. IMAGE_OPENING: "mtmedia.image.opening",
  16796. IMAGE_OPENED: "mtmedia.image.opened",
  16797. IMAGE_CLOSING: "mtmedia.image.closing",
  16798. IMAGE_CLOSED: "mtmedia.image.closed",
  16799. VIDEO_START: "mtmedia.video.start",
  16800. VIDEO_PAUSE: "mtmedia.video.pause",
  16801. VIDEO_ENDED: "mtmedia.video.end"
  16802. })
  16803. }
  16804. , {}],
  16805. 132: [function(e, t, i) {
  16806. "use strict";
  16807. t.exports = Object.freeze({
  16808. maxEmbedWidth: 350,
  16809. defaultAspectRatio: .75
  16810. })
  16811. }
  16812. , {}],
  16813. 133: [function(e, t, i) {
  16814. "use strict";
  16815. t.exports = Object.freeze({
  16816. TEXT: "text",
  16817. LINK: "link",
  16818. IMAGE: "photo",
  16819. VIDEO: "video",
  16820. RICH: "rich"
  16821. })
  16822. }
  16823. , {}],
  16824. 134: [function(e, t, i) {
  16825. "use strict";
  16826. function n(e) {
  16827. this.capabilities = {
  16828. links: {
  16829. enable: e.supportLinks,
  16830. keepLabels: e.keepLinkLabels
  16831. }
  16832. }
  16833. }
  16834. var r = e("./DescriptionChunkType");
  16835. n.prototype.parse = function(e, t) {
  16836. var i = []
  16837. , n = e.split("[").map(function(e, t) {
  16838. return 0 === t ? e : "[" + e
  16839. });
  16840. return n.forEach(function(e) {
  16841. var n = this.findMarkdown(e);
  16842. if (n) {
  16843. if (n.url.indexOf("javascript:") !== -1)
  16844. return;
  16845. this.addLinkChunk(i, n, t),
  16846. this.addTextChunk(i, e.slice(n.markdown.length))
  16847. } else
  16848. this.addTextChunk(i, e)
  16849. }
  16850. .bind(this)),
  16851. i
  16852. }
  16853. ,
  16854. n.prototype.findMarkdown = function(e) {
  16855. var t = /\[([^\]]*)\]\((.*)\)/
  16856. , i = e.match(t);
  16857. if (i) {
  16858. for (var n = i[2], r = 1, o = 0; o < n.length && ("(" === n[o] ? r++ : ")" === n[o] && r--,
  16859. 0 !== r); )
  16860. o++;
  16861. var a = n.length - o;
  16862. return {
  16863. markdown: i[0].substring(0, i[0].length - a),
  16864. label: i[1],
  16865. url: i[2].substring(0, o)
  16866. }
  16867. }
  16868. }
  16869. ,
  16870. n.prototype.addTextChunk = function(e, t) {
  16871. 0 !== t.length && e.push({
  16872. type: r.TEXT,
  16873. text: t
  16874. })
  16875. }
  16876. ,
  16877. n.prototype.addLinkChunk = function(e, t) {
  16878. if (!this.capabilities.links.enable)
  16879. return void (this.capabilities.links.keepLabels && this.addTextChunk(e, t.label));
  16880. var i = {
  16881. label: t.label,
  16882. url: t.url
  16883. };
  16884. i.url.indexOf("://") === -1 && (i.url = "http://" + i.url),
  16885. e.push({
  16886. type: r.LINK,
  16887. link: i
  16888. })
  16889. }
  16890. ,
  16891. t.exports = n
  16892. }
  16893. , {
  16894. "./DescriptionChunkType": 133
  16895. }],
  16896. 135: [function(e, t, i) {
  16897. (function(i) {
  16898. "use strict";
  16899. var n = e("../util/logger")
  16900. , r = new n(i)
  16901. , o = {
  16902. parseIdsFromChunkName: function(e, t) {
  16903. t.floorId = o.parseFloor(e),
  16904. t.roomId = o.parseRoom(e)
  16905. },
  16906. parseFloor: function(e) {
  16907. var t = e.match(/_group([0-9]+)/);
  16908. if (!t)
  16909. return 0;
  16910. try {
  16911. return parseInt(t[1], 10)
  16912. } catch (e) {
  16913. return r.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  16914. 0
  16915. }
  16916. },
  16917. parseRoom: function(e) {
  16918. var t = e.match(/_sub([0-9]+)/);
  16919. if (!t)
  16920. return -1;
  16921. try {
  16922. return parseInt(t[1], 10)
  16923. } catch (e) {
  16924. return r.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  16925. 0
  16926. }
  16927. }
  16928. };
  16929. t.exports = o
  16930. }
  16931. ).call(this, "/js/model/Chunks.js")
  16932. }
  16933. , {
  16934. "../util/logger": 189
  16935. }],
  16936. 136: [function(e, t, i) {
  16937. (function(i) {
  16938. "use strict";
  16939. function n(e) {
  16940. s.call(this),
  16941. this.model = e,
  16942. this.exploded = !1
  16943. }
  16944. var r = e("../objects/Floor")
  16945. , o = (e("../settings"),
  16946. e("../util/logger"))
  16947. , a = e("../util/transitions")
  16948. , s = e("../util/IndexedCollection")
  16949. , l = e("../util/common")
  16950. , c = e("../util/easing");
  16951. new o(i);
  16952. l.inherit(n, s),
  16953. n.prototype.add = function(e) {
  16954. s.prototype.add.call(this, e),
  16955. this.model.add(e)
  16956. }
  16957. ,
  16958. n.prototype.getIndex = function(e) {
  16959. return e.floorIndex
  16960. }
  16961. ,
  16962. n.prototype.build = function() {
  16963. this.list.forEach(function(e) {
  16964. e.build()
  16965. })
  16966. }
  16967. ,
  16968. n.prototype.size = function() {
  16969. return this.length
  16970. }
  16971. ,
  16972. n.prototype.sort = function() {
  16973. s.prototype.sort.call(this, function(e, t) {
  16974. return e.floorIndex - t.floorIndex
  16975. })
  16976. }
  16977. ,
  16978. n.prototype.nextFloor = function(e, t) {
  16979. return this.index[e.floorIndex + t] || null
  16980. }
  16981. ,
  16982. n.prototype.getFloorAtPoint = function(e) {
  16983. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16984. var r = this.list[n]
  16985. , o = r.distanceToPoint(e);
  16986. (!t || i > o) && (i = o,
  16987. t = r)
  16988. }
  16989. return t
  16990. }
  16991. ,
  16992. n.prototype.getOrMakeFloor = function(e) {
  16993. var t = this.index[e];
  16994. return t || (t = new r(this.model,e),
  16995. this.add(t)),
  16996. t
  16997. }
  16998. ,
  16999. n.prototype.hide = function() {
  17000. this.list.forEach(function(e) {
  17001. e.hide()
  17002. })
  17003. }
  17004. ,
  17005. n.prototype.show = function() {
  17006. this.list.forEach(function(e) {
  17007. e.show()
  17008. })
  17009. }
  17010. ,
  17011. n.prototype.names = function() {
  17012. return this.list.reduce(function(e, t) {
  17013. return e.concat(t.name)
  17014. }, [])
  17015. }
  17016. ,
  17017. n.prototype.toggleExplodeHorizontal = function() {
  17018. function e(e, t) {
  17019. r.copy(e.position),
  17020. e.position.x = i[e.floorIndex] * t,
  17021. e.position.y = 1 * e.floorIndex * t,
  17022. r.sub(e.position).multiplyScalar(-1),
  17023. e.panos.forEach(function(e) {
  17024. e.translate(r)
  17025. })
  17026. }
  17027. var t, i = [], n = 0;
  17028. this.list.forEach(function(e, r, o) {
  17029. t = r > 0 ? Math.max(o[r - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  17030. n += t,
  17031. i[r] = n
  17032. }),
  17033. i = i.map(function(e) {
  17034. return e - n / 2
  17035. });
  17036. var r = this.list[0].position.clone();
  17037. this.exploded ? this.list.forEach(function(t) {
  17038. a.start(function(i) {
  17039. e(t, 1 - i)
  17040. }, 1500, null, 0, c.easeOutExpo)
  17041. }) : this.list.forEach(function(t) {
  17042. a.start(function(i) {
  17043. e(t, i)
  17044. }, 1500, null, 0, c.easeOutExpo)
  17045. }),
  17046. this.exploded = !this.exploded
  17047. }
  17048. ,
  17049. n.prototype.toggleExplodeVertical = function() {
  17050. function e(e, i) {
  17051. var n = n.copy(e.position);
  17052. e.position.y = (5 * e.floorIndex - t.y / 2) * i,
  17053. n.sub(e.position).multiplyScalar(-1),
  17054. e.panos.forEach(function(e) {
  17055. e.translate(n)
  17056. })
  17057. }
  17058. var t = this.model.size;
  17059. this.list[0].position.clone();
  17060. this.exploded ? this.list.forEach(function(t) {
  17061. a.start(function(i) {
  17062. e(t, 1 - i)
  17063. }, 1500, null, 0, c.easeOutExpo)
  17064. }) : this.list.forEach(function(t) {
  17065. a.start(function(i) {
  17066. e(t, i)
  17067. }, 1500, null, 0, c.easeOutExpo)
  17068. }),
  17069. this.exploded = !this.exploded
  17070. }
  17071. ,
  17072. t.exports = n
  17073. }
  17074. ).call(this, "/js/model/FloorCollection.js")
  17075. }
  17076. , {
  17077. "../objects/Floor": 146,
  17078. "../settings": 166,
  17079. "../util/IndexedCollection": 175,
  17080. "../util/common": 185,
  17081. "../util/easing": 186,
  17082. "../util/logger": 189,
  17083. "../util/transitions": 195
  17084. }],
  17085. 137: [function(e, t, i) {
  17086. (function(i) {
  17087. "use strict";
  17088. function n() {
  17089. c.call(this)
  17090. }
  17091. var r = e("../settings")
  17092. , o = e("../util/logger")
  17093. , a = e("../enum/Viewmode")
  17094. , s = e("../objects/Snapshot")
  17095. , l = (e("../util/math"),
  17096. e("../util/common"))
  17097. , c = e("../util/IndexedCollection")
  17098. , h = new o(i);
  17099. l.inherit(n, c),
  17100. n.prototype.getImage = function(e) {
  17101. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  17102. }
  17103. ,
  17104. n.prototype.filterByModesAndReel = function(e, t) {
  17105. for (var i = [], n = 0; n < t.length; n += 1) {
  17106. var r = t[n]
  17107. , o = this.index[r.sid];
  17108. o && i.push(o)
  17109. }
  17110. var s = e[a.DOLLHOUSE]
  17111. , l = e[a.FLOORPLAN];
  17112. i = i.filter(function(e) {
  17113. if (!e.metadata || void 0 === e.metadata.camera_mode)
  17114. return !0;
  17115. var t;
  17116. try {
  17117. t = a.convertWorkshopModeInt(e.metadata.camera_mode)
  17118. } catch (e) {
  17119. return h.debug(e.message),
  17120. !1
  17121. }
  17122. return t === a.PANORAMA || t === a.FLOORPLAN && l || t === a.DOLLHOUSE && s
  17123. }),
  17124. i.length !== this.list.length && h.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  17125. this.list = i,
  17126. this.reIndex()
  17127. }
  17128. ,
  17129. n.prototype.getHeroLocations = function(panos) {//改 增加二级location
  17130. if (0 === this.list.length)
  17131. return [];
  17132. var locations = [];
  17133. var deal = (info, container)=>{
  17134. var src = info.thumbnail_signed_src,
  17135. o = info.name || "";
  17136. if (info.metadata && void 0 !== info.metadata.camera_quaternion) {
  17137. if (!r.show360Views.enabled && info.metadata.scan_id) {
  17138. let a = panos.get(info.metadata.scan_id);
  17139. if (a && !a.isAligned()) return
  17140. }
  17141. var cameraMode = a.convertWorkshopModeInt(info.metadata.camera_mode);
  17142. if (cameraMode === a.MESH) return
  17143. if(window.isLocal)src = manage.dealURL(src)
  17144. else src = "one" === g_version ? g_Prefix + src + "?" + randomTime().getTime() : src + "?" + randomTime().getTime()
  17145. var l = {
  17146. cameraMode: cameraMode,
  17147. position: info.metadata.camera_position,
  17148. quaternion: info.metadata.camera_quaternion,
  17149. zoom: info.metadata.zoom,
  17150. panoId: info.metadata.scan_id,
  17151. orthoZoom: info.metadata.ortho_zoom,
  17152. floorVisibility: void 0 !== info.metadata.floor_visibility ? info.metadata.floor_visibility.slice(0) : [],
  17153. thumbUrl: src,
  17154. name: n.filterImageName(o),
  17155. sid: info.sid
  17156. }
  17157. var item = new s(l);
  17158. item.momentTour = info.momentTour
  17159. item.dontRot = info.dontRot
  17160. item.rotTime = info.rotTime
  17161. item.musicInfo = info.musicInfo || g_data2.tourAudio[info.sid] || {}//新的music数据统一写在每个info下,如果有musicInfo则覆盖g_data2.tourAudio
  17162. container.push(item)
  17163. return item
  17164. }
  17165. }
  17166. this.list.forEach(image=>{
  17167. if(image.images){
  17168. var folder = $.extend({}, image )
  17169. folder.heroLocations = [];
  17170. image.images.list.forEach(child=>{
  17171. deal(child, folder.heroLocations);
  17172. })
  17173. folder.musicInfo = folder.musicInfo || {}
  17174. locations.push(folder)
  17175. delete folder.images;
  17176. delete folder.locations;
  17177. }else{
  17178. var item = deal(image, locations);
  17179. }
  17180. })
  17181. return locations
  17182. }
  17183. ,
  17184. n.prototype.getIndex = function(e) {
  17185. return e.sid
  17186. }
  17187. ,
  17188. n.filterImageName = function(e) {
  17189. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  17190. }
  17191. ,
  17192. t.exports = n
  17193. }
  17194. ).call(this, "/js/model/ImageCollection.js")
  17195. }
  17196. , {
  17197. "../enum/Viewmode": 51,
  17198. "../objects/Snapshot": 153,
  17199. "../settings": 166,
  17200. "../util/IndexedCollection": 175,
  17201. "../util/common": 185,
  17202. "../util/logger": 189,
  17203. "../util/math": 190
  17204. }],
  17205. 138: [function(e, t, i) {
  17206. (function(i) {
  17207. "use strict";
  17208. function n() {
  17209. u.call(this)
  17210. }
  17211. var r = e("../label/Label")
  17212. , o = e("../settings")
  17213. , a = e("../util/logger")
  17214. , s = e("../util/math")
  17215. , l = e("../util/ajax")
  17216. , c = e("./RoomCollection")
  17217. , h = e("../util/common")
  17218. , u = e("../util/IndexedCollection");
  17219. new a(i);
  17220. h.inherit(n, u),
  17221. n.prototype.getIndex = function(e) {
  17222. return e.labelId
  17223. }
  17224. ,
  17225. n.prototype.associateWithRooms = function(e) {
  17226. this.forEach(function(t) {
  17227. e.forEach(function(e) {
  17228. e.roomId === t.roomId && (t.room = e)
  17229. })
  17230. })
  17231. }
  17232. ,
  17233. n.prototype.createFromLabelData = function(e) {
  17234. e.forEach(function(e) {
  17235. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  17236. t = c.generateRoomId(e.floorId, t);
  17237. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  17238. i.position = s.convertWorkshopVector(i.position),
  17239. this.add(i),
  17240. i.build()
  17241. }
  17242. .bind(this))
  17243. }
  17244. ,
  17245. n.prototype.load = function(e, t) {
  17246. return l.get(e, {
  17247. responseType: "json",
  17248. auth: t ? o.authorizationHeader : null
  17249. }).done(function(e) {
  17250. var t = [];
  17251. for (var i in e) {
  17252. var n = e[i];
  17253. t.push(n)
  17254. }
  17255. this.createFromLabelData(t)
  17256. }
  17257. .bind(this))
  17258. }
  17259. ,
  17260. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  17261. var t = -1;
  17262. if (e) {
  17263. if(typeof e == 'number'){//add
  17264. t = parseInt(e)
  17265. }else{
  17266. var i = e.split("_");
  17267. t = parseInt(i[0])
  17268. }
  17269. }
  17270. return t
  17271. },
  17272. t.exports = n
  17273. }
  17274. ).call(this, "/js/model/LabelCollection.js")
  17275. }
  17276. , {
  17277. "../label/Label": 90,
  17278. "../settings": 166,
  17279. "../util/IndexedCollection": 175,
  17280. "../util/ajax": 181,
  17281. "../util/common": 185,
  17282. "../util/logger": 189,
  17283. "../util/math": 190,
  17284. "./RoomCollection": 141
  17285. }],
  17286. 139: [function(e, t, i) {
  17287. (function(i) {
  17288. "use strict";
  17289. function n(e, t) {
  17290. o.Object3D.call(this)
  17291. this.sid = window.number;//t.sid,
  17292. this.data = t,
  17293. this.options = e,
  17294. this.urls = new s(e.urlFiles),
  17295. this.isPublic = void 0 !== t.is_public && t.is_public,
  17296. //创建heroLocations
  17297. this.images = new _(this),
  17298. this.images.extend(t.images),
  17299. this.images.forEach((info)=>{
  17300. if(info.locations){
  17301. info.images = new _(this);
  17302. info.images.extend(info.locations)
  17303. }
  17304. })
  17305. this.heroLocations = []
  17306. //this.heroImage = this.images.getImage(t.icon), //初始画面沒有用到icon
  17307. this.outdoorPanoLocations = [],
  17308. this.floors = new d(this),
  17309. this.floorsEnabled = void 0 === e.floors || e.floors,
  17310. this.changingFloor = !1,
  17311. this.chunks = [],
  17312. this.panos = new A,
  17313. this.colliders = [],
  17314. this.loadPanosPromise = null,
  17315. this.loadMeshTexturesPromise = null,
  17316. this.auxDataPromise = null,
  17317. this.meshTexturesLoaded = !1,
  17318. this.meshTextures = [],
  17319. this.tags = {},
  17320. this.tagsShown = !1,
  17321. this.shouldShowtags = !1,
  17322. this.has360Views = !1,
  17323. this.showingLabels = f.labels.enabled && t.player_options.labels,
  17324. this.supportedModes = {},
  17325. this.supportedModes[c.PANORAMA] = !0,
  17326. this.supportedModes[c.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && w.valueFromHash("dh", 1),
  17327. this.supportedModes[c.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && w.valueFromHash("dh", 1),
  17328. this.supportedModes[c.TRANSITIONING] = !0,
  17329. this.supportsTiles = this.configureTiling(),
  17330. // this.supportsVR = t.is_vr,
  17331. this.supportsVR = window.DATA.supportsVR || false//true; // 方奕卓 VR功能可配置
  17332. this.mode = c.DOLLHOUSE,
  17333. this.size = null,
  17334. this.center = null,
  17335. this.boundingBox = new o.Box3,
  17336. this.currentFloor = null,
  17337. this.allFloorsVisible = !0,
  17338. this.projectedPano0 = null,
  17339. this.projectedPano1 = null,
  17340. this.floorsEnabled && t.floors && t.floors.indexOf(",") !== -1 && t.floors.split(",").forEach(function(e, t) {
  17341. this.addFloor(new u(this,t,e.trim()))
  17342. }
  17343. .bind(this)),
  17344. this.waitQueue = [],
  17345. this.on("load", function(e) {
  17346. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  17347. return !e.isLoadedCallback()
  17348. }),
  17349. 0 === this.waitQueue.length && this.emit("waiting-done"))
  17350. }
  17351. .bind(this)),
  17352. this.setupCustomProperties()
  17353. this.hots = {};
  17354. }
  17355. function r() {
  17356. try {
  17357. var e = document.createElement("canvas")
  17358. , t = e.getContext("webgl");
  17359. t || (t = e.getContext("experimental-webgl"));
  17360. var i = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE);
  17361. return i
  17362. } catch (e) {
  17363. return 0
  17364. }
  17365. }
  17366. var o = e("three")
  17367. , a = e("../util/ajax")
  17368. , s = e("../util/ModelUrls")
  17369. , l = e("../objects/BoundingTextureSkybox")
  17370. , c = e("../enum/Viewmode")
  17371. , h = e("../enum/RenderOrder")
  17372. , u = (e("../enum/AlignmentType"),
  17373. e("../objects/Floor"))
  17374. , d = e("./FloorCollection")
  17375. , p = e("../objects/Chunk")
  17376. , f = (e("../objects/Room"),
  17377. e("../objects/Snapshot"),
  17378. e("../label/Label"),
  17379. e("../util/math"),
  17380. e("../settings"))
  17381. ,ss = e("../shaders")
  17382. , g = e("../util/logger")
  17383. , m = e("../tag/tag")
  17384. , v = (e("../tag/tagManager"),
  17385. e("../objects/Panorama"))
  17386. , A = e("../util/PanoramaCollection")
  17387. , y = e("../loaders/ModelLoader")
  17388. , C = e("../loaders/ModelTextureLoader")
  17389. , I = e("../loaders/SweepDataLoader")
  17390. , E = e("../util/transitions")
  17391. , b = e("../util/common")
  17392. , es = e("../util/easing")
  17393. ,lerp = e("../util/lerp")
  17394. ,tex = e("../util/texture")
  17395. , w = e("./../util/browser")
  17396. , _ = e("./ImageCollection")
  17397. , T = e("./RoomCollection")
  17398. , x = e("./LabelCollection")
  17399. , S = e("./Chunks")
  17400. , cameraLight = e("./util/cameraLight")
  17401. , M = e("./../util/showcase")
  17402. , R = e("../exception/BasicException")
  17403. , P = (e("../constants")
  17404. ,e("events").EventEmitter)
  17405. ,GLCubeFaces = e("../enum/GLCubeFaces")
  17406. //,Hot = e("hot")
  17407. , O = new g(i);
  17408. n.prototype = Object.create(o.Object3D.prototype),
  17409. b.extend(n, P),
  17410. n.prototype.setupCustomProperties = function() {
  17411. var e = f.modelAlpha;
  17412. Object.defineProperty(this, "alpha", {
  17413. get: function() {
  17414. return e
  17415. },
  17416. set: function(t) {
  17417. e = t
  17418. //console.log(t)
  17419. this.chunks.forEach(function(chunk) {
  17420. if (chunk.material && chunk.material.uniforms.modelAlpha) {
  17421. chunk.material.uniforms.modelAlpha.value = e
  17422. //修改一下defines,为了在不需要map时不加载map。 by xzw
  17423. /* if (e>0) {
  17424. if (!('useModelMap' in chunk.material.defines)) {
  17425. chunk.material.defines.useModelMap = ''
  17426. chunk.material.needsUpdate = true
  17427. console.log('add useModelMap')
  17428. }
  17429. } else {
  17430. if ('useModelMap' in chunk.material.defines) {
  17431. delete chunk.material.defines.useModelMap
  17432. chunk.material.needsUpdate = true
  17433. chunk.material.uniforms.map.value.dispose() //防止崩溃(但是因为这样飞出要等待时间所以被去掉了)
  17434. console.log('delete useModelMap')
  17435. }
  17436. } */
  17437. }
  17438. })
  17439. }
  17440. })
  17441. }
  17442. ,
  17443. n.prototype.configureTiling = function() {
  17444. var e = r();
  17445. if (e < 2048)
  17446. return !1;
  17447. O.warn("Max cube texture size: " + e);
  17448. for (var t = 0; t < f.tiling.tilingFlagNames.length; t++) {
  17449. var i = f.tiling.tilingFlagNames[t];
  17450. if ("1" === w.valueFromHash(i, null))
  17451. return !0;
  17452. if ("0" === w.valueFromHash(i, null))
  17453. return !1
  17454. }
  17455. //--------------------------------------------许钟文-------------------------------------------
  17456. //return true;
  17457. return !!M.modelDataPromisesTiles(this.data) //免去访问mdoeldata.json的vision_version,不明白这是什么
  17458. //--------------------------------------------e n d -------------------------------------------
  17459. }
  17460. ,
  17461. n.prototype.toggleAlpha = function() {
  17462. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  17463. }
  17464. ,
  17465. n.prototype.load = function(e) {
  17466. var t = function() {
  17467. return $.when(this.loadPanos(), this.loadMesh())
  17468. }
  17469. , i = this.urls.init().then(t.bind(this));
  17470. return e ? i = i.then(this.loadMeshTextures.bind(this)) : i.then(this.loadMeshTextures.bind(this)),
  17471. this.auxDataPromise = $.when( /*this.loadHighlightReel(), this.loadtags() */this.loadhots(), this.loadLabels()),
  17472. $.when(i, this.auxDataPromise).done(this.build.bind(this)) //不要另外使用active_reel文件
  17473. }
  17474. ,
  17475. n.prototype.loadMesh = function() {
  17476. function e(e) {
  17477. O.error(e),
  17478. n.reject("loading-failed")
  17479. }
  17480. function t(e, t) {
  17481. n.notify(e, t)
  17482. }
  17483. function i(e, t) {
  17484. if (0 === e.length) {
  17485. O.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  17486. r.supportedModes[c.DOLLHOUSE] = !1,
  17487. r.supportedModes[c.FLOORPLAN] = !1;
  17488. var i = new p({
  17489. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  17490. });
  17491. i.material.visible = !1,
  17492. i.rotateX(-Math.PI / 2),
  17493. i.geometry.computeBoundingBox(),
  17494. e = [i]
  17495. }
  17496. e.forEach(function(e) {
  17497. var t = r.floorsEnabled ? S.parseFloor(e.name) : 0;
  17498. r.addChunk(t, e)
  17499. }),
  17500. r.floors.sort(),
  17501. n.resolve(r)
  17502. }
  17503. var n = $.Deferred()
  17504. , r = this;
  17505. return y.load(r.data.job.uuid, r.urls, i, t, e),
  17506. n.promise()
  17507. }
  17508. ,
  17509. n.prototype.loadMeshTextures = function() {
  17510. return this.loadTexturesPromise ? this.loadTexturesPromise : (this.loadTexturesPromise = C.load(this, this.meshTextures).then(function() {
  17511. this.meshTexturesLoaded = !0
  17512. }
  17513. .bind(this)),
  17514. this.loadTexturesPromise)
  17515. }
  17516. ,
  17517. /* n.prototype.loadtags = function() {//xzw改
  17518. var e = $.Deferred();
  17519. if (!f.tags.enabled)
  17520. return e.resolve();
  17521. //var t = this.options.urlBase + "/api/v1/jsonstore/model/tags/" + this.sid;
  17522. t = "data/" + this.sid + "/tags.json"
  17523. return a.get(t, {
  17524. responseType: "json",
  17525. auth: this.isPublic ? null : f.authorizationHeader
  17526. }).done(function(t) {
  17527. var i = 0
  17528. , n = 0;
  17529. for (var r in t) {
  17530. var o = t[r];
  17531. o.enabled && (n++,
  17532. (o.label.length || o.description.length) && (this.tags[r] = new m(this,r,o),
  17533. i++))
  17534. }
  17535. i !== n && O.warn("Disallowed " + (n - i) + " tags with no text data"),
  17536. e.resolve()
  17537. }
  17538. .bind(this)).fail(function() {
  17539. O.warn("Getting tags failed, not displaying tags."),
  17540. e.resolve()
  17541. }),
  17542. e
  17543. } */
  17544. n.prototype.shineHots = function(){ //xzw
  17545. E.trigger({
  17546. func: function(e) {
  17547. var opa = e <= .5 ? 2 * e : -2 * e + 2
  17548. for(var i in this.hots){
  17549. this.hots[i].mesh.material.uniforms.opac.value = opa;
  17550. }
  17551. }.bind(this),
  17552. cycling: true,
  17553. duration: 3000,
  17554. //easing: "easeInOutQuad",
  17555. name: "hotShine"
  17556. })
  17557. },
  17558. /* n.prototype.loadOverlays = function(overlays){
  17559. var overlays = window.data2 && window.data2.overlays
  17560. overlays && overlays.forEach((info)=>{
  17561. new Overlay(info)
  17562. })
  17563. Overlay.load()
  17564. }
  17565. */
  17566. n.prototype.loadhots = function() {//xzw
  17567. initHot(this)
  17568. this.roomLabels = []
  17569. this.hotsCount = 0;
  17570. var r = $.Deferred();
  17571. var t = g_Prefix+"data/" + this.sid + "/data2.js" +'?'+ randomTime().getTime();
  17572. return a.get(t, {
  17573. responseType: "json",
  17574. auth: this.isPublic ? null : f.authorizationHeader
  17575. }).done(function(e) {
  17576. window.data2 = e;
  17577. if(!e){
  17578. console.error("data2 is null")
  17579. }else{
  17580. g_data2 = hotMatcher(e);
  17581. let create = ()=>{
  17582. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  17583. if(e.hots){
  17584. var sids = Object.keys(e.hots).sort((a,b)=>{return e.hots[a].order - e.hots[b].order});
  17585. sids.forEach((sid)=>{
  17586. e.hots[sid].sid = sid
  17587. if(e.hots[sid].texType == 'photo' && !e.hots[sid].texSrc)return console.error('有photo热点无texSrc',e.hots[sid])
  17588. new Hot(e.hots[sid], e.hots[sid].version != 'multi' && "byHot" )
  17589. })
  17590. }
  17591. if(e.overlays){
  17592. e.overlays.forEach((info)=>{
  17593. //if(info.file.includes('m/data/762/edit/20210312_112357584.mp4') )return;
  17594. new Hot(info, 'byOverlay')
  17595. })
  17596. }
  17597. Hot.createHotList();
  17598. Hot.startLoad()
  17599. {
  17600. let maxCount = browser.isMobile() ? 200000 : 400000
  17601. let noVisiHots = this.hotGroup.children.filter(e=>!e.info.visiblePanos && e.info.texType != 'shine') //只看非热点的,否则数据太多
  17602. //let visiHots = this.hotGroup.children.filter(e=>e.info.visiblePanos)
  17603. let c = this.panos.list.length * this.colliders.length * noVisiHots.length
  17604. if(c > maxCount){ //防止加载时间过长,分批计算
  17605. console.log('hot分批setVisiblePanos')
  17606. Hot.visiPanosCountSlice = Math.ceil(maxCount / this.colliders.length / noVisiHots.length)
  17607. Hot.visiEveryDurSlice = browser.isMobile() ? 25 : 16;
  17608. let dur = Math.ceil(this.panos.list.length / Hot.visiPanosCountSlice) * Hot.visiEveryDurSlice
  17609. console.log(Hot.visiPanosCountSlice, Hot.visiEveryDurSlice, dur, Math.round(dur*noVisiHots.length))
  17610. if(noVisiHots.length){
  17611. let i = 0
  17612. let hotVisiInterval = setInterval(()=>{
  17613. noVisiHots[i].setVisiblePanos();
  17614. i++;
  17615. if(i>=noVisiHots.length){
  17616. clearInterval(hotVisiInterval)
  17617. }
  17618. }, dur)
  17619. }
  17620. }
  17621. }
  17622. if(DATA.roomLabels){
  17623. DATA.roomLabels.forEach((data)=>{
  17624. this.roomLabels.push(new RoomLabel(data))
  17625. })
  17626. }
  17627. }
  17628. if(player.currentPano){
  17629. create()
  17630. }else{
  17631. let f = ()=>{
  17632. window.bus.removeEventListener('playerAndModelReady',f)
  17633. create()
  17634. }
  17635. window.bus.addEventListener('playerAndModelReady',f)
  17636. }
  17637. g_index = w.valueFromHash("m");
  17638. }
  17639. /***************************方奕卓 请求data.js数据, 用于初始化热点列表 ****************************/
  17640. /* var dataJsPromise = $.Deferred();
  17641. var dataJsUrl = g_Prefix+"data/" + this.sid + "/hot/js/data.js" +'?'+ randomTime().getTime();
  17642. a.get(dataJsUrl,{
  17643. responseType: "json",
  17644. auth: this.isPublic ? null : f.authorizationHeader
  17645. }).done(function(data) {
  17646. window.hotData = data;
  17647. this.createHotItem(data, this.hots);
  17648. for(let i in this.hots){//add
  17649. data[i] && this.hots[i].initStyleImg(data[i]);
  17650. }
  17651. dataJsPromise.resolve();
  17652. }.bind(this)).fail(function(){
  17653. console.log('Data.js is empty');
  17654. dataJsPromise.resolve();
  17655. }) */
  17656. r.resolve();
  17657. }.bind(this)).fail(function() {
  17658. console.log('没有热点');
  17659. r.resolve()
  17660. }),
  17661. r
  17662. }
  17663. ,
  17664. n.prototype.loadPanos = function() {
  17665. if (this.loadPanosPromise)
  17666. return this.loadPanosPromise;
  17667. var e = new I(this);
  17668. return this.loadPanosPromise = e.load().then(function(e) {
  17669. return this.data.sweeps && Object.keys(this.data.sweeps).length > 0 && (e = e.filter(function(e) {
  17670. if(this.data.sweeps[e.uuid])return this.data.sweeps[e.uuid].enabled
  17671. else console.log(e.uuid)
  17672. }
  17673. .bind(this))),
  17674. this.panos.extend(e.map(function(e) {
  17675. return new v(this,e.uuid,e,this.supportsTiles)
  17676. }
  17677. .bind(this))),
  17678. this.panos.forEach(function(e) {
  17679. e.neighbourUUIDs && (e.neighbourUUIDs.forEach(function(t) {
  17680. var i = this.panos.get(t);
  17681. i && this.panos.setNeighbour(e, i, !0)
  17682. }
  17683. .bind(this)),
  17684. e.neighbourPanos = this.panos.getNeighbours(e) || this.panos.setNeighbour(e, e, !0))
  17685. }
  17686. .bind(this)),
  17687. 0 === this.panos.length && (O.warn("Model has no panos, turning off inside mode"),
  17688. this.supportedModes[c.PANORAMA] = !1),
  17689. $.when(this)
  17690. }
  17691. .bind(this)),
  17692. this.loadPanosPromise
  17693. }
  17694. ,
  17695. n.prototype.loadHighlightReel = function() {//xzw
  17696. var e = $.Deferred()
  17697. // , t = this.options.urlBase + "/api/v1/jsonstore/model/highlights/" + this.sid + "/active_reel";
  17698. ,t = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  17699. return a.get(t, {
  17700. responseType: "json",
  17701. auth: this.isPublic ? null : f.authorizationHeader
  17702. }).done(function(t) {
  17703. t.reel ? (O.info("Got highlight reel with " + t.reel.length + " items"),
  17704. this.images.filterByModesAndReel(this.supportedModes, t.reel)) : O.info("No highlight reel found"),
  17705. e.resolve()
  17706. }
  17707. .bind(this)).fail(function() {
  17708. O.warn("Getting highlight reel failed, no highlights available"),
  17709. e.resolve()
  17710. }),
  17711. e
  17712. }
  17713. ,
  17714. n.prototype.waitForLoad = function(e, t) {
  17715. t() || (this.waitQueue.push({
  17716. object: e,
  17717. isLoadedCallback: t
  17718. }),
  17719. 1 === this.waitQueue.length && this.emit("waiting"))
  17720. }
  17721. ,
  17722. n.prototype.hide = function() {
  17723. this.floors.hide()
  17724. }
  17725. ,
  17726. n.prototype.show = function() {
  17727. this.floors.show()
  17728. }
  17729. ,
  17730. n.prototype.floorNames = function() {
  17731. return this.floors.names()
  17732. }
  17733. ,
  17734. n.prototype.warpDestFloors = function(e, t) {
  17735. if (!e || this.floors.length !== e.length)
  17736. return void this.toggleAllFloors(!0);
  17737. var i = e.findIndex(function(e) {
  17738. return e
  17739. }
  17740. .bind(this));
  17741. i !== -1 && this.setFloor(this.floors.list[i], null, t)
  17742. }
  17743. ,
  17744. n.prototype.setFloor = function(e, t, i) {
  17745. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  17746. this.allFloorsVisible = !1,
  17747. this._setFloor(e, t, i)
  17748. }
  17749. ,
  17750. n.prototype.toggleAllFloors = function(e) {
  17751. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  17752. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  17753. this._setFloor(this.currentFloor)
  17754. }
  17755. ,
  17756. n.prototype._setFloor = function(e, t, i) {
  17757. t = t || this.mode,
  17758. this.emit("floor.changed", e, t, this.currentFloor),
  17759. this.currentFloor = e;
  17760. var n;
  17761. if (t === c.PANORAMA) {
  17762. if (this.show(),
  17763. this.shouldShowtags && this.tagsShown)
  17764. for (n in this.tags)
  17765. this.tags[n].show(f.showFloorDuration)
  17766. } else if ((t === c.FLOORPLAN || t === c.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  17767. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  17768. }
  17769. .bind(this)),
  17770. this.shouldShowtags && this.tagsShown))
  17771. for (n in this.tags) {
  17772. var r = this.tags[n];
  17773. this.allFloorsVisible ? r.show(f.showFloorDuration) : r.floor === this.currentFloor ? r.show(f.showFloorDuration, f.showFloorDelay) : r.hide(f.hideFloorDuration, f.hideFloorDelay)
  17774. }
  17775. var o = this
  17776. , a = e;
  17777. E.start(function() {}, f.showFloorDelay, function() {
  17778. o.floors.forEach(function(e) {
  17779. e.chunks.forEach(function(t) {
  17780. t.renderOrder = e === a ? h.visibleFloor : h.ghostFloor
  17781. })
  17782. })
  17783. }
  17784. .bind(this))
  17785. }
  17786. ,
  17787. n.prototype.toggleExplode = function() {
  17788. this.floors.toggleExplodeHorizontal()
  17789. }
  17790. ,
  17791. n.prototype.toggleExplodeUp = function() {
  17792. this.floors.toggleExplodeVertical()
  17793. }
  17794. ,
  17795. n.prototype.nextFloor = function(e) {
  17796. return this.floors.nextFloor(this.currentFloor, e)
  17797. }
  17798. ,
  17799. n.prototype.addFloor = function(e) {
  17800. this.floors.add(e)
  17801. }
  17802. ,
  17803. n.prototype.getFloorAtPoint = function(e) {
  17804. return this.floors.getFloorAtPoint(e)
  17805. }
  17806. ,
  17807. n.prototype.getTagBySid = function(e) {
  17808. return this.tags[e]
  17809. }
  17810. ,
  17811. n.prototype.addChunk = function(e, t) {
  17812. this.floors.getOrMakeFloor(e).addChunk(t),
  17813. this.chunks.push(t)
  17814. }
  17815. ,
  17816. n.prototype.setMode = function(e) {
  17817. if (!this.supportedModes[e])
  17818. throw new R("Mode not supported for this model: " + e);
  17819. this.mode = e;
  17820. this.skybox.material.transparent = e == "panorama" ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  17821. this.chunks.forEach(function(t) {
  17822. t.setMode(e)
  17823. })
  17824. }
  17825. ,
  17826. n.prototype.build = function() {
  17827. this.heroLocations = this.images.getHeroLocations(this.panos);
  17828. var e = function() {
  17829. 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()
  17830. }
  17831. .bind(this)();
  17832. this.has360Views = f.show360Views.enabled && this.heroLocations.some(function(e) {
  17833. return e.cameraMode === c.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  17834. }
  17835. .bind(this)) || e,
  17836. null === this.heroImage && O.warn("No hero image defined."),
  17837. this.currentFloor = this.floors.last(),
  17838. this.floors.build(),
  17839. this.colliders = this.floors.reduce(function(e, t) {
  17840. return e.concat(t.collider.children)
  17841. }, []),
  17842. this.panos.forEach(function(e) {
  17843. e.build1(),
  17844. e.on("enter", function() {
  17845. e.floor !== this.currentFloor && this.setFloor(e.floor)
  17846. }
  17847. .bind(this))
  17848. }
  17849. .bind(this))
  17850. //有很多场景的floorPosition在地面之下,导致marker看不到,所以探测一下
  17851. let time1 = performance.now()
  17852. let downVec = new THREE.Vector3(0,-1,0)
  17853. this.panos.forEach((pano)=>{
  17854. player.raycaster.set(pano.position, downVec);
  17855. let collider = pano.floor.collider.children
  17856. let n = player.raycaster.intersectObjects(collider , true );//add true
  17857. if(n && n[0]){
  17858. if(n[0].point.y - pano.floorPosition.y > 0.03){
  17859. //console.error(`${pano.id}, 探测高度${n[0].point.y.toPrecision(5)} 原高度 ${pano.floorPosition.y.toPrecision(5)}, 相差 ${(n[0].point.y - pano.floorPosition.y).toPrecision(5)}`)
  17860. pano.originFloorY = pano.floorPosition.y
  17861. pano.floorPosition.y = n[0].point.y
  17862. }
  17863. }
  17864. //是否需要排除一下相差过高的?因为可能探测到的是长椅这样的
  17865. })
  17866. let time2 = performance.now()
  17867. console.log('探测时间',time2-time1)
  17868. this.panos.forEach(function(e) {
  17869. e.build2()
  17870. }),
  17871. window.PuckHeightHelper && (window.PuckHeightHelper.captureBaseFloorPosition(this),
  17872. window.PuckHeightHelper.applyToModel(this, window.DATA && window.DATA.puckHeight)),
  17873. this.floors.forEach(function(e) {
  17874. this.boundingBox.union(e.boundingBox)
  17875. }
  17876. .bind(this)),
  17877. this.size = this.boundingBox.size(),
  17878. this.center = this.boundingBox.center(),
  17879. this.floors.forEach(function(e) {
  17880. O.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  17881. }
  17882. .bind(this)),
  17883. this.panos.populate_path_graph(),
  17884. this.skybox = new l(this.boundingBox),
  17885. this.skybox.matrixWorldNeedsUpdate = !0,
  17886. this.add(this.skybox);
  17887. //因为一部分漫游点在模型外
  17888. {
  17889. let bounding = new THREE.Box3 //不包含pano的bound
  17890. this.floors.list.forEach(floor=>{
  17891. bounding.union(floor.conservativeBoundingBox)
  17892. })
  17893. this.boundWithoutPanos = bounding
  17894. this.sizeWithoutPanos = bounding.size()
  17895. this.centerWithoutPanos = bounding.center()
  17896. /* 如果想居中模型, bound不加pano:
  17897. this.boundingBox = bounding
  17898. this.size = bounding.size()
  17899. this.center = bounding.center() */
  17900. }
  17901. this.createFloorLogo()
  17902. return O.debug("Done building model"),
  17903. v.raycastsDone > 0 && (O.warn("raycasts: " + v.raycastsDone),
  17904. O.warn("raycasts skipped: " + v.raycastsSkipped)),
  17905. this.buildRooms(),
  17906. this.labels.associateWithRooms(this.rooms),
  17907. $.when(this)
  17908. }
  17909. ,
  17910. n.prototype.createFloorLogo = function(){
  17911. console.log('createFloorLogo')
  17912. if(this.floorLogos || !settings.floorlogoURL)return;
  17913. var url = settings.floorlogoURL
  17914. var map = tex.load(url);//可以追加done
  17915. this.floorLogos = [];
  17916. for(var i=0; i<2; i++){ //不可共用uniforms等 [0]在上一个位置,[1]是下一个位置、 是飞入及飞出后的位置
  17917. var material = new o.MeshBasicMaterial({
  17918. opacity:0,
  17919. map:map,
  17920. side: o.DoubleSide,
  17921. transparent: !0,
  17922. depthWrite: !1,
  17923. depthTest:false//改 在chunk\skybox外也可看到
  17924. });
  17925. var logo = new o.Mesh(new o.PlaneGeometry(2,2,1,1),material);
  17926. //var s = (Store.metadata.floorLogoSize || 100)/100;
  17927. //logo.scale.set(s,s,s);
  17928. logo.position.set(0,-1.5,0);
  17929. logo.lookAt(logo.position.clone().add(new o.Vector3(0,1,0)));
  17930. logo.renderOrder = 100;//cover the videoSkybox
  17931. //logo.layers.set(0)
  17932. this.add(logo);
  17933. this.floorLogos.push(logo);
  17934. }
  17935. this.floorLogos[1].visible = false;
  17936. }
  17937. n.prototype.adjustfloorLogoHeight = function(o){
  17938. var h = player.currentPano.floorPosition.y + 0.01;
  17939. this.floorLogos[1].position.setY(h);
  17940. this.floorLogos[0].position.setY(h);
  17941. //publicObjectSet.player.path.currentPanoMarker.mesh.position.y = h
  17942. },
  17943. n.prototype.changefloorLogoOpa = function(o){//改 i, opacity, time, delay
  17944. if(!this.floorLogos) return;
  17945. E.cancelById("flOpa_"+o.index);//先停止之前该logo的透明度变化
  17946. if(o.from!=void 0)this.floorLogos[o.index].material.opacity = o.from;//初始透明度
  17947. if(!o.dur){//立刻
  17948. //this.floorLogos[o.index].material.uniforms.opacity.value = o.opa;
  17949. this.floorLogos[o.index].material.opacity = o.opa;
  17950. }else{
  17951. //E.start(lerp.uniform(this.floorLogos[o.index], "opacity", o.opa), o.dur || 0, null,
  17952. E.start(lerp.property(this.floorLogos[o.index].material, "opacity", o.opa), o.dur || 0, null,
  17953. o.delay||0, es["easeInQuad"], "changefloorLogoOpa", "flOpa_"+o.index)
  17954. }
  17955. },
  17956. n.prototype.updateFloorlogo = function() { //xzw add 更新地标的旋转
  17957. var lastQ, lastP;
  17958. var equals = function(v1, v2, min){
  17959. return Math.abs(v1-v2) < min
  17960. }
  17961. var isSame = function(now, last, k){//如果和上次相同就不改变
  17962. if(!last)return false;
  17963. var R = k.sceneRenderer;
  17964. //var min = R.AFPS < 38 ? 0.005 : R.AFPS < 45 ? 0.0008 : R.AFPS < 50 ? 0.0006 : 0.0003;
  17965. //暂时:
  17966. var min = 0.0008
  17967. var same = equals(now.x , last.x, min) && equals(now.y , last.y, min) && equals(now.z , last.z, min)
  17968. && (now.w!=void 0 ? equals(now.w , last.w, min) : true)
  17969. return same;
  17970. }
  17971. return function(Q, k){
  17972. if(!Q)return;
  17973. /* if(Config.ifFish && window.lowFPS){
  17974. this.fLCompute++;
  17975. if(R.AFPS < 38){
  17976. if(k.flyingToTag && k.flying && k.fLCompute %4 !=1) return; //点击tag过渡
  17977. else if(k.flying && k.fLCompute%2 !=1) return;
  17978. k.fLCompute %= 4;
  17979. }else if(R.AFPS < 45){
  17980. if(k.flyingToTag && k.flying && k.fLCompute %3 !=1) return; //点击tag过渡
  17981. else if(k.flying && k.fLCompute%2 !=1) return;
  17982. k.fLCompute %= 6;
  17983. }else{
  17984. if(k.flyingToTag && k.flying && k.fLCompute %2 !=1) return;
  17985. //else if(k.flying && k.fLCompute%2 !=1) return;
  17986. k.fLCompute %= 2;
  17987. }
  17988. } */
  17989. var sameQ, sameP, quaternion, visible;
  17990. for(var i=0;i<2;i++){
  17991. var logo = this.floorLogos[i];
  17992. if(!logo.visible || logo.material.uniforms.opacity.value==0) continue;
  17993. visible = true;
  17994. }
  17995. if(!visible)return; //如果两个都不可见,就不更改,如果有一个可见,就都改
  17996. var c = k.cameraControls.activeControl;
  17997. var sameQ = c ? ( c.lat < 10 ? equals(c.lon, lastQ, 0.1) : equals(c.lon, lastQ, 1) ): false;
  17998. sameQ || (lastQ = c ? c.lon : null); //相机旋转是否改变了
  17999. for(var i=0;i<2;i++){
  18000. var logo = this.floorLogos[i];
  18001. if(!sameQ){
  18002. if(!quaternion){
  18003. var a = new THREE.Vector3(0,0,-1);
  18004. a.applyQuaternion(Q);
  18005. a.setY(0);
  18006. var _ = (new THREE.Matrix4).lookAt(a,new THREE.Vector3, new THREE.Vector3(0,1,0));
  18007. quaternion = (new THREE.Quaternion).setFromRotationMatrix(_)
  18008. var a = new THREE.Quaternion( 0, 0.7071067811865476, 0.7071067811865476 , 0)//计算得
  18009. quaternion.multiply(a);
  18010. }
  18011. logo.quaternion.copy(quaternion);
  18012. }
  18013. }
  18014. }
  18015. }()
  18016. n.prototype.loadLabels = function() {//xzw
  18017. this.labels = new x(this);
  18018. var e = $.Deferred();
  18019. //加载俯视图的标签 注释这个备注就会加载
  18020. //原先是labels, 改为showLabels,因为之前的somedata写的labels都是true
  18021. window.DATA.showingLabels ? this.showingLabels = true : '';
  18022. if (!this.showingLabels)
  18023. return e.resolve();
  18024. // var t = this.options.urlBase + "/api/v1/jsonstore/model/labels/" + this.sid;
  18025. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  18026. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  18027. O.warn("Getting labels failed, not displaying labels."),
  18028. e.resolve()
  18029. }),
  18030. e
  18031. }
  18032. ,
  18033. n.prototype.buildRooms = function() {
  18034. this.rooms = new T(this),
  18035. this.rooms.createFromChunks(this.chunks),
  18036. this.rooms.calcRoomBoundaries()
  18037. }
  18038. ,
  18039. n.prototype.updateProjectedPanos = function() {
  18040. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  18041. }
  18042. ,
  18043. n.prototype.setProjectedPanos = function(e, t, i) {
  18044. void 0 !== i && null !== i || (i = !0),
  18045. i = !!i,
  18046. this.projectedPano0 = e,
  18047. this.projectedPano1 = t,
  18048. this.skybox.material.setProjectedPanos(e, t, i),
  18049. this.chunks.forEach(function(n) {
  18050. n.materialInside.setProjectedPanos(e, t, i)
  18051. })
  18052. }
  18053. ,
  18054. n.prototype.setSide = function(e) {
  18055. this.floors.forEach(function(t) {
  18056. t.collider.material.side = e
  18057. })
  18058. }
  18059. ,
  18060. n.prototype.heroCount = function() {
  18061. return this.heroLocations ? this.heroLocations.length : 0
  18062. }
  18063. ,
  18064. n.prototype.getHeroDescriptorByIndex = function(e=[]) {//改 因增加了二级目录
  18065. if (e[0] < 0)
  18066. return O.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  18067. null;
  18068. if (this.heroCount() < 1)
  18069. return O.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  18070. null;
  18071. var t = this.heroLocations[e[0]];
  18072. if(t.heroLocations && e[1]!=void 0){
  18073. t = t.heroLocations[e[1]];
  18074. }
  18075. return void 0 === t ? (O.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  18076. null) : t
  18077. }
  18078. ,
  18079. n.prototype.findPanoramicHero = function() {
  18080. for (var e in this.heroLocations)
  18081. if (this.heroLocations[e].cameraMode === c.PANORAMA)
  18082. return this.heroLocations[e];
  18083. return null
  18084. }
  18085. ,
  18086. n.prototype.listImagePanos = function() {
  18087. var e = []
  18088. , t = this;
  18089. return this.images.forEach(function(i) {
  18090. if (i.metadata && i.metadata.scan_id) {
  18091. var n = t.panos.get(i.metadata.scan_id);
  18092. n && (t.supportsTiles || n.isLoaded("high") || e.push(n))
  18093. }
  18094. }),
  18095. e
  18096. }
  18097. ,
  18098. n.prototype.fadePanoMarkers = function(/* e, t */opacity, dur, o = {}) {//改
  18099. //this.panos.fadeMarkerOpacity(e, t)
  18100. if(window.DATA.hideFloorMarker)return
  18101. var currentPano = player.currentPano
  18102. opacity = void 0 == opacity ? _settings.panorama.markerOpacity : opacity //不传opacity代表显示
  18103. var hideWhenFlyOut = () => {
  18104. var shows = [],
  18105. hides = []
  18106. player.model.panos.forEach(pano => {
  18107. hides.push(pano)
  18108. })
  18109. this.panos.fadeMarkerOpacity(0, dur, [{ toOp: 0, member: hides }])
  18110. }
  18111. if (opacity == 0) {
  18112. hideWhenFlyOut()
  18113. } else {
  18114. if (player.mode == 'panorama' && currentPano) {
  18115. var shows = [], hides = []
  18116. player.model.panos.forEach(pano => { //是邻近点就显示否则隐藏
  18117. if (pano.id === currentPano.id) {
  18118. hides.push(pano)
  18119. } else if (currentPano.neighbourPanos[pano.id]) {
  18120. shows.push(pano)
  18121. } else {
  18122. hides.push(pano)
  18123. }
  18124. })
  18125. this.panos.fadeMarkerOpacity(opacity, dur, [
  18126. { toOp: opacity, member: shows },
  18127. { toOp: 0, member: hides },
  18128. ])
  18129. } else if (player.modeTran.split('-')[1] != 'panorama') {
  18130. //飞出后marker隐藏
  18131. hideWhenFlyOut()
  18132. }
  18133. }
  18134. }
  18135. ,
  18136. n.prototype.setSweepVisibility = function(e) {
  18137. this.panos.forEach(function(t) {
  18138. t.marker && (t.marker.visible = e)
  18139. })
  18140. }
  18141. ,
  18142. n.prototype.outsideAllowed = function() {
  18143. return this.supportedModes[c.DOLLHOUSE] && this.supportedModes[c.FLOORPLAN]
  18144. }
  18145. ,
  18146. n.prototype.addHighMapCube = function() {
  18147. //创建8*8的tile cube
  18148. if (player.qualityManager.getMaxZoomClass() == '4k' && player.qualityManager.maxRenderTargetSize == 2048) {
  18149. var geo = new THREE.PlaneGeometry(1, 1, 1, 1)
  18150. var cube = new THREE.Object3D()
  18151. cube.tiles = []
  18152. for (var cubeIndex = 0; cubeIndex < 6; cubeIndex++) {
  18153. var face = new THREE.Object3D()
  18154. for (var i = 0; i < 8; i++) {
  18155. for (var j = 0; j < 8; j++) {
  18156. var tile = new THREE.Mesh(geo, new THREE.MeshBasicMaterial({ side: 2 }))
  18157. tile.position.set(i - 3.5, j - 3.5, -4)
  18158. if (highMapAddColor) {
  18159. tile.material.opacity = 0.4
  18160. var colorHue = Math.random()
  18161. tile.material.color = new THREE.Color().setHSL(colorHue, 0.6, 0.9)
  18162. }
  18163. tile.material.transparent = true
  18164. tile.material.depthTest /* = tile.material.depthWrite */ = false //防止chunk比cube近从而被遮 且能不遮住box视频和热点等
  18165. tile.visible = false
  18166. tile.tileX = i
  18167. tile.tileY = j
  18168. tile.cubeFace = cubeIndex
  18169. tile.renderOrder = 2//RenderOrder.highTileCube
  18170. cube.tiles.push(tile)
  18171. face.add(tile)
  18172. }
  18173. }
  18174. switch (cubeIndex) {
  18175. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  18176. face.rotation.set(0, Math.PI / 2, 0)
  18177. break
  18178. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  18179. face.rotation.set(0, -Math.PI / 2, 0)
  18180. break
  18181. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  18182. var rot1 = new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(0, 1, 0), Math.PI)
  18183. var rot2 = new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(1, 0, 0), Math.PI / 2)
  18184. face.quaternion.copy(rot1).multiply(rot2)
  18185. //face.rotation.set(Math.PI/2,0,0);
  18186. break
  18187. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  18188. //face.rotation.set(-Math.PI/2,0,0);
  18189. var rot1 = new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(0, 1, 0), Math.PI)
  18190. var rot2 = new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(1, 0, 0), -Math.PI / 2)
  18191. face.quaternion.copy(rot1).multiply(rot2)
  18192. break
  18193. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  18194. face.rotation.set(0, Math.PI, 0)
  18195. break
  18196. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  18197. face.rotation.set(0, 0, 0)
  18198. }
  18199. face.scale.set(1, -1, 1)
  18200. cube.add(face)
  18201. }
  18202. cube.name = 'highMapCube'
  18203. this.highMapCube = cube
  18204. this.add(cube)
  18205. cube.scale.set(0.21, 0.21, 0.21) //camera.near is 0.1
  18206. this.highMapCube.visible = false
  18207. this.highMapCube.texLoadedCount = 0
  18208. player.once("pano.chosen",()=>{//wait sceneRenderer
  18209. player.sceneRenderer.on('after-render', e => {
  18210. if (this.highMapCube.visibleTiles) {
  18211. this.updateTiles()
  18212. }
  18213. if (player && player.lastFrameChanged) {
  18214. common.intervalTool.isWaiting(
  18215. 'update4kTiles',
  18216. () => {
  18217. let vectorForward = player.getDirection()
  18218. this.updateTiles(vectorForward)
  18219. },
  18220. 500
  18221. )
  18222. }
  18223. })
  18224. })
  18225. }
  18226. }
  18227. /*
  18228. highMapCube会遮住场景中所有物体, 如果一定要显示的话,只能类似potree中的那样渲染一个深度贴图出来(model无需贴图),然后其他所有物体的shader中都加入一段代码。(貌似本身已经支持了?)
  18229. */
  18230. n.prototype.isHighMapLoaded = function(cubeFace, tileX, tileY){
  18231. var tile = this.highMapCube.children[cubeFace].children[tileX * 8 + tileY]
  18232. return !!tile.material.map
  18233. }
  18234. n.prototype.updateTiles = function(direction) {
  18235. if (!this.highMapCube || !this.highMapCube.visible) return
  18236. if (this.highMapCube.tiles.filter(e => e.image).length <= 10) return //加载的太少了
  18237. //performance.mark('updateTiles-start')
  18238. if (direction) {
  18239. let camera = player.cameraControls.cameras.panorama
  18240. let hfov = THREE.Math.degToRad(cameraLight.getHFOVForCamera(camera, $("#player").width(), $("#player").height())) / 2
  18241. let vfov = THREE.Math.degToRad(camera.fov) / 2
  18242. /* let hcos = Math.cos(hfov / 2)
  18243. let vcos = Math.cos(vfov / 2) */
  18244. let list = this.highMapCube.tiles
  18245. list.forEach(e => {
  18246. //屏幕外的不显示
  18247. let pos = e.getWorldPosition(new THREE.Vector3())
  18248. let dir = new THREE.Vector3().subVectors(pos, this.highMapCube.position).normalize()
  18249. let hcos_ = dir.clone().setY(direction.y).normalize().dot(direction) //在direction的斜面上水平角度差
  18250. let hRad = Math.acos(hcos_)
  18251. let vRad = -200
  18252. if (hRad > hfov + 0.08) {
  18253. e.score = -100
  18254. } else {
  18255. vRad = Math.abs(Math.acos(dir.y) - Math.acos(direction.y))
  18256. if (vRad > vfov + 0.08) {
  18257. e.score = -100
  18258. } else {
  18259. e.score = -(hRad / hfov + vRad / vfov)
  18260. }
  18261. }
  18262. e.scores = hRad.toFixed(3) + ', ' + vRad.toFixed(3)
  18263. if (e.score == -100) {
  18264. this.resetTile(e)
  18265. }
  18266. })
  18267. this.highMapCube.visibleTiles = list.filter(e => e.score > -100)
  18268. /* this.highMapCube.visibleTiles.sort((e,b)=>{return e.score-b.score})
  18269. this.highMapCube.visibleTiles = this.highMapCube.visibleTiles.slice(0,10)
  18270. */
  18271. //list.forEach(e=>e.scoreLabel.setText(e.scores))
  18272. }
  18273. let needRecover = this.highMapCube.visibleTiles.filter(e => !e.material.map)
  18274. if (needRecover.length) {
  18275. let maxCount = 1//common.getBestCount({ name: '4kmaxTileRecover', minCount: 0, maxCount: 2, durBound1: 1.5, durBound2: 6, ifLog: false, maxHistory: 2 })
  18276. let count = 0
  18277. needRecover.forEach((e, i) => {
  18278. //只更新若干个,因为太耗时了, 其余的等下帧更新
  18279. if (count >= maxCount) return
  18280. let r = this.recoverTile(e)
  18281. if (r) count++
  18282. })
  18283. }
  18284. }
  18285. n.prototype.getHighImage = function(image, cubeFace, tileX, tileY){
  18286. this.gotSomeHighImg = true; //标记,需要马上updateTiles
  18287. let tile = this.highMapCube.children[cubeFace].children[tileX * 8 + tileY]
  18288. tile.image = image //先记录下来
  18289. }
  18290. n.prototype.updateHighMap = function(image, cubeFace, tileX, tileY) {
  18291. let tile = this.highMapCube.children[cubeFace].children[tileX * 8 + tileY]
  18292. if (image) tile.image = image //先记录下来
  18293. if (tile.material.map) return
  18294. if (this.highMapCube.visibleTiles && !this.highMapCube.visibleTiles.includes(tile) ) {
  18295. return
  18296. }
  18297. //简易创建贴图
  18298. /* var tex = this.$app.core.get('SceneRenderer').initSizedTexture2D(512, THREE.ClampToEdgeWrapping)
  18299. //var loaded = this.$app.core.get('Player').model.isHighMapLoaded(tile.cubeFace, tile.tileX, tile.tileY)
  18300. this.$app.core.get('SceneRenderer').uploadTexture2D(image, tex, 0, 0, 512, 512) //只替换tex对应的img,不新建
  18301. */
  18302. var tex = new THREE.Texture()
  18303. tex.image = image
  18304. tex.flipY = false
  18305. tex.wrapS = tex.wrapT = THREE.ClampToEdgeWrapping
  18306. tex.generateMipmaps = false
  18307. tex.minFilter = THREE.LinearFilter
  18308. tex.needsUpdate = true
  18309. tile.material.map = tex
  18310. if (highMapAddColor) {
  18311. tile.material.opacity = 1
  18312. }
  18313. tile.visible = true
  18314. tile.material.needsUpdate = true //发现每次开始放大但还未放大到4k时也会把之前加载过的4k加载
  18315. //console.log( {level:1} , 'updateHighMap', cubeFace, tileX, tileY)
  18316. }
  18317. n.prototype.recoverTile = function(tile) {
  18318. if (tile.material.map) return
  18319. if (tile.image) {
  18320. this.updateHighMap(tile.image, tile.cubeFace, tile.tileX, tile.tileY)
  18321. return true
  18322. } else {
  18323. //console.log('no image')
  18324. }
  18325. }
  18326. n.prototype.resetTile = function(tile, kill) {
  18327. if (kill) {
  18328. //完全消灭
  18329. tile.image = null
  18330. }
  18331. let map = tile.material.map
  18332. if (map) {
  18333. map.dispose() //这句其实无效。本来可以使用three自带的deallocateTexture(texture),但因为创建的方式不是普通的new Texture,所以并没有onTextureDispose的侦听,故要自己写
  18334. map.loaded = !1
  18335. map.version = 0
  18336. //这两句才是真正释放贴图资源的 ,类似app.sceneRenderer.deallocateCubeTexture(tile.material.map)
  18337. var h = player.sceneRenderer.renderer.properties.get(map)
  18338. player.sceneRenderer.renderer.getContext().deleteTexture(h.__webglTexture)
  18339. tile.material.map = null
  18340. if (highMapAddColor) {
  18341. tile.material.opacity = 0.4
  18342. }
  18343. tile.material.needsUpdate = true
  18344. tile.visible = false
  18345. //this.highMapCube.texLoadedCount --
  18346. //console.log({level:1},'resetTile'/* , tile.cubeFace, tile.tileX, tile.tileY */)
  18347. }
  18348. }
  18349. n.prototype.resetHighMap = function() {
  18350. if (!this.highMapCube) return
  18351. this.highMapCube.children.forEach(e =>
  18352. e.children.forEach(tile => {
  18353. this.resetTile(tile, true)
  18354. })
  18355. )
  18356. //this.highMapCube.texLoadedCount = 0
  18357. this.highMapCube.visibleTiles = null
  18358. this.hideHighMap()
  18359. }
  18360. n.prototype.setHighMap = function(pano) {
  18361. if (!this.highMapCube) return
  18362. this.highMapCube.position.copy(pano.position)
  18363. this.highMapCube.quaternion.copy(pano.quaternion)
  18364. }
  18365. n.prototype.showHighMap = function() {
  18366. if (!this.highMapCube) return
  18367. this.highMapCube.visible = true
  18368. }
  18369. n.prototype.hideHighMap = function() {
  18370. if (!this.highMapCube) return
  18371. this.highMapCube.visible = false
  18372. }
  18373. //缩小后继续显示cube呢还是不显示? 不显示的话,就要把cube上的复制到renderTarget上……会不会又崩溃,or没加载的显示???
  18374. t.exports = n
  18375. }
  18376. ).call(this, "/js/model/Model.js")
  18377. }
  18378. , {
  18379. "../constants": 8,
  18380. "../enum/AlignmentType": 17,
  18381. "../enum/RenderOrder": 42,
  18382. "../enum/Viewmode": 51,
  18383. "../exception/BasicException": 55,
  18384. "../label/Label": 90,
  18385. "../loaders/ModelLoader": 105,
  18386. "../loaders/ModelTextureLoader": 106,
  18387. "../loaders/SweepDataLoader": 107,
  18388. "../tag/tag": 123,
  18389. "./util/cameraLight": 184,
  18390. "../tag/tagManager": 124,
  18391. "../objects/BoundingTextureSkybox": 143,
  18392. "../objects/Chunk": 144,
  18393. "../objects/Floor": 146,
  18394. "../objects/Panorama": 148,
  18395. "../objects/Room": 150,
  18396. "../objects/Snapshot": 153,
  18397. "../settings": 166,
  18398. "../shaders": 167,
  18399. "../util/ModelUrls": 177,
  18400. "../util/PanoramaCollection": 178,
  18401. "../util/ajax": 181,
  18402. "../util/common": 185,
  18403. "../util/easing": 186,
  18404. "../util/lerp": 188,
  18405. "../util/logger": 189,
  18406. "../util/math": 190,
  18407. "../util/texture": 194,
  18408. "../util/transitions": 195,
  18409. "./../util/browser": 182,
  18410. "./../util/showcase": 193,
  18411. "./Chunks": 135,
  18412. "./FloorCollection": 136,
  18413. "./ImageCollection": 137,
  18414. "./LabelCollection": 138,
  18415. "./RoomCollection": 141,
  18416. events: 202,
  18417. three: 217,
  18418. "hot": "hot" ,
  18419. "../enum/GLCubeFaces":25 ,
  18420. }],
  18421. 140: [function(e, t, i) {
  18422. "use strict";
  18423. function n() {
  18424. this.modelMap = {},
  18425. this.activeModel = null,
  18426. this.modelCount = 0,
  18427. this.tileDownloader = null,
  18428. this.panoRenderer = null
  18429. }
  18430. var r = (e("three"),
  18431. e("../util/common"))
  18432. , o = e("../exception/BasicException")
  18433. , a = e("../enum/ModelManagerEvents")
  18434. , s = e("../enum/PanoRendererEvents")
  18435. , l = e("events").EventEmitter;
  18436. n.prototype.init = function(e, t, i) {
  18437. this.tileDownloader = e,
  18438. this.panoRenderer = t,
  18439. this.qualityManager = i,
  18440. this.bindEvents()
  18441. }
  18442. ,
  18443. n.prototype.bindEvents = function() {
  18444. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  18445. }
  18446. ,
  18447. n.prototype.onTileRendered = function(e, t, i, n) {}
  18448. ,
  18449. n.prototype.addModel = function(e) {
  18450. this.modelMap[e.sid] = e,
  18451. 0 === this.modelCount && this.activateModel(e.sid),
  18452. this.modelCount++,
  18453. this.emit(a.ModelAdded)
  18454. }
  18455. ,
  18456. n.prototype.getModel = function(e) {
  18457. return this.modelMap[e]
  18458. }
  18459. ,
  18460. n.prototype.activateModel = function(e) {
  18461. var t = this.modelMap[e];
  18462. if (!t)
  18463. throw new o("Tried to activate invalid model!");
  18464. var i = this.activeModel;
  18465. this.activeModel = t,
  18466. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  18467. this.tileDownloader.setUrls(t.urls),
  18468. t.panos.forEach(function(e) {
  18469. e.attachToPanoRenderer(this.panoRenderer),
  18470. e.tileDownloader = this.tileDownloader,
  18471. e.qualityManager = this.qualityManager
  18472. }
  18473. .bind(this)),
  18474. this.emit(a.ActiveModelChanged, {
  18475. oldModel: i,
  18476. model: t
  18477. })
  18478. }
  18479. ,
  18480. n.prototype.getActiveModel = function() {
  18481. return this.activeModel
  18482. }
  18483. ,
  18484. r.extend(n, l),
  18485. t.exports = n
  18486. }
  18487. , {
  18488. "../enum/ModelManagerEvents": 33,
  18489. "../enum/PanoRendererEvents": 35,
  18490. "../exception/BasicException": 55,
  18491. "../util/common": 185,
  18492. events: 202,
  18493. three: 217
  18494. }],
  18495. 141: [function(e, t, i) {
  18496. (function(i) {
  18497. "use strict";
  18498. function n() {
  18499. s.call(this)
  18500. }
  18501. var r = e("../objects/Room")
  18502. , o = (e("../settings"),
  18503. e("../util/logger"))
  18504. , a = (e("../util/transitions"),
  18505. e("../util/easing"),
  18506. e("../util/common"))
  18507. , s = e("../util/IndexedCollection")
  18508. , l = e("./Chunks");
  18509. new o(i);
  18510. a.inherit(n, s),
  18511. n.prototype.getIndex = function(e) {
  18512. return e.roomId
  18513. }
  18514. ,
  18515. n.prototype.calcRoomBoundaries = function() {
  18516. this.forEach(function(e) {
  18517. e.calcBoundaries()
  18518. })
  18519. }
  18520. ,
  18521. n.prototype.createFromChunks = function(e) {
  18522. var t = {
  18523. floorId: -1,
  18524. roomId: -1
  18525. }
  18526. , i = {};
  18527. e.forEach(function(e) {
  18528. l.parseIdsFromChunkName(e.name, t);
  18529. var o = i[t.roomId];
  18530. if (!o) {
  18531. var a = n.generateRoomId(t.floorId, t.roomId);
  18532. o = new r(t.floorId,a),
  18533. this.add(o),
  18534. i[t.roomId] = o
  18535. }
  18536. o.addChunk(e)
  18537. }
  18538. .bind(this)),
  18539. this.calcRoomBoundaries()
  18540. }
  18541. ,
  18542. n.generateRoomId = function(e, t) {
  18543. return e + "_" + t
  18544. }
  18545. ,
  18546. t.exports = n
  18547. }
  18548. ).call(this, "/js/model/RoomCollection.js")
  18549. }
  18550. , {
  18551. "../objects/Room": 150,
  18552. "../settings": 166,
  18553. "../util/IndexedCollection": 175,
  18554. "../util/common": 185,
  18555. "../util/easing": 186,
  18556. "../util/logger": 189,
  18557. "../util/transitions": 195,
  18558. "./Chunks": 135
  18559. }],
  18560. 142: [function(e, t, i) {
  18561. "use strict";
  18562. function n(e, t, i) {
  18563. e = e.clone().expandByScalar(0.01);//改
  18564. var n = e.size()
  18565. , o = new r.BoxGeometry(n.x,n.y,n.z);
  18566. o.boundingBox = e,
  18567. r.Mesh.call(this, o, t),
  18568. this.position.copy(e.center()),
  18569. this.frustumCulled = !1,
  18570. i && this.add(new r.WireframeHelper(this))
  18571. }
  18572. var r = e("three");
  18573. n.prototype = Object.create(r.Mesh.prototype),
  18574. n.prototype.constructor = n,
  18575. t.exports = n
  18576. }
  18577. , {
  18578. three: 217
  18579. }],
  18580. 143: [function(e, t, i) {
  18581. (function(i) {
  18582. "use strict";
  18583. function n(e) {
  18584. h.time("Computing a nice bounding cubemap");
  18585. var t = new a({
  18586. side: r.BackSide,
  18587. transparent: !0
  18588. });
  18589. t.uniforms.modelAlpha.value = 0,
  18590. t.uniforms.opacity.value = 1 - s.modelAlpha,
  18591. this.renderOrder = l.boundingSkybox,
  18592. o.call(this, e, t),
  18593. h.timeEnd("Computing a nice bounding cubemap")
  18594. }
  18595. var r = e("three")
  18596. , o = (e("../enum/Viewmode"),
  18597. e("../shaders"),
  18598. e("./BoundingMesh"))
  18599. , a = e("../materials/ModelTextureMaterial")
  18600. , s = e("../settings")
  18601. , l = e("../enum/RenderOrder")
  18602. , c = e("../util/logger")
  18603. , h = new c(i);
  18604. n.prototype = Object.create(o.prototype),
  18605. n.prototype.constructor = n,
  18606. t.exports = n
  18607. }
  18608. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  18609. }
  18610. , {
  18611. "../enum/RenderOrder": 42,
  18612. "../enum/Viewmode": 51,
  18613. "../materials/ModelTextureMaterial": 118,
  18614. "../settings": 166,
  18615. "../shaders": 167,
  18616. "../util/logger": 189,
  18617. "./BoundingMesh": 142,
  18618. three: 217
  18619. }],
  18620. 144: [function(e, t, i) {
  18621. "use strict";
  18622. function n(e) {
  18623. this.materialInside = new s({
  18624. side: r.DoubleSide
  18625. });
  18626. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  18627. this.materialOutside = new r.RawShaderMaterial({
  18628. fragmentShader: o.modelOutside.fragmentShader,
  18629. vertexShader: o.modelOutside.vertexShader,
  18630. uniforms: t,
  18631. side: r.FrontSide,
  18632. name: "chunkOut"
  18633. }),
  18634. r.Mesh.call(this, e.geometry, this.materialInside),
  18635. this.name = e.name || "",
  18636. this.textureName = e.textureName,
  18637. this.meshUrl = e.meshUrl
  18638. }
  18639. var r = e("three")
  18640. , o = e("../shaders")
  18641. , a = e("../enum/Viewmode")
  18642. , s = e("../materials/ModelTextureMaterial");
  18643. n.prototype = Object.create(r.Mesh.prototype),
  18644. n.prototype.setTextureMap = function(e) {
  18645. this.materialInside.uniforms.map.value = e,
  18646. this.materialOutside.uniforms.map.value = e
  18647. }
  18648. ,
  18649. n.prototype.setMode = function(e) {
  18650. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  18651. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  18652. t.transparent = this.material.transparent,
  18653. t.uniforms.opacity.value = this.material.uniforms.opacity.value,
  18654. this.material = t
  18655. }
  18656. ,
  18657. t.exports = n
  18658. }
  18659. , {
  18660. "../enum/Viewmode": 51,
  18661. "../materials/ModelTextureMaterial": 118,
  18662. "../shaders": 167,
  18663. three: 217
  18664. }],
  18665. 145: [function(e, t, i) {
  18666. "use strict";
  18667. function n(e) {
  18668. this.chunksize = e || 10,
  18669. this.chunks = {},
  18670. this.boundingBoxes = {},
  18671. this.children = [],
  18672. this.offset = new r.Vector3(0,.5,0),
  18673. this.material = new r.MeshBasicMaterial({
  18674. color: 16777215 * Math.random(),
  18675. side: r.DoubleSide
  18676. })
  18677. }
  18678. var r = e("three");
  18679. e("../enum/Viewmode");
  18680. n.prototype.add = function(e) {
  18681. var t, i, n, o, a, s, l, c, h, u, d, p, f, g, m = e.attributes;
  18682. m ? (t = m.position.array,
  18683. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  18684. n = e.faces);
  18685. var v = new r.Vector3;
  18686. if (i)
  18687. for (o = 0,
  18688. a = i.length; o < a; o += 3) {
  18689. var A = 3 * i[o]
  18690. , y = 3 * i[o + 1]
  18691. , C = 3 * i[o + 2];
  18692. s = (t[A] + t[y] + t[C]) / 3,
  18693. l = (t[A + 1] + t[y + 1] + t[C + 1]) / 3,
  18694. c = (t[A + 2] + t[y + 2] + t[C + 2]) / 3,
  18695. h = Math.floor(s / this.chunksize),
  18696. u = Math.floor(l / this.chunksize),
  18697. d = Math.floor(c / this.chunksize),
  18698. p = h + "." + u + "." + d,
  18699. p in this.chunks ? (g = this.chunks[p],
  18700. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  18701. f = this.boundingBoxes[p] = new r.Box3),
  18702. 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]),
  18703. f.expandByPoint(v.set(t[A], t[A + 1], t[A + 2])),
  18704. f.expandByPoint(v.set(t[y], t[y + 1], t[y + 2])),
  18705. f.expandByPoint(v.set(t[C], t[C + 1], t[C + 2]))
  18706. }
  18707. else
  18708. for (o = 0,
  18709. a = t.length; o < a; o += 9)
  18710. s = (t[o] + t[o + 3] + t[o + 6]) / 3,
  18711. l = (t[o + 1] + t[o + 4] + t[o + 7]) / 3,
  18712. c = (t[o + 2] + t[o + 5] + t[o + 8]) / 3,
  18713. h = Math.floor(s / this.chunksize),
  18714. u = Math.floor(l / this.chunksize),
  18715. d = Math.floor(c / this.chunksize),
  18716. p = h + "." + u + "." + d,
  18717. p in this.chunks ? (g = this.chunks[p],
  18718. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  18719. f = this.boundingBoxes[p] = new r.Box3),
  18720. 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]),
  18721. f.expandByPoint(v.set(t[o], t[o + 1], t[o + 2])),
  18722. f.expandByPoint(v.set(t[o + 3], t[o + 4], t[o + 5])),
  18723. f.expandByPoint(v.set(t[o + 6], t[o + 7], t[o + 8]))
  18724. }
  18725. ,
  18726. n.prototype.build = function() {
  18727. var e = new r.Object3D;
  18728. e.material = this.material;
  18729. for (var t in this.chunks) {
  18730. var i = this.chunks[t]
  18731. , n = new r.BufferGeometry;
  18732. n.addAttribute("position", new r.BufferAttribute(new Float32Array(i),3)),
  18733. n.boundingBox = this.boundingBoxes[t];
  18734. var o = new r.Mesh(n,this.material);
  18735. o.material.visible = !1,
  18736. e.add(o),
  18737. this.chunks[t] = []
  18738. }
  18739. return e
  18740. }
  18741. ,
  18742. t.exports = n
  18743. }
  18744. , {
  18745. "../enum/Viewmode": 51,
  18746. three: 217
  18747. }],
  18748. 146: [function(e, t, i) {
  18749. "use strict";
  18750. var r = e("three")
  18751. , o = e("../settings")
  18752. , a = e("../util/common")
  18753. , s = e("../util/lerp")
  18754. , l = e("./ChunkedCollider")
  18755. , c = e("../util/transitions")
  18756. , h = e("../util/easing")
  18757. , u = (e("../objects/Panorama"),
  18758. e("../enum/RenderOrder"))
  18759. , d = e("../localization/localize");
  18760. function n(e, t, i) {
  18761. r.Object3D.call(this),
  18762. this.model = e,
  18763. this.floorIndex = t,
  18764. this.lang = o.languageTag,
  18765. this.name = i || o.languageTag === "cn" ? "Floor " + (t + 1) + "" : "第" + (t + 1) + "层",
  18766. this.panos = [],
  18767. this.chunks = [],
  18768. this.colliderBuilder = new l(3),
  18769. this.collider = null,
  18770. this.center = null,
  18771. this.boundingBox = new r.Box3,
  18772. this.size = null,
  18773. this.hidden = !1,
  18774. this.conservativeBoundingBox = new r.Box3,
  18775. this.debugColor = 16777215 * Math.random(),
  18776. this.transition = null
  18777. }
  18778. n.prototype = Object.create(r.Object3D.prototype),
  18779. n.prototype.enter = function(e) {
  18780. this.model.setFloor(this, e)
  18781. }
  18782. ,
  18783. n.prototype.hide = function(e) {
  18784. if (!this.hidden || this.transition) {
  18785. this.chunks.forEach(function(e) {
  18786. e.material.transparent = !0
  18787. }),
  18788. c.cancel(this.transition);
  18789. var t = e ? 0 : o.hideFloorDuration + o.hideFloorDelay
  18790. , i = e ? 0 : o.hideFloorDelay / t;
  18791. this.transition = c.start(s.allUniforms(this.chunks, "opacity", .08), t, function() {
  18792. this.hidden = !0
  18793. }
  18794. .bind(this), i, h.easeInOutQuad)
  18795. }
  18796. }
  18797. ,
  18798. n.prototype.show = function(e) {
  18799. if (this.hidden || this.transition) {
  18800. this.hidden = !1,
  18801. c.cancel(this.transition);
  18802. var t = e ? o.showFloorDuration : o.showFloorDuration + o.showFloorDelay
  18803. , i = e ? 0 : o.showFloorDelay / t;
  18804. this.transition = c.start(s.allUniforms(this.chunks, "opacity", 1), t, function() {
  18805. this.hidden || this.chunks.forEach(function(e) {
  18806. e.material.transparent = !1
  18807. })
  18808. }
  18809. .bind(this), i, h.easeInOutQuad)
  18810. }
  18811. }
  18812. ,
  18813. n.prototype.toggle = function(e, t) {
  18814. e = void 0 === e ? this.hidden : e,
  18815. e ? this.show(t) : this.hide(t)
  18816. }
  18817. ,
  18818. n.prototype.containsPoint = function(e) {
  18819. return this.collider.children.some(function(t) {
  18820. return t.geometry.boundingBox || t.geometry.computeBoundingBox(),
  18821. t.geometry.boundingBox.containsPoint(e)
  18822. })
  18823. }
  18824. ,
  18825. n.prototype.distanceToPoint = function(e) {
  18826. var t = null
  18827. , i = 1 / 0;
  18828. return this.collider.children.forEach(function(n) {
  18829. n.geometry.boundingBox || n.geometry.computeBoundingBox();
  18830. var r = n.geometry.boundingBox.distanceToPoint(e);
  18831. (!t || i > r) && (i = r,
  18832. t = n)
  18833. }),
  18834. i
  18835. }
  18836. ,
  18837. n.prototype.addChunk = function(e) {
  18838. e.renderOrder = u.ghostFloor,
  18839. this.add(e),
  18840. this.chunks.push(e),
  18841. this.boundingBox.union(e.geometry.boundingBox),
  18842. this.size = this.boundingBox.size(),
  18843. this.colliderBuilder.add(e.geometry)
  18844. }
  18845. ,
  18846. n.prototype.addPano = function(e) {
  18847. this.panos.push(e),
  18848. this.add(e.skyboxMesh),
  18849. e.marker && this.add(e.marker);
  18850. if(e.neighbourUUIDs && e.neighbourUUIDs.length){//add 有相邻点才算入bound 因为拍摄有bug,会出现floorPosition为000,且position位置很偏的点,它们一般都是不可见点。
  18851. var t = new r.Vector3(1,1,1)
  18852. , i = (new r.Box3).setFromCenterAndSize(e.position, t);
  18853. this.boundingBox.union(i)
  18854. }
  18855. }
  18856. ,
  18857. n.prototype.build = function() {
  18858. this.collider = this.colliderBuilder.build(!0),
  18859. this.add(this.collider),
  18860. this.center = this.boundingBox.center(),
  18861. this.conservativeBoundingBox.copy(this.boundingBox),
  18862. this.conservativeBoundingBox.min.y = a.lowerMedian(this.collider.children.map(function(e) {
  18863. return e.geometry.boundingBox.min.y
  18864. }), 5),
  18865. this.conservativeBoundingBox.max.y = a.lowerMedian(this.collider.children.map(function(e) {
  18866. return e.geometry.boundingBox.max.y
  18867. }), 5)
  18868. if(!settings.extractFloor || !settings.extractFloor[window.number]){
  18869. this.colliderBuilder = null
  18870. }
  18871. }
  18872. ,
  18873. n.prototype.toShortString = function() {
  18874. return a.nth(this.floorIndex + 1)
  18875. }
  18876. ,
  18877. n.prototype.toString = function() {
  18878. return this.name
  18879. }
  18880. ,
  18881. n.prototype.constructor = n, //add
  18882. t.exports = n
  18883. }
  18884. , {
  18885. "../enum/RenderOrder": 42,
  18886. "../localization/localize": 108,
  18887. "./strings-cn-CN": 109,
  18888. "../objects/Panorama": 148,
  18889. "../settings": 166,
  18890. "../util/common": 185,
  18891. "../util/easing": 186,
  18892. "../util/lerp": 188,
  18893. "../util/transitions": 195,
  18894. "./ChunkedCollider": 145,
  18895. three: 217
  18896. }],
  18897. 147: [function(e, t, i) {
  18898. "use strict";
  18899. function n(e) {
  18900. this.player = e,
  18901. this.obj3d = null,
  18902. this.UP = new r.Vector3(0,1,0)
  18903. }
  18904. var r = e("three")
  18905. , o = e("../settings");
  18906. n.prototype.prefs = {
  18907. linewidth: 3,
  18908. height: .07,
  18909. opacity: .45,
  18910. endScale: .05
  18911. },
  18912. n.prototype.discard = function() {
  18913. if (this.obj3d) {
  18914. var e = this.obj3d.parent;
  18915. e && e.remove(this.obj3d)
  18916. }
  18917. this.obj3d = null
  18918. }
  18919. ,
  18920. n.prototype.draw = function() {
  18921. if (this.discard(),
  18922. o.showNeighbors) {
  18923. var e = this.player.currentPano.floor;
  18924. this.obj3d = new r.Object3D;
  18925. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  18926. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  18927. i.y += this.prefs.height;
  18928. var n = .1525
  18929. , a = .127
  18930. , s = .0127
  18931. , l = .1
  18932. , c = .19
  18933. , h = .2032
  18934. , u = .2286
  18935. , d = .255
  18936. , p = new r.Matrix4;
  18937. for (var f in t)
  18938. if (t[f]) {
  18939. var g = this.player.model.panos.get(f)
  18940. , m = (g.position.clone().sub(this.player.model.position),
  18941. g.position.clone().sub(g.floorPosition))
  18942. , v = g.floorPosition.clone().sub(this.player.model.position);
  18943. v.y += this.prefs.height;
  18944. var A = new r.Geometry;
  18945. 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)),
  18946. 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)),
  18947. p.identity().setPosition(m),
  18948. A.applyMatrix(p),
  18949. A.vertices.push(new r.Vector3(0,-this.prefs.endScale,0)),
  18950. 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)),
  18951. p.lookAt(v, i, this.UP).setPosition(v),
  18952. A.applyMatrix(p),
  18953. A.vertices.push(v, i);
  18954. var y = new r.Line(A,new r.LineBasicMaterial({
  18955. color: g.debugColor.getHex(),
  18956. transparent: !0,
  18957. opacity: this.prefs.opacity,
  18958. depthWrite: !1,
  18959. name: "sLine" + f,
  18960. linewidth: this.prefs.linewidth
  18961. }));
  18962. this.obj3d.add(y)
  18963. }
  18964. e.add(this.obj3d)
  18965. }
  18966. }
  18967. ,
  18968. n.prototype.update = function() {
  18969. o.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  18970. }
  18971. ,
  18972. t.exports = n
  18973. }
  18974. , {
  18975. "../settings": 166,
  18976. three: 217
  18977. }],
  18978. 148: [function(e, t, i) {
  18979. (function(i) {
  18980. "use strict";
  18981. function n(e, t, i, n) {
  18982. this.model = e,
  18983. this.id = t,
  18984. this.alignmentType = i.alignmentType || l.ALIGNED,
  18985. this.neighbourUUIDs = i.neighbours || null,
  18986. this.neighbourPanos = null,
  18987. this.floor = null,
  18988. this.floorIndex = i.floor,
  18989. this.failedLoadingAt = 0,
  18990. this.maxLoadRetries = 4,
  18991. this.origin = i.position.clone(),
  18992. this.position = this.alignmentType === l.UNALIGNED ? new r.Vector3(0,-5,0) : i.position.clone(),
  18993. this.quaternion = i.quaternion.clone(),
  18994. this.skyboxMesh = new r.Mesh(E),
  18995. this.skyboxMesh.position.copy(this.position),
  18996. this.skyboxMesh.quaternion.copy(this.quaternion),
  18997. this.skyboxMesh.name = "skybox",
  18998. this.skyboxMesh.visible = !1,
  18999. this.skyboxMesh.updateMatrix(),
  19000. this.skyboxMesh.updateMatrixWorld(),
  19001. this.marker = null,
  19002. this.showFloorMarker = !window.DATA.hideFloorMarker;
  19003. if(this.isAligned() ){
  19004. this.marker = new r.Mesh(b,new r.MeshBasicMaterial({
  19005. map: w,
  19006. side: r.DoubleSide,
  19007. opacity: 0,
  19008. transparent: !0,
  19009. depthWrite: !1
  19010. })),
  19011. this.marker.visible = false //改:先不显示,之后根据opacity显示
  19012. this.marker.renderOrder = s.panoMarker,
  19013. this.marker.name = "marker",
  19014. this.marker.pano = this,
  19015. this.marker.layers.set(v.PANOMARKERS),
  19016. this.marker.updateMatrixWorld()
  19017. if(!window.DATA.hideFloorMarker){//xzw
  19018. let opa = this.marker.material.opacity
  19019. Object.defineProperty(this.marker.material, 'opacity', {
  19020. get: function () {
  19021. return opa
  19022. },
  19023. set: (o)=>{
  19024. opa = o
  19025. convertTool.updateVisible(this.marker, 'hideWhenZeroOpa', o > 0)
  19026. //if(o==0)console.log('o==0',this.id,this.marker.visible)
  19027. //console.log(o,this.id,this.marker.visible)
  19028. },
  19029. })
  19030. }
  19031. a.colorMarkerOnLoad && this.on("load", function() {
  19032. this.marker.material.color.set(65280)
  19033. })
  19034. }
  19035. this.debugColor = (new r.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  19036. this.floorPosition = i.puck ? i.puck.clone() : null,
  19037. this.tiled = n,
  19038. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new r.Texture([null, null, null, null, null, null]),
  19039. this.solidSkybox.flipY = !1,
  19040. a.minimalMemoryMode && (this.solidSkybox.minFilter = r.LinearFilter,
  19041. this.solidSkybox.magFilter = r.LinearFilter,
  19042. this.solidSkybox.generateMipmaps = !1)),
  19043. this.zoomed = !1,
  19044. this.panoRenderer = null,
  19045. this.qualityManager = null,
  19046. this.tileDownloader = null,
  19047. this.tiledPanoRenderTarget = null,
  19048. this.minimumTiledPanoLoaded = !1,
  19049. this.highestPartialTileRenderOpCompleted = 0,
  19050. this.highestFullTileRenderOpCompleted = 0,
  19051. this.shouldRedrawOnBaseLoaded = !1,
  19052. this.lockUntilRenderingComplete = !1,
  19053. a.colorMarkerOnLoad && this.on("load", function() {
  19054. this.marker.material.color.set(65280)
  19055. });
  19056. /********************************************************************fyz改vr from徐世廷*************************************************************/
  19057. var e = new r.TextureLoader;
  19058. e.setCrossOrigin(!0);
  19059. var g = e.load("images/texture.jpg");
  19060. if (this.vrMarker = new r.Mesh(new r.OctahedronGeometry(.1,0),new r.MeshLambertMaterial({
  19061. color: 16777215,
  19062. transparent: !0,
  19063. opacity: .75,
  19064. map: g
  19065. })),
  19066. this.vrMarker.boluoType = "vr",
  19067. this.vrMarker.position.z = 1,
  19068. this.vrMarker.enabled = !0,
  19069. this.vrMarker.visible = !1,
  19070. window.vrMarkers = window.vrMarkers || [],
  19071. window.vrMarkers.push(this.vrMarker),
  19072. this.marker && this.marker.add(this.vrMarker),
  19073. a.showAxis && (this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(0,1,0),new r.Vector3(0,0,0),1,255)),
  19074. this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(0,0,1),new r.Vector3(0,0,0),1,16711680)),
  19075. this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(1,0,0),new r.Vector3(0,0,0),1,65280))),
  19076. this.adjustAngleEnable) {
  19077. var i = new r.Quaternion;
  19078. i.setFromAxisAngle(new r.Vector3(1,0,0), this.adjustAngleX),
  19079. this.skyboxMesh.quaternion.multiply(i);
  19080. var m = new r.Quaternion;
  19081. m.setFromAxisAngle(new r.Vector3(0,1,0), this.adjustAngleY),
  19082. this.skyboxMesh.quaternion.multiply(m);
  19083. var n = new r.Quaternion;
  19084. n.setFromAxisAngle(new r.Vector3(0,0,1), this.adjustAngleZ),
  19085. this.skyboxMesh.quaternion.multiply(n),
  19086. this.skyboxMesh.updateMatrix(),
  19087. this.skyboxMesh.updateMatrixWorld(),
  19088. this.model.updateProjectedPanos()
  19089. }
  19090. /**************************************************************************************************************************************/
  19091. }
  19092. var r = e("three")
  19093. , o = e("../util/logger")
  19094. , a = e("../settings")
  19095. , s = (e("../enum/Viewmode"),
  19096. e("../enum/RenderOrder"))
  19097. , l = e("../enum/AlignmentType")
  19098. , c = (e("../util/common"),
  19099. e("../util/transitions"))
  19100. , h = e("../util/lerp")
  19101. , u = e("../util/ajax")
  19102. , d = e("../util/texture")
  19103. , p = e("../util/panorama")
  19104. , f = (e("../enum/TileDownloaderEvents"),
  19105. e("../enum/PanoramaEvents"))
  19106. , g = e("../enum/PanoRendererEvents")
  19107. , m = e("../enum/PanoSizeClass")
  19108. , v = e("../enum/RenderLayers")
  19109. , A = (e("../scene/SceneRenderer"),
  19110. e("../enum/GLCubeFaces"),
  19111. e("../exception/BasicException"))
  19112. , y = e("../tile/TileUtils")
  19113. , C = e("events").EventEmitter
  19114. , I = new o(i)
  19115. , E = new r.SphereBufferGeometry(.1)
  19116. , b = new r.PlaneBufferGeometry(.35,.35,1,1)
  19117. , w = d.load("images/marker.png");
  19118. w.anisotropy = browser.isMobile() ? 1 : 3 //add
  19119. n.prototype = Object.create(C.prototype),
  19120. n.prototype.enter = function() {
  19121. var e = null;
  19122. return function() {
  19123. this.setZoomed(!1),
  19124. this.emit("enter", {
  19125. oldPano: e,
  19126. newPano: this
  19127. }),
  19128. e = this
  19129. this.model.setHighMap(this) //add
  19130. }
  19131. }(),
  19132. n.prototype.exit = function() {
  19133. this.tiled ? (this.clearWaitDeferreds(),
  19134. this.minimumTiledPanoLoaded = !1,
  19135. this.tiledPanoRenderTarget = null,
  19136. this.setZoomed(!1),
  19137. this.panoRenderer.deactivateTiledPano(this),
  19138. this.highestPartialTileRenderOpCompleted = 0,
  19139. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  19140. this.solidSkybox.loaded = !1,
  19141. this.solidSkybox.version = 0),
  19142. this.emit("exit")
  19143. }
  19144. ,
  19145. n.prototype.hoverOn = function(e) {
  19146. this.marker && (c.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  19147. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  19148. }
  19149. ,
  19150. n.prototype.hoverOff = function(e) {
  19151. this.marker && c.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  19152. }
  19153. ,
  19154. n.prototype.build1 = function() {
  19155. this.floor = this.floor || this.model.floors.get(this.floorIndex) || (this.model.floors.list.length == 1 ? this.model.floors.list[0] : this.raycastToFindFloor()) || this.model.getFloorAtPoint(this.position),
  19156. this.floor.addPano(this),
  19157. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  19158. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  19159. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  19160. }
  19161. ,
  19162. n.prototype.build2 = function() {
  19163. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  19164. this.height = this.position.distanceTo(this.floorPosition),
  19165. this.placeMarker()
  19166. }
  19167. ,
  19168. n.prototype.interpolateFloorPosition = function() {
  19169. var e = this.model.panos.filter(n.filters.isNeighbourPanoTo(this)).filter(function(e) {
  19170. return !!e.floorPosition
  19171. }).sort(function(e, t) {
  19172. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  19173. }
  19174. .bind(this))
  19175. , t = this.position.clone();
  19176. return e.length >= 2 ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  19177. t
  19178. }
  19179. ,
  19180. n.prototype.raycastFloorPosition = function() {
  19181. I.warn("Performance warning: Raycasting to find floor position");
  19182. var e = new r.Raycaster(this.position,new r.Vector3(0,-1,0))
  19183. , t = e.intersectObjects(this.floor && this.floor.collider && this.floor.collider.children && this.floor.collider.children.length ? this.floor.collider.children : this.model.colliders, !0);
  19184. return t.length ? t[0].point : null
  19185. }
  19186. ,
  19187. n.prototype.raycastToFindFloor = function() {
  19188. 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)];
  19189. return function() {
  19190. I.warn("Performance warning: Raycasting to find floor index");
  19191. for (var t = 0; t < e.length; t++) {
  19192. var i = new r.Raycaster(this.position.clone(),e[t].clone())
  19193. , n = i.intersectObjects(this.model.colliders);
  19194. if (n.length)
  19195. return n[0].object.parent.parent
  19196. }
  19197. return null
  19198. }
  19199. }(),
  19200. n.prototype.placeMarker = function() {
  19201. this.marker && (this.marker.position.copy(this.floorPosition),
  19202. //this.fixedFloorY != void 0 && this.marker.position.setY(this.fixedFloorY),//add
  19203. this.marker.position.y += settings.markerHeight,
  19204. this.marker.lookAt(new r.Vector3(0,1,0).add(this.marker.position)))
  19205. }
  19206. ,
  19207. n.prototype.translate = function(e) {
  19208. this.position.add(e),
  19209. this.floorPosition.add(e),
  19210. this.baseFloorPosition && this.baseFloorPosition.add(e)
  19211. }
  19212. ,
  19213. n.prototype.findClosestMidtpointPanoTo = function(e) {
  19214. (new r.Vector3).addVectors(this.position, e.position).divideScalar(2);
  19215. return this.model.panos.find([n.filters.notIn([this, e])], [n.sortFunctions.distanceToPoint(point)])
  19216. }
  19217. ,
  19218. n.prototype.attachToPanoRenderer = function(e) {
  19219. this.panoRenderer = e,
  19220. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  19221. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  19222. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  19223. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  19224. }
  19225. ;
  19226. var _ = {};
  19227. n.prototype.getWaitDeferred = function(e) {
  19228. var t = _[this.id];
  19229. t || (t = {},
  19230. _[this.id] = t);
  19231. var i = t[e];
  19232. return i || (i = {
  19233. deferred: $.Deferred(),
  19234. active: !1
  19235. },
  19236. t[e] = i),
  19237. i
  19238. }
  19239. ,
  19240. n.prototype.resetWaitDeferred = function(e) {
  19241. var t = this.getWaitDeferred(e);
  19242. t.active = !1,
  19243. t.deferred = $.Deferred()
  19244. }
  19245. ,
  19246. n.prototype.clearWaitDeferreds = function() {
  19247. var e = _[this.id];
  19248. e || (e = {},
  19249. _[this.id] = e);
  19250. for (var t in e)
  19251. if (e.hasOwnProperty(t)) {
  19252. var i = e[t];
  19253. i.active = !1,
  19254. i.deferred = $.Deferred()
  19255. }
  19256. }
  19257. ,
  19258. n.prototype.loadTiledPano = function() {
  19259. var e = (new r.Vector3,
  19260. [])
  19261. , t = [];
  19262. return function(i, n, r, o, a, s) {
  19263. null !== o && void 0 !== o || (o = !0),
  19264. null !== a && void 0 !== a || (a = !0);
  19265. var l = this.getWaitDeferred(i)
  19266. , c = l.deferred
  19267. , h = null
  19268. , u = null;
  19269. if (r && ("number" == typeof r ? h = r : (h = r.hFov,
  19270. u = r.vFov)),
  19271. !this.isLoaded(i)) {
  19272. if (!l.active) {
  19273. if (l.active = !0,
  19274. r) {
  19275. var d = y.matchingTilesInDirection(this, i, n, h, u);
  19276. e[this.id + ":" + i] = {
  19277. tileCount: 0,
  19278. targetTileCount: d
  19279. },
  19280. I.info("Loading partial pano: " + this.id + " with " + d + " tiles")
  19281. }
  19282. t[this.id] || (t[this.id] = !0,
  19283. this.on(f.LoadComplete, function(e, t) {
  19284. //console.warn('点位下载完成 ', 'id:'+this.id, 'count:'+t )
  19285. var i = this.getWaitDeferred(e).deferred;
  19286. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  19287. this.resetWaitDeferred(e))
  19288. }
  19289. .bind(this)),
  19290. this.on(f.LoadFailed, function(e) {
  19291. var t = this.getWaitDeferred(e).deferred;
  19292. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  19293. this.resetWaitDeferred(e))
  19294. }
  19295. .bind(this)),
  19296. this.on(f.TileLoaded, function(t, i, n) {
  19297. //console.log('tileLoaded', 'id:'+this.id, 'size:'+t, 'index:'+i )
  19298. var r = this.getWaitDeferred(t).deferred;
  19299. if (r && "pending" === r.state()) {
  19300. r.notify(t, i, n);
  19301. var o = e[this.id + ":" + t];
  19302. o && (o.tileCount++,
  19303. o.tileCount === o.targetTileCount && (this.onPanoRendered(this.id, t, n, !0),
  19304. r.resolve(t, n),
  19305. this.resetWaitDeferred(t)))
  19306. }
  19307. }
  19308. .bind(this)))
  19309. }
  19310. this.tileDownloader.clearForceQueue(),
  19311. this.tileDownloader.forceQueueTilesForPano(this, i, n, h, u, s),
  19312. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, Math.min(2048, this.qualityManager.getMaxNavPanoSize()) , o), //不要超过2048否则漫游到下一个点时卡顿
  19313. this.panoRenderer.renderPanoTiles(this.id, n, a)
  19314. }
  19315. return c.promise()
  19316. }
  19317. }(),
  19318. n.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  19319. if (e === this.id) {
  19320. var n = this.qualityManager.getPanoSize(m.BASE);
  19321. t === n && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  19322. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  19323. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  19324. }
  19325. }
  19326. ,
  19327. n.prototype.onTileRendered = function(e, t, i, n) {
  19328. e === this.id && this.emit(f.TileLoaded, t, i, n)
  19329. }
  19330. ,
  19331. n.prototype.onPanoRendered = function(e, t, i, n) {
  19332. e === this.id && (this.minimumTiledPanoLoaded = !0,
  19333. this.updateSkyboxForZoomLevel(),
  19334. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  19335. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  19336. this.emit("load", t),
  19337. this.model.emit("load", this),
  19338. this.emit(f.LoadComplete, t, i))
  19339. }
  19340. ,
  19341. n.prototype.setZoomed = function(e) {
  19342. this.zoomed = e,
  19343. this.updateSkyboxForZoomLevel()
  19344. if(e){ //add
  19345. if(player.qualityManager.getNavZoomClass() != '1k' ){
  19346. this.model.showHighMap()
  19347. }
  19348. }else{
  19349. this.model.hideHighMap()
  19350. }
  19351. }
  19352. ,
  19353. n.prototype.ensureSkyboxReadyForRender = function() {
  19354. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  19355. this.solidSkybox.loaded = !0)
  19356. }
  19357. ,
  19358. n.prototype.updateSkyboxForZoomLevel = function() {
  19359. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  19360. }
  19361. ,
  19362. n.prototype.getSkyboxTexture = function() {
  19363. //return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  19364. if(!this.tiled){
  19365. return this.solidSkybox
  19366. }
  19367. if(this.minimumTiledPanoLoaded)
  19368. {
  19369. if(this.zoomed && (this.qualityManager.maxRenderTargetSize > this.qualityManager.maxNavPanoSize|| player.qualityManager.getNavZoomClass() == '4k' ))//change 如果放大后和不放大都是2k就不用这个
  19370. {
  19371. return this.panoRenderer.zoomRenderTarget.texture;
  19372. }
  19373. else
  19374. {
  19375. this.tiledPanoRenderTarget.texture.mapping = THREE.UVMapping//add
  19376. return this.tiledPanoRenderTarget.texture;
  19377. }
  19378. }
  19379. else
  19380. {
  19381. return null;
  19382. }
  19383. }
  19384. ,
  19385. n.prototype.onTileRenderFail = function(e, t, i) {
  19386. e === this.id && this.emit(f.LoadFailed, t)
  19387. }
  19388. ,
  19389. n.prototype.isLoaded = function(e) {
  19390. if (this.tiled) {
  19391. if (e && "string" == typeof e)
  19392. throw new A("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  19393. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  19394. }
  19395. if (e && "number" == typeof e)
  19396. throw new A("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  19397. return !!this.solidSkybox.high || e in this.solidSkybox
  19398. }
  19399. ,
  19400. n.prototype.loadCube = function(e) {
  19401. if (this.isLoaded(e))
  19402. return I.info("Skipping load of pano, already loaded"),
  19403. $.when();
  19404. this.emit("loading", e),
  19405. this.model.emit("loading", this);
  19406. var t = p.getCubemapUrls(this.model.urls, this.id, e)
  19407. , i = t.filter(function(e) {
  19408. return !e
  19409. });
  19410. "low" === e && i.length > 0 && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  19411. e = "high",
  19412. t = p.getCubemapUrls(this.model.urls, this.id, e));
  19413. var n = 0
  19414. , r = [0, 1, 2, 3, 4, 5].map(function(e, i, n) {
  19415. return u.getImage(t[i])
  19416. }
  19417. .bind(this));
  19418. return $.when(r[0], r[1], r[2], r[3], r[4], r[5]).then(function(t, i, n, r, o, a) {
  19419. return this.solidSkybox[e] = [t, i, n, r, o, a],
  19420. "high" !== e && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[e],
  19421. this.solidSkybox.low = null),
  19422. this.solidSkybox.needsUpdate = !0,
  19423. this.emit("load", e),
  19424. this.model.emit("load", this),
  19425. this
  19426. }
  19427. .bind(this), function() {
  19428. I.error("Downloading cubemap for pano", this.id, "failed"),
  19429. this.failedLoadingAt = Date.now()
  19430. }
  19431. .bind(this), function() {
  19432. return $.when(++n, 6)
  19433. })
  19434. }
  19435. ,
  19436. n.raycastsSkipped = 0,
  19437. n.raycastsDone = 0,
  19438. n.prototype.findNeighourPanos = function() {
  19439. return this.model.panos.setNeighbour(this.id, this.id, !1),
  19440. this.model.panos.forEach(function(e) {
  19441. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  19442. var t = this.position.distanceTo(e.position);
  19443. if (t > a.panoramaNeighbourMaxDistance)
  19444. return this.model.panos.setNeighbour(this, e, !1),
  19445. void n.raycastsSkipped++;
  19446. var i = e.position.clone().sub(this.position).normalize()
  19447. , o = new r.Raycaster(this.position,i.clone(),0,t)
  19448. , s = o.intersectObjects(this.model.colliders);
  19449. n.raycastsDone++,
  19450. this.model.panos.setNeighbour(this, e, 0 === s.length),
  19451. 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)))
  19452. }
  19453. }
  19454. .bind(this)),
  19455. this.model.panos.neighbourMap[this.id]
  19456. }
  19457. ,
  19458. n.prototype.worldPosition = function() {
  19459. return this.position
  19460. }
  19461. ,
  19462. n.prototype.addLabel = function() {
  19463. this.removeLabel()
  19464. this.label = new TextSprite({
  19465. sizeInfo: {
  19466. minSize: 100,
  19467. maxSize: 200,
  19468. nearBound: 0.7,
  19469. farBound: 10, //Math.max(20, player.model.size.length() / 3),
  19470. farBoundPlan: 100,
  19471. },
  19472. backgroundColor: { r: 255, g: 255, b: 255, a: 0.4 },
  19473. textColor: { r: 0, g: 0, b: 0, a: 1 },
  19474. borderRadius: 15,
  19475. renderOrder: 5,
  19476. text: this.id //`${this.id}-f${this.floorIndex}`
  19477. })
  19478. let position = this.floorPosition.clone()
  19479. position.y += 0.2
  19480. this.label.position.copy(position)
  19481. this.floor.add(this.label)
  19482. },
  19483. n.prototype.removeLabel = function() {
  19484. this.label && (this.floor.remove(this.label), this.label.material.dispose(), (this.label = null))
  19485. },
  19486. /* n.prototype.addTextSprite = function(e, t) {
  19487. this.removeTextSprite();
  19488. var i = document.createElement("canvas")
  19489. , n = i.getContext("2d");
  19490. i.width = 256,
  19491. i.height = 256;
  19492. var o = "Arial"
  19493. , a = 60;
  19494. n.font = "bold " + a + "px " + o,
  19495. n.fillStyle = "white";
  19496. var s = n.measureText(e).width;
  19497. n.fillText(e, (i.width - s) / 2, (i.height + a) / 2);
  19498. var l = new r.Texture(i);
  19499. l.needsUpdate = !0;
  19500. var c = new r.SpriteMaterial({
  19501. map: l,
  19502. color: t || 16428055
  19503. });
  19504. this.text3d = new r.Sprite(c),
  19505. this.text3d.position.copy(this.skyboxMesh.position),
  19506. this.floor.add(this.text3d)
  19507. }
  19508. ,
  19509. n.prototype.removeTextSprite = function() {
  19510. this.text3d && (this.floor.remove(this.text3d),
  19511. this.text3d = null)
  19512. }*/
  19513. n.prototype.isAligned = function() {
  19514. return this.alignmentType === l.ALIGNED
  19515. }
  19516. ,
  19517. n.filters = {
  19518. inDirection: function(e, t, i) {
  19519. return function(n) {
  19520. var r = n.position.clone().sub(e).normalize();
  19521. return r.dot(t) > i
  19522. }
  19523. },
  19524. inFloorDirection: function(e, t, i) {
  19525. return function(n) {
  19526. var r = n.floorPosition.clone().sub(e).normalize();
  19527. return r.dot(t) > i
  19528. }
  19529. },
  19530. inPanoDirection: function(e, t, i) {
  19531. return i = a.navigation.panoScores ? a.navigation.filterStrictness : i,
  19532. function(n) {
  19533. var r = n.floorPosition.clone().sub(e).normalize()
  19534. , o = n.position.clone().sub(e).normalize();
  19535. return r.dot(t) > i || o.dot(t) > i
  19536. }
  19537. },
  19538. atFloor: function(e) {
  19539. return function(t) {
  19540. return !e || t.floor === e
  19541. }
  19542. },
  19543. not: function(e) {
  19544. return function(t) {
  19545. return t !== e
  19546. }
  19547. },
  19548. notIn: function(e) {
  19549. return function(t) {
  19550. return e.indexOf(t) === -1
  19551. }
  19552. },
  19553. isLoaded: function() {
  19554. return function(e) {
  19555. return e.isLoaded()
  19556. }
  19557. },
  19558. isNotLoaded: function() {
  19559. return function(e) {
  19560. return !e.isLoaded()
  19561. }
  19562. },
  19563. isCloseEnoughTo: function(e, t) {
  19564. return function(i) {
  19565. return e.distanceTo(i.floorPosition) < t
  19566. }
  19567. },
  19568. hasMinimumHeightDifferenceTo: function(e, t) {
  19569. return function(i) {
  19570. return Math.abs(i.position.y - e.y) > t
  19571. }
  19572. },
  19573. isNotBehindNormal: function(e, t) {
  19574. var i = new r.Vector3;
  19575. return t = t.clone(),
  19576. function(n) {
  19577. var r = i.copy(n.position).sub(e).normalize();
  19578. return r.dot(t) > 0
  19579. }
  19580. },
  19581. isNeighbourPanoTo: function(e) {
  19582. return function(t) {
  19583. return !e || !e.neighbourPanos || !!e.neighbourPanos[t.id]
  19584. }
  19585. },
  19586. isNeighbourOfNeighbourTo: function(e) {
  19587. return function(t) {
  19588. return !!e.neighbourPanos[t.id] || e.neighbourUUIDs.some(function(i) {
  19589. var n = e.model.panos.get(i);
  19590. return !!n && n.neighbourPanos[t.id]
  19591. })
  19592. }
  19593. },
  19594. isNotRecentlyFailed: function(e) {
  19595. return function(t) {
  19596. return Date.now() - t.failedLoadingAt > e
  19597. }
  19598. },
  19599. isOnVisibleFloor: function() {
  19600. return function(e) {
  19601. return !e.floor.hidden
  19602. }
  19603. },
  19604. isPanoAligned: function() {
  19605. return function(e) {
  19606. return e.isAligned()
  19607. }
  19608. }
  19609. },
  19610. n.sortFunctions = {
  19611. distanceToPoint: function(e) {
  19612. return function(t, i) {
  19613. return t.position.distanceTo(e) - i.position.distanceTo(e)
  19614. }
  19615. },
  19616. floorDistanceToPoint: function(e) {
  19617. return function(t, i) {
  19618. return t.floorPosition.distanceTo(e) - i.floorPosition.distanceTo(e)
  19619. }
  19620. },
  19621. choose: function(e) {
  19622. return function(t, i) {
  19623. return e.id === t.id ? -1 : e.id === i.id ? 1 : 0
  19624. }
  19625. }
  19626. },
  19627. n.scoreFunctions = {
  19628. distance: function(e, t) {
  19629. return t = t || a.navigation.distanceFactor,
  19630. function(i) {
  19631. return e ? e.position.distanceTo(i.position) * t : 0
  19632. }
  19633. },
  19634. distanceSquared: function(e, t) {
  19635. return t = t || a.navigation.distanceFactor,
  19636. function(i) {
  19637. return e ? e.position.distanceToSquared(i.position) * t : 0
  19638. }
  19639. },
  19640. direction: function(e, t) {
  19641. return function(i) {
  19642. var n = i.position.clone().sub(e).normalize();
  19643. return n.dot(t) * a.navigation.directionFactor
  19644. }
  19645. },
  19646. angle: function(e, t) {
  19647. return function(i) {
  19648. var n = i.position.clone().sub(e).normalize();
  19649. return n.angleTo(t) * a.navigation.angleFactor
  19650. }
  19651. },
  19652. inFieldOfView: function(e, t) {
  19653. return function(i) {
  19654. var n = i.position.clone().sub(e).normalize();
  19655. return n.dot(t) > .75 ? 10 : -1
  19656. }
  19657. },
  19658. optionality: function(e) {
  19659. return function(t) {
  19660. var i = t.neighbourUUIDs.filter(function(t) {
  19661. return !(t in e.neighbourUUIDs) && t !== e.id
  19662. });
  19663. return i.length * a.navigation.optionalityFactor
  19664. }
  19665. },
  19666. penalizeHeightDifferenceUnder: function(e, t) {
  19667. return function(i) {
  19668. return e.y - i.position.y < t ? -20 : 0
  19669. }
  19670. }
  19671. },
  19672. t.exports = n
  19673. }
  19674. ).call(this, "/js/objects/Panorama.js")
  19675. }
  19676. , {
  19677. "../enum/AlignmentType": 17,
  19678. "../enum/GLCubeFaces": 25,
  19679. "../enum/PanoRendererEvents": 35,
  19680. "../enum/PanoSizeClass": 36,
  19681. "../enum/PanoramaEvents": 37,
  19682. "../enum/RenderLayers": 41,
  19683. "../enum/RenderOrder": 42,
  19684. "../enum/TileDownloaderEvents": 45,
  19685. "../enum/Viewmode": 51,
  19686. "../exception/BasicException": 55,
  19687. "../scene/SceneRenderer": 158,
  19688. "../settings": 166,
  19689. "../tile/TileUtils": 174,
  19690. "../util/ajax": 181,
  19691. "../util/common": 185,
  19692. "../util/lerp": 188,
  19693. "../util/logger": 189,
  19694. "../util/panorama": 191,
  19695. "../util/texture": 194,
  19696. "../util/transitions": 195,
  19697. events: 202,
  19698. three: 217
  19699. }],
  19700. 149: [function(e, t, i) {
  19701. "use strict";
  19702. function n(e) {
  19703. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  19704. t.map.value = d,
  19705. t.opacity.value = 0,
  19706. t.color.value.set(o.reticuleColor),
  19707. t.showMouseMarker = !window.DATA.hideMouseMarker;
  19708. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  19709. side: r.DoubleSide,
  19710. depthWrite: !1,
  19711. depthTest: !1,
  19712. transparent: !0,
  19713. vertexShader: c.waypoint.vertexShader,
  19714. fragmentShader: c.waypoint.fragmentShader,
  19715. uniforms: t,
  19716. name: "waypoint",
  19717. opacity: 0,
  19718. visible: t.showMouseMarker // 显示/隐藏鼠标标志
  19719. })),
  19720. this.layers.set(h.RETICULE),
  19721. this.renderOrder = u.reticule,
  19722. this.player = e,
  19723. this.direction = new r.Vector3,
  19724. this.hidden = !0,
  19725. this.mouseLastMoveTime = Date.now()
  19726. }
  19727. var r = e("three")
  19728. , o = e("../settings")
  19729. , a = e("../util/transitions")
  19730. , s = e("../util/texture")
  19731. , l = e("../util/lerp")
  19732. , c = e("../shaders")
  19733. , h = e("../enum/RenderLayers")
  19734. , u = e("../enum/RenderOrder")
  19735. , d = s.load("images/reticule.png");
  19736. d.anisotropy = browser.isMobile() ? 1 : 4; //各向异性
  19737. n.prototype = Object.create(r.Mesh.prototype),
  19738. n.prototype.move = function(e, t, i) {
  19739. this.hidden = i,
  19740. this.mouseLastMoveTime = Date.now()
  19741. }
  19742. ,
  19743. n.prototype.hide = function() {
  19744. this.hidden || (this.hidden = !0,
  19745. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  19746. }
  19747. ,
  19748. n.prototype.show = function() {
  19749. this.hidden = !1,
  19750. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  19751. }
  19752. ,
  19753. n.prototype.update = function() {
  19754. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  19755. }
  19756. ,
  19757. n.prototype.updatePosition = function(e, t) {
  19758. if (!this.hidden) {
  19759. if (!t)
  19760. return this.hide();
  19761. var i = t.point
  19762. , n = e.distanceTo(i)
  19763. , r = 1 + .01 * n;
  19764. n < 1 && (r -= 1 - n),
  19765. this.show(),
  19766. this.scale.set(r, r, r),
  19767. this.direction = this.direction.multiplyScalar(.8),
  19768. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  19769. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  19770. this.lookAt(this.position.clone().add(this.direction))
  19771. }
  19772. }
  19773. ,
  19774. n.prototype.writeAstag = function() {
  19775. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  19776. , t = new Date;
  19777. this.tagCount = "undefined" == typeof this.tagCount ? 1 : this.tagCount + 1;
  19778. var i = {
  19779. enabled: !0,
  19780. version: "0",
  19781. created: t.toISOString(),
  19782. created_by: "APITest",
  19783. position: this.position.clone(),
  19784. stem: {
  19785. enabled: o.tags.pole.enabled,
  19786. direction: this.direction.multiplyScalar(o.tags.pole.height)
  19787. },
  19788. label: "tag " + this.tagCount,
  19789. description: "Description " + e,
  19790. floor: function(e) {
  19791. if (e.currentFloor) {
  19792. var t = e.floors.indexOf(e.currentFloor);
  19793. return t > -1 ? t : void 0
  19794. }
  19795. }(this.player.model),
  19796. type: "info",
  19797. metadata: {
  19798. preferred_camera: {
  19799. mode: this.player.mode
  19800. }
  19801. }
  19802. };
  19803. console.log("--------------------------"),
  19804. console.log(JSON.stringify(i));
  19805. var n = this.player.model.addtag(e, i).build();
  19806. n && (n.disc && this.player.tagDiscs.push(n.disc),
  19807. n.visible || n.show(o.tags.startup.fadeInDuration))
  19808. }
  19809. ,
  19810. t.exports = n
  19811. }
  19812. , {
  19813. "../enum/RenderLayers": 41,
  19814. "../enum/RenderOrder": 42,
  19815. "../settings": 166,
  19816. "../shaders": 167,
  19817. "../util/lerp": 188,
  19818. "../util/texture": 194,
  19819. "../util/transitions": 195,
  19820. three: 217
  19821. }],
  19822. 150: [function(e, t, i) {
  19823. "use strict";
  19824. function n(e, t) {
  19825. this.chunks = [],
  19826. this.floorId = e,
  19827. this.roomId = t,
  19828. this.position = new r.Vector3
  19829. }
  19830. var r = e("three");
  19831. n.prototype.addChunk = function(e) {
  19832. this.chunks.push(e)
  19833. }
  19834. ,
  19835. n.prototype.calcBoundaries = function() {
  19836. 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++) {
  19837. var s = this.chunks[a]
  19838. , l = s.geometry.attributes.position;
  19839. if (l)
  19840. for (var c = 0; c < l.array.length; c += 3)
  19841. e.set(l.array[c], l.array[c + 1], l.array[c + 2]),
  19842. t.add(e),
  19843. 0 === c ? (i.copy(e),
  19844. n.copy(e)) : (i.max(e),
  19845. n.min(e)),
  19846. o++
  19847. }
  19848. o > 0 ? (t.multiplyScalar(1 / o),
  19849. this.average = t) : this.average = null,
  19850. this.boundsMax = i,
  19851. this.boundsMin = n,
  19852. this.center = new r.Vector3,
  19853. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  19854. }
  19855. ,
  19856. t.exports = n
  19857. }
  19858. , {
  19859. three: 217
  19860. }],
  19861. 151: [function(e, t, i) {
  19862. (function(i) {
  19863. "use strict";
  19864. function n(e, t, i) {
  19865. this.obj3d = null,
  19866. this.nodes = [],
  19867. this.colorHull = [],
  19868. this.shortPaths = {},
  19869. this.floorHull = null,
  19870. this.cameraHull = null,
  19871. this.floorPathDistance = 0,
  19872. this.floorCurvePoints = null,
  19873. this.floorCurveColors = null,
  19874. this.camCurvePoints = null,
  19875. this.warpDestHeroLoc = null,
  19876. this.warpDestPano = null,
  19877. this.warpPathPoints = null,
  19878. this.warpPathLengths = [0],
  19879. this.warpLength = 0,
  19880. this.closeWarpDistance = 4,
  19881. this.UP = A.UP.clone(),
  19882. this.longestStep = 0,
  19883. this.upcomingTransType = null,
  19884. this.burnsDir = 1, //导览在DOLLHOUSE停留时的旋转方向 1 或 -1
  19885. this.prevNextDist = 0,
  19886. this.nextI = 0,
  19887. this.activeTransType = null,
  19888. this.lastTransType = null,
  19889. this.bunnyObj = null,
  19890. this.director = e,
  19891. this.player = t,
  19892. this.playerControls = i,
  19893. this.modelManager = t.modelManager,
  19894. this.updateModel(),
  19895. this.updateDefaultsFromModelData(),
  19896. this.bindEvents(),
  19897. this.warping = !1,
  19898. this.waitingToWarp = !1,
  19899. this.warpInterrupted = !1,
  19900. this.warpInterruptionBlackoutStyle = null,
  19901. this.warpInterruptionTravelTime = null
  19902. }
  19903. var r = e("three")
  19904. , o = e("../util/logger")
  19905. , a = e("../enum/Viewmode")
  19906. , s = e("../enum/RenderOrder")
  19907. , l = e("../enum/WarpStyle")
  19908. , c = e("../settings")
  19909. , h = e("../util/math")
  19910. , u = e("../util/lerp")
  19911. , d = e("../util/easing")
  19912. , p = e("../util/transitions")
  19913. , f = e("../objects/Snapshot")
  19914. , g = e("../effects")
  19915. , m = e("../shaders")
  19916. , v = (e("../gui/gui"),
  19917. e("../util/texture"))
  19918. , A = e("../enum/Vectors")
  19919. , y = (e("../model/ModelManager"),
  19920. new o(i))
  19921. , C = e("../enum/PlayerEvents")
  19922. , I = e("../enum/BlackoutStyle")
  19923. , E = e("../enum/ModelManagerEvents")
  19924. , b = e("../constants")
  19925. , w = {
  19926. 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"),
  19927. pathEnd: v.load("images/End.png"),
  19928. 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==")
  19929. };
  19930. n.prototype.setScene = function(e) {
  19931. this.createCpm(e),
  19932. this.createBunnyObj(e)
  19933. }
  19934. ,
  19935. n.prototype.updateModel = function() {
  19936. this.model = this.modelManager.getActiveModel()
  19937. }
  19938. ,
  19939. n.prototype.bindEvents = function() {
  19940. this.modelManager.on(E.ActiveModelChanged, this.updateModel.bind(this))
  19941. }
  19942. ,
  19943. n.prototype.updateDefaultsFromModelData = function() {
  19944. this.model.data
  19945. }
  19946. ,
  19947. n.prototype.pointPathDistance = function(e) {
  19948. for (var t = 0, i = 1; i < e.length; i += 1)
  19949. t += e[i - 1].distanceTo(e[i]);
  19950. return t
  19951. }
  19952. ,
  19953. n.prototype.pointPathLengths = function(e) {
  19954. for (var t = [0], i = 1; i < e.length; i += 1)
  19955. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  19956. return t
  19957. }
  19958. ,
  19959. n.prototype.interpAlongPath = function(e, t, i) {
  19960. var n, o = new r.Vector3, a = t[t.length - 1];
  19961. if (i < 1) {
  19962. n = i * a;
  19963. for (var s = 1; s < t.length; s += 1)
  19964. if (t[s] > n) {
  19965. var l = (n - t[s - 1]) / (t[s] - t[s - 1]);
  19966. return o.copy(e[s]),
  19967. o.sub(e[s - 1]),
  19968. o.multiplyScalar(l),
  19969. o.add(e[s - 1]),
  19970. o
  19971. }
  19972. } else
  19973. o.copy(e[e.length - 1]);
  19974. return o
  19975. }
  19976. ,
  19977. n.prototype.pathHeight = function() {
  19978. return this.player.mode !== a.FLOORPLAN ? c.path.height : c.path.outsideHeight
  19979. }
  19980. ,
  19981. n.prototype.createBunnyObj = function(e) {
  19982. this.bunnyObj || (this.bunnyObj = new r.AxisHelper(.1),
  19983. this.bunnyObj.visible = c.warp.showBunny),
  19984. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  19985. e.add(this.bunnyObj)
  19986. }
  19987. ,
  19988. n.prototype.createCpm = function(e) {
  19989. if (!this.currentPanoMarker) {
  19990. var t = this.makeWaypointObj(w.pathEnd, "Current");
  19991. t.material.uniforms.opacity.value = 0,
  19992. //变成一个定位sprite
  19993. /* let sprite = new THREE.Mesh(new THREE.PlaneBufferGeometry(0.4,0.4,1,1), new THREE.MeshBasicMaterial({
  19994. map: v.load('images/icon_address.png'), depthTest:false,
  19995. transparent:true,
  19996. }))
  19997. sprite.position.y = 0.3
  19998. let t = new THREE.Object3D()
  19999. t.add(sprite)
  20000. setTimeout(()=>{
  20001. window.player.on("view.changed",()=>{
  20002. player.path.currentPanoMarker.mesh.quaternion.copy(player.quaternion)
  20003. })
  20004. },1000)*/
  20005. this.currentPanoMarker = {
  20006. mesh: t,
  20007. placed: !1
  20008. }
  20009. }
  20010. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  20011. this.placeCpm(),
  20012. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  20013. }
  20014. ,
  20015. n.prototype.shouldHideCpmAtCurrentPano = function() {
  20016. return this.player && this.player.mode === a.PANORAMA && this.player.currentPano && this.player.currentPano.isAligned()
  20017. }
  20018. ,
  20019. n.prototype.syncCpmVisibility = function() {
  20020. if (!this.currentPanoMarker || !this.currentPanoMarker.mesh)
  20021. return;
  20022. var e = this.shouldHideCpmAtCurrentPano();
  20023. this.currentPanoMarker.mesh.visible = !e,
  20024. e && this.currentPanoMarker.mesh.material && this.currentPanoMarker.mesh.material.uniforms && this.currentPanoMarker.mesh.material.uniforms.opacity && (this.currentPanoMarker.mesh.material.uniforms.opacity.value = 0)
  20025. }
  20026. ,
  20027. n.prototype.placeCpm = function() {
  20028. if (c.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  20029. var e = this.player.currentPano.floor;
  20030. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  20031. e.add(this.currentPanoMarker.mesh)),
  20032. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  20033. this.currentPanoMarker.mesh.position.y += this.pathHeight() ,
  20034. this.currentPanoMarker.placed = !0,
  20035. this.syncCpmVisibility()
  20036. } else
  20037. this.popOutCpm()
  20038. }
  20039. ,
  20040. n.prototype.fadeInCpm = function(e) {
  20041. if (this.shouldHideCpmAtCurrentPano())
  20042. return void this.syncCpmVisibility();
  20043. c.path.mapGuides && this.currentPanoMarker.placed && (this.currentPanoMarker.mesh.visible = !0,
  20044. p.start(u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 1), e))
  20045. }
  20046. ,
  20047. n.prototype.fadeOutCpm = function(e) {
  20048. this.currentPanoMarker && this.currentPanoMarker.mesh && this.currentPanoMarker.mesh.material && this.currentPanoMarker.mesh.material.uniforms && this.currentPanoMarker.mesh.material.uniforms.opacity && (this.currentPanoMarker.mesh.material.uniforms.opacity.value = 0),
  20049. this.syncCpmVisibility()
  20050. }
  20051. n.prototype.popInCpm = function() {
  20052. c.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  20053. }
  20054. ,
  20055. n.prototype.popOutCpm = function() {
  20056. this.fadeOutCpm(2)
  20057. }
  20058. ,
  20059. n.prototype.brushPrefs = {
  20060. linewidth: 7,
  20061. strokeWidth: 15,
  20062. cvSegments: 48,
  20063. paveStep: .1,
  20064. paveWidth: .2,
  20065. lookBlendDist: 3,
  20066. maxTurn: r.Math.degToRad(2)
  20067. },
  20068. n.prototype.panoPathDistance = function(e) {
  20069. var t = this.model.panos;
  20070. if (!e || e.length < 2)
  20071. return 0;
  20072. for (var i = [], n = 0; n < e.length; n += 1)
  20073. i.push(t.get(e[n]).floorPosition);
  20074. return this.pointPathDistance(i)
  20075. }
  20076. ,
  20077. n.prototype.loadTileTexture = function(e) {
  20078. var t = v.load(e, function(t) {
  20079. t.wrapS = r.RepeatWrapping,
  20080. t.wrapT = r.RepeatWrapping,
  20081. t.needsUpdate = !0,
  20082. y.debug('path texture "' + e + '" is ready')
  20083. }, function() {
  20084. y.error('path texture "' + e + '" failed')
  20085. });
  20086. return t.mapping = r.UVMapping,
  20087. t
  20088. }
  20089. ,
  20090. n.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  20091. var a = {
  20092. cameraMode: n,
  20093. position: e,
  20094. quaternion: t,
  20095. panoId: i,
  20096. orthoZoom: o,
  20097. floorVisibility: r,
  20098. thumbUrl: null,
  20099. name: null
  20100. };
  20101. return new f(a)
  20102. }
  20103. ,
  20104. n.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  20105. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  20106. }
  20107. ,
  20108. n.prototype.setWarpDestination = function(e) {
  20109. this.warpDestHeroLoc = e
  20110. }
  20111. ,
  20112. n.prototype.setWarpDestinationByHeroIndex = function(e) {
  20113. var t = this.getHeroDescriptorByHeroIndex(e);
  20114. return null !== t && (this.setWarpDestination(t),
  20115. !0)
  20116. }
  20117. ,
  20118. n.prototype.setWarpDestinationByPano = function(e, t) {
  20119. var i = this.model.panos.get(e.id);
  20120. return !!i && this.setWarpDestinationByPanoId(e.id, t)
  20121. }
  20122. ,
  20123. n.prototype.setWarpDestinationByPanoId = function(e, t) {
  20124. var i = this.model.panos.get(e);
  20125. if (i) {
  20126. t = t || new r.Quaternion;
  20127. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  20128. return this.setWarpDestination(n),
  20129. !0
  20130. }
  20131. return !1
  20132. }
  20133. ,
  20134. n.prototype.getHeroDescriptorByHeroIndex = function(e) {
  20135. var t = this.model.heroCount();
  20136. /* if (null !== this.warpDestHeroLoc && t < 2)
  20137. return y.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  20138. this.model.getHeroDescriptorByIndex(0); */
  20139. var i = this.model.getHeroDescriptorByIndex(e);
  20140. if (i) {
  20141. var n = i.isPano() ? i.panoId : i.cameraMode;
  20142. y.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  20143. }
  20144. return i
  20145. }
  20146. ,
  20147. n.prototype.getHeroDescriptorByPano = function(e) {
  20148. var t = this.model.panos.get(e.id);
  20149. return t ? this.getHeroDescriptorByPanoId(e.id) : null
  20150. }
  20151. ,
  20152. n.prototype.getHeroDescriptorByPanoId = function(e) {
  20153. var t = this.getHeroIndexFromPanoId(e);
  20154. return this.getHeroDescriptorByHeroIndex(t)
  20155. }
  20156. ,
  20157. n.prototype.getHeroIndexFromPanoId = function(e) {
  20158. for (var t = 0; t < this.model.heroLocations.length; t++) {
  20159. var i = this.model.heroLocations[t]
  20160. , n = this.getHeroId(i);
  20161. if (n && n === e)
  20162. return t
  20163. }
  20164. return -1
  20165. }
  20166. ,
  20167. n.prototype.getHeroPano = function(e) {
  20168. if (null === e)
  20169. return y.warn("getHeroPano(): no destination"),
  20170. null;
  20171. var t = this.getHeroId(e)
  20172. , i = this.model.panos.get(t);
  20173. return void 0 === i && (i = null,
  20174. "" !== t && y.debug('unable to find pano "' + t + '"')),
  20175. i
  20176. }
  20177. ,
  20178. n.prototype.getHeroId = function(e) {
  20179. return e.panoId
  20180. }
  20181. ,
  20182. n.prototype.setWarpDestPano = function() {
  20183. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  20184. this.warpDestPano
  20185. }
  20186. ,
  20187. n.prototype.brushToWarpPano = function(e, t) {
  20188. if (this.discardPathObject(),
  20189. !this.setWarpDestPano())
  20190. return !1;
  20191. if (this.warpDestHeroLoc.cameraMode !== a.PANORAMA && y.warn("Can only brush from pano to pano"),
  20192. !this.warpDestPano)
  20193. return y.info("No brush"),
  20194. !1;
  20195. if (!this.player.currentPano)
  20196. return y.debug("No current pano, visibility undefined"),
  20197. !1;
  20198. if (!this.warpDestPano)
  20199. return y.info("No wPano, visibility undefined"),
  20200. !1;
  20201. if (!this.warpDestPano.isAligned())
  20202. return y.debug("Cannot brush to unaligned pano"),
  20203. !1;
  20204. var i = (e === l.STD || e === l.WALK) && c.path.mapGuides
  20205. , n = !0;
  20206. if (this.player.currentPano.id === this.warpDestPano.id)
  20207. y.debug("Already at destination pano");
  20208. else {
  20209. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  20210. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  20211. this.obj3d = new r.Object3D,
  20212. y.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  20213. n ? (y.info('No "walkable" route, using fall-back warp style transition'),
  20214. e = t) : (this.setPathHulls(this.nodes),
  20215. this.setFloorCurves(),
  20216. 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)))),
  20217. this.player.currentPano.floor.add(this.obj3d);
  20218. var o = this.player.mode === a.DOLLHOUSE || this.player.mode === a.FLOORPLAN
  20219. , s = e === l.STD;
  20220. if (!n && (i || s)) {
  20221. if (o) {
  20222. var h = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  20223. this.obj3d.add(h)
  20224. }
  20225. var u = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  20226. this.obj3d.add(u)
  20227. }
  20228. this.appearSlow()
  20229. }
  20230. return this.upcomingTransType = e,
  20231. !n
  20232. }
  20233. ,
  20234. n.prototype.findShortestPath = function(e, t) {
  20235. if (!e || !t)
  20236. return null;
  20237. var i = c.warp.walkExtraPanosDistance
  20238. , n = e.id + ":" + t.id + ":" + i;
  20239. if (this.shortPaths.hasOwnProperty(n))
  20240. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  20241. var r = t.id + ":" + e.id + ":" + i;
  20242. if (this.shortPaths.hasOwnProperty(r))
  20243. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  20244. var o = this.model.panos.aStarSearch(e, t);
  20245. return this.model.panos.includeNodesNearPath(o, i),
  20246. this.shortPaths[n] = o ? o.slice() : null,
  20247. o
  20248. }
  20249. ,
  20250. n.prototype.makePathHulls = function(e) {
  20251. var t, i, n, r, o, a = 0, s = [], l = [], h = [], u = this.model.panos;
  20252. t = u.get(e[0]),
  20253. r = t.floor.floorIndex;
  20254. for (var d = 0; d < e.length; d += 1)
  20255. t = u.get(e[d]),
  20256. i = t.floorPosition.clone().sub(this.model.position),
  20257. i.y += this.pathHeight(),
  20258. s.push(i),
  20259. l.push(t.position.clone()),
  20260. n = t.floor.floorIndex,
  20261. h.push(n > r ? c.path.colorUp : n < r ? c.path.colorDown : c.path.color),
  20262. d > 0 && (o = l[d].distanceTo(l[d - 1]),
  20263. o > a && (a = o));
  20264. return a > this.longestStep && (this.longestStep = a,
  20265. y.debug("path contains " + a + " meter segment")),
  20266. {
  20267. floor: s,
  20268. camera: l,
  20269. color: h
  20270. }
  20271. }
  20272. ,
  20273. n.prototype.makeFloorCurves = function(e, t, i) {
  20274. var n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  20275. , o = this.pointPathDistance(e) - 2 * n
  20276. , s = e.slice(0)
  20277. , l = s[1].clone().sub(s[0]);
  20278. l.y = 0,
  20279. l.normalize().multiplyScalar(n),
  20280. s[0] = (new r.Vector3).copy(s[0]).add(l),
  20281. l = s[s.length - 2].clone().sub(s[s.length - 1]),
  20282. l.y = 0,
  20283. l.normalize().multiplyScalar(n),
  20284. s[s.length - 1] = (new r.Vector3).copy(s[s.length - 1]).add(l);
  20285. var h = new r.CatmullRomCurve3(s)
  20286. , u = Math.floor(o / i);
  20287. u = 4 * Math.floor(u / 4),
  20288. u = Math.max(4, u);
  20289. for (var d, p, f, g = h.getSpacedPoints(u), m = [], v = new r.Vector3, A = 0; A < g.length; A += 1) {
  20290. f = 0,
  20291. d = g[A].distanceTo(e[0]);
  20292. for (var y = 1; y < e.length; y += 1)
  20293. v.copy(g[A]).sub(e[y]),
  20294. v.y *= 4,
  20295. p = v.length(),
  20296. p < d && (f = y);
  20297. m.push(t[f])
  20298. }
  20299. return {
  20300. distance: o,
  20301. points: g,
  20302. colors: m
  20303. }
  20304. }
  20305. ,
  20306. n.prototype.makeCameraCurvePoints = function(e, t) {
  20307. var i = this.pointPathDistance(e)
  20308. , n = new r.CatmullRomCurve3(e);
  20309. return n.getSpacedPoints(Math.max(2, Math.floor(i / t)))
  20310. }
  20311. ,
  20312. n.prototype.makeCameraCurveTangents = function(e, t) {
  20313. var i = this.pointPathDistance(e)
  20314. , n = new r.CatmullRomCurve3(e)
  20315. , o = Math.max(2, Math.floor(i / t));
  20316. o || (o = 5);
  20317. for (var a = [], s = 0; s <= o; s++)
  20318. a.push(n.getTangentAt(s / o));
  20319. return a
  20320. }
  20321. ,
  20322. n.prototype.setPathHulls = function(e) {
  20323. var t = this.makePathHulls(e);
  20324. this.floorHull = t.floor,
  20325. this.cameraHull = t.camera,
  20326. this.colorHull = t.color
  20327. }
  20328. ,
  20329. n.prototype.setFloorCurves = function() {
  20330. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  20331. this.floorPathDistance = e.distance,
  20332. this.floorCurvePoints = e.points,
  20333. this.floorCurveColors = e.colors
  20334. }
  20335. ,
  20336. n.prototype.setCameraCurvePoints = function() {
  20337. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, c.warp.stepFactor * this.brushPrefs.paveStep)
  20338. }
  20339. ,
  20340. n.prototype.chooseWarpPath = function(e) {
  20341. var t, i, n, o = this.playerControls.cameras[a.PANORAMA];
  20342. if (this.player.currentPano === this.warpDestPano || !e)
  20343. return this.warpPathPoints = null,
  20344. this.warpLength = 0,
  20345. !1;
  20346. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  20347. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (y.debug("warp path to unreachable node"),
  20348. t = this.warpDestPano.position.clone().sub(o.position),
  20349. i = t.clone().negate(),
  20350. t.multiplyScalar(.15).add(o.position),
  20351. i.multiplyScalar(.15).add(this.warpDestPano.position),
  20352. t.y = o.position.y,
  20353. i.y = this.warpDestPano.position.y,
  20354. n = new r.CubicBezierCurve3(o.position.clone(),t,i,this.warpDestPano.position.clone()),
  20355. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (y.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  20356. this.setCameraCurvePoints(),
  20357. this.warpPathPoints = this.camCurvePoints.slice(0)),
  20358. this.warpLength = 0,
  20359. this.warpPathLengths = [0];
  20360. 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) {
  20361. s.copy(this.warpPathPoints[d - 1]).sub(this.warpPathPoints[d]);
  20362. var p = s.length();
  20363. s.y *= c.warp.climbEffort;
  20364. var f = s.length() / p;
  20365. if (d > 1) {
  20366. s.setY(0).normalize(),
  20367. l.copy(this.warpPathPoints[d - 2]).sub(this.warpPathPoints[d - 1]).setY(0).normalize();
  20368. var g = Math.min(1, s.dot(l))
  20369. , m = 1 + (c.warp.brakeStrength - 1) * (1 - r.Math.smoothstep(g, u, h));
  20370. f = Math.max(m, f)
  20371. }
  20372. this.warpLength += p * f,
  20373. this.warpPathLengths[d] = this.warpLength
  20374. }
  20375. return !0
  20376. }
  20377. ,
  20378. n.prototype.drawPathRibbon = function(e, t) {
  20379. this.bunnyObj.visible = c.warp.showBunny;
  20380. 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) {
  20381. h.copy(e[u]),
  20382. 0 === u ? h.sub(e[u + 1]) : h.sub(e[u - 1]).negate(),
  20383. h.normalize(),
  20384. n.crossVectors(h, A.UP),
  20385. n.multiplyScalar(i);
  20386. var d = (new r.Vector3).copy(e[u]).add(o);
  20387. d.sub(n),
  20388. l.vertices.push(d),
  20389. d = (new r.Vector3).copy(e[u]).add(o),
  20390. d.add(n),
  20391. l.vertices.push(d)
  20392. }
  20393. var p, f = 0;
  20394. for (u = 0; u < e.length - 1; u += 1) {
  20395. var g = 2 * u
  20396. , v = f;
  20397. f += e[u + 1].distanceTo(e[u]);
  20398. var y = f
  20399. , C = t[u]
  20400. , I = t[u + 1];
  20401. p = new r.Face3(g,g + 1,g + 2),
  20402. p.vertexColors = [new r.Color(C), new r.Color(C), new r.Color(I)],
  20403. l.faces.push(p),
  20404. l.faceVertexUvs[0].push([new r.Vector2(0,v), new r.Vector2(1,v), new r.Vector2(0,y)]),
  20405. p = new r.Face3(g + 2,g + 1,g + 3),
  20406. p.vertexColors = [new r.Color(I), new r.Color(C), new r.Color(I)],
  20407. l.faces.push(p),
  20408. l.faceVertexUvs[0].push([new r.Vector2(0,y), new r.Vector2(1,v), new r.Vector2(1,y)])
  20409. }
  20410. l.computeFaceNormals(),
  20411. l.computeVertexNormals();
  20412. var E, b;
  20413. this.player.mode === a.PANORAMA ? (b = r.UniformsUtils.clone(m.ribbon.uniforms),
  20414. b.map.value = w.path,
  20415. b.opacity.value = 0,
  20416. b.color.value.set(c.path.color),
  20417. E = new r.RawShaderMaterial({
  20418. side: r.DoubleSide,
  20419. depthWrite: !1,
  20420. transparent: !0,
  20421. vertexShader: m.ribbon.vertexShader,
  20422. fragmentShader: m.ribbon.fragmentShader,
  20423. uniforms: b,
  20424. name: "ribbonT",
  20425. opacity: 0
  20426. })) : E = new r.MeshBasicMaterial({
  20427. color: 16777215,
  20428. side: r.DoubleSide,
  20429. name: "ribbonOut",
  20430. vertexColors: r.VertexColors
  20431. });
  20432. var _ = new r.Mesh(l,E);
  20433. _.renderOrder = 10
  20434. return _.name = "ribbon",
  20435. this.player.mode === a.PANORAMA && (_.renderOrder = s.ribbon),
  20436. _
  20437. }
  20438. ,
  20439. n.prototype.drawPathPavement = function(e) {
  20440. for (var t, i = .25, n = new r.Vector3, o = new r.Geometry, s = new r.Vector3, l = 0; l < e.length; l += 1)
  20441. s.copy(e[l]),
  20442. 0 === l ? s.sub(e[l + 1]).negate() : s.sub(e[l - 1]),
  20443. s.normalize(),
  20444. n.crossVectors(s, A.UP),
  20445. n.multiplyScalar(this.brushPrefs.paveWidth),
  20446. t = (new r.Vector3).copy(e[l]),
  20447. t.sub(n),
  20448. o.vertices.push(t),
  20449. o.vertices.push((new r.Vector3).copy(e[l])),
  20450. t = (new r.Vector3).copy(e[l]),
  20451. t.add(n),
  20452. o.vertices.push(t);
  20453. var h, u, d;
  20454. for (l = 0; l < e.length - 1; l += 1)
  20455. h = 3 * l + 1,
  20456. u = l * i,
  20457. d = u + i,
  20458. o.faces.push(new r.Face3(h - 1,h,h + 3)),
  20459. o.faceVertexUvs[0].push([new r.Vector2(0,u), new r.Vector2(.5,u), new r.Vector2(.5,d)]),
  20460. o.faces.push(new r.Face3(h + 3,h + 2,h - 1)),
  20461. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(0,d), new r.Vector2(0,u)]),
  20462. o.faces.push(new r.Face3(h + 3,h,h + 1)),
  20463. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(.5,u), new r.Vector2(1,u)]),
  20464. o.faces.push(new r.Face3(h + 3,h + 1,h + 4)),
  20465. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(1,u), new r.Vector2(1,d)]);
  20466. var p = this.player.mode === a.PANORAMA ? new r.MeshBasicMaterial({
  20467. color: c.path.color,
  20468. side: r.DoubleSide,
  20469. transparent: !0,
  20470. depthWrite: !1,
  20471. opacity: 0,
  20472. name: "paveT",
  20473. map: w.path
  20474. }) : new r.MeshBasicMaterial({
  20475. color: c.path.color,
  20476. side: r.DoubleSide,
  20477. transparent: !0,
  20478. depthWrite: !1,
  20479. opacity: 1,
  20480. name: "paveO",
  20481. map: w.path
  20482. });
  20483. return new r.Mesh(o,p)
  20484. }
  20485. ,
  20486. n.prototype.hintPrefs = {
  20487. rad: .18,
  20488. width: .0125,
  20489. depth: .0625,
  20490. setBack: -.04,
  20491. markRad: .25,
  20492. markInnerRad: .16
  20493. },
  20494. n.prototype.makeWaypointObj = function(e, t) {
  20495. var i = new r.Geometry
  20496. , n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  20497. , o = this.pathHeight();
  20498. 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)),
  20499. i.faces.push(new r.Face3(0,1,2), new r.Face3(2,3,0)),
  20500. i.faceVertexUvs[0].push([new r.Vector2(0,0), new r.Vector2(1,0), new r.Vector2(1,1)]),
  20501. i.faceVertexUvs[0].push([new r.Vector2(1,1), new r.Vector2(0,1), new r.Vector2(0,0)]);
  20502. var s = r.UniformsUtils.clone(m.waypoint.uniforms);
  20503. s.map.value = e,
  20504. s.opacity.value = 0,
  20505. s.color.value.set(c.path.color);
  20506. var l = {
  20507. side: r.DoubleSide,
  20508. depthWrite: !1,
  20509. transparent: !0,
  20510. vertexShader: m.waypoint.vertexShader,
  20511. fragmentShader: m.waypoint.fragmentShader,
  20512. uniforms: s,
  20513. name: "waypoint",
  20514. opacity: 0
  20515. };
  20516. this.player.mode !== a.PANORAMA && (l.depthTest = !1,
  20517. l.name = "wayPtOut");
  20518. var h = new r.RawShaderMaterial(l)
  20519. , u = new r.Mesh(i,h);
  20520. return u.name = t,
  20521. u
  20522. }
  20523. ,
  20524. n.prototype.makeStartMarker = function(e, t) {
  20525. var i = (new r.Vector3).copy(t[1]).sub(t[0]);
  20526. i.y = 0,
  20527. i.normalize();
  20528. var n = Math.acos(i.x)
  20529. , o = this.makeWaypointObj(w.pathStart, "Start");
  20530. return o.rotateOnAxis(new r.Vector3(0,1,0), n),
  20531. o.position.copy(e),
  20532. o
  20533. }
  20534. ,
  20535. n.prototype.makeEndMarker = function(e) {
  20536. var t = this.makeWaypointObj(w.pathEnd, "End")
  20537. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  20538. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  20539. return i < n ? t.material.uniforms.color.value.set(c.path.colorUp) : i > n && t.material.uniforms.color.value.set(c.path.colorDown),
  20540. t.position.copy(e),
  20541. t
  20542. }
  20543. ,
  20544. n.prototype.pathClean = function(e) {
  20545. if (e) {
  20546. for (var t in e.children)
  20547. this.pathClean(e.children[t]);
  20548. e.geometry && e.geometry.dispose(),
  20549. e.material && e.material.dispose()
  20550. }
  20551. }
  20552. ,
  20553. n.prototype.discardPathObject = function() {
  20554. if (this.obj3d) {
  20555. var e = this.obj3d.parent;
  20556. e && e.remove(this.obj3d),
  20557. this.pathClean(this.obj3d)
  20558. }
  20559. this.obj3d = null,
  20560. this.popInCpm()
  20561. }
  20562. ,
  20563. n.prototype.discardSlow = function() {
  20564. if (this.obj3d) {
  20565. if (this.player.mode !== a.PANORAMA)
  20566. return void this.discardPathObject();
  20567. for (var e, t = this, i = 0, n = function() {
  20568. this.discardPathObject()
  20569. }
  20570. .bind(this), r = 0; r < t.obj3d.children.length; r += 1)
  20571. e = t.obj3d.children[r],
  20572. 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]),
  20573. i += 1,
  20574. n = null);
  20575. 0 === i && this.discardPathObject(),
  20576. this.player.mode !== a.PANORAMA && this.fadeInCpm(c.path.fadeInTime - 3)
  20577. }
  20578. }
  20579. ,
  20580. n.prototype.appearSlow = function() {
  20581. var e, t = this;
  20582. this.fadeOutCpm(c.path.fadeInTime);
  20583. for (var i = this.player.mode === a.PANORAMA ? c.path.opacity : 1, n = 0; n < t.obj3d.children.length; n += 1)
  20584. e = t.obj3d.children[n],
  20585. 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]))
  20586. }
  20587. ,
  20588. n.prototype.update = function() {
  20589. this.obj3d && this.obj3d.updateMatrixWorld()
  20590. }
  20591. ,
  20592. n.prototype.calcBurnsAmount = function(e) {//计算导览点旋转角
  20593. var t = r.Math.degToRad(c.warp.burnsAngle);
  20594. if (this.player.mode === a.PANORAMA) {
  20595. var i = this.burnsDir * t;
  20596. if (this.upcomingTransType === l.BLACK)
  20597. return i;
  20598. var n = e;
  20599. if (null === n)
  20600. return y.warn("Transition request for non-highlight"),
  20601. i;
  20602. var o = this.getHeroDescriptorByHeroIndex(n);
  20603. if (null === o)
  20604. return i;
  20605. if (!o.isPano())
  20606. return i;
  20607. var s = this.getHeroPano(o)
  20608. , h = this.playerControls.cameras[a.PANORAMA]
  20609. , u = A.FORWARD.clone().applyQuaternion(h.quaternion).setY(0).normalize()
  20610. , d = Math.min(r.Math.degToRad(c.warp.minBurnsAngle), t)
  20611. , p = function(e) {
  20612. var i = Math.acos(Math.min(1, e.dot(u)))
  20613. , n = (new r.Vector3).crossVectors(u, e);
  20614. return Math.max(d, Math.min(Math.abs(i), t)) * Math.sign(n.y)
  20615. };
  20616. if (s === this.player.currentPano)
  20617. return i = p(A.FORWARD.clone().applyQuaternion(o.quaternion).setY(0).normalize());
  20618. var f = this.findShortestPath(this.player.currentPano, s);
  20619. if (void 0 === f || null === f || f.length < 1)
  20620. return y.debug("Empty path ahead..."),
  20621. i;
  20622. var g = this.makePathHulls(f)
  20623. , m = new r.CatmullRomCurve3(g.camera)
  20624. , v = Math.min(.1, c.warp.lookAheadDist / m.getLength());
  20625. return i = p(m.getPointAt(v).clone().sub(h.position).setY(0).normalize())
  20626. }
  20627. return this.player.mode === a.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir
  20628. }
  20629. ,
  20630. n.prototype.waitNextStep = function(e, t, time) {//xzw 改时间
  20631. var i = (time==void 0)? c.warp.tourStepDelay : time;
  20632. i==void 0 && (i = this.lastTransType === l.BLACK ? b.tourStepDelaySlideShow : b.tourStepDelayDefault);
  20633. var n = new r.Euler
  20634. , o = new r.Vector3;
  20635. y.debug("Starting wait: " + (void 0 !== t));
  20636. var currentLocation = this.model.getHeroDescriptorByIndex(this.director.currentItem)//this.model.heroLocations[this.director.currentItem[0]]
  20637. var s = currentLocation.dontRot || this.calcBurnsAmount(e)
  20638. , h = function() {
  20639. this.endWarpState(),
  20640. this.player.mode === a.DOLLHOUSE && (this.playerControls.cameras[a.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  20641. t && t()
  20642. }
  20643. .bind(this)
  20644. , u = function(e, t) {
  20645. if (this.warpInterrupted)
  20646. return h(),
  20647. !0;
  20648. var r = t || 1e3 / 60;
  20649. if (c.warp.doBurns && !currentLocation.dontRot )
  20650. if (this.player.mode === a.PANORAMA) {
  20651. var l = this.playerControls.cameras[a.PANORAMA];
  20652. n.setFromQuaternion(l.quaternion, c.warp.eOrder);
  20653. var u = i == 0 ? s : r * s / i;
  20654. u = Math.sign(u) * Math.max(u, 0.0001) //add 如果音频长的话,使旋转可见,否则以为停住了
  20655. n.y += u,
  20656. o.set(0, 0, -1),
  20657. o.applyEuler(n),
  20658. o.add(l.position),
  20659. l.controls.lookAt(o),
  20660. l.controls.lookVector.copy(o)
  20661. ,l.lookAt(o)
  20662. } else
  20663. this.player.mode === a.DOLLHOUSE ? this.playerControls.controls[a.DOLLHOUSE].rotationAcceleration.x = s : this.playerControls.controls[a.FLOORPLAN].absoluteScale *= .9996
  20664. }
  20665. .bind(this);
  20666. this.startWarpState(),
  20667. p.start(u, i, h, 0, d.easeInOutQuad, "wait")
  20668. }
  20669. ,
  20670. n.prototype.warpToNonPano = function(e) {
  20671. if (this.discardPathObject(),
  20672. this.warpDestHeroLoc.cameraMode === a.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === a.FLOORPLAN) {
  20673. var t = function() {
  20674. e && e()
  20675. }
  20676. .bind(this);
  20677. this.player.flyToNewMode({
  20678. mode: this.warpDestHeroLoc.cameraMode,
  20679. duration: c.warp.outsideTime,
  20680. warpDest: this.warpDestHeroLoc,
  20681. callback: t,
  20682. force: !0
  20683. })
  20684. } else
  20685. y.warn("no warp destination!!!"),
  20686. e && e()
  20687. }
  20688. ,
  20689. n.prototype._resetWarpShaderParams = function(e) {//
  20690. this.player.mode === a.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  20691. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  20692. /* if(momentTourBlackNewType && "newBlack" in e.material.defines){
  20693. delete e.material.defines.newBlack;
  20694. e.material.needsUpdate = true
  20695. } */
  20696. }
  20697. ,
  20698. n.prototype._clearWarpShading = function() {
  20699. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  20700. this._resetWarpShaderParams(e[t]),
  20701. e[t].visible = !0;
  20702. this._resetWarpShaderParams(this.model.skybox)
  20703. }
  20704. ,
  20705. n.prototype._warpStopFlying = function() {
  20706. this.activeTransType = null,
  20707. this.placeCpm()
  20708. }
  20709. ,
  20710. n.prototype._wrapupTravelOnlyBits = function() {
  20711. this._warpStopFlying(),
  20712. this.warpPathPoints && (this.player.currentPano.exit(),
  20713. this.warpDestPano.enter(),
  20714. this.player.currentPano = this.warpDestPano),
  20715. this.player.spider.draw(),
  20716. this.placeCpm()
  20717. }
  20718. ,
  20719. n.prototype._wrapupTravel = function(e) {
  20720. this._wrapupTravelOnlyBits(),
  20721. this.warpCameraAim(e)
  20722. }
  20723. ,
  20724. n.prototype._wrapupWarpShading = function(e) {
  20725. this._clearWarpShading(),
  20726. this._wrapupTravel(e)
  20727. }
  20728. ,
  20729. n.prototype.wrapupWarpShadingOnly = function(e, t) {
  20730. t !== I.END && this._clearWarpShading(),
  20731. this._wrapupTravelOnlyBits(),
  20732. this.upcomingTransType = null,
  20733. e && e()
  20734. }
  20735. ,
  20736. n.prototype._warpCameraAim = function(e, t) {//到每个片段终点时转向终点朝向。
  20737. var i = this.warpDestHeroLoc.quaternion
  20738. , n = this.playerControls.cameras[a.PANORAMA]
  20739. , o = new r.Vector3(0,0,1).applyQuaternion(i).normalize()
  20740. , s = new r.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize()
  20741. , l = s.dot(o)
  20742. , u = r.Math.radToDeg(Math.acos(l))
  20743. , f = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(i, c.warp.eOrder)
  20744. , g = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  20745. , m = new r.Euler(f.x - g.x,f.y - g.y,f.z - g.z,c.warp.eOrder);
  20746. m.y = h.constrainedTurn(m.y),
  20747. this.burnsDir = Math.sign(m.y);
  20748. var v = new r.Euler(0,0,0,c.warp.eOrder)
  20749. , A = new r.Vector3
  20750. , C = function(e, t) {
  20751. return !!this.warpInterrupted || (v.x = g.x + e * m.x,
  20752. v.y = g.y + e * m.y,
  20753. v.z = g.z + e * m.z,
  20754. A.set(0, 0, -1),
  20755. A.applyEuler(v),
  20756. A.add(n.position),
  20757. n.controls.lookAt(A),
  20758. n.controls.lookVector.copy(A),
  20759. void n.lookAt(A))
  20760. }
  20761. .bind(this);
  20762. /* return u > c.warp.minRotation ? (p.start(C, e, t, 0, d[c.warp.movementEasing])
  20763. ,(this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  20764. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  20765. ):
  20766. (y.info("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim")
  20767. ,void (t && t())
  20768. ) */
  20769. (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  20770. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  20771. return u > c.warp.minRotation ? p.start(C, e, t, 0, d[c.warp.movementEasing]) :
  20772. (y.info("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim")
  20773. ,void (t && t())
  20774. )
  20775. }
  20776. ,
  20777. n.prototype._warpBendAim = function(e, t, i, n) {
  20778. var o = n || 0
  20779. , s = this.playerControls.cameras[a.PANORAMA]
  20780. , l = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20781. , u = (new r.Euler).setFromQuaternion(s.quaternion, c.warp.eOrder)
  20782. , f = new r.Euler(l.x - u.x,l.y - u.y,l.z - u.z,c.warp.eOrder);
  20783. f.y = h.constrainedTurn(f.y);
  20784. var g = Math.min(r.Math.degToRad(c.warp.softBendTilt), Math.abs(f.x));
  20785. f.x = g * Math.sign(f.x),
  20786. g = Math.min(r.Math.degToRad(Math.max(0, c.warp.softBendAngle)), g),
  20787. this.burnsDir = Math.sign(f.y),
  20788. g *= Math.sign(f.y),
  20789. f.y = g;
  20790. var m = new r.Euler(0,0,0,c.warp.eOrder)
  20791. , v = new r.Vector3
  20792. , A = function(e, t) {
  20793. if (e < .5)
  20794. m.x = u.x + e * f.x,
  20795. m.y = u.y + e * f.y,
  20796. m.z = u.z + e * f.z;
  20797. else {
  20798. var i = (1 - e) * c.warp.softBendEnd;
  20799. m.x = l.x - i * f.x,
  20800. m.y = l.y - i * f.y,
  20801. m.z = l.z - i * f.z
  20802. }
  20803. v.set(0, 0, -1),
  20804. v.applyEuler(m),
  20805. v.add(s.position);
  20806. s.controls.lookAt(v),
  20807. s.controls.lookVector.copy(v),
  20808. s.lookAt(v);
  20809. }
  20810. .bind(this);
  20811. if(window.DATA.momentTourBlackNewType){
  20812. A(1)
  20813. }else return p.start(A, t, i, o, d[c.warp.movementEasing])
  20814. }
  20815. ,
  20816. n.prototype._warpStepCameraAim = function(e, t, i) {
  20817. var n = this.playerControls.cameras[a.PANORAMA]
  20818. , o = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20819. , s = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  20820. , l = new r.Euler(o.x - s.x,o.y - s.y,o.z - s.z,c.warp.eOrder);
  20821. l.y = h.constrainedTurn(l.y),
  20822. this.burnsDir = Math.sign(l.y);
  20823. var u = new r.Euler(0,0,0,c.warp.eOrder)
  20824. , f = new r.Vector3
  20825. , g = function(e, t) {
  20826. e < .5 ? u.copy(s) : u.copy(o),
  20827. f.set(0, 0, -1),
  20828. f.applyEuler(u),
  20829. f.add(n.position),
  20830. n.controls.lookAt(f),
  20831. n.controls.lookVector.copy(f),
  20832. n.lookAt(f)
  20833. }
  20834. .bind(this);
  20835. return p.start(g, t, i, 0, d[c.warp.movementEasing])
  20836. }
  20837. ,
  20838. n.prototype.setBurnsDir = function() {
  20839. var e = this.playerControls.cameras[a.PANORAMA]
  20840. , t = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20841. , i = (new r.Euler).setFromQuaternion(e.quaternion, c.warp.eOrder)
  20842. , n = new r.Euler(t.x - i.x,t.y - i.y,t.z - i.z,c.warp.eOrder);
  20843. n.y = h.constrainedTurn(n.y),
  20844. this.burnsDir = Math.sign(n.y)
  20845. }
  20846. ,
  20847. n.prototype.stepWarpPath = function(firstPos, e ) {
  20848. var i = this.playerControls.cameras[a.PANORAMA];
  20849. var n = this.warpPathPoints ? this.warpPathPoints[0] : firstPos
  20850. if (!n){
  20851. return i.position.copy(this.warpDestPano.position),
  20852. !0;
  20853. }
  20854. /* if (!this.warpPathPoints)
  20855. return i.position.copy(this.warpDestPano.position),
  20856. !0;
  20857. var n = this.warpPathPoints[0] */
  20858. var o = this.warpDestPano.position;
  20859. /* console.log(firstPos)
  20860. console.log(o) */
  20861. if (null !== this.nodes && this.cameraHull && this.cameraHull.length > 1) {
  20862. var s = new r.Vector3;
  20863. 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),
  20864. i.position.copy(s)
  20865. } else
  20866. e < .5 ? i.position.copy(n) : i.position.copy(o)
  20867. }
  20868. ,
  20869. n.prototype.interruptAndFastForward = function(e, t) {
  20870. this.warping && (this.warpInterrupted = !0,
  20871. this.warpInterruptionBlackoutStyle = e,
  20872. this.warpInterruptionTravelTime = t,
  20873. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = I.MIDDLE),
  20874. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = c.minWarpTime))
  20875. }
  20876. ,
  20877. n.prototype.warpCameraAim = function(e) {
  20878. var t = c.warp.minWarpTime;
  20879. if (this.upcomingTransType === l.BLACK)
  20880. t = c.warp.teleportTime;
  20881. else {
  20882. var i = this.playerControls.cameras[a.PANORAMA]
  20883. , n = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20884. , o = (new r.Euler).setFromQuaternion(i.quaternion, c.warp.eOrder)
  20885. , s = new r.Euler(n.x - o.x,n.y - o.y,n.z - o.z,c.warp.eOrder);
  20886. s.y = h.constrainedTurn(s.y);
  20887. var u = 1e3 * Math.abs(s.y) / r.Math.degToRad(c.warp.maxAimPerSec);
  20888. t = Math.max(t, u)
  20889. }
  20890. var d = function() {
  20891. this._warpStopFlying(),
  20892. this.discardSlow(),
  20893. e && e()
  20894. }
  20895. .bind(this);
  20896. this._warpCameraAim(t, d)
  20897. }
  20898. ,
  20899. n.prototype.warpCommonParameters = function(e, t, i, n) {
  20900. this.model.skybox.material.uniforms.blackout.value = n;
  20901. var r = u.uniform(this.model.skybox, "progress", 1)
  20902. , o = u.allUniforms(this.model.chunks, "progress", 1)
  20903. , a = !1
  20904. , s = function() {
  20905. if (this.warpInterrupted)
  20906. return a = !0,
  20907. !0
  20908. }
  20909. .bind(this)
  20910. , l = function(e, t) {
  20911. return i && a ? (this.model.skybox.material.uniforms.progress.value = 0,
  20912. !0) : void r(e, t)
  20913. }
  20914. .bind(this)
  20915. , h = function(e, t) {
  20916. return i && a ? (o(0),
  20917. !0) : void o(e, t)
  20918. }
  20919. .bind(this);
  20920. p.start(s, e, null, t, null, "safeHaltWatch"),
  20921. p.start(l, e, null, t, d[c.warp.blendEasing], "skyboxProgress"),
  20922. p.start(h, e, null, t, d[c.warp.blendEasing], "chunkProgress")
  20923. }
  20924. ,
  20925. n.prototype.warpTravel_STD = function(e) {
  20926. 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),
  20927. 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;
  20928. w += this.warpLength * c.warp.timePerMeter,
  20929. c.warp.flySpeed > .01 && (w = 1e3 * this.warpLength / c.warp.flySpeed);
  20930. var _ = !1
  20931. , T = this.warpDestHeroLoc.quaternion
  20932. , x = new r.Vector3(0,0,-1).applyQuaternion(T).normalize()
  20933. , S = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  20934. , M = S.dot(x)
  20935. , R = r.Math.radToDeg(Math.acos(M))
  20936. , P = function(e) {
  20937. var t = o
  20938. , i = r.Math.smoothstep(e, 0, t) * (1 - r.Math.smoothstep(e, 1 - t, 1));
  20939. return i
  20940. }
  20941. , O = function() {
  20942. return E.lookAt(C, t, A.UP),
  20943. s.setFromRotationMatrix(E, c.warp.eOrder),
  20944. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  20945. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  20946. h.constrainedTurn(b.y)
  20947. }
  20948. .bind(this)
  20949. , L = function(e, t) {
  20950. if (this.warpInterrupted)
  20951. return _ = !0,
  20952. !0
  20953. }
  20954. .bind(this)
  20955. , D = function(e, t) {
  20956. return _ || !this.warpPathPoints ? (g.blur(0),
  20957. !0) : void g.blur(e)
  20958. }
  20959. .bind(this)
  20960. , N = u.allUniforms(this.model.chunks, "modelAlpha", 1)
  20961. , B = function(e, t) {
  20962. return _ || !this.warpPathPoints ? (N(0),
  20963. !0) : void N(e, t)
  20964. }
  20965. .bind(this)
  20966. , F = function(e, t) {
  20967. if (!this.warpPathPoints)
  20968. return n.position.copy(this.warpDestPano.position),
  20969. !0;
  20970. if (_)
  20971. return !0;
  20972. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  20973. n.position.copy(i),
  20974. C = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  20975. }
  20976. .bind(this)
  20977. , V = function(e, n) {
  20978. return this.warpPathPoints ? !!_ || void (t = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + i, 1))) : (y.debug("Lost bunny."),
  20979. !0)
  20980. }
  20981. .bind(this)
  20982. , U = function(e, o) {
  20983. if (_)
  20984. return y.debug(">>>> Walkthrough interupted at t=" + e),
  20985. !0;
  20986. if (!this.warpPathPoints)
  20987. return !0;
  20988. var a = this.warpLength * e
  20989. , l = r.Math.smoothstep(a, 0, this.brushPrefs.lookBlendDist)
  20990. , u = r.Math.smoothstep(a, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  20991. c.warp.matchCam && (l *= 1 - u),
  20992. E.lookAt(C, t, A.UP),
  20993. s.setFromRotationMatrix(E, c.warp.eOrder),
  20994. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  20995. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  20996. b.y = h.constrainedTurn(b.y),
  20997. s.x = m.x + l * b.x,
  20998. s.y = m.y + l * b.y,
  20999. s.z = m.z + l * b.z,
  21000. b.set(s.x - v.x, s.y - v.y, s.z - v.z, c.warp.eOrder),
  21001. b.y = h.constrainedTurn(b.y);
  21002. var d = r.Math.degToRad(c.warp.maxTurnPerSec) * o / 1e3;
  21003. b.y = Math.sign(b.y) * Math.min(d, Math.abs(b.y)),
  21004. v.x = v.x + b.x * c.warp.turnFriction,
  21005. v.y = v.y + b.y * c.warp.turnFriction,
  21006. v.z = v.z + b.z * c.warp.turnFriction,
  21007. v.x = Math.max(r.Math.degToRad(c.warp.minDownAngle), v.x);
  21008. var p = t.clone().sub(C).normalize();
  21009. if (R < c.warp.maxAimRotation && u > 0) {
  21010. var g = 1 - u;
  21011. p.x = p.x * g + u * S.x,
  21012. p.y = p.y * g + u * S.y,
  21013. p.z = p.z * g + u * S.z,
  21014. p.normalize()
  21015. }
  21016. this.bunnyObj.position.copy(n.position).add(p),
  21017. f.set(0, 0, -1).applyEuler(v).normalize(),
  21018. f.multiplyScalar(8),
  21019. f.add(n.position),
  21020. e > 1 - i && c.warp.matchCam || (n.controls.lookAt(f),
  21021. n.controls.lookVector.copy(f),
  21022. n.lookAt(f))
  21023. }
  21024. .bind(this)
  21025. , k = function() {
  21026. _ ? (this.discardSlow(),
  21027. this.upcomingTransType = l.BLACK,
  21028. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, I.BEGINNING, e)) : this._wrapupWarpShading(e)
  21029. }
  21030. .bind(this);
  21031. V(0);
  21032. var H = c.warp.motionLeadTime + 1e3 * Math.abs(O()) / r.Math.degToRad(c.warp.maxTurnPerSec);
  21033. w += H;
  21034. var G = H / w;
  21035. this.warpCommonParameters(w, G, !0, I.NONE),
  21036. p.start(L, w, null, 0, null, "_haltWatcher"),
  21037. c.warp.blur > 0 && (g.blurStrength = c.warp.blur,
  21038. p.start(D, w, null, G, P, "blurring")),
  21039. p.start(B, w, null, G, P, "modelAlpha"),
  21040. p.start(F, w, null, G, d[c.warp.blendEasing], "followPath"),
  21041. p.start(V, w, null, G, d[c.warp.blendEasing], "goBunny"),
  21042. p.start(U, w, k, 0, d[c.warp.blendEasing], "lookAtBunny")
  21043. }
  21044. ,
  21045. n.prototype.warpTravel_BLACK = function(e, t, i, n) {
  21046. var r = e || 0;
  21047. void 0 !== t && null !== t || (t = c.warp.teleportTime)
  21048. //add
  21049. player.model.hotGroup.visible = false
  21050. let oldPano = this.player.currentPano
  21051. let toPano = this.player.model.panos.get(this.warpDestHeroLoc.panoId)
  21052. this.player.emit("pano.chosen", oldPano, toPano)
  21053. var done = ()=>{
  21054. this.player.transitionPos({type:"beforeFlytopano", pano:this.player.currentPano, dur:0, callback:()=>{
  21055. player.model.hotGroup.visible = true
  21056. Hot.updateVisibles([this.player.currentPano]) //更新热点显示
  21057. }})
  21058. this.player.emit("flying.ended",toPano.position, oldPano.position,toPano, oldPano)
  21059. }
  21060. if(window.DATA.momentTourBlackNewType){
  21061. player.sceneRenderer.effects.fastTranMaskPass.start(player.sceneRenderer)
  21062. var camera = this.playerControls.cameras[a.PANORAMA];
  21063. var end = this.warpDestHeroLoc.position
  21064. camera.position.copy(end)
  21065. setTimeout(()=>{
  21066. player.sceneRenderer.effects.fastTranMaskPass.stop()
  21067. this.wrapupWarpShadingOnly(n, i);
  21068. done()
  21069. },t)
  21070. }else{
  21071. var o = function() {
  21072. this.wrapupWarpShadingOnly(n, i);
  21073. done()
  21074. }
  21075. .bind(this);
  21076. var firstPos = this.player.position.clone()//add
  21077. p.start(this.stepWarpPath.bind(this, firstPos), t, o, r, d[c.warp.blendEasing], "stepMotion")
  21078. }
  21079. this.warpCommonParameters(t, r, !1, i)
  21080. this.model.chunks.concat(this.model.skybox).forEach(function(e) {// 改
  21081. if(window.DATA.momentTourBlackNewType){
  21082. e.material.uniforms.blackout.value = 5//i 改
  21083. //e.material.defines.newBlack = ''
  21084. //e.material.needsUpdate = true
  21085. }else{
  21086. e.material.uniforms.blackout.value = i
  21087. }
  21088. }),
  21089. this._warpBendAim(null, t, null, r);
  21090. }
  21091. ,
  21092. n.prototype.flightStepWalk = function(e, t, i) {
  21093. var n = .001
  21094. , o = 1
  21095. , a = 1.2
  21096. , s = new r.Vector3
  21097. , h = new r.Vector3
  21098. , u = function(e, t) {
  21099. //导览速度
  21100. var i = Math.min(this.player.position.distanceTo(e.position), c.transition.flytimeMaxDistanceThreshold)
  21101. // , r = i * c.transition.flytimeDistanceMultiplier + c.transition.flyTime;
  21102. , r = i * c.warp.flytimeDistanceMultiplier + c.warp.flyTime;
  21103. h.copy(A.FORWARD),
  21104. this.player.getDirection(h),
  21105. s.copy(t).sub(e.position).normalize();
  21106. var l = s.dot(h)
  21107. , u = Math.acos(l)
  21108. , d = u / r;
  21109. d > n && (r *= d / n,
  21110. u < o && (r *= a))
  21111. return r / DATA.tourWalkSpeed * 100 // 改
  21112. };
  21113. return function(e, t, i) {
  21114. if (this.warpInterrupted)
  21115. i && i();
  21116. else if (this.activeTransType !== l.WALK)
  21117. this._clearWarpShading(),
  21118. this._warpStopFlying(),
  21119. this.player.spider.draw(),
  21120. this.placeCpm(),
  21121. i && i();
  21122. else if (this.player.currentPano !== e) {
  21123. var n = {
  21124. pano: e,
  21125. lookAtPoint: t,
  21126. duration: null,
  21127. maxDistanceOverride: c.warp.walkMaxDist,
  21128. skipWarpingCheck: !1,
  21129. constantMoveSpeed: !0
  21130. };
  21131. if(e == this.warpDestPano){//到达终点前,放大到终点的zoom
  21132. n.zoomLevel = this.warpDestHeroLoc.zoom
  21133. }
  21134. n.duration = u.call(this, e, t),
  21135. this.player.nonInterruptingFlyToPano(n, i)
  21136. } else
  21137. i && i()
  21138. }
  21139. }(),
  21140. n.prototype.makeWalkFlightFunc = function(e, t, i) {
  21141. return this.flightStepWalk.bind(this, e, t, i)
  21142. }
  21143. ,
  21144. n.prototype.warpTravel_WALK = function() {
  21145. var e = [];
  21146. return function(t) {
  21147. var i = this.player.model.panos;
  21148. e.length = 0;
  21149. for (var n = null, o = !1, a = 0; a < this.nodes.length; a++) {
  21150. var s = this.nodes[a]
  21151. , l = i.get(s);
  21152. a === this.nodes.length - 1;
  21153. o = n && l.position.distanceTo(n.position) < c.warp.walkMinDist,
  21154. n && o || (e.push(s),
  21155. n = l)
  21156. }
  21157. o && this.nodes.length > 1 && (e[e.length - 1] = this.nodes[this.nodes.length - 1]);
  21158. var h = e.length
  21159. , u = i.get(e[h - 1])
  21160. , d = new Array(h + 1);
  21161. d[d.length - 1] = function() {
  21162. t && t()
  21163. }
  21164. .bind(this);
  21165. for (var p = h - 1, f = d.length - 1; f > 0; f -= 1) {
  21166. var g = e[p];
  21167. u = i.get(g);
  21168. var m = new r.Vector3;
  21169. this.getLookAtForWalkingTourNode(e, p, m),
  21170. d[f - 1] = this.makeWalkFlightFunc(u, m, d[f]),
  21171. p--
  21172. }
  21173. d[0]()
  21174. }
  21175. }(),
  21176. n.prototype.getLookAtForWalkingTourNode = function() {
  21177. var e = new r.Vector3
  21178. , t = new r.Vector3
  21179. , i = new r.Vector3
  21180. , n = new r.Vector3
  21181. , o = new r.Vector3
  21182. , a = .65
  21183. , s = .75
  21184. , l = .2
  21185. , c = .4
  21186. , h = .2
  21187. , u = 3;
  21188. return function(r, d, p) {
  21189. var f = r.length;
  21190. if (d >= f)
  21191. return !1;
  21192. var g = 1
  21193. , m = 1;
  21194. t.set(0, 0, 0),
  21195. o.set(0, 0, 0);
  21196. for (var v = null, A = d; A < d + u && !(A >= f); A++) {
  21197. if (v = this.player.model.panos.get(r[A]),
  21198. this.getOrientationForWalkingTourNode(r, A, i),
  21199. A === d && e.copy(i),
  21200. n.copy(i),
  21201. A > d) {
  21202. var y = n.dot(e) < a;
  21203. g *= y ? l : s,
  21204. m *= y ? h : c
  21205. }
  21206. i.multiplyScalar(g),
  21207. t.add(i),
  21208. o.lerp(v.position, m)
  21209. }
  21210. return t.normalize(),
  21211. p.copy(o),
  21212. p.add(t),
  21213. !0
  21214. }
  21215. }(),
  21216. n.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  21217. var n = e.length;
  21218. if (t >= n)
  21219. return !1;
  21220. if (t === n - 1)
  21221. i.copy(A.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  21222. else {
  21223. var r = this.player.model.panos.get(e[t])
  21224. , o = this.player.model.panos.get(e[t + 1]);
  21225. i.copy(o.position).sub(r.position)
  21226. }
  21227. return i.normalize(),
  21228. !0
  21229. }
  21230. ,
  21231. n.prototype.warpCameraTravel = function(e, t, i, n) {
  21232. if (this.activeTransType = this.upcomingTransType,
  21233. this.lastTransType = this.activeTransType,
  21234. this.upcomingTransType = null,
  21235. !e) {
  21236. var r = function() {
  21237. this._wrapupTravel(n)
  21238. }
  21239. .bind(this)
  21240. , o = {
  21241. pano: this.warpDestPano,
  21242. lookAtPoint: null,
  21243. duration: null,
  21244. maxDistanceOverride: null,
  21245. skipWarpingCheck: !1
  21246. };
  21247. return void this.player.flyToPano(o, r)
  21248. }
  21249. this.activeTransType === l.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === l.WALK ? this.warpTravel_WALK(function() {
  21250. this._clearWarpShading(),
  21251. this._warpStopFlying(),
  21252. this.player.spider.draw(),
  21253. this.placeCpm(),
  21254. n && n()
  21255. }
  21256. .bind(this)) : this.warpTravel_STD(n)
  21257. }
  21258. ,
  21259. n.prototype.startWarpState = function() {
  21260. this.warping = !0,
  21261. this.warpInterrupted = !1,
  21262. this.warpInterruptionBlackoutStyle = null,
  21263. this.warpInterruptionTravelTime = null
  21264. }
  21265. ,
  21266. n.prototype.endWarpState = function() {
  21267. this.warping = !1
  21268. this.director.emit('warp.end')//xzw add
  21269. }
  21270. ,
  21271. n.prototype.warpToPano = function(e, t, i, n) {
  21272. if (this.warping)
  21273. return void y.warn("Cannot warp when already warping");
  21274. if (this.upcomingTransType = e,
  21275. this.activeTransType = null,
  21276. !this.setWarpDestPano())
  21277. return this.upcomingTransType = null,
  21278. void this.warpToNonPano(n);
  21279. if (this.player.mode !== a.PANORAMA)
  21280. return this.upcomingTransType = null,
  21281. this.discardSlow(),
  21282. void this.player.flyToNewMode({
  21283. mode: a.PANORAMA,
  21284. pano: this.warpDestPano,
  21285. duration: c.warp.outsideTime,
  21286. warpDest: this.warpDestHeroLoc,
  21287. callback: n,
  21288. force: !0
  21289. });
  21290. if (!this.warpDestPano)
  21291. return y.warn("no warp destination, callback dropped"),
  21292. void (this.upcomingTransType = null);
  21293. 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)
  21294. , o = this.chooseWarpPath(r);
  21295. if (o && this.upcomingTransType !== l.WALK) {
  21296. var s = function() {
  21297. this.waitingToWarp = !1,
  21298. this.warpToPano(e, t, i, n)
  21299. }
  21300. .bind(this);
  21301. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, s))
  21302. return void (this.waitingToWarp = !0)
  21303. }
  21304. this.player.currentPano || (y.warn("Arrived at a very strange spot!"),
  21305. this.player.currentPano = this.warpDestPano,
  21306. this.placeCpm(),
  21307. this.fadeOutCpm(c.path.fadeOutTime),
  21308. this.player.spider.draw()),
  21309. y.debug("Warping to pano ", this.warpDestPano.position),
  21310. this.upcomingTransType !== l.WALK && this.player.emit(C.PanoChosen, this.player.currentPano, this.warpDestPano),
  21311. this.startWarpState();
  21312. var h = function() {
  21313. this.endWarpState(),
  21314. n && n()
  21315. }
  21316. .bind(this);
  21317. o ? this.warpCameraTravel(r, t, i, h) : this.warpCameraAim(h)
  21318. //this.player.smoothZoomToDefault(c.zoom.restoreTime);
  21319. }
  21320. ,
  21321. t.exports = n
  21322. }
  21323. ).call(this, "/js/objects/ShowPath.js")
  21324. }
  21325. , {
  21326. "../constants": 8,
  21327. "../effects": 16,
  21328. "../enum/BlackoutStyle": 18,
  21329. "../enum/ModelManagerEvents": 33,
  21330. "../enum/PlayerEvents": 40,
  21331. "../enum/RenderOrder": 42,
  21332. "../enum/Vectors": 50,
  21333. "../enum/Viewmode": 51,
  21334. "../enum/WarpStyle": 52,
  21335. "../gui/gui": 65,
  21336. "../model/ModelManager": 140,
  21337. "../objects/Snapshot": 153,
  21338. "../settings": 166,
  21339. "../shaders": 167,
  21340. "../util/easing": 186,
  21341. "../util/lerp": 188,
  21342. "../util/logger": 189,
  21343. "../util/math": 190,
  21344. "../util/texture": 194,
  21345. "../util/transitions": 195,
  21346. three: 217
  21347. }],
  21348. 152: [function(e, t, i) {
  21349. "use strict";
  21350. function n() {
  21351. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  21352. , t = new r.RawShaderMaterial({
  21353. fragmentShader: o.skysphere.fragmentShader,
  21354. vertexShader: o.skysphere.vertexShader,
  21355. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  21356. side: r.BackSide,
  21357. name: "skysphere"
  21358. });
  21359. t.uniforms.radius.value = e.parameters.radius,
  21360. r.Mesh.call(this, e, t)
  21361. }
  21362. var r = e("three")
  21363. , o = e("../shaders")
  21364. , a = e("../settings");
  21365. n.prototype = Object.create(r.Mesh.prototype),
  21366. n.prototype.constructor = n,
  21367. t.exports = n
  21368. }
  21369. , {
  21370. "../settings": 166,
  21371. "../shaders": 167,
  21372. three: 217
  21373. }],
  21374. 153: [function(e, t, i) {
  21375. (function(i) {
  21376. "use strict";
  21377. function n(e) {
  21378. o.call(this, e),
  21379. this.sid = e.sid,//xzw add
  21380. this.panoId = e.panoId,
  21381. this.orthoZoom = e.orthoZoom,
  21382. this.floorVisibility = e.floorVisibility,
  21383. this.thumbUrl = e.thumbUrl,
  21384. this.name = e.name,
  21385. this.zoom = e.zoom
  21386. }
  21387. var r = (e("three"),
  21388. e("../util/logger"))
  21389. , o = (e("../settings"),
  21390. e("../enum/Viewmode"),
  21391. e("../util/common"),
  21392. e("../util/transitions"),
  21393. e("../util/lerp"),
  21394. e("../util/ajax"),
  21395. e("../util/texture"),
  21396. e("./View"));
  21397. e("events").EventEmitter,
  21398. new r(i);
  21399. n.prototype = Object.create(o.prototype),
  21400. n.prototype.isPano = function() {
  21401. return this.panoId && "" !== this.panoId && this.panoId != "outside"
  21402. }
  21403. ,
  21404. t.exports = n
  21405. }
  21406. ).call(this, "/js/objects/Snapshot.js")
  21407. }
  21408. , {
  21409. "../enum/Viewmode": 51,
  21410. "../settings": 166,
  21411. "../util/ajax": 181,
  21412. "../util/common": 185,
  21413. "../util/lerp": 188,
  21414. "../util/logger": 189,
  21415. "../util/texture": 194,
  21416. "../util/transitions": 195,
  21417. "./View": 154,
  21418. events: 202,
  21419. three: 217
  21420. }],
  21421. 154: [function(e, t, i) {
  21422. (function(i) {
  21423. "use strict";
  21424. function n(e) {
  21425. e = e || {},
  21426. this.position = new r.Vector3,
  21427. this.quaternion = new r.Quaternion,
  21428. this.update(e)
  21429. }
  21430. var r = e("three")
  21431. , o = e("../util/logger")
  21432. , a = (e("../settings"),
  21433. e("../enum/Viewmode"),
  21434. e("../util/common"),
  21435. e("../util/transitions"),
  21436. e("../util/lerp"),
  21437. e("../util/ajax"),
  21438. e("../util/texture"),
  21439. e("events").EventEmitter);
  21440. new o(i);
  21441. n.prototype = Object.create(a.prototype),
  21442. n.prototype.isValid = function() {
  21443. return !!this.cameraMode
  21444. }
  21445. ,
  21446. n.prototype.update = function(e) {
  21447. return this.cameraMode = e.cameraMode || this.cameraMode,
  21448. this.pano = e.pano || this.pano,
  21449. e.position && this.position.copy(e.position),
  21450. e.quaternion && this.quaternion.copy(e.quaternion),
  21451. this
  21452. }
  21453. ,
  21454. t.exports = n
  21455. }
  21456. ).call(this, "/js/objects/View.js")
  21457. }
  21458. , {
  21459. "../enum/Viewmode": 51,
  21460. "../settings": 166,
  21461. "../util/ajax": 181,
  21462. "../util/common": 185,
  21463. "../util/lerp": 188,
  21464. "../util/logger": 189,
  21465. "../util/texture": 194,
  21466. "../util/transitions": 195,
  21467. events: 202,
  21468. three: 217
  21469. }],
  21470. 155: [function(e, t, i) {//player.js
  21471. (function(i) {
  21472. "use strict";
  21473. function n(e) {
  21474. this.currentPano = null,
  21475. this.nextPano = null,
  21476. this.camera = null,
  21477. this.paused = !1,
  21478. this.flying = !1,
  21479. this.sceneIntersectionPlane = null,
  21480. this.target = new r.Vector3,
  21481. this.mouse = new r.Vector3(1.1,1.1,.5),
  21482. this.mouseAtMouseDown = new r.Vector2,
  21483. this.mouseCouldBeClickToMove = !1,
  21484. this.mouseLastMoveTime = Date.now(),
  21485. this.mouseDown = !1,
  21486. this.mouseDownTimer = null,
  21487. this.couldBeLongTap = !1,
  21488. this.containsMouse = !1, //
  21489. this.isTouchEvent = !1,
  21490. this.isPanoHover = !1,
  21491. this.reticule = new a(this),
  21492. this.panoMarkers = [],
  21493. this.spider = new h(this),
  21494. this.quaternion = new r.Quaternion,
  21495. this.position = new r.Vector3(15,10,15),
  21496. this.previousState = null,
  21497. this.lastInsideView = new c,
  21498. this.last360View = new c,
  21499. this.raycaster = new r.Raycaster,
  21500. this.intersect = null,
  21501. this.lastChangeTime = Date.now(),
  21502. this.history = new I,
  21503. this.cameraControls = null,
  21504. this.path = null,
  21505. this.model = null,
  21506. this.domElement = null,
  21507. this.cachedPanoCandidates = null,
  21508. this.basePanoSize = 0,
  21509. this.standardPanoSize = 0,
  21510. this.highPanoSize = 0,
  21511. this.ultraHighPanoSize = 0,
  21512. this.zoomLevel = 1,
  21513. this.zooming = 0,
  21514. this.zoomSpeed = .5,
  21515. this.scrollZoomSpeed = .06,
  21516. this.zoomSpeedAdjust = .05,
  21517. this.defaultZoomIncrement = .2,
  21518. this.baseFov = f.insideFOV,
  21519. this.zoomFov = this.baseFov,
  21520. this.zoomEnabled = !0,
  21521. this.preRenderingEnabled = !1,
  21522. this.setupCustomProperties(e),
  21523. this.zoomStats = new L
  21524. window.player = this
  21525. this.modeTran = ''
  21526. }
  21527. var r = e("three")
  21528. , o = e("./util/logger")
  21529. , a = e("./objects/Reticule")
  21530. , s = e("./objects/Panorama")
  21531. , l = e("./objects/ShowPath")
  21532. , c = e("./objects/View")
  21533. , h = (e("./objects/Snapshot"),
  21534. e("./objects/NSpider"))
  21535. , u = e("./enum/Viewmode")
  21536. , d = (e("./enum/TagStates"),
  21537. e("./enum/Vectors"))
  21538. , p = e("./enum/Keys")
  21539. , f = (e("./enum/AlignmentType"),
  21540. e("./settings"))
  21541. , g = e("./util/common")
  21542. , m = (e("./util/browser"),
  21543. e("./util/math"))
  21544. , v = e("./util/lerp")
  21545. , A = e("./util/easing")
  21546. , y = e("./util/transitions")
  21547. , C = e("events").EventEmitter
  21548. , I = (e("./shaders"),
  21549. e("./util/history"))
  21550. , E = (e("./util/camera"),
  21551. e("./model/ModelManager"),
  21552. e("./enum/PathDiscardMode"))
  21553. , b = e("./enum/PathDisplayMode")
  21554. , w = e("./enum/PlayerEvents")
  21555. , _ = e("./enum/ControlEvents")
  21556. , T = e("./enum/ModelManagerEvents")
  21557. , x = e("./enum/WarpStyle")
  21558. , S = e("./enum/BlackoutStyle")
  21559. , M = e("./exception/BasicException")
  21560. , R = e("./enum/PanoSizeClass")
  21561. , P = (e("./tile/TileDownloader"),
  21562. e("./tile/TilePrioritizer"))
  21563. , O = (e("./enum/PanoramaEvents"),
  21564. e("./enum/ZoomEvents"))
  21565. , L = e("./util/ZoomStats")
  21566. , D = e("./constants")
  21567. , N = e("./util/common")
  21568. , B = e("./util/cameraLight")
  21569. //, Hot = e('hot')
  21570. , F = new o(i)
  21571. , V = Object.freeze({
  21572. FlyToPano: y.getUniqueId(),
  21573. FlyToNewMode: y.getUniqueId(),
  21574. FlyToSameMode: y.getUniqueId(),
  21575. FlyToViewFloor: y.getUniqueId(),
  21576. LookTransition: y.getUniqueId(),
  21577. ZoomTransition: y.getUniqueId()
  21578. });
  21579. n.prototype = Object.create(C.prototype),
  21580. n.prototype.init = function(e) {
  21581. this.modelManager = e.modelManager,
  21582. this.tileDownloader = e.tileDownloader,
  21583. this.panoRenderer = e.panoRenderer,
  21584. this.qualityManager = e.qualityManager,
  21585. this.domElement = e.container,
  21586. this.camera = e.camera,
  21587. this.tagManager = e.tagManager,
  21588. this.cameraControls = e.controls,
  21589. this.path = new l(e.director,this,e.controls),
  21590. this.basePanoSize = this.qualityManager.getPanoSize(R.BASE),
  21591. this.standardPanoSize = this.qualityManager.getPanoSize(R.STANDARD),
  21592. this.highPanoSize = this.qualityManager.getPanoSize(R.HIGH),
  21593. this.ultraHighPanoSize = this.qualityManager.getPanoSize(R.ULTRAHIGH),
  21594. this.tileDownloader.processPriorityQueue = !1,
  21595. this.tileDownloader.tilePrioritizer = new P(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  21596. this.bindEvents(e.container),
  21597. this.updateModel()
  21598. //this.guider2 = new PanTransGuide(this)
  21599. }
  21600. //xzw add: 截图
  21601. function dataURLtoBlob(dataurl) {
  21602. var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
  21603. bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
  21604. while(n--){
  21605. u8arr[n] = bstr.charCodeAt(n);
  21606. };
  21607. return new Blob([u8arr], {type:mime});
  21608. }
  21609. n.prototype.screenShot = function(o){
  21610. if(this.flying || this.flyingToTag) return;
  21611. var R = this.sceneRenderer;
  21612. R.updateScreenSize(o);
  21613. for(var i in this.model.panos.index){
  21614. if(!this.model.panos.index[i].marker) continue;
  21615. this.model.panos.index[i].marker.forceHide = this.model.panos.index[i].marker.visible;
  21616. this.model.panos.index[i].marker.visible = false;
  21617. }
  21618. for(var i in this.model.hots){
  21619. this.model.hots[i].mesh.visible = false;
  21620. }
  21621. this.reticule.visible = false;
  21622. this.reticule.forceUnvisible = true;
  21623. this.path.currentPanoMarker.mesh.visible = false;
  21624. setTimeout(function(){//因resize效用没办法立即生效(原因未知),故而延后
  21625. R.renderer.clear(true,true,true);
  21626. R.renderer.render(R.scene, R.camera);
  21627. var imgData = R.renderer.domElement.toDataURL(o.type,0.9);
  21628. o.f && o.f(imgData)
  21629. R.updateScreenSize({resize:true});
  21630. this.reticule.visible = true;
  21631. for(var i in this.model.hots){
  21632. this.model.hots[i].mesh.visible = true;
  21633. }
  21634. for(var i in this.model.panos.index){
  21635. this.model.panos.index[i].marker.visible = this.model.panos.index[i].marker.forceHide;
  21636. }
  21637. this.path.currentPanoMarker.mesh.visible = true;
  21638. R.renderer.render(R.scene, R.camera);
  21639. }.bind(this),30) //这个数字不能太小
  21640. }
  21641. var scaleImg = e("scaleImg");
  21642. var ResizeImg = function(img, option){
  21643. var img2; //不能直接改img 否则可能触发第二次img.onload
  21644. var compress = function(ratio,type){
  21645. var image = img2 || img;
  21646. var c = document.createElement('canvas');
  21647. c.width = image.width; c.height = image.height;
  21648. var ctx = c.getContext('2d');
  21649. ctx.drawImage(image,0,0,image.width,image.height);
  21650. img2 = scaleImg(ratio/* option.maxSize/oldSize */, c, type/* option.type||"png" */);//最大不能超过0.8M
  21651. }
  21652. var reCom = function(){ //如果有了img2 就只需要img2 否则创造新的img2
  21653. var image = img2 || img;
  21654. var blob = dataURLtoBlob(image.src);
  21655. if(option.maxWeight && blob.size > option.maxWeight){
  21656. compress(option.maxWeight/blob.size, "jpeg")
  21657. blob = dataURLtoBlob(image.src);
  21658. }
  21659. if(!img2){
  21660. img2 = new Image();
  21661. }
  21662. img2.base64Src = image.src;
  21663. img2.src = window.URL.createObjectURL(blob);
  21664. }
  21665. var oldSize = Math.max(img.width, img.height);
  21666. if(option.toType != "png"){//不是非要png的话
  21667. if(option.oldType == "jpeg"){//jpeg先判断尺寸,然后是尺寸
  21668. if(oldSize > option.maxSize){
  21669. compress(option.maxSize/oldSize, "jpeg");
  21670. }
  21671. reCom();
  21672. }else if(option.oldType == "png"){//png先判断数据量 如果数据量达标,就无视大小(有可能超出大小)
  21673. if(option.maxWeight && option.weight > option.maxWeight){//如果一开始大小不大就不压缩 还是png
  21674. compress(oldSize>option.maxSize ? option.maxSize/oldSize : 1, "jpeg");
  21675. reCom();
  21676. }
  21677. }
  21678. }else{
  21679. //?貌似png会越压缩越大?
  21680. }
  21681. return img2 || img;
  21682. }
  21683. var _fixType=function(type) {
  21684. type = type.toLowerCase().replace(/jpg/i, 'jpeg');
  21685. var r = type.match(/png|jpeg|bmp|gif/)[0];
  21686. return 'image/' + r;
  21687. };
  21688. var saveFile=function(data, filename){
  21689. var save_link = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');
  21690. save_link.href = data;
  21691. save_link.download = filename;
  21692. var event = document.createEvent('MouseEvents');
  21693. event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
  21694. save_link.dispatchEvent(event);
  21695. };
  21696. n.prototype.getWrapShot = function(){ //获取导览点截图/初始画面和信息
  21697. var info = this.getSnapAngleInfo();
  21698. var str = ',{\r\t' + info;
  21699. var arg = arguments[0];
  21700. this.screenShot({ width:g_snapShotWidth*4, height:g_snapShotHeight*4, type:"image/jpeg", f:function(imgData){
  21701. if (arg && arg.__callback) {
  21702. return arg.__callback(imgData, info)
  21703. }
  21704. var img = new Image();
  21705. img.src = imgData;
  21706. img.onload = function(){
  21707. var img2 = ResizeImg(this,{maxSize: g_snapShotWidth, oldType:"jpeg"}); //暂定缩略图大小
  21708. img2.src.replace(_fixType("image/jpeg"),'image/octet-stream');
  21709. var filename = "snap" + (new Date()).getTime();
  21710. saveFile(img2.src,filename + ".jpg");
  21711. str +=(',\r\t"thumbnail_signed_src":"'+filename+'.jpg",');
  21712. str +=('\r\t"sid":"'+filename+'",');
  21713. str +=('\r\t"name":"'+filename+'"\r}');
  21714. logData(str)
  21715. }
  21716. }});
  21717. }
  21718. ,
  21719. n.prototype.getSnapAngleInfo = function(){
  21720. var info = {};
  21721. var str = '"metadata":{';
  21722. var q = this.camera.quaternion.clone();
  21723. switch (this.mode) {
  21724. case "panorama":
  21725. info.scan_id = this.currentPano.id;
  21726. str += ('"scan_id":"'+this.currentPano.id+'",');
  21727. break;
  21728. case "floorplan":
  21729. info.camera_mode = 1;
  21730. q = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  21731. q.multiply(this.camera.quaternion);
  21732. str += ('"camera_mode":1,');
  21733. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  21734. str += ('"ortho_zoom":'+ m.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  21735. break;
  21736. case "dollhouse":
  21737. info.camera_mode = 2;
  21738. str += ('"camera_mode":2,');
  21739. break;
  21740. }
  21741. info.camera_position = m.toPrecision(this.camera.position.toArray(),4);
  21742. console.log(info.camera_position)
  21743. if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的
  21744. /**fyz 对相机截屏的角度进行校对 */
  21745. var out = new r.Quaternion(q.x, q.y, q.z, q.w)
  21746. out.multiply(new r.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  21747. out.x *= -1;
  21748. out.w *= -1;
  21749. info.camera_quaternion = m.toPrecision(out.toArray(),4);
  21750. }else{
  21751. info.camera_quaternion = m.toPrecision(q.toArray(),4);;
  21752. }
  21753. info.zoom = this.zoomLevel;
  21754. console.log(info.camera_quaternion)
  21755. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  21756. // fyz 扩展编辑页面, 加上导览点缩放值
  21757. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+'], "zoom":' + info.zoom + '}');
  21758. return str;
  21759. }
  21760. //------end
  21761. n.prototype.setupCustomProperties = function(e) {
  21762. var t = e || u.PANORAMA;
  21763. Object.defineProperty(this, "mode", {
  21764. get: function() {
  21765. return t
  21766. },
  21767. set: function(e) {
  21768. var i = t;
  21769. t = e,
  21770. this.onModeUpdated(i, t)
  21771. }
  21772. })
  21773. }
  21774. ,
  21775. n.prototype.isInMode = function() {
  21776. for (var e = 0; e < arguments.length; e++)
  21777. if (this.mode === arguments[e])
  21778. return !0;
  21779. return !1
  21780. }
  21781. ,
  21782. n.prototype.isOutsideMode = function(e) {
  21783. return e = e || this.mode,
  21784. e === u.DOLLHOUSE || e === u.FLOORPLAN
  21785. }
  21786. ,
  21787. n.prototype.is360View = function(e, t) {
  21788. return e === u.PANORAMA && t && !t.isAligned()
  21789. }
  21790. ,
  21791. n.prototype.setScene = function(e) {
  21792. this.sceneIntersectionPlane = e.plane,
  21793. this.path.setScene(e),
  21794. this.moveReticuleToScene(e)
  21795. }
  21796. ,
  21797. n.prototype.moveReticuleToScene = function(e) {
  21798. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  21799. e.add(this.reticule)
  21800. }
  21801. ,
  21802. n.prototype.updateModel = function() {
  21803. function e(e, t, n) {
  21804. this.mode === u.DOLLHOUSE && e !== n && i.call(this, e.center.y)
  21805. }
  21806. function t(e, t) {
  21807. if (this.mode === u.DOLLHOUSE) {
  21808. var n = e ? this.model.center.y : n = t.center.y;
  21809. i.call(this, n)
  21810. }
  21811. }
  21812. function i(e) {
  21813. var t = this.cameraControls.cameras[u.DOLLHOUSE]
  21814. , i = this.cameraControls.controls[u.DOLLHOUSE]
  21815. , n = t.position.y + (e - i.target.y)
  21816. , r = f.showFloorDuration + f.showFloorDelay;
  21817. y.start(v.property(i.target, "y", e), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor),
  21818. y.start(v.property(t.position, "y", n), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor)
  21819. }
  21820. this.model = this.modelManager.getActiveModel(),
  21821. this.model.on("floor.changed", e.bind(this)),
  21822. this.model.on("allfloors.toggled", t.bind(this)),
  21823. this.on(w.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  21824. /*******************************************************************VR fyz改 from徐世廷*******************************************************************/
  21825. var e2 = this;
  21826. this.model.panos.list.forEach(function(a) {
  21827. a.vrMarker.addEventListener("click", function() {
  21828. e2.flyToPano({
  21829. pano: a
  21830. })
  21831. })
  21832. })
  21833. /********************************************************************************************************************************************/
  21834. this.model.addHighMapCube()//add
  21835. this.on(w.FlyingStarted, this.model.resetHighMap.bind(this.model))
  21836. }
  21837. ,
  21838. n.prototype.updateModelDependentData = function() {
  21839. this.cameraControls.setModelForControls(this.model),
  21840. this.getPanoMarkersFromModel(this.model)
  21841. }
  21842. ,
  21843. n.prototype.onModelChanged = function() {
  21844. this.updateModel(),
  21845. this.updateModelDependentData()
  21846. }
  21847. ,
  21848. n.prototype.getPanoMarkersFromModel = function(e) {
  21849. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  21850. return t.marker ? e.concat(t.marker) : e
  21851. }, [])
  21852. }
  21853. ,
  21854. n.prototype.handleControlMove = function(e) {
  21855. this.emit(w.Move, e)
  21856. }
  21857. ,
  21858. n.prototype.handleControlInputStart = function(e) {
  21859. this.emit(w.InputStart, e)
  21860. }
  21861. ,
  21862. n.prototype.onModeUpdated = function(e, t) {
  21863. this.cameraControls.activateControls(t),
  21864. this.emit(w.ModeChanged, e, t)
  21865. }
  21866. ,
  21867. n.prototype.isWarping = function() {//是否导览缓慢走向某个点
  21868. return this.path.warping
  21869. }
  21870. ,
  21871. n.prototype.isWaitingToWarp = function() {
  21872. return this.path.waitingToWarp
  21873. }
  21874. ,
  21875. n.prototype.getLabelScaleFactor = function() {
  21876. if (this.isOutsideMode()) {
  21877. var e = 10
  21878. , t = Math.sqrt(this.cameraControls.controls[u.FLOORPLAN].currentScale / e);
  21879. return t
  21880. }
  21881. return .5
  21882. }
  21883. ,
  21884. /* n.prototype.changeMusic = function() {//xzw add
  21885. if(!this.director.tourIsPlaying) this.director.bgmReplay()
  21886. } */
  21887. n.prototype.bindEvents = function(e) {
  21888. e !== document && e.setAttribute("tabindex", -1),
  21889. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  21890. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  21891. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  21892. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  21893. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  21894. this.modelManager.on(T.ActiveModelChanged, this.onModelChanged.bind(this)),
  21895. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  21896. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  21897. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  21898. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  21899. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  21900. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  21901. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  21902. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  21903. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  21904. this.cameraControls.on(_.Move, this.handleControlMove.bind(this)),
  21905. this.cameraControls.on(_.InputStart, this.handleControlInputStart.bind(this)),
  21906. this.cameraControls.on(_.Pinch, this.handleControlPinch.bind(this)),
  21907. this.cameraControls.on(_.Scroll, this.handleControlScroll.bind(this)),
  21908. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),//xzw add
  21909. //window.addEventListener("tourAudioEnded", this.changeMusic.bind(this));//xzw add
  21910. // lzb
  21911. window.getSeft && getSeft(this);
  21912. }
  21913. ,
  21914. n.prototype.onMouseDown = function(e) {
  21915. e.currentTarget !== document && e.currentTarget.focus(),
  21916. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  21917. this.updateIntersect())
  21918. }
  21919. ,
  21920. n.prototype.onMouseMove = function(e) {
  21921. this.isTouchEvent = !1,
  21922. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  21923. }
  21924. ,
  21925. n.prototype.onMouseOver = function(e) {
  21926. this.containsMouse = !0,
  21927. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  21928. if(this.intersectHot){
  21929. this.intersectHot.setHoverState(true)
  21930. }
  21931. }
  21932. ,
  21933. n.prototype.onMouseOut = function(e) {
  21934. this.containsMouse = !1
  21935. if(this.intersectHot){
  21936. this.intersectHot.setHoverState(false)
  21937. }
  21938. }
  21939. ,
  21940. n.prototype.onMouseUp = function(e) {
  21941. this.handleInputEnd.call(this, e.clientX, e.clientY, !1);
  21942. }
  21943. ,
  21944. n.prototype.onTouchStart = function(e) {
  21945. if (e.currentTarget !== document && e.currentTarget.focus(),
  21946. !this.mouseDown) {
  21947. this.couldBeLongTap = !0;
  21948. var t = g.average(e.changedTouches, "clientX")
  21949. , i = g.average(e.changedTouches, "clientY");
  21950. this.handleInputStart.call(this, t, i, !0),
  21951. this.mouseDownTimer = setTimeout(function() {
  21952. this.updateIntersect(),
  21953. this.handleInputEnd.call(this, t, i, !0)
  21954. }
  21955. .bind(this), f.input.longTapThreshold)
  21956. }
  21957. }
  21958. ,
  21959. n.prototype.onTouchMove = function(e) {
  21960. var t = g.average(e.changedTouches, "clientX")
  21961. , i = g.average(e.changedTouches, "clientY");
  21962. this.handleInputMove.call(this, t, i, !0)
  21963. }
  21964. ,
  21965. n.prototype.onTouchEnd = function(e) {
  21966. if (clearTimeout(this.mouseDownTimer),
  21967. this.mouseDown) {
  21968. this.couldBeLongTap = !1,
  21969. this.updateIntersect();
  21970. var t = g.average(e.changedTouches, "clientX")
  21971. , i = g.average(e.changedTouches, "clientY");
  21972. this.handleInputEnd.call(this, t, i, !0)
  21973. }
  21974. //add
  21975. if (this.intersectHot) this.intersectHot.setHoverState(false)
  21976. this.intersectHot = null
  21977. Hot.mobileAutoPlay(this)
  21978. }
  21979. ,
  21980. n.prototype.onPointerDown = function(e) {
  21981. return e.currentTarget !== document && e.currentTarget.focus(),
  21982. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  21983. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  21984. void (this.mouseDownTimer = setTimeout(function() {
  21985. this.updateIntersect(),
  21986. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  21987. }
  21988. .bind(this), f.input.longTapThreshold)))
  21989. }
  21990. ,
  21991. n.prototype.onPointerMove = function(e) {
  21992. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  21993. }
  21994. ,
  21995. n.prototype.onPointerUp = function(e) {
  21996. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  21997. this.couldBeLongTap = !1,
  21998. this.updateIntersect(),
  21999. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  22000. }
  22001. ,
  22002. n.prototype.onPointerOut = function(e) {
  22003. this.mouseDown = !1
  22004. }
  22005. ,
  22006. n.prototype.onPointerCancel = function(e) {
  22007. this.mouseDown = !1
  22008. }
  22009. ,
  22010. n.prototype.onKeyDown = function(e) {
  22011. var t = function() {
  22012. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, "key")
  22013. }
  22014. .bind(this)
  22015. , i = e.which;
  22016. switch (i) {
  22017. case p.F:
  22018. t(),
  22019. this.changeFloor(-1);
  22020. break;
  22021. case p.R:
  22022. t(),
  22023. this.changeFloor(1)
  22024. }
  22025. if (this.mode === u.PANORAMA)
  22026. switch (i) {
  22027. case p.UPARROW:
  22028. case p.W:
  22029. this.flyLocalDirection(d.FORWARD.clone());
  22030. break;
  22031. case p.DOWNARROW:
  22032. case p.S:
  22033. this.flyLocalDirection(d.BACK.clone());
  22034. break;
  22035. case p.A:
  22036. this.flyLocalDirection(d.LEFT.clone());
  22037. break;
  22038. case p.D:
  22039. this.flyLocalDirection(d.RIGHT.clone())
  22040. }
  22041. }
  22042. ,
  22043. n.prototype.handleScrollPinchZoom = function() {
  22044. return function(e) {
  22045. var t = e
  22046. , i = this.zoomLevel;
  22047. this.zoomBy(t),
  22048. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  22049. }
  22050. }(),
  22051. n.prototype.handleControlPinch = function(e) {
  22052. f.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new r.Vector3(0,0,e).normalize())
  22053. }
  22054. ,
  22055. n.prototype.handleControlScroll = function(e) {
  22056. f.zoom.enabled ? (e > 0 ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  22057. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new r.Vector3(0,0,-e).normalize())
  22058. }
  22059. ,
  22060. n.prototype.handleInputStart = function(e, t, i) {
  22061. //许钟文加
  22062. var pad = this.handelPadding(e, t);
  22063. e = pad.x;
  22064. t = pad.y;
  22065. this.isTouchEvent = i,
  22066. m.convertScreenPositionToNDC(e, t, this.mouse),
  22067. m.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  22068. this.mouseCouldBeClickToMove = !0,
  22069. this.mouseDown = !0;
  22070. Hot.mobileAutoPlay(this)
  22071. }
  22072. ,
  22073. n.prototype.handelPadding = function(x, y) {
  22074. //去除player左边和上面的宽高,因为pc的player左上有其他element 许钟文
  22075. if (!this.pad)
  22076. this.pad = {//可以直接用$("#player")[0].getBoundingClientRect() , 因为body没有offset
  22077. x: dom.getOffset("left", $("#player")[0]),
  22078. y: dom.getOffset("top", $("#player")[0])
  22079. }
  22080. return {
  22081. x: x - this.pad.x,
  22082. y: y - this.pad.y
  22083. }
  22084. }
  22085. n.prototype.handleInputMove = function(e, t, i) {
  22086. //许钟文加
  22087. var pad = this.handelPadding(e, t);
  22088. e = pad.x;
  22089. t = pad.y;
  22090. this.isTouchEvent = i,
  22091. m.convertScreenPositionToNDC(e, t, this.mouse),
  22092. this.mouseAtMouseDown.distanceTo(this.mouse) > f.input.moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  22093. this.couldBeLongTap = !1,
  22094. clearTimeout(this.mouseDownTimer)),
  22095. this.mouseLastMoveTime = Date.now(),
  22096. this.reticule.move(e, t, i)
  22097. }
  22098. ,
  22099. n.prototype.handleInputEnd = function(e, t, i) {//xzw
  22100. if (this.isTouchEvent = i,
  22101. this.mouseDown = !1,
  22102. this.cameraControls.controls[u.PANORAMA].emit("interaction.direct"),
  22103. !i && this.couldBeLongTap)
  22104. return !0;
  22105. if (this.handleLongTap())
  22106. return !0;
  22107. /* if(this.director.tourIsPlaying){
  22108. return !0;
  22109. } */
  22110. if (this.mouseCouldBeClickToMove) {
  22111. if (this.flying)
  22112. return this.path.activeTransType === x.WALK && this.emit(w.WarpInterruptedWithFlyTo, this.path.activeTransType), //停止导览
  22113. !0;
  22114. //add----
  22115. if(this.checkHotClick())//add
  22116. return !0;
  22117. if(this.hoveringPlane){
  22118. this.clickOverlay(this.hoveringPlane)
  22119. return;
  22120. }
  22121. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, this.isTouchEvent ? "touch" : "mouse"),
  22122. this.history.invalidate(),
  22123. this.intersect)
  22124. return this.flyToPanoClosestToMouse();
  22125. if (this.mode === u.PANORAMA) {
  22126. var n = this.closestPanoInDirection(this.getMouseDirection());
  22127. return n ? this.flyToPano({
  22128. pano: n
  22129. }) : this.bump(this.getMouseDirection())
  22130. }
  22131. }
  22132. //this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode) //xzw 删,否则拖拽后就不高亮了
  22133. }
  22134. ,
  22135. n.prototype.handleLongTap = function() {
  22136. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== u.PANORAMA))
  22137. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.LongTap, "touch"),
  22138. !0
  22139. }
  22140. ,
  22141. n.prototype.checktagClick = function() {
  22142. if (this.tagManager.intersectTag) {
  22143. var e = this.isTouchEvent
  22144. , t = this.tagManager.clickedOnTag(e, this);
  22145. return e || t || y.cancelById(V.LookTransition),
  22146. !0
  22147. }
  22148. if (this.tagManager.activeTag)
  22149. return this.tagManager.dismissActiveTag(),
  22150. !1
  22151. }
  22152. ,
  22153. n.prototype.rankedtagInDirection = function(e, t) {
  22154. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  22155. }
  22156. ,
  22157. n.prototype.start = function(e) {
  22158. //-------------------
  22159. //-------------------
  22160. var t = e.mode
  22161. , i = e.pano
  22162. , n = e.position
  22163. , rr = e.quaternion
  22164. , o = e.tag
  22165. , a = e.quickstart
  22166. , s = $.Deferred();
  22167. this.updateModelDependentData(),
  22168. this.updateFromControls(),
  22169. this.findDefaultViews();
  22170. var l = this.is360View(t, i);
  22171. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, rr, o, s) : this.startOutside(e, s),
  22172. s.done(function(e) {
  22173. this.emit(w.Ready, l, e, o)
  22174. }
  22175. .bind(this)),
  22176. s.promise()
  22177. }
  22178. ,
  22179. n.prototype.startOutside = function(e, t) {
  22180. var i = e.mode
  22181. , n = e.pano
  22182. , r = e.position
  22183. , o = e.quaternion
  22184. , a = e.zoom
  22185. , s = e.floorVisibility
  22186. , l = e.tag;
  22187. this.emit(w.StartOutside, f[i].transitionTime),
  22188. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  22189. y.cancelById(V.FlyToViewFloor),
  22190. i === u.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  22191. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  22192. }
  22193. ,
  22194. n.prototype.startInside = function(e, t, i, n, r) {
  22195. r = r || $.Deferred(),
  22196. this.currentPano = e;
  22197. window.bus.dispatchEvent({type:'playerAndModelReady'})
  22198. this.ready = true
  22199. var o = e && !e.isAligned();
  22200. if (t = o ? e.position : t || e.position,
  22201. i = i || e.quaternion,
  22202. e) {
  22203. var a = this.startInside.bind(this, e, t, i, n, r);
  22204. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  22205. return
  22206. }
  22207. //add
  22208. this.transitionPos({type:"beforeFlytopano", pano:this.currentPano, dur:0})
  22209. //this.updateHotVisible()
  22210. Hot.updateVisibles([this.currentPano])
  22211. this.modeTran = "panorama-panorama"
  22212. return this.mode = u.PANORAMA,
  22213. e.floor.enter(this.mode),
  22214. this.emit(w.PanoChosen, this.currentPano, this.currentPano),
  22215. this.switchCameraMode(this.mode, i),
  22216. this.emit(w.StartInside, o),
  22217. r.resolve(!0),
  22218. r
  22219. }
  22220. ,
  22221. n.prototype.startInsideWithFlyin = function(e, t, i, n, r) {
  22222. if (r = r || $.Deferred(),
  22223. this.dollhouseMode(),
  22224. !e)
  22225. return F.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  22226. r.resolve(!1),
  22227. r;
  22228. t = t || e.position;
  22229. var o = i || this.cameraControls.activeControl.camera.quaternion
  22230. , a = e.position;
  22231. return this.fitDollhouse(a, t, o),
  22232. setTimeout(function(t) {
  22233. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = t);
  22234. var n = {
  22235. mode: u.PANORAMA,
  22236. pano: e,
  22237. quaternion: i,
  22238. callback: function() {
  22239. this.emit(w.FlyinFinished),
  22240. r.resolve(!0)
  22241. }
  22242. .bind(this)
  22243. };
  22244. this.flyToNewMode(n)
  22245. }.bind(this, this.cameraControls.activeControl.maxDistance), f.startupFlyinDelay),
  22246. r
  22247. }
  22248. ,
  22249. n.prototype.checkAndWaitForPanoLoad = function() {
  22250. var e = {}
  22251. , t = {}
  22252. , i = 5e3
  22253. , n = function() {
  22254. for (var n in e)
  22255. if (e.hasOwnProperty(n) && e[n]) {
  22256. var r = performance.now() - t[n];
  22257. if (r < i)
  22258. return !0
  22259. }
  22260. return !1
  22261. };
  22262. return function(r, o, a, s, l, c, h, u, d, p) {
  22263. if (n())
  22264. return !0;
  22265. var f = function(t, i, n) {
  22266. N.delayOneFrame(function() {
  22267. e[t] = !1,
  22268. l && l(i, n)
  22269. }
  22270. .bind(this))
  22271. }
  22272. .bind(this, r.id)
  22273. , g = function(t, i) {
  22274. N.delayOneFrame(function() {
  22275. e[t] = !1,
  22276. c && c(i)
  22277. }
  22278. .bind(this))
  22279. }
  22280. .bind(this, r.id);
  22281. try {
  22282. return null !== u && void 0 !== u || (u = !0),
  22283. 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),
  22284. e[r.id] && (t[r.id] = performance.now()),
  22285. e[r.id]
  22286. } catch (n) {
  22287. throw e[r.id] = !1,
  22288. t[r.id] = performance.now() - i,
  22289. n
  22290. }
  22291. }
  22292. }(),
  22293. n.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  22294. if (!e)
  22295. throw new M("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  22296. return r && this.model.waitForLoad(e, function() {
  22297. return e.isLoaded(i)
  22298. }),
  22299. !e.isLoaded(t) && (e.loadCube(t).done(n),
  22300. !0)
  22301. }
  22302. ,
  22303. n.prototype.checkAndWaitForTiledPanoLoad = function() {
  22304. var e = new r.Vector3;
  22305. return function(t, i, n, r, o, a, s, l) {
  22306. if (!t)
  22307. throw new M("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  22308. return e.copy(d.FORWARD),
  22309. this.getDirection(e),
  22310. !t.isLoaded(i) && (a && this.model.waitForLoad(t, function() {
  22311. return t.isLoaded(i)
  22312. }),
  22313. t.loadTiledPano(i, e, null, s, l).done(function(e, t) {
  22314. n && n(e, t)
  22315. }
  22316. .bind(this)).fail(function(e) {
  22317. r && r(e)
  22318. }
  22319. .bind(this)).progress(function(e, t, i) {
  22320. o && o(e, t, i)
  22321. }
  22322. .bind(this)),
  22323. !0)
  22324. }
  22325. }(),
  22326. n.prototype.switchCameraMode = function(e, t) {
  22327. var i = this.cameraControls.controls[e]
  22328. , n = i.camera;
  22329. switch (e) {
  22330. case u.PANORAMA:
  22331. n.position.copy(this.currentPano.position);
  22332. var o = t ? d.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  22333. i.lookAt(o.add(n.position));
  22334. break;
  22335. case u.DOLLHOUSE:
  22336. /* var a = this.position.clone();
  22337. 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),
  22338. n.position.copy(a),
  22339. i.target.copy(this.target.clone().setY(this.model.center.y));
  22340. break; */
  22341. //for多楼层 且 让模型刚好适应屏幕
  22342. var box = this.model.boundingBox.clone();
  22343. box.applyMatrix4(this.camera.matrixWorld);//将 boundingbox、也就是模型, 转换到当前相机朝向
  22344. var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  22345. var fov = B.getHFOVFromVFOV(f.insideFOV, n.aspect, 1); //获得在当前窗口的横向的fov
  22346. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2))//根据上面获得的参数得到target到相机的距离
  22347. //console.log(boxSize.x,distance, boxSize.length() / 2)
  22348. distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  22349. if(this.mode === u.PANORAMA){
  22350. i.target.copy(this.model.center);
  22351. var vec = this.getDirection().negate().setY(1).normalize()//获得朝向
  22352. }else{
  22353. i.target.copy(this.target.clone().setY(this.model.center.y))
  22354. var vec = d.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
  22355. }
  22356. vec.multiplyScalar(distance )
  22357. n.position.copy(i.target.clone().add(vec))
  22358. break
  22359. case u.FLOORPLAN:
  22360. n.position.copy(this.model.center).setY(f.floorplan.cameraHeight),
  22361. i.target.copy(this.model.center).setY(0),
  22362. i.zoomToContain(this.model.size),
  22363. i.rotateToView(this.model.size, this.getDirection())
  22364. }
  22365. i.update(0)
  22366. }
  22367. ,
  22368. n.prototype.update = function() {
  22369. var e = (new r.Vector3,
  22370. {})
  22371. , t = [];
  22372. return function(i) {
  22373. this.updatePersistentZooming(i),
  22374. this.updateFromControls(i),
  22375. this.getCurrentNodePanos(t)
  22376. this.lastFrameChanged = false
  22377. if(this.hasChanged(e) ) {
  22378. this.lastFrameChanged = e.cameraChanged3 ? 'level3' : e.cameraChanged2 ? 'level2' : e.cameraChanged ? 'level1' : false
  22379. this.lastChangeTime = Date.now(),
  22380. !this.mouseDown && this.containsMouse && this.updateIntersect(),
  22381. this.emit(w.ViewChanged, e),
  22382. // 注意: player.cameraControls.activeControl.camera 的 matrix是错的
  22383. this.intersect && this.magnifier && this.magnifier.update(this.intersect.point)
  22384. }
  22385. if(e.cameraChanged2){ //变化要更大些
  22386. }
  22387. if(e.cameraChanged){
  22388. this.mode == "panorama" && window.cad && cad.setSign({ x: this.position.x, y: this.position.z }, this.cameraControls.controls.panorama.lon);
  22389. /* for(var i in this.model.hots){
  22390. this.model.hots[i].updateTitle(this)
  22391. } */
  22392. Hot.updateHots()
  22393. }
  22394. this.model.supportsTiles && (this.updateTileDownloader(t),
  22395. this.updatePanoRenderer(t)),
  22396. this.updatePreRendering(t),
  22397. this.reticule.update(),
  22398. this.path.update(),
  22399. this.spider.update(),
  22400. this.cachedPanoCandidates && f.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  22401. this.updateControlLocks(),
  22402. this.model.supportsTiles && this.updateZoomPano()
  22403. }
  22404. }(),
  22405. /* n.prototype.controlVideosPlay = function() {//判断box视频是否可见 不可见就暂停
  22406. var lastMode, lastPano;
  22407. return function(){
  22408. var mode = this.mode;
  22409. var pano = mode == "panorama" ? this.currentPano : "";
  22410. if(mode != "panorama" || pano != lastPano){
  22411. overlay.noBlock = null
  22412. }
  22413. this.overlayGroup.children.forEach((overlay)=>{
  22414. if(overlay.overlayType == "video" ){
  22415. var matrix = overlay.plane.matrixWorld;
  22416. var inSight = false;
  22417. var cameraDir = this.getDirection();
  22418. var planeDir = (new r.Vector3).copy(d.FORWARD).applyQuaternion(overlay.plane.quaternion)
  22419. var vertexes = []
  22420. if(cameraDir.angleTo(planeDir)>Math.PI/2){//朝向相机视线
  22421. for(let i=0; i<4; i++){
  22422. var vertex = overlay.plane.geometry.vertices[i].clone().applyMatrix4(matrix)
  22423. vertexes.push(vertex)
  22424. if(overlay.noBlock == null){
  22425. if(!m.ifShelter(vertex)){
  22426. overlay.noBlock = true
  22427. }
  22428. inSight = true; break;
  22429. }else{
  22430. overlay.noBlock = true
  22431. }
  22432. if(m.getPos2d(vertex, this.camera, $("#player")[0]).inSight){
  22433. inSight = true; break;
  22434. }
  22435. }
  22436. }
  22437. overlay.inSight = inSight
  22438. if(!inSight)overlay.plane.material.map.image.pause()
  22439. else overlay.plane.material.map.image.play()//maybe fail
  22440. }
  22441. })
  22442. lastMode = mode, lastPano = pano
  22443. }
  22444. }() */
  22445. n.prototype.updatePersistentZooming = function(e) {
  22446. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : this.zooming === -1 && this.zoomBy(1 - this.zoomSpeed * e)
  22447. }
  22448. ,
  22449. n.prototype.updateControlLocks = function() {
  22450. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[u.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  22451. }
  22452. ,
  22453. n.prototype.updatePanoRenderer = function() {
  22454. var e = new r.Vector3;
  22455. return function(t) {
  22456. var i = this.nextPano || this.currentPano;
  22457. this.panoRenderer.hasQueuedTiles() && i && (e.copy(d.FORWARD),
  22458. this.getDirection(e),
  22459. this.panoRenderer.updateDirection(e))
  22460. }
  22461. }(),
  22462. n.prototype.cleanupInactivePanos = function() {
  22463. var e = []
  22464. , t = [];
  22465. return function() {
  22466. e.length = 0,
  22467. e.push(this.currentPano),
  22468. this.nextPano && e.push(this.nextPano),
  22469. t.length = 0;
  22470. for (var i = 0; i < this.panoRenderer.activePanos.length; i++)
  22471. t.push(this.panoRenderer.activePanos[i]);
  22472. for (var n = 0; n < t.length; n++) {
  22473. for (var r = t[n], o = !0, a = 0; a < e.length; a++)
  22474. r.id === e[a].id && (o = !1);
  22475. o && r.exit()
  22476. }
  22477. }
  22478. }(),
  22479. n.prototype.updatePreRendering = function() {
  22480. var e = {};
  22481. return function(t) {
  22482. if (1 === f.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  22483. var i = this.nextPano || this.currentPano;
  22484. if (i && t && t.length > 1) {
  22485. var n = t.findIndex(function(e) {
  22486. if (e.id === i.id)
  22487. return !0
  22488. });
  22489. if (n >= 0 && n + 1 < t.length) {
  22490. var r = t[n + 1];
  22491. r.isLoaded(this.basePanoSize) || e[r.id] || (window.setTimeout(function(t) {
  22492. this.checkAndWaitForPanoLoad(t, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  22493. window.setTimeout(function(t) {
  22494. e[t.id] = !1
  22495. }
  22496. .bind(this, t), f.tiling.panoPreRenderRepeatDelay)
  22497. }
  22498. .bind(this, r), f.tiling.panoPreRenderDelay),
  22499. e[r.id] = !0)
  22500. }
  22501. }
  22502. }
  22503. }
  22504. }(),
  22505. n.prototype.enablePreRendering = function() {
  22506. this.preRenderingEnabled = !0
  22507. }
  22508. ,
  22509. n.prototype.disablePreRendering = function() {
  22510. this.preRenderingEnabled = !1,
  22511. this.cleanupInactivePanos()
  22512. }
  22513. ,
  22514. n.prototype.updateTileDownloader = function() {
  22515. var e = new r.Vector3;
  22516. return function(t) {
  22517. var i = this.nextPano || this.currentPano;
  22518. i && (e.copy(d.FORWARD),
  22519. this.getDirection(e),
  22520. this.tileDownloader.tilePrioritizer.updateCriteria(i, this.position, e, t.length > 0 ? t : null),
  22521. this.tileDownloader.processPriorityQueue = !0)
  22522. }
  22523. }(),
  22524. n.prototype.updateFromControls = function(e) {
  22525. null !== e && void 0 !== e || (e = 0),
  22526. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  22527. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  22528. this.position.copy(this.cameraControls.activeControl.camera.position),
  22529. this.target.copy(this.cameraControls.activeControl.target),
  22530. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  22531. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  22532. this.camera.position.copy(this.position),
  22533. this.camera.quaternion.copy(this.quaternion),
  22534. this.camera.updateMatrix(),
  22535. this.camera.updateMatrixWorld()
  22536. }
  22537. ,
  22538. n.prototype.hasChanged = function(e) {
  22539. if (!this.previousState)
  22540. {
  22541. this.previousState = {
  22542. allFloorsVisible: this.model.allFloorsVisible,
  22543. position: this.position.clone(),
  22544. quaternion: this.quaternion.clone(),
  22545. mouse: this.mouse.clone(),
  22546. //labelScaleFactor: this.getLabelScaleFactor(),
  22547. currentFloor: this.model.currentFloor,
  22548. projectionMatrix: this.camera.projectionMatrix.clone(),
  22549. worldMatrix: this.camera.matrixWorld.clone(),
  22550. mode: this.mode,
  22551. modelPosition: this.model.position.clone(),
  22552. modelCenter: this.model.center.clone(),
  22553. zoomLevel: this.zoomLevel
  22554. };
  22555. e.cameraChanged = e.cameraChanged2 = true;
  22556. return !0;
  22557. }
  22558. //许钟文改 分成相机是否改变cameraChanged 和其他
  22559. 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)
  22560. 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 ;
  22561. e.cameraChanged = !a;
  22562. e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  22563. e.moved = !this.position.equals(this.previousState.position),
  22564. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  22565. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  22566. // e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  22567. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  22568. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  22569. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  22570. e.modeChanged = this.mode !== this.previousState.mode,
  22571. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  22572. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  22573. e.nextPanoActive = null !== this.nextPano,
  22574. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel
  22575. /* if(e.cameraChanged){//
  22576. e.cameraChanged2 = !MathLight.closeTo(this.quaternion, this.previousState.quaternion, 3) || !MathLight.closeTo(this.position, this.previousState.position, 4) || !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix)
  22577. }else e.cameraChanged2 = false */
  22578. if(e.cameraChanged){
  22579. e.cameraChanged2 = e.cameraProjectionChanged || !MathLight.closeTo(this.quaternion, this.previousState.quaternion, 5) || !MathLight.closeTo(this.position, this.previousState.position, 4)
  22580. e.cameraChanged3 = e.cameraProjectionChanged || !MathLight.closeTo(this.quaternion, this.previousState.quaternion, 3) || !MathLight.closeTo(this.position, this.previousState.position, 3)
  22581. } else {
  22582. e.cameraChanged2 = false
  22583. e.cameraChanged3 = false
  22584. }
  22585. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  22586. this.previousState.position.copy(this.position),
  22587. this.previousState.quaternion.copy(this.quaternion),
  22588. this.previousState.mouse.copy(this.mouse),
  22589. //this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  22590. this.previousState.currentFloor = this.model.currentFloor,
  22591. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  22592. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  22593. this.previousState.mode = this.mode,
  22594. this.previousState.modelPosition.copy(this.model.position),
  22595. this.previousState.modelCenter.copy(this.model.center),
  22596. this.previousState.zoomLevel = this.zoomLevel;
  22597. //console.log("cameraChanged2 "+ e.cameraChanged2 + ", mouseMoved "+e.mouseMoved)
  22598. return !t
  22599. }
  22600. ,
  22601. n.prototype.updateIntersect = function() {
  22602. var e = this.flying || this.isWarping()
  22603. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  22604. , i = y.getById(V.LookTransition)
  22605. , n = !(e || t || this.isTouchEvent || i.length && i[0].running);
  22606. {//clear:
  22607. if(this.intersectHot) this.intersectHot.setHoverState(false)
  22608. this.intersectHot = null
  22609. CursorDeal.remove('hoverHot')
  22610. }
  22611. var deal = ()=>{
  22612. if(this.intersect && this.intersect.object.visible ){
  22613. if("hotSprite" == this.intersect.object.type){
  22614. this.intersectHot = this.intersect.object
  22615. while(!(this.intersectHot instanceof Hot)){
  22616. this.intersectHot = this.intersectHot.parent
  22617. }
  22618. $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass("active")
  22619. this.intersectHot.setHoverState(true)
  22620. }
  22621. }
  22622. }
  22623. if(this.model.hotGroup){
  22624. var hots = this.model.hotGroup.children.filter(e=> e.info.actionType.examine || e.info.actionType.fastTran || e.info.actionType.openHot || e.info.actionType.playAndPause)
  22625. let colliders = this.model.floors.reduce(function(e, t) {
  22626. return t.hidden ? e : e.concat(t.collider.children)
  22627. }, this.mode === 'panorama' ? this.panoMarkers : [])
  22628. this.intersect = this.getMouseIntersect(null, hots.concat(colliders/* this.model.colliders */));
  22629. if(this.intersect){
  22630. deal()
  22631. let intersect = this.intersect
  22632. if(this.intersectHot){
  22633. this.intersect = null
  22634. CursorDeal.add('hoverHot')
  22635. }else{
  22636. if(intersect.object.parent.parent.hidden ){//楼层已隐藏
  22637. this.intersect = null
  22638. }
  22639. }
  22640. }
  22641. }else{
  22642. this.intersect = this.getMouseIntersect()
  22643. }
  22644. this.intersect && this.updateClosestPano(this.intersect),
  22645. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  22646. f.navigation.panoScores && !f.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  22647. }
  22648. ,
  22649. n.prototype.checkHotClick = function() {
  22650. if(this.intersectHot){
  22651. if(this.intersectHot.texType == "video" && this.intersectHot.info.actionType.playAndPause){
  22652. this.intersectHot.switchPlay(!!this.intersectHot.pausedByUser)
  22653. }
  22654. this.intersectHot.examine(this)
  22655. return true;
  22656. }
  22657. },
  22658. n.prototype.getMouseDirection = function(e) {
  22659. e = e || this.mouse;
  22660. var t = new r.Vector3(e.x,e.y,-1).unproject(this.camera)
  22661. , i = new r.Vector3(e.x,e.y,1).unproject(this.camera);
  22662. return i.sub(t).normalize()
  22663. }
  22664. ,
  22665. n.prototype.hoverOverlay = function(mesh){
  22666. if(!mesh){
  22667. this.hoveringPlane = null;
  22668. $("#player").css("cursor",this.currentCursor || "" );
  22669. }else{
  22670. var overlay = mesh.parent;
  22671. $("#player").css("cursor","pointer");
  22672. this.hoveringPlane = overlay;
  22673. return true;
  22674. }
  22675. },
  22676. n.prototype.clickOverlay = function(overlay){
  22677. if(this.openOverlay && !overlay)return;
  22678. var plane = overlay.plane;
  22679. /* if(overlay.overlayType == "video"){
  22680. if(plane.material.map.image.paused) plane.material.map.image.play()
  22681. else plane.material.map.image.pause()
  22682. } */
  22683. if(overlay.overlayType == "video"){
  22684. overlay.switchPlay(!!overlay.pausedByUser)
  22685. }
  22686. /* if(window.EditOverlay &&EditOverlay.editing){
  22687. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane) EditOverlay.closeOverlayPanel('cancel')
  22688. $('#overlayProp').removeClass('atRight').removeClass('hide')
  22689. EditOverlay.endAddPlane();
  22690. EditOverlay.updateOverlayPanel(overlay)
  22691. EditOverlay.controlSelectOverlay(overlay)
  22692. return;
  22693. } */
  22694. },
  22695. n.prototype.getMouseIntersect = function(e, t) {//xzw change
  22696. e = e || this.mouse.clone(),
  22697. t = t || this.model.floors.reduce(function(e, t) {
  22698. return t.hidden ? e : e.concat(t.collider.children)
  22699. }, this.mode === u.PANORAMA ? this.panoMarkers : []);
  22700. var i = new r.Vector3(e.x,e.y,-1).unproject(this.camera);
  22701. this.raycaster.set(i, this.getMouseDirection(e));
  22702. var n = this.raycaster.intersectObjects(t, true);//add true
  22703. var o = n[0];
  22704. if(o){
  22705. o.face && (o.normal = o.face.normal.applyQuaternion(o.object.quaternion),
  22706. this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
  22707. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  22708. o.horizontal = .8 < o.normal.y);
  22709. return o
  22710. }
  22711. }
  22712. ,
  22713. n.prototype.updateClosestPano = function(e) {
  22714. var t = [s.filters.isPanoAligned()];
  22715. if (this.mode === u.PANORAMA) {
  22716. if (!this.currentPano)
  22717. return;
  22718. t.push(s.filters.not(this.currentPano)),
  22719. t.push(s.filters.isNeighbourPanoTo(this.currentPano)),
  22720. t.push(s.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  22721. t.push(s.filters.isCloseEnoughTo(e.point, f.panoFloorClickRadius)),
  22722. t.push(s.filters.isNotBehindNormal(e.point, e.normal))
  22723. } else{
  22724. t.push(s.filters.isOnVisibleFloor()),
  22725. t.push(this.checkHasNeighbor)//add
  22726. this.mode !== u.FLOORPLAN && t.push(s.filters.inDirection(this.position, this.getDirection(), .25));
  22727. }
  22728. var i = this.model.panos.find(t, [s.sortFunctions.floorDistanceToPoint(e.point)]);
  22729. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  22730. this.emit(w.ClosestPanoChanging, this.closestPano, i, this.mode),
  22731. this.closestPano = i,
  22732. this.closestPano && this.mode == 'panorama' ? CursorDeal.add('hoverPano' ) : CursorDeal.remove('hoverPano' ) //add
  22733. ) : this.isPanoHover = !1
  22734. }
  22735. ,
  22736. n.prototype.dollhouseMode = function(e, t) {
  22737. this.emit(w.ModeChanging, this.mode, u.DOLLHOUSE),
  22738. this.mode = u.DOLLHOUSE,
  22739. this.cameraControls.controls[u.DOLLHOUSE].reset();
  22740. var i = new r.Vector3(this.model.center.x,0,this.model.center.z)
  22741. , n = new r.Vector3(15,10,15);
  22742. if (e && t) {
  22743. var o = d.FORWARD.clone().applyQuaternion(t)
  22744. , a = this.model.center.clone().sub(e)
  22745. , s = a.dot(o);
  22746. s > 0 ? (i = o.clone().multiplyScalar(s).add(e),
  22747. n.copy(e)) : F.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  22748. }
  22749. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(0, !0),
  22750. this.cameraControls.controls[u.DOLLHOUSE].target.copy(i),
  22751. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(n),
  22752. this.updateFromControls(),
  22753. this.model.alpha = 1,
  22754. this.model.skybox.material.uniforms.opacity.value = 0
  22755. }
  22756. ,
  22757. n.prototype.insideMode = function(e, t) {
  22758. var i = $.Deferred()
  22759. , n = t || null;
  22760. if (this.mode !== u.PANORAMA && this.mode !== u.TRANSITIONING) {
  22761. var r = [s.filters.isPanoAligned()];
  22762. this.model.currentFloor && r.push(s.filters.atFloor(this.model.currentFloor)),
  22763. e = e || this.currentPano || this.model.panos.find(r, [s.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  22764. this.flyToNewMode({
  22765. mode: u.PANORAMA,
  22766. pano: e,
  22767. callback: n
  22768. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  22769. } else {
  22770. var o = this.mode === u.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  22771. i.reject(o)
  22772. }
  22773. return i.promise()
  22774. }
  22775. ,
  22776. n.prototype.fitDollhouse = function(e, t, i) {//许钟文改 飞入前寻找和初始视角最合适的位置
  22777. //if(urlHasValue('oldEntry')){
  22778. //搬自一代。
  22779. var maxY = this.model.boundingBox.max.y;
  22780. var n = d.FORWARD.clone().applyQuaternion(i)
  22781. , i = n.clone().add(e);
  22782. this.cameraControls.activeControl.target.copy(i),
  22783. this.cameraControls.activeControl.camera.position.set(0, maxY * 2.4, 0).add(e).add(n.multiplyScalar(-10))
  22784. //return;
  22785. /* //this.camera.position.copy(this.model.center);
  22786. //this.camera.updateMatrixWorld()
  22787. this.switchCameraMode("dollhouse", i) */
  22788. //}//下面是二代代码,看不太懂。因为有的场景在靠近一端的某个方向截取的初始视角会甩镜头,也就是不是下去之后的方向
  22789. //直接用一代的这个 效果和二代几乎一样,且不会甩
  22790. /* var n = d.FORWARD.clone().applyQuaternion(i);
  22791. this.cameraControls.activeControl.target.copy(n).add(e);
  22792. var o = d.RIGHT.clone().applyQuaternion(i)
  22793. , a = d.UP.clone()
  22794. , s = o.clone().applyAxisAngle(a, Math.PI / 2)
  22795. , l = this.model.boundingBox.max.clone()
  22796. , c = this.model.boundingBox.min.clone()
  22797. , 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)]
  22798. , u = 0
  22799. , p = 0
  22800. , g = 0;
  22801. h.forEach(function(e, t, i) {
  22802. var n = Math.abs(e.dot(o))
  22803. , r = e.dot(s);
  22804. n > u && (u = n,
  22805. p = r),
  22806. r > g && (g = r)
  22807. });
  22808. 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)))
  22809. , v = s.clone().multiplyScalar(p).add(t)
  22810. , A = s.clone().multiplyScalar(g).add(t);
  22811. p = u / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * this.cameraControls.activeControl.camera.aspect * (Math.PI / 180));
  22812. g = m / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * (Math.PI / 180));
  22813. p = Math.max(p, 10),
  22814. g = Math.max(g, 10);
  22815. var y = n.clone().multiplyScalar(-p).add(v).sub(t).length()
  22816. , C = n.clone().multiplyScalar(-g).add(v).sub(t).length();
  22817. this.cameraControls.activeControl.maxDistance = f.skyboxRadius - 1;
  22818. y >= C ? this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(v).add(n.multiplyScalar(1.1 * -p))
  22819. : this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(A).add(n.multiplyScalar(1.1 * -g))
  22820. */
  22821. }
  22822. ,
  22823. n.prototype.floorplanMode = function(e, t, i) {
  22824. this.mode = u.FLOORPLAN;
  22825. var n = this.cameraControls.controls[u.FLOORPLAN];
  22826. n.reset();
  22827. var r = e ? e : this.model.center;
  22828. if (n.target.copy(r).setY(0),
  22829. n.camera.position.copy(r).setY(f.floorplan.cameraHeight),
  22830. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  22831. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  22832. t) {
  22833. var o = d.LEFT.clone().applyQuaternion(t);
  22834. n.rotateLeft(-Math.atan2(o.x, o.z))
  22835. } else
  22836. n.rotateToView(this.model.size, this.getDirection());
  22837. n.update(0)
  22838. }
  22839. ,
  22840. n.prototype.nonInterruptingFlyToPano = function(e, t) {
  22841. return e.skipWarpingCheck = !0,
  22842. this.flyToPano(e, t)
  22843. }
  22844. ,
  22845. n.prototype.updateMarkerVisi = function() {//加
  22846. if(this.mode != "panorama")return;
  22847. this.model.panos.list.forEach((pano)=>{
  22848. if(!pano.marker)return;
  22849. var isCurrent = pano.id == this.currentPano.id;
  22850. var isNeighbour = !!pano.neighbourPanos[this.currentPano.id];
  22851. pano.marker.material.visible = !isCurrent && isNeighbour;
  22852. pano.marker.material.opacity = !isCurrent && isNeighbour ? _settings.panorama.markerOpacity : 0;
  22853. })
  22854. }
  22855. ,
  22856. /* n.prototype.updateHotVisible = function(pano){
  22857. var hots = this.model.hots;
  22858. pano = pano || this.currentPano;
  22859. for (var index in hots){
  22860. var visible;
  22861. if(this.mode != "panorama"){
  22862. visible = true;
  22863. }else{
  22864. //hots[index].mesh.material.depthTest = false;
  22865. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  22866. }
  22867. hots[index].mesh.visible = visible;
  22868. }
  22869. } */
  22870. n.prototype.flyToPano = function(e, t) {
  22871. var i = e.pano
  22872. , aim = e.lookAtPoint
  22873. , aimQua = e.quaternion //ADD
  22874. , o = e.duration
  22875. , a = e.aimDuration
  22876. , s = e.maxDistanceOverride
  22877. , l = e.skipWarpingCheck
  22878. , c = e.constantMoveSpeed
  22879. , h = null
  22880. , p = null
  22881. if (aim){
  22882. var _ = (new r.Matrix4).lookAt(i.position, aim, d.UP)
  22883. aimQua = (new r.Quaternion).setFromRotationMatrix(_)
  22884. }
  22885. else aimQua = aimQua
  22886. var zoomLevel = e.zoomLevel || 1 //add
  22887. if(this.flying) return t && t(e)
  22888. window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(i);
  22889. if (this.isWarping() && !l && (this.path.activeTransType === x.BLACK || this.path.activeTransType === x.STD))
  22890. return F.warn("Player.flyToPano() -> Cannot fly when warping"),
  22891. t && t(),
  22892. !1;
  22893. if (this.updateLastView(),
  22894. this.mode !== u.PANORAMA) {
  22895. var m;
  22896. return void this.flyToNewMode({
  22897. mode: u.PANORAMA,
  22898. pano: i,
  22899. duration: o,
  22900. quaternion: aimQua ,
  22901. callback: t
  22902. })
  22903. }
  22904. if (!i || (h = g.deepExtend(e),
  22905. p = function() {
  22906. N.delayOneFrame(function() {
  22907. this.flyToPano(h, t)
  22908. }
  22909. .bind(this))
  22910. }
  22911. .bind(this),
  22912. !this.checkAndWaitForPanoLoad(i, "high", "low", this.basePanoSize, p))) {
  22913. var C = function(e) {
  22914. t && t(e)
  22915. }
  22916. .bind(this);
  22917. this.currentPano || (this.currentPano = i,
  22918. this.path.placeCpm(),
  22919. this.path.fadeOutCpm(f.path.fadeOutTime),
  22920. this.spider.draw());
  22921. var I = o;
  22922. if ("number" != typeof o) {
  22923. var E = s || f.transition.flytimeMaxDistanceThreshold;
  22924. I = Math.min(this.currentPano.position.distanceTo(i.position), E) * f.transition.flytimeDistanceMultiplier + f.transition.flyTime
  22925. }
  22926. if (f.transition.flySpeed > .01 && (I = 1e3 * this.currentPano.position.distanceTo(i.position) / f.transition.flySpeed),
  22927. zoomLevel !== this.zoomLevel)
  22928. switch (f.zoom.transitionStyle) {
  22929. case 1:
  22930. this.smoothZoomFovTo(null, zoomLevel, zoomLevel == 1 ? I / 2 : I); //改
  22931. break;
  22932. case 2:
  22933. return h = g.deepExtend(e),
  22934. p = this.flyToPano.bind(this, h, t),
  22935. void this.smoothZoomFovTo(null, zoomLevel, f.zoom.restoreTime * (this.zoomLevel - 1), p)
  22936. }
  22937. if (aimQua) {
  22938. y.cancelById(V.LookTransition),
  22939. I *= f.transition.aimSlowFactor;
  22940. var b = this.cameraControls.activeControl.camera.quaternion.clone()
  22941. , S = b.clone()
  22942. , M = new r.Vector3;
  22943. if (i === this.currentPano) {
  22944. var R = d.FORWARD.clone().applyQuaternion(b)
  22945. , P = d.FORWARD.clone().applyQuaternion(aimQua)
  22946. , O = R.angleTo(P);
  22947. return void 0 !== a && null !== a || (a = 1 * Math.sqrt(O) / f.tags.navigate.rotateSpeedFactor * 1e3),
  22948. void y.start(function(e) {
  22949. S.copy(b),
  22950. v.quaternion(S, aimQua)(e),
  22951. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  22952. this.cameraControls.activeControl.lookAt(M)
  22953. }
  22954. .bind(this), a, C, 0, A[f.transition.movementEasing], null, V.LookTransition)
  22955. }
  22956. }
  22957. if (i === this.currentPano )
  22958. return void C();
  22959. this.flying = !0;
  22960. var L = this.position.clone()
  22961. , D = this.currentPano;
  22962. F.debug("Flying to pano ", i.position),
  22963. this.emit(w.PanoChosen, this.currentPano, i),
  22964. this.emit(w.FlyingStarted, i.position, L, i, D)
  22965. //---------before fly--------------- add
  22966. this.transitionPos({type:"beforeFlytopano", pano:i, dur:I})//add
  22967. Hot.updateVisibles([this.currentPano, i],'every')
  22968. //地标变化
  22969. if(this.model.floorLogos){
  22970. this.model.changefloorLogoOpa({index:0, opa:0, dur: p, delay:0.7})//this.model.floorLogoFade(0, _duration*0.5, 0.7);
  22971. this.model.floorLogos[1].position.copy(i.floorPosition.clone().sub(this.model.position));
  22972. //this.model.adjustfloorLogoHeight();
  22973. this.model.floorLogos[1].material.opacity = 0;//uniforms.opacity.value = 0;
  22974. this.model.floorLogos[1].visible = true;
  22975. this.model.changefloorLogoOpa({index:1, opa:1, dur: 250})//this.model.floorLogoShow(1,250);
  22976. }
  22977. //=======================================
  22978. this.nextPano = i
  22979. let beginTran = ()=>{
  22980. aimQua && y.start(function(e) {
  22981. S.copy(b),
  22982. v.quaternion(S, aimQua)(e),
  22983. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  22984. this.cameraControls.activeControl.lookAt(M)
  22985. }
  22986. .bind(this), I, null, 0, A[f.transition.movementEasing], null, V.LookTransition);
  22987. var B = c ? null : A[f.transition.movementEasing];
  22988. y.start(v.uniform(this.model.skybox, "progress", 1), I, null, 0, A[f.transition.blendEasing], "skyFly", V.FlyToPano),
  22989. y.start(v.allUniforms(this.model.chunks, "progress", 1), I, null, 0, A[f.transition.blendEasing], "chunkFly", V.FlyToPano),
  22990. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, i.position), I, function(e) {
  22991. this.flying = !1,
  22992. this.currentPano !== i && this.currentPano.exit(),
  22993. i.enter(),
  22994. this.currentPano = i,
  22995. this.nextPano = null,
  22996. this.path.placeCpm(),
  22997. this.path.fadeOutCpm(f.path.fadeOutTime),
  22998. this.spider.draw(),
  22999. this.emit(w.FlyingEnded, i.position, L, i, D),
  23000. this.updateMarkerVisi(),//add
  23001. C(e)
  23002. //add:
  23003. if(this.mode == "panorama" ){
  23004. if(this.model.floorLogos){
  23005. this.model.floorLogos[0].position.copy(this.model.floorLogos[1].position)
  23006. //this.model.adjustfloorLogoHeight()
  23007. this.model.changefloorLogoOpa({index:0,opa:1,dur:0});//this.model.floorLogos[0].material.uniforms.opacity.value = 1;
  23008. this.model.floorLogos[1].visible = false;
  23009. }
  23010. this.model.fadePanoMarkers()//add
  23011. Hot.updateVisibles([this.currentPano])//add
  23012. }
  23013. }
  23014. .bind(this), 0, B, "camFly", V.FlyToPano)
  23015. }
  23016. if(!this.model.supportsTiles && i.getSkyboxTexture().image[0].width > 1024 /* || this.qualityManager.getMaxZoomClass() == '4k' */){
  23017. setTimeout(()=>{
  23018. beginTran()
  23019. }, 50) //2048的非tile需要延迟到下一帧,因为需要时间载入贴图,否则掉帧
  23020. }else{
  23021. beginTran()
  23022. }
  23023. }
  23024. }
  23025. ,
  23026. n.prototype.warpToPano = function(o={}) {
  23027. }
  23028. n.prototype.blackToPano = function(o={},callback) {//add 瞬间过渡
  23029. //o.panoId = "8bc9156b288d48459e4e0f74d7051ef1"
  23030. if(this.flying || this.isWarping() )return;
  23031. let pano = o.pano || this.model.panos.index[o.panoId]
  23032. if (this.mode !== u.PANORAMA) {
  23033. var m;
  23034. void this.flyToNewMode({
  23035. mode: u.PANORAMA,
  23036. pano ,
  23037. duration: o.duration,
  23038. quaternion: o.quaternion ,
  23039. callback
  23040. })
  23041. }
  23042. let oldPos = this.position.clone();
  23043. let oldPano = this.currentPano
  23044. this.path.warpDestPano = pano
  23045. var retry = ()=>{
  23046. this.waitingToWarp = !1,
  23047. this.blackToPano(o,callback)
  23048. }
  23049. if (this.checkAndWaitForPanoLoad(pano, "high", "low", this.basePanoSize, retry))
  23050. return void (this.waitingToWarp = !0)
  23051. this.flying = true
  23052. this.nextPano = pano //提前加载高清图片
  23053. this.path.warpDestHeroLoc = {
  23054. panoId : pano.id,
  23055. position: pano.position,
  23056. quaternion: o.quaternion || this.quaternion.clone()
  23057. }
  23058. this.path.warpTravel_BLACK(null, 1500,1, ()=>{
  23059. pano != this.currentPano && this.currentPano.exit()
  23060. pano.enter()
  23061. this.currentPano = pano
  23062. this.flying = false
  23063. this.nextPano = null
  23064. this.updateMarkerVisi();//add
  23065. callback && callback()
  23066. } )
  23067. }
  23068. window._transitionPosId = 9999
  23069. n.prototype.transitionPos = function(o={}) {//渐变overlay和热点的位置
  23070. y.cancelById(_transitionPosId)
  23071. var begin = function(object, pos, qua, scale){
  23072. if(pos){
  23073. if(!same(object.position, pos, 0.01)){
  23074. y.start(v.vector(object.position, pos), o.dur, (e)=>{
  23075. object.updateScale()
  23076. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  23077. }
  23078. if(qua && !same(object.quaternion, qua, 1e-6)){
  23079. y.start(v.quaternion(object.quaternion, qua), o.dur, (e)=>{
  23080. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  23081. }
  23082. if(scale && !same(object.scale, scale, 0.001)){
  23083. y.start(v.vector(object.scale, scale), o.dur, (e)=>{
  23084. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  23085. }
  23086. }
  23087. }
  23088. var same = function(vec1, vec2, diff){
  23089. var s = Math.abs(vec1.x-vec2.x) < diff && Math.abs(vec1.y-vec2.y) < diff && Math.abs(vec1.z-vec2.z) < diff
  23090. if(s && vec1.w) s = Math.abs(vec1.w-vec2.w) < diff
  23091. return s
  23092. }
  23093. var sid = o.pano != void 0 ? o.pano.id : "outside";
  23094. for(let i in this.model.hots){//是否判断visible?
  23095. var hot = this.model.hots[i];
  23096. var panoData = hot.info.transformAtPanos[sid];
  23097. var useCustom = !panoData
  23098. //if(hot.usingTransformData || !useCustom){
  23099. var pos = useCustom ? hot.info.position : panoData.pos;
  23100. var qua = hot.isSprite ? null : (useCustom ? hot.info.quaternion : panoData.qua);
  23101. var scale = useCustom ? hot.info.scale : panoData.scale;
  23102. begin(hot, pos , qua, scale )
  23103. //}
  23104. //hot.usingTransformData = !useCustom;
  23105. }
  23106. if(o.callback){
  23107. setTimeout(()=>{
  23108. o.callback()
  23109. },o.dur + 16) ;//姑且这么写
  23110. }
  23111. }
  23112. window._tranOutsideFocus = 4399
  23113. n.prototype.focusPoint = function(o={}){//当在外时,聚焦相机到这一点
  23114. console.log("focusPoint")
  23115. if(this.mode == "floorplan"){
  23116. var modelSize = o.modelSize || new THREE.Vector3(8,8,8);//可视范围
  23117. var control = this.cameraControls.controls.floorplan;
  23118. var absoluteScale = control.getDefaultAbsoluteScale(modelSize)
  23119. var currentScale = control.absoluteScale;
  23120. var currentTarget = control.target.clone()
  23121. y.cancelById(window._tranOutsideFocus, true);
  23122. y.start(function(progress){
  23123. control.absoluteScale = absoluteScale*progress + currentScale*(1-progress);
  23124. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  23125. control.camera.position.copy(control.target.clone().add(control.offset)) //维持角度
  23126. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, A[f.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  23127. }else if(player.mode == "dollhouse"){
  23128. var control = player.cameraControls.controls.dollhouse;
  23129. var radius = o.radius || 8;
  23130. var currentTarget = control.target.clone()
  23131. var dir = control.offset.clone().normalize()
  23132. var currentRadius = control.offset.length();
  23133. y.cancelById(window._tranOutsideFocus, true);
  23134. y.start(function(progress){
  23135. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  23136. let radius_ = radius*progress+currentRadius*(1-progress)
  23137. control.camera.position.copy(control.target.clone().add(dir.clone().multiplyScalar(radius_)))
  23138. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, A[f.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  23139. }else if(this.mode == 'panorama'){
  23140. this.flyToPano({
  23141. lookAtPoint: o.aim.clone() ,
  23142. pano: this.currentPano,
  23143. aimDuration: o.dur || 600
  23144. })
  23145. }
  23146. }
  23147. /*
  23148. 切换到某个模式后再执行函数
  23149. */
  23150. n.prototype.FlyToMode = function(mode, f1, duration){
  23151. var f2;
  23152. if (this.mode == mode) {
  23153. f1 && f1()
  23154. } else {
  23155. f2 = f1;
  23156. if (this.mode == "transitioning" && this.modeTran.split('-')[1] != mode) {//正飞向其他模式,就要先飞完再飞进来然后执行
  23157. this.afterCModeFuc = function() {
  23158. /* objects.gui.modeChange[mode](null, {
  23159. fuc: f2 这个写法会使得先添加的回调fuc取代之后添加的afterCModeFuc,所以统一改为afterCModeFuc
  23160. }); */
  23161. this.afterCModeFuc = f2
  23162. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano,
  23163. //callback : f2
  23164. });
  23165. //这个fuc在trainsitioning状态下传入是无效的,所以后面得用afterCModeFuc。但是执行完afterCModeFuc,afterCModeFuc会变为null,所以里面得用fuc。。orz
  23166. }.bind(this)
  23167. } else {
  23168. if(this.afterCModeFuc)console.log("已经有afterCModeFuc了!!!!!!!!!!!!!!!")
  23169. this.afterCModeFuc = f2;//飞入后执行
  23170. try{ //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  23171. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano, duration:duration});
  23172. }catch(e){
  23173. console.log('FlyToMode遇到问题?')
  23174. }
  23175. }
  23176. }
  23177. }
  23178. n.prototype.fastForwardActivePanoFlight = function(e) {
  23179. e = e || f.transition.fastForwardFactor / 10 * 4 + 1
  23180. y.adjustSpeed(V.FlyToPano, e)
  23181. y.adjustSpeed(V.LookTransition, e)
  23182. }
  23183. ,
  23184. n.prototype.flyToPanoClosestToMouse = function() {
  23185. if (Date.now() - this.mouseLastMoveTime > 50 && (this.intersect = this.getMouseIntersect(),
  23186. this.intersect && this.updateClosestPano(this.intersect)),
  23187. this.closestPano)
  23188. return this.flyToPano({
  23189. pano: this.closestPano
  23190. });
  23191. var e = this.getMouseDirection();
  23192. this.flyDirection(e) || this.flyToPano({
  23193. pano: this.currentPano
  23194. })
  23195. }
  23196. ,
  23197. n.prototype.flyLocalDirection = function(e) {
  23198. var t = this.getDirection(e)
  23199. , i = 1 === e.z ? .4 : .75
  23200. , n = 1 === Math.abs(e.x);
  23201. return this.flyDirection(t, i, n)
  23202. }
  23203. ,
  23204. n.prototype.flyDirection = function(e, t, i) {
  23205. Hot.closePopup();//xzw add
  23206. var n = $.Deferred();
  23207. this.history.invalidate();
  23208. var r = this.closestPanoInDirection(e, t, i);
  23209. return r ? this.flyToPano({
  23210. pano: r
  23211. }, n.resolve.bind(n, !0)) : (this.bump(e),
  23212. n.resolve(!1)),
  23213. n.promise()
  23214. }
  23215. ,
  23216. n.prototype.closestPanoInDirection = function(e, t, i) {
  23217. return this.rankedPanoInDirection(0, e, t, i)
  23218. }
  23219. ,
  23220. n.prototype.rankedPanoInDirection = function() {
  23221. var e = {
  23222. pano: null,
  23223. candidates: []
  23224. };
  23225. return function(t, i, n, r) {
  23226. t || (t = 0),
  23227. n = void 0 !== n ? n : .75;
  23228. var o = r ? "angle" : "direction";
  23229. return this.model.panos.findRankedByScore(t,
  23230. [s.filters.isPanoAligned(),
  23231. s.filters.not(this.currentPano),
  23232. s.filters.isNeighbourPanoTo(this.currentPano),
  23233. s.filters.inPanoDirection(this.position, i, n)],
  23234. [s.scoreFunctions.distanceSquared(this.currentPano),
  23235. s.scoreFunctions[o](this.position, i)], e),
  23236. this.cachedPanoCandidates = e.candidates,
  23237. e.pano
  23238. }
  23239. }(),
  23240. n.prototype.bump = function(e) {
  23241. if (this.mode === u.PANORAMA && !this.flying && !this.isWarping()) {
  23242. 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;
  23243. if (s)
  23244. t = function() {
  23245. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", a > 0 ? 1.04 : .96), o, i, 0, A.easeInOutSine, "bumpZStart")
  23246. }
  23247. .bind(this),
  23248. i = function() {
  23249. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", 1), 5 * o, n, 0, A.easeInOutSine, "bumpZRelax")
  23250. }
  23251. .bind(this);
  23252. else {
  23253. var l = this.camera.position.clone()
  23254. , c = e.clone();
  23255. this.raycaster.set(l, c);
  23256. var h = this.model.floors.reduce(function(e, t) {
  23257. return e.concat(t.collider.children)
  23258. }, [])
  23259. , d = this.raycaster.intersectObjects(h)
  23260. , p = d.length > 0 ? d[0].distance / 25 : .04
  23261. , g = l.clone().add(c.multiplyScalar(p));
  23262. t = function() {
  23263. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, g), o, i, 0, A.easeInOutSine, "bumpTStart")
  23264. }
  23265. .bind(this),
  23266. i = function() {
  23267. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, l), 5 * o, n, 0, A.easeInOutSine, "bumpTRelax")
  23268. }
  23269. .bind(this)
  23270. }
  23271. n = function() {
  23272. this.flying = !1
  23273. }
  23274. .bind(this),
  23275. this.flying = !0,
  23276. t()
  23277. }
  23278. }
  23279. ,
  23280. n.prototype.changeFloor = function(e) {
  23281. if (!this.is360View(this.mode, this.currentPano))
  23282. if (this.mode === u.PANORAMA) {
  23283. var t = this.history.reversePano(e);
  23284. t && t.isAligned() ? this.flyToPano({
  23285. pano: t
  23286. }) : this.changeFloorByScore(e)
  23287. } else
  23288. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  23289. }
  23290. ,
  23291. n.prototype.changeFloorByScore = function() {
  23292. var e = {
  23293. pano: null,
  23294. candidates: []
  23295. };
  23296. return function(t) {
  23297. var i = this.model.nextFloor(t);
  23298. 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),
  23299. void (e.pano ? (this.cachedPanoCandidates = e.candidates,
  23300. this.history.push(t, this.currentPano),
  23301. this.flyToPano({
  23302. pano: e.pano
  23303. })) : F.warn("No pano found on selected floor, not moving there."))) : void F.debug("player.changeFloor(" + t + "): no such floor")
  23304. }
  23305. }(),
  23306. n.prototype.gotoFloor = function(e) {
  23307. var t = e - this.model.currentFloor.floorIndex;
  23308. this.changeFloor(t)
  23309. }
  23310. ,
  23311. n.prototype.getDirection = function(e) {
  23312. return e = e ? e : (new r.Vector3).copy(d.FORWARD),
  23313. e.applyQuaternion(this.camera.quaternion)
  23314. }
  23315. ,
  23316. n.prototype.flyToSameMode = function(e, t, i, n, o) {
  23317. if (o = o || $.Deferred(),
  23318. this.mode === u.TRANSITIONING)
  23319. return F.warn("should not be transitioning here"),
  23320. n && n(!1),
  23321. o.reject().promise();
  23322. var a = i || !1
  23323. , s = i ? i.position : this.position
  23324. , l = this.position.clone()
  23325. , c = this.currentPano;
  23326. if (F.debug("New pose in mode " + this.mode),
  23327. !e || (retryCallback = function() {
  23328. N.delayOneFrame(function() {
  23329. this.flyToSameMode(e, t, i, n, o)
  23330. }
  23331. .bind(this))
  23332. }
  23333. .bind(this),
  23334. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  23335. var h = function() {
  23336. this.emit(w.FlyingEnded, s, l, e, c),
  23337. n && n(!0)
  23338. }
  23339. .bind(this)
  23340. , d = f[this.mode]
  23341. , p = void 0 !== t ? t : d.transitionTime
  23342. , g = new r.Vector3
  23343. , C = new r.Vector3;
  23344. if (this.emit(w.FlyingStarted, s, l, e, c),
  23345. this.mode === u.PANORAMA)
  23346. F.warn("we should not be here for panorama views");
  23347. else if (this.mode === u.DOLLHOUSE)
  23348. if (a) {
  23349. var I = new r.Vector3(0,1,0);
  23350. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  23351. this.model.warpDestFloors(i.floorVisibility),
  23352. C.copy(i.position);
  23353. var E = new r.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  23354. , b = new r.Raycaster(C.clone(),E.clone(),0,1 / 0)
  23355. , _ = b.intersectObjects(this.model.colliders)
  23356. , T = 3;
  23357. _.length ? (g.copy(_[0].point),
  23358. T = .75 * C.distanceTo(g)) : (g.copy(E).multiplyScalar(3).add(C),
  23359. F.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  23360. var x = (new r.Matrix4).lookAt(C, g, I)
  23361. , S = (new r.Euler).setFromRotationMatrix(x, f.warp.eOrder)
  23362. , M = g.distanceTo(C)
  23363. , R = (new r.Matrix4).lookAt(this.cameraControls.cameras[u.DOLLHOUSE].position, this.cameraControls.controls[u.DOLLHOUSE].target, I)
  23364. , P = (new r.Euler).setFromRotationMatrix(R, f.warp.eOrder)
  23365. , O = this.cameraControls.cameras[u.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[u.DOLLHOUSE].target);
  23366. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(Math.min(O, T), !0);
  23367. var L = new r.Euler(S.x - P.x,S.y - P.y,S.z - P.z,f.warp.eOrder);
  23368. L.y = L.y > Math.PI ? L.y -= 2 * Math.PI : L.y < -Math.PI ? L.y += 2 * Math.PI : L.y,
  23369. this.path.burnsDir = Math.sign(L.y);
  23370. var D = new r.Euler(0,0,0,f.warp.eOrder)
  23371. , B = new r.Vector3;
  23372. y.start(v.vector(this.cameraControls.controls[u.DOLLHOUSE].target, g), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  23373. y.start(function(e, t) {
  23374. D.x = P.x + e * L.x,
  23375. D.y = P.y + e * L.y,
  23376. D.z = P.z + e * L.z;
  23377. var i = O + e * (M - O);
  23378. B.set(0, 0, i).applyEuler(D).add(this.cameraControls.controls[u.DOLLHOUSE].target),
  23379. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(B).add(this.model.position)
  23380. }
  23381. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  23382. y.start(function(e, t) {
  23383. this.cameraControls.controls[u.DOLLHOUSE].update(),
  23384. this.quaternion.copy(this.cameraControls.cameras[u.DOLLHOUSE].quaternion),
  23385. this.position.copy(this.cameraControls.cameras[u.DOLLHOUSE].position)
  23386. }
  23387. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  23388. } else
  23389. F.warn("invalid warp destination in flyToSameMode()? ignore it then");
  23390. else if (this.path.placeCpm(),
  23391. this.path.fadeInCpm(f.path.fadeInTime),
  23392. i) {
  23393. this.model.warpDestFloors(i.floorVisibility);
  23394. var U = this.cameraControls.cameras[u.FLOORPLAN]
  23395. , k = this.cameraControls.controls[u.FLOORPLAN]
  23396. , H = k.target.clone()
  23397. , G = i.position.clone().sub(H)
  23398. , z = U.position.clone().sub(k.target)
  23399. , W = z.length()
  23400. , j = new r.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  23401. , Y = Math.atan2(k.offset.x, k.offset.z)
  23402. , X = Math.atan2(j.x, j.z)
  23403. , Z = k.absoluteScale
  23404. , q = m.convertWorkshopOrthoZoom(i.orthoZoom);
  23405. y.start(function(e, t) {
  23406. k.target.copy(G).multiplyScalar(e).add(H);
  23407. var i = Y + (X - Y) * e;
  23408. k.offset.x = W * Math.sin(i),
  23409. k.offset.z = W * Math.cos(i),
  23410. U.position.copy(k.target).add(k.offset),
  23411. k.absoluteScale = Z + e * (q - Z),
  23412. k.update(),
  23413. this.quaternion.copy(U.quaternion),
  23414. this.position.copy(U.position),
  23415. this.target.copy(k.target),
  23416. this.camera.projectionMatrix.copy(U.projectionMatrix)
  23417. }
  23418. .bind(this), p, null, 0, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  23419. } else
  23420. F.info("flyToSameMode() funny floorplan view? skipping");
  23421. return y.setTimeout(function(e) {
  23422. this.mode = e,
  23423. h(),
  23424. o.resolve(!0)
  23425. }
  23426. .bind(this, this.mode), p, V.FlyToSameMode),
  23427. this.mode = u.TRANSITIONING,
  23428. o.promise()
  23429. }
  23430. }
  23431. ,
  23432. n.prototype.flyToNewMode = function(e, t) {
  23433. Hot.closePopup();//xzw add
  23434. e = e || {};
  23435. var i = e.mode
  23436. , n = e.pano
  23437. , o = e.duration
  23438. , a = e.warpDest
  23439. , s = e.callback
  23440. , l = e.force
  23441. , c = e.quaternion;
  23442. if (t = t || $.Deferred(),
  23443. this.isWarping())
  23444. return F.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  23445. s && s(!1),
  23446. t.reject("Cannot change mode during tour transition").promise();
  23447. if (this.mode === u.TRANSITIONING)
  23448. return s && s(!1),
  23449. t.reject("Cannot change mode during mode transition").promise();
  23450. if (i === this.mode)
  23451. return l ? (this.flyToSameMode(n, o, a, s).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  23452. t.promise()) : (s && s(!1),
  23453. t.reject("Already in " + i + " mode").promise());
  23454. var h = a || !1;
  23455. F.debug("Switching mode to " + i);
  23456. if (window.vrEnabled && i != 'panorama'){
  23457. return s && s(!1), t.reject("vr不允许飞出").promise();
  23458. }
  23459. var d = function() {
  23460. N.delayOneFrame(function() {
  23461. this.flyToNewMode(e, t)
  23462. }
  23463. .bind(this))
  23464. }
  23465. .bind(this);
  23466. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, d))
  23467. return t.promise();
  23468. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  23469. return F.info("Waiting for model textures to be loaded before going out to dollhouse"),
  23470. this.model.waitForLoad(this.model, function() {
  23471. return this.model.meshTexturesLoaded;
  23472. }
  23473. .bind(this)),
  23474. this.model.loadMeshTextures().done(d),
  23475. t.promise();
  23476. this.history.invalidate(),
  23477. this.updateLastView();
  23478. var p = this.mode
  23479. , C = this.cameraControls.cameras[i];
  23480. e = g.deepExtend({}, f[i], f[p + "-" + i]);
  23481. var I = void 0 !== o ? o : e.transitionTime;
  23482. this.emit(w.ModeChanging, p, i, n, I),
  23483. n && (this.currentPano = n),
  23484. this.switchCameraMode(i, c),
  23485. y.cancelById(V.LookTransition);
  23486. //before fly---------------------
  23487. this.modeTran = p + "-" + i; //add
  23488. if(this.mode == "panorama"){
  23489. if(this.model.floorLogos){
  23490. this.model.floorLogos[0].visible = false;
  23491. this.model.floorLogos[1].visible = false;
  23492. }
  23493. }
  23494. if(i == "panorama"){
  23495. this.transitionPos({type:"beforeFlyIn", pano:n, dur:I})//add
  23496. }else{
  23497. this.transitionPos({type:"beforeFlyOut", dur:I/2})//add
  23498. }
  23499. window.bus.dispatchEvent({type:'playerAndModelReady'})
  23500. this.ready = true
  23501. //------------------------------------
  23502. var beginTran = ()=>{
  23503. var _ = (new r.Vector3).copy(this.position);
  23504. if (i === u.PANORAMA){
  23505. this.emit(w.PanoChosen, n, n),
  23506. setTimeout(function() {
  23507. n.floor.enter(i)
  23508. }
  23509. .bind(this), I / 2),
  23510. this.path.fadeOutCpm(f.path.fadeOutTime);
  23511. if(this.model.floorLogos){
  23512. this.model.floorLogos[0].position.copy(n.floorPosition.clone().sub(this.model.position));//改
  23513. this.model.floorLogos[1].position.copy(this.model.floorLogos[0].position);//for floorIcon position
  23514. }
  23515. }else if (i === u.DOLLHOUSE) {
  23516. if (h && (this.model.stayPut = !0),
  23517. a ? (this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  23518. this.model.warpDestFloors(a.floorVisibility)) : this.model.toggleAllFloors(!0),
  23519. this.path.placeCpm(),
  23520. this.path.fadeInCpm(f.path.fadeInTime),
  23521. h) {
  23522. var T = new r.Vector3(this.model.center.x,0,this.model.center.z);
  23523. _.set(15, 10, 15);
  23524. var M = new r.Vector3(0,0,-1).applyQuaternion(a.quaternion)
  23525. , R = new r.Raycaster(a.position.clone(),M.clone(),0,1 / 0)
  23526. , P = R.intersectObjects([this.sceneIntersectionPlane]);
  23527. P.length ? (T.copy(P[0].point),
  23528. _.copy(a.position),
  23529. 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),
  23530. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(3, !0)),
  23531. this.cameraControls.controls[u.DOLLHOUSE].target.copy(T),
  23532. _.add(this.model.position),
  23533. C.position.copy(_),
  23534. this.cameraControls.controls[u.DOLLHOUSE].update()
  23535. }
  23536. } else if (this.path.placeCpm(),
  23537. this.path.fadeInCpm(f.path.fadeInTime),
  23538. a) {
  23539. this.model.warpDestFloors(a.floorVisibility);
  23540. var O = this.cameraControls.cameras[u.FLOORPLAN]
  23541. , L = this.cameraControls.controls[u.FLOORPLAN]
  23542. , D = O.position.clone().sub(L.target)
  23543. , B = new r.Vector3(-1,0,0).applyQuaternion(a.quaternion).normalize()
  23544. , U = Math.atan2(B.x, B.z);
  23545. L.target.copy(a.position);
  23546. var k = D.length();
  23547. L.offset.x = k * Math.sin(U),
  23548. L.offset.y = 0,
  23549. L.offset.z = k * Math.cos(U),
  23550. O.position.copy(L.target).add(L.offset);
  23551. L.target.clone().sub(C.position);
  23552. C.quaternion.copy(a.quaternion),
  23553. L.currentScale = m.convertWorkshopOrthoZoom(a.orthoZoom),
  23554. L.absoluteScale = L.currentScale,
  23555. L.update()
  23556. } else
  23557. this.model.currentFloor.enter(i);
  23558. var H = this.currentPano
  23559. , G = this.position.clone();
  23560. this.emit(w.FlyingStarted, _, G, n, this.currentPano),
  23561. this.flying = !0,
  23562. this.isOutsideMode(i) && this.is360View(p, H) ? (h || i !== u.DOLLHOUSE || (C.position.set(15, 10, 15),
  23563. C.controls.target.set(this.model.center.x, 0, this.model.center.z),
  23564. C.controls.update()),
  23565. e.blackoutStyle = S.FADEIN,
  23566. I = f.show360Views.transitionTime,
  23567. this.fade360View(I, C, e)) : this.isOutsideMode(p) && this.is360View(i, n) ? (h && this.switchCameraMode(i, h.quaternion),
  23568. this.mode = i,
  23569. this.path && this.path.popOutCpm(),
  23570. e.blackoutStyle = S.END,
  23571. I = f.show360Views.transitionTime,
  23572. this.fade360View(I, C, e)) : (y.start(v.property(this.model, "alpha", e.modelAlpha, null), I * e.modelAlphaLength, null, e.modelAlphaDelay, null, V.FlyToNewMode),
  23573. y.start(v.vector(this.position, C.position), I, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToNewMode),
  23574. y.start(v.quaternion(this.quaternion, C.quaternion), I * e.rotationDuration, null, e.rotationDelay, A[f.flydown.rotationEasing], null, V.FlyToNewMode),
  23575. y.start(v.matrix4(this.camera.projectionMatrix, C.projectionMatrix), I * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, V.FlyToNewMode),
  23576. y.start(v.uniform(this.model.skybox, "opacity", e.skyboxOpacity), I * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, V.FlyToNewMode),
  23577. y.start(v.property(this.reticule.material.uniforms.opacity, "value", 0), I, null, V.FlyToNewMode)),
  23578. y.setTimeout(function() {
  23579. this.flying = !1,
  23580. p === u.PANORAMA && i !== u.PANORAMA ? this.currentPano.exit() : p !== u.PANORAMA && i === u.PANORAMA && (this.currentPano !== H && H.exit(),
  23581. this.currentPano.enter(),
  23582. this.path.placeCpm(),
  23583. this.path.fadeOutCpm(f.path.fadeOutTime),
  23584. this.spider.draw()),
  23585. p === u.DOLLHOUSE && this.cameraControls.controls[u.DOLLHOUSE].resetRanges(),
  23586. this.mode = i,
  23587. this.emit(w.FlyingEnded, _, G, this.currentPano, H)
  23588. //add:
  23589. this.updateMarkerVisi() ;
  23590. //(this.mode == u.PANORAMA) && this.updateHotVisible(),
  23591. this.mode == u.PANORAMA&&this.model.floorLogos&&(
  23592. this.model.changefloorLogoOpa({index:0, from:0, opa:1, dur: 150 }),//this.model.floorLogoShow(0,150);
  23593. this.model.floorLogos[0].visible = true
  23594. )
  23595. if (this.afterCModeFuc) {
  23596. //手动加的函数
  23597. var cf = this.afterCModeFuc;
  23598. this.afterCModeFuc = null;//因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  23599. cf();
  23600. }
  23601. if(this.mode == u.PANORAMA){
  23602. Hot.updateVisibles([this.currentPano])
  23603. this.model.fadePanoMarkers()
  23604. }else{
  23605. Hot.updateVisibles(true)
  23606. this.model.hotGroup.children.forEach(overlay=>{
  23607. if(overlay.animateInfo){
  23608. GifTexDeal.start(overlay.animation)
  23609. }
  23610. })
  23611. }
  23612. h && p !== u.PANORAMA && i === u.PANORAMA ? this.startWarp(b.Retain, E.Retain, x.BLACK, null, null, s) : (s && s(),
  23613. t.resolve())
  23614. }
  23615. .bind(this), I, V.FlyToNewMode)
  23616. }
  23617. if( i == "panorama" && !this.model.supportsTiles && n.getSkyboxTexture().image[0].width > 1024){
  23618. setTimeout(()=>{
  23619. beginTran()
  23620. },16) //2048的非tile需要延迟到下一帧,因为需要时间载入贴图,否则掉帧
  23621. }else{
  23622. beginTran()
  23623. }
  23624. this.mode = u.TRANSITIONING
  23625. //p == "panorama" && this.updateHotVisible(),
  23626. return t.promise()
  23627. }
  23628. ,
  23629. n.prototype.fade360View = function(e, t, i) {
  23630. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  23631. $(this.domElement).fadeOut(.5 * e, function() {
  23632. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  23633. this.model.alpha = i.modelAlpha,
  23634. this.position.copy(t.position),
  23635. this.quaternion.copy(t.quaternion),
  23636. this.camera.projectionMatrix.copy(t.projectionMatrix),
  23637. $(this.domElement).fadeIn(.5 * e)
  23638. }
  23639. .bind(this))
  23640. }
  23641. ,
  23642. n.prototype.findDefaultViews = function() {
  23643. this.findDefaultView(this.lastInsideView, !0),
  23644. this.findDefaultView(this.last360View, !1)
  23645. }
  23646. ,
  23647. n.prototype.findDefaultView = function(e, t) {
  23648. var i, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  23649. if (e.cameraMode !== u.PANORAMA)
  23650. return !1;
  23651. var i = r.get(e.panoId);
  23652. return i && i.isAligned() === t
  23653. });
  23654. o >= 0 ? (i = r.get(n[o].panoId),
  23655. e.update({
  23656. cameraMode: u.PANORAMA,
  23657. pano: i,
  23658. position: n[o].position,
  23659. quaternion: n[o].quaternion
  23660. })) : (o = r.list.findIndex(function(e) {
  23661. return e.isAligned() === t
  23662. }),
  23663. o >= 0 ? (i = r.list[o],
  23664. e.update({
  23665. cameraMode: u.PANORAMA,
  23666. pano: i,
  23667. position: i.position
  23668. })) : F.warn("There are no", t ? "inside" : "360º", "views in this model"))
  23669. }
  23670. ,
  23671. n.prototype.updateLastView = function() {
  23672. if (this.mode === u.PANORAMA) {
  23673. var e = this.currentPano.isAligned() ? this.lastInsideView : this.last360View;
  23674. e.update({
  23675. pano: this.currentPano,
  23676. position: this.position,
  23677. quaternion: this.quaternion
  23678. })
  23679. }
  23680. }
  23681. ,
  23682. n.prototype.goToLastView = function(e, t) {
  23683. var i = $.Deferred()
  23684. , n = i.resolve.bind(i)
  23685. , r = i.reject.bind(i)
  23686. , o = e ? this.lastInsideView : this.last360View;
  23687. return this.isInMode(u.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  23688. this.isInMode(u.PANORAMA) ? (this.path && this.path.popOutCpm(),
  23689. this.fadeToView(e, o, f.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  23690. mode: o.cameraMode,
  23691. pano: o.pano,
  23692. quaternion: o.quaternion,
  23693. callback: t
  23694. }).done(n).fail(r),
  23695. i.promise()
  23696. }
  23697. ,
  23698. n.prototype.fadeToView = function(e, t, i, n) {
  23699. var r = $.Deferred()
  23700. , o = r.resolve.bind(r)
  23701. , a = r.reject.bind(r);
  23702. if (!t.isValid() || t.cameraMode === u.PANORAMA && !t.pano)
  23703. return F.warn("Tried to fade to an illegal view", t.cameraMode),
  23704. a("Cannot go to illegal view"),
  23705. r.promise();
  23706. var s = (f[t.cameraMode],
  23707. function() {
  23708. $(this.domElement).fadeIn(.5 * i),
  23709. n && n(),
  23710. o()
  23711. }
  23712. .bind(this))
  23713. , l = e ? S.FADEIN : S.END;
  23714. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  23715. $(this.domElement).fadeOut(.5 * i, function() {
  23716. this.model.fadePanoMarkers(e ? f.panorama.markerOpacity : 0),
  23717. t.cameraMode === u.PANORAMA ? this.flyToPano({
  23718. pano: t.pano,
  23719. lookAtPoint: d.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  23720. duration: 0
  23721. }, s) : this.flyToNewMode({
  23722. mode: t.cameraMode,
  23723. quaternion: t.quaternion,
  23724. duration: 0,
  23725. callback: s
  23726. })
  23727. }
  23728. .bind(this)),
  23729. r.promise()
  23730. }
  23731. ,
  23732. n.prototype.startWarp = function(e, t, i, n, r, o) {
  23733. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  23734. this.flying)
  23735. return F.warn("Player.startWarp() -> Cannot warp when flying"),
  23736. o && o(),
  23737. !1;
  23738. null !== e && void 0 !== e || (e = b.Show),
  23739. this.history.invalidate()
  23740. e !== b.Retain ? this.path.brushToWarpPano(i, x.BLACK) || (i = x.BLACK) : i = this.path.upcomingTransType;
  23741. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  23742. return this.emit(w.WarpStarted, a, i, n, r),
  23743. n = n || S.MIDDLE,
  23744. this.path.warpToPano(i, n, r, function() {
  23745. t === E.Slow ? this.path.discardSlow() : t === E.Standard && this.path.discardPathObject(),
  23746. this.emit(w.WarpEnded, i),
  23747. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  23748. o && o()
  23749. }
  23750. .bind(this)),
  23751. e === b.Hide && this.path.discardPathObject(),
  23752. !0
  23753. }
  23754. ,
  23755. n.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  23756. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (F.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  23757. s && s(),
  23758. !1)
  23759. }
  23760. ,
  23761. n.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  23762. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (F.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  23763. a && a(),
  23764. !1)
  23765. }
  23766. ,
  23767. n.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  23768. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  23769. }
  23770. ,
  23771. n.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  23772. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  23773. !0) : (F.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  23774. t && t(),
  23775. !1)
  23776. }
  23777. ,
  23778. n.prototype.aimTourCamera = function(e, t, i, n) {
  23779. return F.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  23780. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  23781. }
  23782. ,
  23783. n.prototype.showPathToHeroLocation = function(e) {
  23784. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(x.STD, x.BLACK)
  23785. }
  23786. ,
  23787. n.prototype.tourInterlude = function(e, t) {
  23788. this.history.invalidate();
  23789. this.path.discardSlow();
  23790. //xzw:
  23791. var defaultRotTime = DATA.tourRotTime * 1000
  23792. var timeEachItem = 2e3 / (DATA.tourWalkSpeed + DATA.tourBlackSpeed) * 200 //预估时间假设每个item飞的时间(如果距离远就少了)
  23793. var currentLocation = this.model.getHeroDescriptorByIndex(this.director.currentItem)
  23794. var currentLocation0 = this.model.heroLocations[this.director.currentItem[0]]
  23795. //zeg 标注一下
  23796. //var currentLocation = this.model.heroLocations[this.director.currentItem[0]]
  23797. var rotTime
  23798. if(currentLocation.rotTime == void 0 || currentLocation.rotTime == ''){
  23799. var restChildCount = currentLocation0.heroLocations ? (currentLocation0.heroLocations.length-this.director.currentItem[1]-1) : 0
  23800. var hasMusic = currentLocation0 && currentLocation0.musicInfo.music
  23801. if(hasMusic){
  23802. var audioObj = SoundManager.list.find(e=>e.name == 'tour')
  23803. var current = audioObj.audio.currentTime * 1e3 // || 0 //g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  23804. rotTime = currentLocation0.musicInfo.time - current
  23805. if(restChildCount){//如果当前folder中还有剩下的item,平分一下时间
  23806. rotTime = (rotTime-timeEachItem*restChildCount) / (restChildCount+1);
  23807. }
  23808. }else{
  23809. rotTime = defaultRotTime
  23810. }
  23811. rotTime = Math.max(0, rotTime)
  23812. Log("rotTime "+rotTime +" at item "+this.director.currentItem + (hasMusic ? (",musicCurrentTime:"+current+'音乐总长:'+currentLocation0.musicInfo.time) : ''),"#E8E")
  23813. }else{
  23814. rotTime = currentLocation.rotTime * 1000
  23815. Log("rotTime "+rotTime +" at item "+this.director.currentItem,"#E8E")
  23816. }
  23817. this.path.waitNextStep(e, function() {
  23818. t && t()
  23819. }.bind(this), rotTime)
  23820. }
  23821. ,
  23822. n.prototype.stopInterlude = function() {
  23823. this.interruptAndFastForward(null, 0)
  23824. }
  23825. ,
  23826. n.prototype.interruptAndFastForward = function(e, t) {
  23827. //Log('interruptAndFastForward' , '#f00')
  23828. this.isWarping() && this.emit(w.WarpInterrupted, this.path.activeTransType, e, t),
  23829. this.flying && this.emit(w.FlyingInterrupted),
  23830. this.path.interruptAndFastForward(e, t)
  23831. }
  23832. ,
  23833. n.prototype.setSize = function(e, t) {
  23834. var i = e / t;
  23835. this.baseFov = B.clampVFOV(f.insideFOV, f.insideFOVMax, e, t);
  23836. var n = B.getHFOVFromVFOV(f.insideFOV, e, t);
  23837. n > f.insideFOVMax ? this.baseFov = B.getVFOVFromHFOV(f.insideFOVMax, e, t) : this.baseFov = f.insideFOV;
  23838. for (var r in this.cameraControls.cameras) {
  23839. var o = this.cameraControls.cameras[r];
  23840. o.fov = this.baseFov * (1 / this.zoomLevel),
  23841. o.updateAspect(i)
  23842. }
  23843. }
  23844. ,
  23845. n.prototype.toJSON = function() {
  23846. var e = {};
  23847. return this.cameraControls.activeControl ? (e = this.cameraControls.activeControl.toJSON(),
  23848. e.camera_mode = u.toInt(this.mode),
  23849. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  23850. return e.hidden ? 0 : 1
  23851. }) : u.PANORAMA && (e.scan_id = this.currentPano.id),
  23852. e) : e
  23853. }
  23854. ,
  23855. n.prototype.getCurrentNodePanos = function(e) {
  23856. this.model.panos.map;
  23857. if (e.length = 0, this.path.nodes){
  23858. var momentTour = this.director.getMomentTour(this.director.destinationItem)
  23859. if(momentTour == 'black'){ //改 upcomingPanos如果是black的只需要起点和终点
  23860. if(this.path.nodes.length){
  23861. e.push(this.model.panos.get(this.path.nodes[0]))
  23862. }
  23863. if(this.path.nodes.length>1){
  23864. e.push(this.model.panos.get(this.path.nodes[this.path.nodes.length-1]))
  23865. }
  23866. }else{
  23867. for (var t = 0; t < this.path.nodes.length; t++) {
  23868. var i = this.path.nodes[t];
  23869. e.push(this.model.panos.get(i))
  23870. }
  23871. }
  23872. }
  23873. }
  23874. ,
  23875. n.prototype.zoomIncrementally = function(e) {
  23876. var t = this.zoomLevel;
  23877. this.zoomTo(this.zoomLevel + e),
  23878. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  23879. }
  23880. ,
  23881. n.prototype.zoomInIncrementally = function(e) {
  23882. e = e || this.defaultZoomIncrement,
  23883. this.zoomIncrementally(e)
  23884. }
  23885. ,
  23886. n.prototype.zoomOutIncrementally = function(e) {
  23887. e = e || -this.defaultZoomIncrement,
  23888. this.zoomIncrementally(e)
  23889. }
  23890. ,
  23891. n.prototype.zoomBy = function(e) {
  23892. this.zoomTo(this.zoomLevel * e)
  23893. }
  23894. ,
  23895. n.prototype.zoomIn = function() {
  23896. this.zoomBy(1 + this.zoomSpeed)
  23897. }
  23898. ,
  23899. n.prototype.zoomOut = function() {
  23900. this.zoomBy(1 - this.zoomSpeed)
  23901. }
  23902. ,
  23903. n.prototype.zoomTo = function(e, t) {
  23904. if (t || f.zoom.enabled && this.mode === u.PANORAMA && this.zoomEnabled) {
  23905. if (e < f.zoom.min && (e = f.zoom.min),
  23906. e > f.zoom.max && (e = f.zoom.max),
  23907. e > this.zoomLevel ? (this.emit(O.ZoomIn),
  23908. e === f.zoom.max && this.emit(O.ZoomMax)) : e < this.zoomLevel && (this.emit(O.ZoomOut),
  23909. e === f.zoom.min && this.emit(O.ZoomMin)),
  23910. this.cameraControls.activeControl) {
  23911. var i = this.cameraControls.activeControl.camera;
  23912. this.zoomLevel = e,
  23913. i.fov = this.baseFov * (1 / this.zoomLevel),
  23914. i.updateProjectionMatrix(),
  23915. this.zoomFov = i.fov
  23916. }
  23917. }
  23918. }
  23919. ,
  23920. n.prototype.increaseZoomSpeed = function() {
  23921. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  23922. }
  23923. ,
  23924. n.prototype.decreaseZoomSpeed = function() {
  23925. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  23926. }
  23927. ,
  23928. n.prototype.clampZoomSpeed = function(e) {
  23929. return e < 0 ? 0 : e
  23930. }
  23931. ,
  23932. n.prototype.activatePersistentZooming = function(e) {
  23933. this.zooming = e ? 1 : -1
  23934. }
  23935. ,
  23936. n.prototype.deactivatePersistentZooming = function() {
  23937. this.zooming = 0
  23938. }
  23939. ,
  23940. n.prototype.zoomDefault = function() {
  23941. this.zoomTo(1, !0)
  23942. }
  23943. ,
  23944. window.fovTranId = 333;//add
  23945. n.prototype.smoothZoomToDefault = function(e, t) {
  23946. y.cancelById(window.fovTranId)
  23947. var i, n = this.zoomLevel,
  23948. r = function(e) {
  23949. e > 1 && (e = 1),
  23950. i = n * (1 - e) + e,
  23951. this.zoomTo(i, !0)
  23952. }.bind(this),
  23953. o = function() {
  23954. this.zoomDefault(),
  23955. t && window.setTimeout(t, 50)
  23956. }.bind(this);
  23957. y.start(r, e, o, null, 0, A[f.transition.blendEasing], null, window.fovTranId)
  23958. }
  23959. n.prototype.smoothZoomFovTo = function (fov, zoomLevel, dur, callback) {//add
  23960. y.cancelById(window.fovTranId)
  23961. console.log("smoothZoomFovTo "+zoomLevel)
  23962. var i,
  23963. n = this.zoomLevel,
  23964. aimLevel = zoomLevel || this.baseFov / fov
  23965. if (n == aimLevel) return
  23966. var fun = function (e) {
  23967. e > 1 && (e = 1), (i = n * (1 - e) + e * aimLevel),
  23968. this.zoomTo(i, !0)
  23969. }.bind(this)
  23970. y.start(fun, dur, callback, null, 0, A[f.transition.blendEasing], null, window.fovTranId)
  23971. }
  23972. n.prototype.updateZoomPano = function() {
  23973. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === u.PANORAMA && this.currentPano) {
  23974. let navTileClass = this.qualityManager.getNavZoomClass()
  23975. let tileClass = this.qualityManager.getMaxZoomClass()
  23976. if(navTileClass == '4k'){
  23977. var r = true
  23978. }else{
  23979. var levelThreshold1 = navTileClass == '1k' ? 1.1 : 1.5 , levelThreshold2 = 1.8 //levelThreshold2不能比zoom.max大也就是不能超过2,否则zoom.max将无法提升到3
  23980. var t = this.zoomLevel > levelThreshold1
  23981. , i = this.flying && this.nextPano && this.nextPano !== this.currentPano
  23982. , n = !i && !this.isWarping()
  23983. , r = t //&& n ; // 允许flying状态下加载4K图
  23984. }
  23985. this.tileDownloader.tilePrioritizer.setZoomingActive(r),
  23986. this.panoRenderer.setZoomingActive(r, this.currentPano, !0);
  23987. var o = function(pano, ifZoom) {
  23988. this.panoRenderer.resetRenderStatus(pano.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  23989. this.panoRenderer.clearAllQueuedUploadsForPano(pano.id),
  23990. this.panoRenderer.renderPanoTiles(pano.id, null, !1, !1),
  23991. pano.setZoomed(ifZoom)
  23992. }.bind(this);
  23993. if(navTileClass == '4k'){
  23994. if (!this.currentPano.zoomed) {
  23995. o(this.currentPano, !0);
  23996. this.panoRenderer.enableUltraHighQualityMode(function() {//开启4k getMaxZoomPanoSize
  23997. this.qualityManager.useUltraHighResolutionPanos && (f.zoom.max = D.ultraHighQualityMaxZoom);
  23998. o(this.currentPano, !0)
  23999. }
  24000. .bind(this));
  24001. }
  24002. }else{
  24003. let zoomLevelRes = this.qualityManager.zoomLevelResolution
  24004. if (r && (!this.currentPano.zoomed || zoomLevelRes && zoomLevelRes != '4k')) {//needZoom
  24005. this.currentPano.zoomed || o(this.currentPano, !0);
  24006. if(navTileClass == '1k' && tileClass != '1k' && this.zoomLevel < levelThreshold2){
  24007. this.panoRenderer.enableHighQuality( function() {//开启2k
  24008. if(tileClass != '4k'){
  24009. o(this.currentPano, !0);
  24010. }
  24011. }.bind(this));
  24012. }else{
  24013. this.panoRenderer.enableUltraHighQualityMode(function() {//开启4k getMaxZoomPanoSize
  24014. this.qualityManager.useUltraHighResolutionPanos && !f.zoom.overridemax && (f.zoom.max = D.ultraHighQualityMaxZoom)
  24015. o(this.currentPano, !0)
  24016. }.bind(this));
  24017. }
  24018. } else {
  24019. !t && this.currentPano.zoomed && o(this.currentPano, !1);
  24020. }
  24021. //有三个级别的话,需要标记zoomLevelResolution,以便更新maxZoomPanoSize判断能下载的最高级别
  24022. if(r && navTileClass == '1k' && tileClass == '4k' ){ //目前只有手机端navTileClass == '1k'
  24023. var change = (zoomedFlag)=>{
  24024. this.qualityManager.updateMaximums()//更新maxZoomPanoSize
  24025. this.panoRenderer.setupZoomRenderTarget() //更新renderTarget
  24026. //this.currentPano.setZoomed(t);//更新uniforms贴图
  24027. if(this.qualityManager.zoomLevelResolution == '4k'){
  24028. this.model.showHighMap()
  24029. }else{
  24030. this.model.hideHighMap()
  24031. }
  24032. }
  24033. this.qualityManager.zoomLevelResolution = this.zoomLevel >= levelThreshold2 ? '4k' : this.zoomLevel > levelThreshold1? '2k' : '1k'
  24034. if(this.oldZoomLevel < levelThreshold2 && this.zoomLevel >= levelThreshold2){//1k/2k-4k
  24035. change()
  24036. o(this.currentPano, t)
  24037. }else if(this.oldZoomLevel <= levelThreshold1 && this.zoomLevel > levelThreshold1){//1k-2k
  24038. change()
  24039. }else if(this.oldZoomLevel > levelThreshold2 && this.zoomLevel <= levelThreshold2){//4k-2k/1k
  24040. change()
  24041. o(this.currentPano, t)
  24042. }else if(this.oldZoomLevel > levelThreshold1 && this.zoomLevel <= levelThreshold1){//2k-1k
  24043. change()
  24044. }
  24045. this.oldZoomLevel = this.zoomLevel
  24046. }
  24047. }
  24048. }
  24049. }
  24050. n.prototype.checkHasNeighbor = function(pano){//add
  24051. for(var i in pano.neighbourPanos ){
  24052. if(i == pano.id)continue;
  24053. if(pano.neighbourPanos[i]){
  24054. return true;
  24055. }
  24056. }
  24057. }
  24058. ,
  24059. t.exports = n
  24060. }
  24061. ).call(this, "/js/player.js")
  24062. }
  24063. , {
  24064. "./constants": 8,
  24065. "./enum/AlignmentType": 17,
  24066. "./enum/BlackoutStyle": 18,
  24067. "./enum/ControlEvents": 21,
  24068. "./enum/Keys": 30,
  24069. "./enum/ModelManagerEvents": 33,
  24070. "./enum/PanoSizeClass": 36,
  24071. "./enum/PanoramaEvents": 37,
  24072. "./enum/PathDiscardMode": 38,
  24073. "./enum/PathDisplayMode": 39,
  24074. "./enum/PlayerEvents": 40,
  24075. "./enum/TagStates": 44,
  24076. "./enum/Vectors": 50,
  24077. "./enum/Viewmode": 51,
  24078. "./enum/WarpStyle": 52,
  24079. "./enum/ZoomEvents": 53,
  24080. "./exception/BasicException": 55,
  24081. "./model/ModelManager": 140,
  24082. "./objects/NSpider": 147,
  24083. "./objects/Panorama": 148,
  24084. "./objects/Reticule": 149,
  24085. "./objects/ShowPath": 151,
  24086. "./objects/Snapshot": 153,
  24087. "./objects/View": 154,
  24088. "./settings": 166,
  24089. "./shaders": 167,
  24090. "./tile/TileDownloader": 171,
  24091. "./tile/TilePrioritizer": 172,
  24092. "./util/ZoomStats": 179,
  24093. "./util/browser": 182,
  24094. "./util/camera": 183,
  24095. "./util/cameraLight": 184,
  24096. "./util/common": 185,
  24097. "./util/easing": 186,
  24098. "./util/history": 187,
  24099. "./util/lerp": 188,
  24100. "./util/logger": 189,
  24101. "./util/math": 190,
  24102. "./util/transitions": 195,
  24103. "hot":"hot",
  24104. "scaleImg":"scaleImg",
  24105. events: 202,
  24106. three: 217
  24107. }],
  24108. "scaleImg":[function(t, e){// xzw
  24109. var OUTPUT = e;
  24110. (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")}
  24111. function n(t){if(t){var e,a=G.getImageData(0,0,s,f),i=a.data;for(e=0;at>e;e+=4)
  24112. 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}
  24113. return G.getImageData(0,0,s,f)}
  24114. 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}
  24115. a||(a=t.input,i=t.output,r=t.inputRemovable,t.scale&&(t=t.scale));var u,d;if(a.src)
  24116. if(u=document.createElement("canvas"),null!=a.naturalWidth)
  24117. 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}
  24118. else
  24119. 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)
  24120. 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)
  24121. for(h(),J=n(),K=J.data,x=0;f>x;x++)
  24122. 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)
  24123. 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)
  24124. W=new Float32Array(at);else
  24125. for(W=[],et=0;at>et;++et)
  24126. W[et]=0;for(b=0;w>b;b++)
  24127. 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)
  24128. 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;}
  24129. delete p,h(),J=n(W)}
  24130. 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}
  24131. if("png-src"===i||"jpeg-src"===i)
  24132. return B.toDataURL("image/"+i.split("-")[0],0.85)}
  24133. return B}
  24134. var e=this;"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=t),exports.scale=t):c=t}).call(this);
  24135. OUTPUT.exports = c;
  24136. }, {}
  24137. ],
  24138. 156: [function(e, t, i) {
  24139. (function(i) {
  24140. "use strict";
  24141. function n(e, t) {
  24142. this.model = e,
  24143. this.panos = e.panos,
  24144. this.player = t,
  24145. this.imagePanos = this.listImagePanos(),
  24146. this.retryMinimumTime = 1e4
  24147. }
  24148. var r = (e("three"),
  24149. e("./enum/Viewmode"))
  24150. , o = (e("./settings"),
  24151. e("./objects/Panorama"))
  24152. , a = e("./util/logger")
  24153. , s = new a(i);
  24154. n.prototype.start = function() {
  24155. this.loadNextPano(function(e) {
  24156. e ? this.start() : (s.debug("No suitable pano loaded, waiting a little while before looking again"),
  24157. setTimeout(function() {
  24158. this.start()
  24159. }
  24160. .bind(this), 1e3))
  24161. }
  24162. .bind(this))
  24163. }
  24164. ,
  24165. n.prototype.validLoadTarget = function(e) {
  24166. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  24167. }
  24168. ,
  24169. n.prototype.listImagePanos = function() {
  24170. var e = []
  24171. , t = this;
  24172. return this.model.images.forEach(function(i) {
  24173. if (i.metadata && i.metadata.scan_id) {
  24174. var n = t.model.panos.get(i.metadata.scan_id);
  24175. n && !n.isLoaded("high") && e.push(n)
  24176. }
  24177. }),
  24178. e
  24179. }
  24180. ,
  24181. n.prototype.nextNotLoadedImage = function() {
  24182. for (; this.imagePanos.length > 0; ) {
  24183. var e = this.imagePanos[0];
  24184. if (!e.isLoaded("high"))
  24185. return e;
  24186. this.imagePanos.shift()
  24187. }
  24188. return null
  24189. }
  24190. ,
  24191. n.prototype.loadNextPano = function(e) {
  24192. var t, i, n = this.model.waitQueue.filter(function(e) {
  24193. return e.object instanceof o
  24194. });
  24195. n.length > 0 ? (t = n[0].object,
  24196. s.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  24197. s.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  24198. s.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  24199. t = this.imagePanos[0],
  24200. 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())]),
  24201. t && s.debug("Normal pano selection: neighbor " + t.id)),
  24202. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  24203. s.debug("Preloading " + i + "-res pano " + t.id),
  24204. t.loadCube(i).done(e).fail(function() {
  24205. s.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  24206. e()
  24207. })) : e && e(null)
  24208. }
  24209. ,
  24210. t.exports = n
  24211. }
  24212. ).call(this, "/js/preloaders.js")
  24213. }
  24214. , {
  24215. "./enum/Viewmode": 51,
  24216. "./objects/Panorama": 148,
  24217. "./settings": 166,
  24218. "./util/logger": 189,
  24219. three: 217
  24220. }],
  24221. 157: [function(e, t, i) {
  24222. (function(i) {
  24223. "use strict";
  24224. function n(e, t, i, n, r) {
  24225. this.qualityManager = e,
  24226. this.scene = t,
  24227. this.camera = i,
  24228. this.container = r,
  24229. this.controls = n,
  24230. this.controls.enabled = !0,
  24231. this.controls.locked = !0,
  24232. this.quickstartCamera = n.camera,
  24233. this.quickstartCamera.fov = h.clampVFOV(a.insideFOV, a.insideFOVMax, $("#player").width(), $("#player").height()),
  24234. this.skybox = null
  24235. }
  24236. var r = e("three")
  24237. , o = e("../util/logger")
  24238. , a = e("../constants")
  24239. , s = (e("../util/transitions"),
  24240. e("../util/lerp"),
  24241. e("../util/easing"),
  24242. e("../enum/Vectors"))
  24243. , l = e("../enum/PanoSizeClass")
  24244. , c = (e("../materials/ModelTextureMaterial"),
  24245. e("../materials/CubemapMaterial"))
  24246. , h = (e("../cameras/PanoramaCamera"),
  24247. e("../controls/PanoramaControls"),
  24248. e("../tile/TileUtils"),
  24249. e("../util/camera"),
  24250. e("../util/cameraLight"))
  24251. , u = (e("../util/browser"),
  24252. e("../settings"),
  24253. e("../gui/helpManager"),
  24254. new o(i));
  24255. n.prototype.load = function(e) {
  24256. e.pano.shouldRedrawOnBaseLoaded = !0;
  24257. var t, i, n = this, r = s.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  24258. this.controls.lookAt(r.add(this.quickstartCamera.position));
  24259. var a = this.qualityManager.getPanoSize(l.BASE)
  24260. , c = this.qualityManager.getPanoSize(l.STANDARD);
  24261. if (e.pano.tiled) {
  24262. u.warn("Loading startPano, TILED", e.pano.id);
  24263. var d = h.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  24264. , p = this.quickstartCamera.fov;
  24265. u.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + d + ", vertical FOV: " + p + "]"),
  24266. t = e.pano.loadTiledPano(c, r, {
  24267. hFov: d,
  24268. vFov: p
  24269. }, !1, !1, !0),
  24270. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  24271. } else
  24272. u.warn("Loading startPano", e.pano.id),
  24273. t = e.pano.loadCube("high");
  24274. return $.when(t).then(function() {
  24275. n.init(e.pano, e.quaternion),
  24276. e.pano.tiled ? i.done(function() {
  24277. e.pano.lockUntilRenderingComplete = !1,
  24278. this.controls.locked = !1
  24279. }
  24280. .bind(this)) : this.controls.locked = !1
  24281. }
  24282. .bind(this))
  24283. }
  24284. ,
  24285. n.prototype.init = function(e, t) {
  24286. u.info("Quickstart done loading, adding scene objects"),
  24287. e.lockUntilRenderingComplete = !0,
  24288. this.skybox = new r.Mesh(new r.CubeGeometry(1,1,1),new c({
  24289. side: r.BackSide
  24290. })),
  24291. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  24292. this.skybox.quaternion.copy(e.quaternion),
  24293. this.scene.add(this.skybox),
  24294. $(this.container).show()
  24295. }
  24296. ,
  24297. n.prototype.update = function(e) {
  24298. this.controls.update(e),
  24299. this.camera.copy(this.quickstartCamera)
  24300. }
  24301. ,
  24302. n.prototype.setSize = function(e, t) {
  24303. this.quickstartCamera.updateAspect(e / t)
  24304. }
  24305. ,
  24306. n.prototype.destroy = function() {
  24307. this.scene.remove(this.skybox)
  24308. }
  24309. ,
  24310. t.exports = n
  24311. }
  24312. ).call(this, "/js/scene/QuickstartManager.js")
  24313. }
  24314. , {
  24315. "../cameras/PanoramaCamera": 7,
  24316. "../constants": 8,
  24317. "../controls/PanoramaControls": 13,
  24318. "../enum/PanoSizeClass": 36,
  24319. "../enum/Vectors": 50,
  24320. "../gui/helpManager": 68,
  24321. "../materials/CubemapMaterial": 117,
  24322. "../materials/ModelTextureMaterial": 118,
  24323. "../settings": 166,
  24324. "../tile/TileUtils": 174,
  24325. "../util/browser": 182,
  24326. "../util/camera": 183,
  24327. "../util/cameraLight": 184,
  24328. "../util/easing": 186,
  24329. "../util/lerp": 188,
  24330. "../util/logger": 189,
  24331. "../util/transitions": 195,
  24332. three: 217
  24333. }],
  24334. 158: [function(e, t, i) {
  24335. "use strict";
  24336. function n(e, t, i) {
  24337. this.scene = e,
  24338. this.camera = t,
  24339. this.renderer = null,
  24340. this.effects = i,
  24341. this.animateCallback = null,
  24342. this.composer = null,
  24343. this.qualityManager = null,
  24344. e.renderWidth = 0,
  24345. e.renderHeight = 0,
  24346. this.updateClock = new r.Clock,
  24347. this.components = [],
  24348. this.updateListeners = [],
  24349. this.resizeListeners = [],
  24350. this.forceUpdateSize = !1,
  24351. this.started = !1,
  24352. this.textures = {},
  24353. this.suspendedObjects = []
  24354. }
  24355. var r = e("three")
  24356. , o = e("../shaders")
  24357. , a = e("../enum/SceneRendererEvents")
  24358. , s = e("../enum/GLTextureType")
  24359. , l = e("../enum/GLCubeFaces")
  24360. , c = e("../exception/BasicException")
  24361. , h = e("../exception/RendererCreationException")
  24362. /**********************************************************************fyz改 from徐世廷**********************************************************************/
  24363. , m = e("../util/browser")
  24364. /**************************************************************************************************************************************************/
  24365. , u = e("../settings")
  24366. , d = e("events").EventEmitter;
  24367. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  24368. n.prototype = Object.create(d.prototype),
  24369. n.prototype.addComponent = function(e) {
  24370. this.components.push(e),
  24371. e.update && this.updateListeners.push(e),
  24372. e.setSize && (this.resizeListeners.push(e),
  24373. this.forceUpdateSize = !0)
  24374. }
  24375. ,
  24376. n.prototype.removeComponent = function(e) {
  24377. var t = function(t) {
  24378. return t !== e
  24379. };
  24380. this.components = this.components.filter(t),
  24381. this.updateListeners = this.updateListeners.filter(t),
  24382. this.resizeListeners = this.resizeListeners.filter(t)
  24383. }
  24384. ,
  24385. n.prototype.start = function(e) {
  24386. if (this.started)
  24387. throw new c("Can't start SceneRenderer, already started");
  24388. this.createContext(e),
  24389. /***************************************************VR fyz改 from徐世廷**********************************************************************/
  24390. /* m.isMobile() && */this.boluoVrInit(),
  24391. /*******************************************************************************************************************************/
  24392. this.initComposer(),
  24393. this.started = !0,
  24394. (p = p.bind(this))()
  24395. }
  24396. ,
  24397. n.prototype.createContext = function(e) {
  24398. var transparent = !!(settings.transparentBg || settings.bgImg)
  24399. try {
  24400. this.renderer = new r.WebGLRenderer({antialias: !m.isMobile(), alpha:transparent}),
  24401. this.renderer.autoClear = !0,
  24402. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  24403. this.renderer.setSize($("#player").width(), $("#player").height(), false), //改
  24404. transparent && this.renderer.setClearColor( 0x000000, 0 ); //透明
  24405. this.emit(a.ContextCreated)
  24406. } catch (e) {
  24407. throw new h("Unable to create a WebGL rendering context")
  24408. }
  24409. u.profiling.enabled && this.overrideTextures(),
  24410. e.appendChild(this.renderer.domElement)
  24411. /* window.stats = new Stats();
  24412. e.appendChild( stats.dom ); */
  24413. }
  24414. ,
  24415. n.prototype.overrideTextures = function() {
  24416. var e = this.renderer.context
  24417. , t = 0
  24418. , i = e.createTexture;
  24419. e.createTexture = function() {
  24420. var n = i.call(e);
  24421. return n.id = t++,
  24422. this.textures[n.id] = n,
  24423. n
  24424. }
  24425. .bind(this);
  24426. var n = e.texImage2D;
  24427. e.texImage2D = function(t, i, r, o, a, l, c, h, u) {
  24428. var d, p = this.getTextureTypeFromTarget(e, t);
  24429. d = p === s.TextureCube ? e.getParameter(e.TEXTURE_BINDING_CUBE_MAP) : e.getParameter(e.TEXTURE_BINDING_2D),
  24430. void 0 !== c ? n.call(e, t, i, r, o, a, l, c, h, u) : (c = o,
  24431. h = a,
  24432. u = l,
  24433. o = u.naturalWidth,
  24434. a = u.naturalHeight,
  24435. n.call(e, t, i, r, c, h, u));
  24436. var f = this.textures[d.id];
  24437. f.width = p === s.TextureCube ? 6 * o : o,
  24438. f.height = a
  24439. }
  24440. .bind(this);
  24441. var r = e.deleteTexture;
  24442. e.deleteTexture = function(t) {
  24443. delete this.textures[t.id],
  24444. r.call(e, t)
  24445. }
  24446. .bind(this)
  24447. }
  24448. ,
  24449. n.prototype.updateTextureMemory = function() {
  24450. var e = null;
  24451. return function() {
  24452. var t = 0;
  24453. for (var i in this.textures) {
  24454. var n = this.textures[i];
  24455. n.width && n.height && (t += n.width * n.height * 4)
  24456. }
  24457. t !== e && this.emit(a.MemoryUsageUpdated, t),
  24458. e = t
  24459. }
  24460. }(),
  24461. n.prototype.getTextureTypeFromTarget = function(e, t) {
  24462. switch (t) {
  24463. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  24464. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  24465. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  24466. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  24467. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  24468. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  24469. return s.TextureCube;
  24470. case e.TEXTURE_2D:
  24471. return s.Texture2D;
  24472. default:
  24473. return null
  24474. }
  24475. }
  24476. ,
  24477. n.prototype.initComposer = function() {
  24478. this.composer = new r.EffectComposer(this.renderer),
  24479. this.composer.addPass(new r.RenderPass(this.scene,this.camera)),
  24480. //this.composer.addPass(this.effects.hblurPass),
  24481. //this.composer.addPass(this.effects.vblurPass)
  24482. this.composer.addPass(this.effects.fastTranMaskPass)//add
  24483. }
  24484. ,
  24485. n.prototype.setSize = function(e, t, devicePixelRatio) {
  24486. this.renderWidth = e,
  24487. this.renderHeight = t,
  24488. this.effects.aspect = e / t,
  24489. /* this.renderer.setSize(e, t), -----MP */
  24490. this.renderer.setSize(e, t, false, devicePixelRatio), //改 为了防止给canvas设置宽高
  24491. this.composer.setSize(e, t);
  24492. for (var i = 0; i < this.resizeListeners.length; i++)
  24493. this.resizeListeners[i].setSize(e, t)
  24494. }
  24495. ,
  24496. n.prototype.render = function() {
  24497. //this.effects.currentBlur > 0 ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  24498. this.effects.fastTranMaskPass.enabled ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  24499. }
  24500. /******************************************************************************************************徐世廷**********************************************************************/
  24501. var vrPermission = {};
  24502. var vrPermissionCallBack = function(info1,info2){
  24503. if(info1 == "reset"){
  24504. vrPermission = {};
  24505. }else{
  24506. vrPermission[info1] = info2
  24507. if(Object.keys(vrPermission).length == 2 && (vrPermission.deviceMotion != "granted" || vrPermission.deviceOrientation != "granted")){
  24508. alert("运动和方向访问失败。这会导致画面视角一直固定。您需要完全关闭此应用,然后再次打开,并允许访问运动与方向。" )
  24509. }
  24510. }
  24511. }
  24512. n.prototype.boluoVrInit = function() {
  24513. console.log("boluoVrInit")
  24514. //webxr.init(this.renderer)
  24515. this.isHuawei5X = m.detectHUAWEI5X(),
  24516. this.oldRenderer = this.renderer,
  24517. this.newRenderer = new this.vrRenderer(this.renderer,this,this.camera);
  24518. window.panoCamera = this.camera;
  24519. var a = this;
  24520. window._vrEnabled = !1,
  24521. Object.defineProperty(window, "vrEnabled", {
  24522. get: function() {
  24523. return window._vrEnabled
  24524. },
  24525. set: function(b) {
  24526. //if(webxr.xrType)return webxr.enterVR()
  24527. b = !!b
  24528. b ? (a.renderer = a.newRenderer,
  24529. window.vrMarkers.forEach(function(a) {
  24530. a.visible = !0
  24531. })) : (a.renderer = a.oldRenderer,
  24532. window.vrMarkers.forEach(function(a) {
  24533. a.visible = !1
  24534. })),
  24535. a.cursor.visible = b,
  24536. a.setSize(window.innerWidth, window.innerHeight)
  24537. window._vrEnabled = b
  24538. $('.cad').css('visibility',b?'hidden':'')
  24539. b ? browser.requestFullscreen(document.body) : browser.exitFullscreen()
  24540. a.setSizeFitGlass()
  24541. setTimeout(()=>{
  24542. console.log('ch',document.body.clientWidth, document.body.clientHeight, window.innerWidth, window.innerHeight )//全屏后得到的才准确
  24543. a.setSizeFitGlass()
  24544. },600)
  24545. if(b){
  24546. setTimeout(function(){
  24547. console.log("orientEnable"+window.orientEnable)
  24548. if(window.vrEnabled && !window.orientEnable){//很可能没能触发陀螺仪事件
  24549. if(m.detectIOS()/* && m.detectSafari() */){
  24550. var b = m.iosVersion();//{major: 10, minor: 3, patch: 1}
  24551. console.log("开始获取权限 major"+b.major)
  24552. if(b.major == 12 && b.minor>=2){
  24553. if(browser.detectSafari()) alert("浏览器未能检测到转动。为完整体验VR效果,请打开 “设置” > “Safari” > “隐私和安全” 下的 “运动和方向访问” 开关,然后刷新此页面。")
  24554. else{//app??
  24555. alert("浏览器未能检测到转动。请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。")
  24556. }
  24557. }else if(b.major >= 13){
  24558. if(!window.location.href.includes("https://")){
  24559. console.log("需要https");
  24560. alert("当前网页下,高于ios12的浏览器版本可能不支持陀螺仪开启。")
  24561. return;
  24562. }
  24563. var hasFailed = window.vrPermission && (window.vrPermission.deviceMotion != "granted" || window.vrPermission.deviceOrientation != "granted")
  24564. setTimeout(()=>{//如果使用了alert会阻断这个事件,报以下错requusting device orientation or motion access requires a user gesture
  24565. if(!window.vrEnabled || window.orientEnable)return;
  24566. vrPermissionCallBack("reset")
  24567. console.log(window.DeviceMotionEvent)
  24568. if ( window.DeviceMotionEvent && window.DeviceMotionEvent.requestPermission && typeof window.DeviceMotionEvent.requestPermission === 'function') {
  24569. console.log("开始获取权限1")
  24570. ///注意:需要https 本地服务器permissionState会得到denied
  24571. window.DeviceMotionEvent.requestPermission().then(permissionState => {
  24572. console.log("permissionState1: "+permissionState)
  24573. vrPermissionCallBack("deviceMotion", permissionState)
  24574. }).catch(function(e){
  24575. vrPermissionCallBack("deviceMotion", false)
  24576. console.log(e)
  24577. })
  24578. }else{
  24579. console.log("window.DeviceMotionEvent undefined")
  24580. vrPermissionCallBack("deviceMotion", false)
  24581. }
  24582. if ( window.DeviceOrientationEvent && window.DeviceOrientationEvent.requestPermission && typeof window.DeviceOrientationEvent.requestPermission === 'function') {
  24583. console.log("开始获取权限2")
  24584. window.DeviceOrientationEvent.requestPermission().then(permissionState => {
  24585. console.log("permissionState2: "+permissionState)
  24586. vrPermissionCallBack("deviceOrientation", permissionState)
  24587. }).catch(function(e){
  24588. vrPermissionCallBack("deviceOrientation", false)
  24589. console.log(e)
  24590. })
  24591. }else{
  24592. console.log("window.DeviceOrientationEvent undefined")
  24593. vrPermissionCallBack("deviceOrientation", false)
  24594. }
  24595. },hasFailed ? 0 : 150)
  24596. /* /* setTimeout(function(){
  24597. if(settings.vrEnabled && !window.orientEnable){
  24598. $alert("若画面视角一直固定,您需要完全关闭Safari浏览器,然后再次打开以开启运动和方向访问。")
  24599. }
  24600. },4000) */
  24601. }else console.log("陀螺仪未能启用 ios "+b.major+"."+b.minor)
  24602. }else{
  24603. //$alert("浏览器未能检测到转动", "请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。")
  24604. }
  24605. }else{
  24606. //已经触发了
  24607. }
  24608. },200);
  24609. }else {
  24610. if(player.mode == 'panorama'){ //xzw add
  24611. player.cameraControls.controls.panorama.endRotation()
  24612. }
  24613. }
  24614. }
  24615. }),
  24616. this.createCursor(.5, !1, 1, 16777215, 0);
  24617. var b = {
  24618. setSize: function(b, c) {
  24619. a.camera.aspect = b / c
  24620. }
  24621. };
  24622. this.resizeListeners.push(b),
  24623. this.vrLoadingInit()
  24624. document.addEventListener('fullscreenchange', (e)=>{
  24625. this.setSizeFitGlass()
  24626. })
  24627. }
  24628. ,
  24629. n.prototype.vrLoadingInit = function() {
  24630. var a = function(camera) {
  24631. var a = this
  24632. , b = new r.RingGeometry(1.3,1.5,32,32,0,1.2 * Math.PI)
  24633. , c = new r.MeshBasicMaterial({
  24634. color: 4967932,
  24635. side: r.DoubleSide
  24636. })
  24637. , d = new r.Mesh(b,c);
  24638. this.mesh = d,
  24639. d.position.z = -2,
  24640. d.scale.set(.08, .08, .08),
  24641. d.visible = !1,
  24642. camera.add(d),
  24643. //window.player.camera.add(d),
  24644. a.enabled = !1,
  24645. this.update = function(b) {
  24646. 1 == a.enabled && (d.rotation.z += 15 * b)
  24647. }
  24648. }
  24649. , a = new a(this.camera);
  24650. window.Loading = a,
  24651. this.updateListeners.push(a)
  24652. }
  24653. ,
  24654. n.prototype.createCursor = function(a, b, c, d, e) {
  24655. var g, h = new r.SpriteMaterial({
  24656. opacity: c,
  24657. color: d,
  24658. transparent: b,
  24659. map: this.boluoGetTexture("images/cursor.png"),
  24660. needsUpdate: !0,
  24661. side: r.DoubleSide
  24662. });
  24663. h.map.offset = new r.Vector2(1 / 17 * e,0),
  24664. h.map.repeat = new r.Vector2(1 / 17,1),
  24665. h.depthTest = !1,
  24666. h.blending = r.AdditiveBlending,
  24667. g = new r.Sprite(h),
  24668. // g.scale.set(a, a, a),
  24669. g.scale.set(.3,.3,.3)
  24670. g.position.z = -2,
  24671. g.visible = !1,
  24672. g.name = "cursor",
  24673. this.camera.add(g),
  24674. this.scene.add(this.camera),
  24675. this.cursor = g;
  24676. var i = new this.CursorAnimation(this.scene,g,this.camera);
  24677. this.cursor.triggerTargetEvent = i.triggerTargetEvent,
  24678. this.updateListeners.push(i)
  24679. }
  24680. n.prototype.setSizeFitGlass = function(){//add 现在大多数手机过长,可能超出眼镜范围,导致看不全眩晕。另外注意调节和镜头的距离。
  24681. let verti = window.orientation == 0 || window.orientation == 180//竖屏
  24682. console.log('setSizeFitGlass')
  24683. if( document.fullscreenElement && !verti && window.vrEnabled && !browser.isMobile()){
  24684. let longW = Math.max(document.body.clientWidth, document.body.clientHeight)
  24685. let shortW = Math.min(document.body.clientWidth, document.body.clientHeight)
  24686. const hopeRatio = 1.84 //因为无法知道手机长度,只能估计,若长宽比较大,很可能过长,所以缩短点。
  24687. let r = longW / shortW
  24688. if(r > hopeRatio){
  24689. let w = shortW*hopeRatio
  24690. window.player.domElement.style.width = w + 'px' //缩短
  24691. window.player.domElement.style.transform = `translate(${(longW-w)*0.5}px,0)` //居中。但我手机荣耀自带浏览器会向右多偏移一些不知为何
  24692. }
  24693. }else{
  24694. window.player.domElement.style.width = ''
  24695. window.player.domElement.style.transform = ''
  24696. }
  24697. }
  24698. ,
  24699. window.orientEnable = 0; //是否能触发deviceorientation
  24700. n.prototype.CursorAnimation = function(a, b, c) {
  24701. function d() {
  24702. g.orient = r.Math.degToRad(window.orientation || 0)
  24703. player.sceneRenderer.setSizeFitGlass()
  24704. }
  24705. function e(a) {
  24706. if(!window.vrEnabled && window.orientEnable) return;
  24707. window.orientEnable || (window.orientEnable = 1);
  24708. var b = r.Math.degToRad(a.alpha)
  24709. , c = r.Math.degToRad(a.beta)
  24710. , d = r.Math.degToRad(a.gamma);
  24711. if (this.isHuawei5X ? (-1e3 === g.alpha && (g.alpha = b),
  24712. -1e3 === g.beta && (g.beta = c),
  24713. -1e3 === g.gamma && (g.gamma = d),
  24714. Math.abs(b - g.alpha) > .06 && (g.alpha = b),
  24715. Math.abs(c - g.beta) > .006 && (g.beta = c),
  24716. Math.abs(d - g.gamma) > .006 && (g.gamma = d)) : (g.alpha = b,
  24717. g.beta = c,
  24718. g.gamma = d),
  24719. n.vrDebug) {
  24720. $("#info-device-orientation").css("display", "block");
  24721. var e = "";
  24722. e += "alpha=(" + g.alpha + ")<BR/>",
  24723. e += "beta=(" + g.beta + ")<BR/>",
  24724. e += "gamma=" + g.gamma + "<BR/>",
  24725. document.getElementById("info-device-orientation").innerHTML = e
  24726. }
  24727. }
  24728. this.cursor = b,
  24729. this.raycaster = new r.Raycaster,
  24730. this.targetEventObj = {},
  24731. this.type = 1,
  24732. this.tweenFlag = !0;
  24733. var g = this;
  24734. this.target = c,
  24735. console.log(c.uuid),
  24736. this.euler = new r.Euler,
  24737. this.q0 = new r.Quaternion,
  24738. this.q1 = new r.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),
  24739. this.zee = new r.Vector3(0,0,1),
  24740. this.alpha = -1e3,
  24741. this.beta = -1e3,
  24742. this.gamma = -1e3,
  24743. this.orient = r.Math.degToRad(window.orientation || 0),
  24744. window.addEventListener("orientationchange", d),
  24745. window.addEventListener("deviceorientation", e),
  24746. this.setObjectQuaternion = function(a, b, d, e, f) {
  24747. if (b == -1000) return //防止打开就歪着
  24748. g.euler.set(d, b, -e, "YXZ"),
  24749. a.setFromEuler(g.euler),
  24750. a.multiply(g.q1),
  24751. a.multiply(g.q0.setFromAxisAngle(g.zee, -f)),
  24752. c.updateMatrixWorld()
  24753. }
  24754. ,
  24755. parent !== window && window.addEventListener("message", function(a) {
  24756. var b = JSON.parse(a.data)
  24757. , c = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  24758. b && b.alpha && b.beta && b.gamma && function(a) {
  24759. var c = r.Math.degToRad(b.alpha)
  24760. , d = r.Math.degToRad(b.beta)
  24761. , e = r.Math.degToRad(b.gamma);
  24762. a ? (-1e3 === g.alpha && (g.alpha = c),
  24763. -1e3 === g.beta && (g.beta = d),
  24764. -1e3 === g.gamma && (g.gamma = e),
  24765. Math.abs(c - g.alpha) > .06 && (g.alpha = c),
  24766. Math.abs(d - g.beta) > .006 && (g.beta = d),
  24767. Math.abs(e - g.gamma) > .006 && (g.gamma = e)) : (g.alpha = c,
  24768. g.beta = d,
  24769. g.gamma = e)
  24770. }(c)
  24771. }),
  24772. this.update = function(a) {
  24773. TWEEN.update()
  24774. if (window.vrEnabled) {
  24775. if (window.ifTest || !browser.isMobile()) this.triggerTargetEvent()//测试时不根据陀螺仪来转向
  24776. else {
  24777. this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient)
  24778. this.triggerTargetEvent()
  24779. }
  24780. }
  24781. }
  24782. ,
  24783. this.triggerTargetEvent = function() {
  24784. var a = this.choseObj()
  24785. , b = a ? a.object : void 0;
  24786. this.targetEventObj.currentObj = b,
  24787. b !== this.targetEventObj.lastObj && (b && this.autoCursorPosition(a),
  24788. 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(),
  24789. b && b.enabled && this.startAnimate(function() {
  24790. this.clickCallback(b)
  24791. }
  24792. .bind(this))) : this.type,
  24793. this.targetEventObj.lastObj = b)
  24794. }
  24795. ,
  24796. this.choseObj = function() {
  24797. this.raycaster.setFromCamera({
  24798. x: 0,
  24799. y: 0
  24800. }, c);
  24801. var a = (this.raycaster.ray,
  24802. window.vrMarkers)
  24803. , b = this.raycaster.intersectObjects(a);
  24804. if (b.length > 0)
  24805. return b[0]
  24806. }
  24807. ,
  24808. this.clickCallback = function(a) {
  24809. this.runTHREEAction(a, "onclick")
  24810. }
  24811. ,
  24812. this.runTHREEAction = function(a, b) {
  24813. switch (b) {
  24814. case "onclick":
  24815. a._listeners && a._listeners.click && a._listeners.click.forEach(function(a) {
  24816. a()
  24817. });
  24818. break;
  24819. case "onhover":
  24820. a._listeners && a._listeners.hover && a._listeners.hover.forEach(function(a) {
  24821. a()
  24822. });
  24823. break;
  24824. case "onout":
  24825. a._listeners && a._listeners.out && a._listeners.out.forEach(function(a) {
  24826. a()
  24827. })
  24828. }
  24829. }
  24830. ,
  24831. this.startAnimate = function(a) {
  24832. this.tweenFlag && this.initAnimation(a)
  24833. }
  24834. ,
  24835. this.initAnimation = function(a) {
  24836. var b = this
  24837. , c = this.cursor.material.map.offset
  24838. , d = function(a) {
  24839. return Math.floor(17 * a) / 17
  24840. };
  24841. b.tweenFlag = !1,
  24842. this.cursorAnimate = new TWEEN.Tween(c).to({
  24843. x: 1
  24844. }, 1e3).onStart(function() {
  24845. b.tweenFlag = !1
  24846. }).onStop(function() {
  24847. b.tweenFlag = !0,
  24848. this.x = 0,
  24849. c.x = 0
  24850. }).onUpdate(function() {}).onComplete(function() {
  24851. a(),
  24852. c.x = 0,
  24853. setTimeout(function() {
  24854. b.tweenFlag = !0
  24855. }, 1500)
  24856. }),
  24857. this.cursorAnimate.easing(d),
  24858. this.cursorAnimate.start()
  24859. }
  24860. ,
  24861. this.autoCursorPosition = function(a) {
  24862. // var b = Math.abs(a.distance - 10);
  24863. // this.cursor.position.z = -b,
  24864. // b /= 10;
  24865. // alert(b);
  24866. // this.cursor.scale.set(b, b, b)
  24867. this.cursor.scale.set(.3,.3,.3)
  24868. }
  24869. }
  24870. ,
  24871. n.prototype.vrRenderer = function(a, b, c) {
  24872. var d = new b.vrCamera(c);
  24873. d.bananaAspect = 0.75// fov origin:0.8
  24874. this.width,
  24875. this.height;
  24876. var b = this;
  24877. this.setSize = function(c, d) {
  24878. a.setSize.call(this, c, d),
  24879. b.width = c,
  24880. b.height = d
  24881. }
  24882. ,
  24883. this.render = function(b, c, e, f) {
  24884. window.cameraQua = c.quaternion.clone();
  24885. var g, h;
  24886. if (c.__RESS__SKIP__STEREO__)
  24887. return a.render(b, c, e, f);
  24888. if ("PerspectiveCamera" === c.type)
  24889. g = d.cameraL,
  24890. h = d.cameraR,
  24891. b.updateMatrixWorld(),
  24892. null === c.parent && c.updateMatrixWorld(),
  24893. d.vrCameraUpdate(c);
  24894. else {
  24895. if ("OrthographicCamera" !== c.type)
  24896. return DEBUG && console.error("Unsupported renderer: ", c.type);
  24897. g = h = c
  24898. }
  24899. a.setScissorTest(!0),
  24900. a.setScissor(0, 0, this.width / 2, this.height),
  24901. a.setViewport(0, 0, this.width / 2, this.height),
  24902. a.render.call(this, b, g, e, f),
  24903. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  24904. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  24905. a.render.call(this, b, h, e, f),
  24906. a.setScissorTest(!1)
  24907. }
  24908. ,
  24909. this.__proto__ = {
  24910. __proto__: a
  24911. }
  24912. }
  24913. ,
  24914. n.prototype.vrCamera = function(a) {
  24915. this.type = "StereoCamera",
  24916. this._aspect = 1,
  24917. this._overlap = .064,
  24918. this.cameraL = new r.PerspectiveCamera,
  24919. this.cameraL.layers.enable(1),
  24920. this.cameraL.near = 0.01,//xzw add
  24921. this.cameraL.matrixAutoUpdate = !1,
  24922. this.cameraR = new r.PerspectiveCamera,
  24923. this.cameraR.layers.enable(2),
  24924. this.cameraR.near = 0.01,//xzw add
  24925. this.cameraR.matrixAutoUpdate = !1,
  24926. this.eyeRight = new r.Matrix4,
  24927. this.eyeLeft = new r.Matrix4,
  24928. this.vrCameraNeedsUpdate = !0,
  24929. window.vrCameraL = this.cameraL; // fyz 记录vr相机
  24930. Object.defineProperty(this, "bananaAspect", {
  24931. get: function() {
  24932. return this._aspect
  24933. },
  24934. set: function(a) {
  24935. this._aspect !== a && (this.vrCameraNeedsUpdate = !0),
  24936. this._aspect = a
  24937. }
  24938. }),
  24939. Object.defineProperty(this, "overlap", {//瞳距
  24940. get: function() {
  24941. return this._overlap
  24942. },
  24943. set: function(a) {
  24944. this._overlap !== a && (this.vrCameraNeedsUpdate = !0),
  24945. this._overlap = a
  24946. }
  24947. }),
  24948. this.vrCameraUpdate = function(a) {
  24949. this.vrCameraNeedsUpdate = true;
  24950. if (this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== a.fov || this.bananaReal_aspect !== a.aspect * this.bananaAspect || this.bananaNear !== a.near || this.bananaFar !== a.far,
  24951. this.vrCameraNeedsUpdate) {
  24952. this.vrCameraNeedsUpdate = !1,
  24953. //console.debug("vrCameraUpdate"),
  24954. this.bananaFocus = a.focus,
  24955. this.bananaFov = a.fov,
  24956. this.bananaReal_aspect = a.aspect * (window.ban || this.bananaAspect),
  24957. this.bananaNear = a.near,
  24958. this.bananaFar = a.far,
  24959. //console.debug(a.aspect),
  24960. this.bananaFocus = 10;
  24961. 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);
  24962. this.eyeLeft.elements[12] = -e,
  24963. this.eyeRight.elements[12] = e,
  24964. b = -g * this.bananaReal_aspect + f,
  24965. c = g * this.bananaReal_aspect + f,
  24966. d.elements[0] = 2 * this.bananaNear / (c - b),
  24967. d.elements[8] = (c + b) / (c - b),
  24968. this.cameraL.projectionMatrix.copy(d),
  24969. b = -g * this.bananaReal_aspect - f,
  24970. c = g * this.bananaReal_aspect - f,
  24971. d.elements[0] = 2 * this.bananaNear / (c - b),
  24972. d.elements[8] = (c + b) / (c - b),
  24973. this.cameraR.projectionMatrix.copy(d)
  24974. }
  24975. this.cameraL.matrixWorld.copy(a.matrixWorld).multiply(this.eyeLeft),
  24976. this.cameraR.matrixWorld.copy(a.matrixWorld).multiply(this.eyeRight)
  24977. }
  24978. }
  24979. ,
  24980. n.prototype.boluoGetTexture = function(a) {
  24981. var b = new r.TextureLoader;
  24982. return b.crossOrigin = "anonymous",
  24983. b.load(a)
  24984. }
  24985. /* let webxr = {
  24986. init(renderer) {
  24987. this.renderer = renderer
  24988. renderer.xr = new THREE.WebXRManager(renderer, renderer.getContext());
  24989. renderer.xr.enabled = true
  24990. if ('xr' in navigator && 'isSessionSupported' in navigator.xr) {
  24991. //pico firefox
  24992. var mode = 'immersive-vr'
  24993. navigator.xr
  24994. .isSessionSupported(mode)
  24995. .then(supported => {
  24996. if (!supported) {
  24997. this.xrNotFound('isSessionSupported not supported')
  24998. } else {
  24999. this.xrType = 'xr' //showEnterXR();
  25000. }
  25001. })
  25002. .catch(this.xrNotFound.bind(this, 'isSessionSupported error'))
  25003. } else if ('getVRDisplays' in navigator) {
  25004. //pico 的vr browser是这个
  25005. console.log('getVRDisplays')
  25006. let setDevice = device => {
  25007. this.xrType = 'vr'
  25008. this.device = device
  25009. this.renderer.xr.setDevice(device) //新版是renderer.vr
  25010. }
  25011. window.addEventListener(
  25012. 'vrdisplayconnect',
  25013. function (event) {
  25014. setDevice(event.display)
  25015. },
  25016. false
  25017. )
  25018. window.addEventListener(
  25019. 'vrdisplaydisconnect',
  25020. function ( ) {
  25021. console.log('vrdisplaydisconnect')
  25022. window.bus.dispatchEvent({type:'exitWebXR'})
  25023. },
  25024. false
  25025. )
  25026. window.addEventListener(
  25027. 'vrdisplaypresentchange',
  25028. function (event) {
  25029. console.log('vrdisplaypresentchange', event.display.isPresenting ? 'EXIT VR' : 'ENTER VR')
  25030. event.display.isPresenting || window.bus.dispatchEvent({type:'exitWebXR'})
  25031. },
  25032. false
  25033. )
  25034. window.addEventListener(
  25035. 'vrdisplayactivate',
  25036. function (event) {
  25037. event.display.requestPresent([{ source: this.renderer.domElement }])
  25038. },
  25039. false
  25040. )
  25041. navigator
  25042. .getVRDisplays()
  25043. .then(function (displays) {
  25044. if (displays.length > 0) {
  25045. setDevice(displays[0])
  25046. } else {
  25047. this.xrNotFound('no displays')
  25048. }
  25049. })
  25050. .catch(this.xrNotFound.bind(this, 'getVRDisplays error'))
  25051. } else {
  25052. this.xrNotFound('xr not supported')
  25053. }
  25054. },
  25055. enterVR() {
  25056. if (!this.xrType) return //不支持
  25057. console.log('enterVR', this.xrType)
  25058. if (this.xrType == 'vr') {
  25059. this.device.isPresenting ? this.device.exitPresent() : this.device.requestPresent([{ source: renderer.domElement }])
  25060. } else if (this.xrType == 'xr') {
  25061. if (this.currentSession == void 0) {
  25062. console.log('this.currentSession == void 0 ')
  25063. function getXRSessionInit(mode, options) {
  25064. var space = (options || {}).referenceSpaceType || 'local-floor'
  25065. var sessionInit = (options && options.sessionInit) || {}
  25066. // Nothing to do for default features.
  25067. if (space == 'viewer') return sessionInit
  25068. if (space == 'local' && mode.startsWith('immersive')) return sessionInit
  25069. // If the user already specified the space as an optional or required feature, don't do anything.
  25070. if (sessionInit.optionalFeatures && sessionInit.optionalFeatures.includes(space)) return sessionInit
  25071. if (sessionInit.requiredFeatures && sessionInit.requiredFeatures.includes(space)) return sessionInit
  25072. // The user didn't request the reference space type as a feature. Add it to a shallow copy
  25073. // of the user-supplied sessionInit requiredFeatures (if any) to ensure it's valid to
  25074. // request it later.
  25075. var newInit = Object.assign({}, sessionInit)
  25076. newInit.requiredFeatures = [space]
  25077. if (sessionInit.requiredFeatures) {
  25078. newInit.requiredFeatures = newInit.requiredFeatures.concat(sessionInit.requiredFeatures)
  25079. }
  25080. return newInit
  25081. }
  25082. let onSessionEnded = ( ) => {
  25083. console.log('onSessionEnded')
  25084. this.currentSession.removeEventListener('end', onSessionEnded)
  25085. setTimeout(()=>{
  25086. this.renderer.xr.setSession(null)
  25087. this.currentSession = null
  25088. window.bus.dispatchEvent({type:'exitWebXR'})
  25089. },1)//延迟原因:先使THREE里的onSessionEnded执行
  25090. }
  25091. let onSessionStarted = session => {
  25092. console.log('onSessionStarted')
  25093. session.addEventListener('end', onSessionEnded)
  25094. this.renderer.xr.setSession(session)
  25095. this.currentSession = session
  25096. }
  25097. var mode = 'immersive-vr'
  25098. var sessionInit = getXRSessionInit(mode)
  25099. navigator.xr.requestSession(mode, sessionInit).then(onSessionStarted)
  25100. } else {
  25101. console.log('this.currentSession.end()', this.currentSession)
  25102. this.currentSession.end()
  25103. }
  25104. }
  25105. },
  25106. xrNotFound(text) {
  25107. console.log('xrNotFound:', text)
  25108. },
  25109. } */
  25110. /***********************************************************************************************************************************************************************************/
  25111. n.prototype.updateScreenSize = function() {//xzw 改 为了截屏 要改canvas大小 以及缩放时不模糊
  25112. var W,H;//当截屏时有setTimeout 期间不能恢复大小,所以要用W,H记录正常大小
  25113. return function(o){
  25114. var render = false;
  25115. var ratio;
  25116. var w, h; //记录应当render的大小
  25117. if(o && !o.resize && o.width!= void 0 && o.height!= void 0){
  25118. w = o.width, h = o.height, render = true, ratio=1;
  25119. }else{
  25120. w = $('#player').width();
  25121. h = $('#player').height();
  25122. o && o.resize && (W = this.renderWidth, H = this.renderHeight);
  25123. (w !== W || h !== H || this.forceUpdateSize) &&
  25124. (W = w, H = h, render = true, ratio = window.devicePixelRatio);
  25125. }
  25126. if(render){
  25127. this.setSize(w, h, ratio);
  25128. this.forceUpdateSize = !1
  25129. }
  25130. }
  25131. }()
  25132. ,
  25133. n.prototype.updateComponents = function() {
  25134. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  25135. this.updateListeners[t].update(e)
  25136. }
  25137. ,
  25138. n.prototype.suspend = function() {
  25139. this.started = !1,
  25140. this.suspendedObjects = this.scene.children.map(function(e) {
  25141. return this.scene.remove(e),
  25142. e
  25143. }
  25144. .bind(this)),
  25145. this.render()
  25146. }
  25147. ,
  25148. n.prototype.resume = function() {
  25149. this.suspendedObjects.forEach(function(e) {
  25150. this.scene.add(e)
  25151. }
  25152. .bind(this)),
  25153. this.suspendedObjects = [],
  25154. this.started = !0,
  25155. p()
  25156. }
  25157. ;
  25158. var p = function() {
  25159. this.started && (window.requestAnimationFrame(p),
  25160. this.updateScreenSize(), // fyz resize
  25161. this.updateComponents(),
  25162. this.updateTextureMemory(),
  25163. this.render(),
  25164. window.stats && (window.fps = stats.update()),
  25165. this.emit(a.AfterRender))
  25166. };
  25167. n.prototype.getImageData = function() {
  25168. var e = document.createElement("canvas")
  25169. , t = e.getContext("2d");
  25170. return function(i, n, r) {
  25171. return e.width === n && e.height === r || (e.width = n,
  25172. e.height = r),
  25173. t.drawImage(i, 0, 0, n, r),
  25174. t.getImageData(0, 0, n, r)
  25175. }
  25176. }(),
  25177. n.prototype.initSizedTexture2D = function(e, t, i) {
  25178. var n = this.renderer
  25179. , o = n.context
  25180. , a = n.state
  25181. , s = new r.Texture(null);
  25182. s.flipY = !1,
  25183. i !== !0 && (i = !1),
  25184. s.generateMipmaps = i;
  25185. var l = n.paramThreeToGL(s.format)
  25186. , c = n.paramThreeToGL(s.type)
  25187. , h = n.properties.get(s)
  25188. , u = o.createTexture();
  25189. a.bindTexture(o.TEXTURE_2D, u),
  25190. o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL, s.flipY),
  25191. o.texImage2D(o.TEXTURE_2D, 0, l, e, e, 0, l, c, null),
  25192. s.wrapS = t,
  25193. s.wrapT = t;
  25194. var d = n.paramThreeToGL(t);
  25195. return o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_S, d),
  25196. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_T, d),
  25197. i ? (s.magFilter = r.LinearFilter,
  25198. s.minFilter = r.LinearMipMapLinearFilter,
  25199. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  25200. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR_MIPMAP_NEAREST),
  25201. o.generateMipmap(o.TEXTURE_2D)) : (s.magFilter = r.LinearFilter,
  25202. s.minFilter = r.LinearFilter,
  25203. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  25204. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR)),
  25205. a.bindTexture(o.TEXTURE_2D, null),
  25206. h.__webglTexture = u,
  25207. s
  25208. }
  25209. ,
  25210. n.prototype.initSizedCubeMap = function(e, t) {
  25211. var i = this.renderer
  25212. , n = i.context
  25213. , o = i.state
  25214. , a = new r.CubeTexture([null, null, null, null, null, null]);
  25215. a.flipY = !1,
  25216. a.generateMipmaps = t;
  25217. var s = i.paramThreeToGL(a.format)
  25218. , l = i.paramThreeToGL(a.type)
  25219. , c = i.properties.get(a)
  25220. , h = n.createTexture();
  25221. o.bindTexture(n.TEXTURE_CUBE_MAP, h),
  25222. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, a.flipY);
  25223. for (var u = 0; u < 6; u++)
  25224. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + u, 0, s, e, e, 0, s, l, null);
  25225. return t ? (a.magFilter = r.LinearFilter,
  25226. a.minFilter = r.LinearMipMapLinearFilter,
  25227. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  25228. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  25229. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  25230. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (a.magFilter = r.LinearFilter,
  25231. a.minFilter = r.LinearFilter,
  25232. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  25233. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  25234. o.bindTexture(n.TEXTURE_CUBE_MAP, null),
  25235. c.__image__webglTextureCube = h,
  25236. a
  25237. }
  25238. ,
  25239. n.prototype.deallocateCubeTexture = function(e) {
  25240. var t = this.renderer
  25241. , i = t.context
  25242. , n = t.properties.get(e);
  25243. i.deleteTexture(n.__image__webglTextureCube)
  25244. }
  25245. ,
  25246. n.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  25247. var a = this.renderer
  25248. , s = a.context
  25249. , l = a.state
  25250. , c = a.properties.get(t);
  25251. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  25252. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  25253. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  25254. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  25255. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  25256. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  25257. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  25258. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  25259. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  25260. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  25261. l.bindTexture(s.TEXTURE_2D, null)
  25262. }
  25263. ,
  25264. n.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  25265. var s = this.renderer
  25266. , l = s.context
  25267. , c = s.state
  25268. , h = s.properties.get(t);
  25269. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  25270. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  25271. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  25272. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  25273. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  25274. }
  25275. ,
  25276. n.prototype.rebuildMipMaps2D = function(e) {
  25277. var t = this.renderer
  25278. , i = t.context
  25279. , n = t.state;
  25280. t.properties.get(e);
  25281. i.generateMipmap(i.TEXTURE_2D),
  25282. n.bindTexture(i.TEXTURE_2D, null)
  25283. }
  25284. ,
  25285. n.prototype.rebuildMipMaps3D = function(e) {
  25286. var t = this.renderer
  25287. , i = t.context
  25288. , n = t.state
  25289. , r = t.properties.get(e);
  25290. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  25291. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  25292. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  25293. }
  25294. ,
  25295. n.prototype.renderToCubeMap = function() {
  25296. var e = !1
  25297. , t = null
  25298. , i = null
  25299. , n = null
  25300. , a = null
  25301. , s = null
  25302. , l = 1;
  25303. return function(c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w) {
  25304. var _ = this.renderer;
  25305. _.context;
  25306. e || (i = new r.OrthographicCamera(l / -2,l / 2,l / 2,l / -2,-200,200),
  25307. i.position.z = 150,
  25308. t = new r.Scene,
  25309. t.add(i),
  25310. n = new r.ShaderMaterial({
  25311. uniforms: {
  25312. tDiffuse: {
  25313. type: "t",
  25314. value: null
  25315. },
  25316. alpha: {
  25317. type: "f",
  25318. value: 1
  25319. }
  25320. },
  25321. vertexShader: o.basicTextured.vertexShader,
  25322. fragmentShader: o.basicTextured.fragmentShader,
  25323. depthWrite: !1,
  25324. depthTest: !1,
  25325. side: r.DoubleSide
  25326. }),
  25327. a = new r.PlaneBufferGeometry(l,l),
  25328. s = new r.Mesh(a,n),
  25329. s.position.z = 0,
  25330. t.add(s),
  25331. e = !0);
  25332. var T = a.getAttribute("uv");
  25333. T.setDynamic(!0),
  25334. T.needsUpdate = !0;
  25335. var x = T.array
  25336. , S = p / u
  25337. , M = f / d
  25338. , R = g / u
  25339. , P = m / d;
  25340. x[0] = S,
  25341. x[1] = M + P,
  25342. x[2] = S + R,
  25343. x[3] = M + P,
  25344. x[4] = S,
  25345. x[5] = M,
  25346. x[6] = S + R,
  25347. x[7] = M;
  25348. var O = a.getAttribute("position");
  25349. O.setDynamic(!0),
  25350. O.needsUpdate = !0;
  25351. var L = O.array
  25352. , D = v / h.width - l / 2
  25353. , N = A / h.height - l / 2
  25354. , B = y / h.width
  25355. , F = C / h.height;
  25356. L[0] = D,
  25357. L[1] = N + F,
  25358. L[3] = D + B,
  25359. L[4] = N + F,
  25360. L[6] = D,
  25361. L[7] = N,
  25362. L[9] = D + B,
  25363. L[10] = N;
  25364. this.renderer.properties.get(c);
  25365. n.uniforms.tDiffuse.value = c,
  25366. n.blending = E || r.NoBlending,
  25367. n.transparent = !!b,
  25368. void 0 !== w && null !== w || (w = 1),
  25369. n.uniforms.alpha.value = w,
  25370. n.needUpdate = !0,
  25371. h.activeCubeFace = I,
  25372. h.viewport.set(0, 0, h.width, h.height);
  25373. var V = this.renderer.autoClear;
  25374. this.renderer.autoClear = !1,
  25375. this.renderer.render(t, i, h, !1),
  25376. this.renderer.autoClear = V
  25377. }
  25378. }(),
  25379. n.prototype.copyCubeMap = function() {
  25380. var e = !1
  25381. , t = null
  25382. , i = null
  25383. , a = null
  25384. , s = null
  25385. , l = null
  25386. , c = new r.Euler;
  25387. new r.Vector3;
  25388. return function(h, u, d, p, f, g, m, v, A) {
  25389. if(f > this.qualityManager.maxRenderTargetSize) return; //add
  25390. this.renderer;
  25391. if (!e) {
  25392. var y = 2;
  25393. i = new r.OrthographicCamera(y / -2,y / 2,y / 2,y / -2,0,200),
  25394. i.position.set(0, 0, 0),
  25395. t = new r.Scene,
  25396. t.add(i),
  25397. a = new r.ShaderMaterial({
  25398. uniforms: {
  25399. tDiffuse: {
  25400. type: "t",
  25401. value: null
  25402. },
  25403. alpha: {
  25404. type: "f",
  25405. value: 1
  25406. }
  25407. },
  25408. vertexShader: o.copyCubeMap.vertexShader,
  25409. fragmentShader: o.copyCubeMap.fragmentShader,
  25410. depthWrite: !1,
  25411. depthTest: !1,
  25412. side: r.DoubleSide
  25413. }),
  25414. s = new r.BoxGeometry(y,y,y),
  25415. l = new r.Mesh(s,a),
  25416. t.add(l),
  25417. e = !0
  25418. }
  25419. for (var C = 0; C < 6; C++)
  25420. n.getCubeOrientationForCubeFace(C, c),
  25421. l.rotation.copy(c),
  25422. l.matrixWorldNeedsUpdate = !0,
  25423. l.updateMatrixWorld(),
  25424. a.uniforms.tDiffuse.value = h,
  25425. a.blending = m || r.NoBlending,
  25426. a.transparent = !!v,
  25427. void 0 !== A && null !== A || (A = 1),
  25428. a.uniforms.alpha.value = A,
  25429. a.needUpdate = !0,
  25430. u.activeCubeFace = C,
  25431. u.viewport.set(0, 0, f, g),
  25432. this.renderer.render(t, i, u, !1)
  25433. }
  25434. }(),
  25435. n.getLookAtForCubeFace = function(e, t) {
  25436. switch (e) {
  25437. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  25438. t.set(1, 0, 0);
  25439. break;
  25440. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  25441. t.set(-1, 0, 0);
  25442. break;
  25443. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  25444. t.set(0, 1, 0);
  25445. break;
  25446. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  25447. t.set(0, -1, 0);
  25448. break;
  25449. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  25450. t.set(0, 0, 1);
  25451. break;
  25452. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  25453. t.set(0, 0, -1)
  25454. }
  25455. }
  25456. ,
  25457. n.getCubeOrientationForCubeFace = function(e, t) {
  25458. switch (e) {
  25459. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  25460. t.set(0, -Math.PI / 2, 0);
  25461. break;
  25462. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  25463. t.set(0, Math.PI / 2, 0);
  25464. break;
  25465. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  25466. t.set(Math.PI / 2, Math.PI, 0);
  25467. break;
  25468. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  25469. t.set(-Math.PI / 2, Math.PI, 0);
  25470. break;
  25471. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  25472. t.set(0, -Math.PI, 0);
  25473. break;
  25474. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  25475. t.set(0, 0, 0)
  25476. }
  25477. }
  25478. ,
  25479. t.exports = n
  25480. }
  25481. , {
  25482. "../enum/GLCubeFaces": 25,
  25483. "../enum/GLTextureType": 26,
  25484. "../enum/SceneRendererEvents": 43,
  25485. "../exception/BasicException": 55,
  25486. "../exception/RendererCreationException": 57,
  25487. "../settings": 166,
  25488. "../shaders": 167,
  25489. /********************************************************************fyz改 from徐世廷**********************************************************************/
  25490. "../util/browser": 182,
  25491. /************************************************************************************************************************************************/
  25492. events: 202,
  25493. three: 217
  25494. }],
  25495. 159: [function(e, t, i) {
  25496. "use strict";
  25497. function n(e) {
  25498. this.messenger = new a(e),
  25499. this.clientKey = null
  25500. }
  25501. var r = e("../util/ajax")
  25502. , o = e("./PostMessageType")
  25503. , a = e("./postmessage")
  25504. , s = e("./VersionInfo")
  25505. , l = e("events").EventEmitter
  25506. , c = window.location.origin + "/api/v1/user/";
  25507. n.prototype = Object.create(l.prototype),
  25508. n.prototype.bindEvents = function() {
  25509. this.messenger.on(o.ACTION, this.onMessageReceived.bind(this))
  25510. }
  25511. ,
  25512. n.prototype.waitForConnection = function() {
  25513. var e = new Promise(function(e, t) {
  25514. this.messenger.on(o.CONNECT, function(i) {
  25515. this.onConnectionReceived(i).then(e.bind(this, i.sdkVersion), t.bind())
  25516. }
  25517. .bind(this))
  25518. }
  25519. .bind(this));
  25520. return e
  25521. }
  25522. ,
  25523. n.prototype.onConnectionReceived = function(e) {
  25524. return this.messenger.setTarget(e.source, e.origin),
  25525. this.verifyConnection(e).then(function(t, i) {
  25526. this.messenger.send({
  25527. type: o.ACCEPT,
  25528. toId: e.fromId,
  25529. warning: i
  25530. }),
  25531. this.clientKey = t,
  25532. this.messenger.removeAllListeners(o.CONNECT),
  25533. this.bindEvents()
  25534. }
  25535. .bind(this), function(t) {
  25536. this.messenger.send({
  25537. type: o.REJECT,
  25538. toId: e.fromId,
  25539. reason: t
  25540. }),
  25541. this.messenger.setTarget()
  25542. }
  25543. .bind(this))
  25544. }
  25545. ,
  25546. n.prototype.verifyConnection = function(e) {
  25547. return new Promise(function(t, i) {
  25548. var n;
  25549. if (s.isDeprecated(e.sdkVersion))
  25550. n = "这个版本正在被弃用";
  25551. else if (!s.isSupported(e.sdkVersion))
  25552. return i("不支持此版本的SDK");
  25553. var o = {
  25554. cache: !1,
  25555. headers: {
  25556. "X-port-Application-Key": e.applicationKey,
  25557. "X-port-Referrer": e.origin
  25558. }
  25559. };
  25560. r.get(c, o).done(t.bind(this, e.applicationKey, n)).fail(i.bind(this, "key/referrer mismatch"))
  25561. }
  25562. )
  25563. }
  25564. ,
  25565. n.prototype.onMessageReceived = function(e) {
  25566. if (this.validateClientApplicationKey(e.applicationKey)) {
  25567. var t = this;
  25568. e.onDone = function(i) {
  25569. i.toId = e.fromId,
  25570. i.uid = e.uid,
  25571. i.type = o.RESPONSE,
  25572. t.messenger.send(i)
  25573. }
  25574. ,
  25575. this.emit(o.ACTION, e)
  25576. }
  25577. }
  25578. ,
  25579. n.prototype.validateClientApplicationKey = function(e) {
  25580. return this.clientKey === e
  25581. }
  25582. ,
  25583. n.prototype.sendEvent = function(e, t) {
  25584. this.messenger.send({
  25585. type: o.EVENT,
  25586. eventType: e,
  25587. eventData: t
  25588. })
  25589. }
  25590. ,
  25591. t.exports = n
  25592. }
  25593. , {
  25594. "../util/ajax": 181,
  25595. "./PostMessageType": 160,
  25596. "./VersionInfo": 163,
  25597. "./postmessage": 165,
  25598. events: 202
  25599. }],
  25600. 160: [function(e, t, i) {
  25601. "use strict";
  25602. t.exports = Object.freeze({
  25603. CONNECT: "postmessage.connect",
  25604. ACCEPT: "postmessage.accept",
  25605. REJECT: "postmessage.reject",
  25606. ACTION: "postmessage.action",
  25607. RESPONSE: "postmessage.response",
  25608. EVENT: "postmessage.event"
  25609. })
  25610. }
  25611. , {}],
  25612. 161: [function(e, t, i) {
  25613. "use strict";
  25614. t.exports = Object.freeze({
  25615. MOVE: "sdk.move",
  25616. ENTER_PANO: "sdk.enterpano",
  25617. MODEL_LOADED: "sdk.modelloaded"
  25618. })
  25619. }
  25620. , {}],
  25621. 162: [function(e, t, i) {
  25622. "use strict";
  25623. t.exports = Object.freeze({
  25624. FLY: "transition.fly",
  25625. FADEOUT: "transition.fade",
  25626. INSTANT: "transition.instant"
  25627. })
  25628. }
  25629. , {}],
  25630. 163: [function(e, t, i) {
  25631. "use strict";
  25632. t.exports = {
  25633. current: "1.0",
  25634. supported: ["1.0"],
  25635. deprecated: [],
  25636. isSupported: function(e) {
  25637. return this.supported.indexOf(e) !== -1
  25638. },
  25639. isDeprecated: function(e) {
  25640. return this.deprecated.indexOf(e) !== -1
  25641. },
  25642. isValid: function(e) {
  25643. return this.isSupported(e) || this.isDeprecated(e)
  25644. }
  25645. }
  25646. }
  25647. , {}],
  25648. 164: [function(e, t, i) {
  25649. (function(i) {
  25650. "use strict";
  25651. function n(e, t, i) {
  25652. e && (e = e.toLowerCase().trim());
  25653. var n = new I.UP.clone
  25654. , r = Math.PI / 3
  25655. , o = Math.PI / 2;
  25656. switch (e) {
  25657. case "left":
  25658. i.copy(t),
  25659. i.applyAxisAngle(n, o);
  25660. break;
  25661. case "right":
  25662. i.copy(t),
  25663. i.applyAxisAngle(n, -o);
  25664. break;
  25665. case "forwardleft":
  25666. i.copy(t),
  25667. i.applyAxisAngle(n, r);
  25668. break;
  25669. case "forwardright":
  25670. i.copy(t),
  25671. i.applyAxisAngle(n, -r);
  25672. break;
  25673. case "forward":
  25674. default:
  25675. i.copy(t)
  25676. }
  25677. return i
  25678. }
  25679. function r(e, t) {
  25680. if (e) {
  25681. var i = {
  25682. pano: e,
  25683. lookAtPoint: null,
  25684. duration: null,
  25685. maxDistanceOverride: null,
  25686. skipWarpingCheck: !1
  25687. };
  25688. this.player.flyToPano(i, function() {
  25689. t && t({
  25690. success: !0,
  25691. message: "Transition complete."
  25692. })
  25693. })
  25694. } else
  25695. R.warn("Showcase -> clickPanoObject: Unable to find pano."),
  25696. t && t({
  25697. success: !1,
  25698. error: "Unable to find pano."
  25699. })
  25700. }
  25701. function o(e, t) {
  25702. var i = this.findRankedPano(e, t);
  25703. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  25704. null)
  25705. }
  25706. function a(e, t) {
  25707. var i = this.findRankedtag(e, t);
  25708. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  25709. null)
  25710. }
  25711. function s(e, t) {
  25712. t.copy(I.FORWARD),
  25713. e.getDirection(t)
  25714. }
  25715. function l(e) {
  25716. function t(e) {
  25717. var t = (new c.Euler).setFromQuaternion(e.quaternion, "YXZ");
  25718. return {
  25719. x: c.Math.radToDeg(t._x),
  25720. y: c.Math.radToDeg(t._y),
  25721. z: c.Math.radToDeg(t._z)
  25722. }
  25723. }
  25724. var i = function(e) {
  25725. return e.alignmentType !== m.ALIGNED ? null : {
  25726. x: e.position.x,
  25727. y: e.position.y,
  25728. z: e.position.z
  25729. }
  25730. };
  25731. return {
  25732. panos: e.panos.list.map(function(n) {
  25733. var r = y.getCubemapUrls(e.urls, n.id, "high")[C.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  25734. return {
  25735. uuid: n.id,
  25736. aligned: n.alignmentType === m.ALIGNED,
  25737. neighbourUUIDs: n.neighbourUUIDs.slice(),
  25738. position: i(n),
  25739. rotation: t(n),
  25740. thumbnail: r
  25741. }
  25742. })
  25743. }
  25744. }
  25745. var c = e("three")
  25746. , h = e("./ApiHost")
  25747. , u = e("../util/logger")
  25748. , d = e("../util/common")
  25749. , p = e("../util/math")
  25750. , f = e("../enum/ModelManagerEvents")
  25751. , g = e("./PostMessageType")
  25752. , m = e("../enum/AlignmentType")
  25753. , v = e("../enum/Direction")
  25754. , A = e("./TransitionStyles")
  25755. , y = e("../util/panorama")
  25756. , C = e("../enum/GLCubeFaces")
  25757. , I = e("../enum/Vectors")
  25758. , E = e("../enum/Viewmode")
  25759. , b = e("../enum/WarpStyle")
  25760. , w = (e("../enum/Keys"),
  25761. e("../enum/PlayerEvents"))
  25762. , _ = e("../sdk/SdkEvents")
  25763. , I = e("../enum/Vectors")
  25764. , T = e("../enum/ControlEvents")
  25765. , x = e("../enum/RenderLayers")
  25766. , S = (e("../constants"),
  25767. e("../settings"))
  25768. , M = e("../lib/jpeg_encoder")
  25769. , R = new u(i)
  25770. , P = function() {
  25771. var e = function e() {
  25772. e.playerDirection.copy(e.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  25773. e.player.getDirection(e.playerDirection),
  25774. e.projectVectors();
  25775. var t = e.playerDirection.angleTo(e.lastFacingDirection);
  25776. if (e.angleTravelled += Math.abs(t),
  25777. e.angleTravelled >= Math.abs(e.angle)) {
  25778. if (e.active = !1,
  25779. e.onDone) {
  25780. var i = e.onDone;
  25781. i()
  25782. }
  25783. } else
  25784. e.lastFacingDirection.copy(e.playerDirection),
  25785. window.setTimeout(e, 4)
  25786. };
  25787. return e.active = !1,
  25788. e.angle = 0,
  25789. e.angleTravelled = 0,
  25790. e.playerDirection = new c.Vector3,
  25791. e.lastFacingDirection = new c.Vector3,
  25792. e.onDone = null,
  25793. e.player = null,
  25794. e.start = function(t, i, n, r) {
  25795. e.active = !0,
  25796. t && i && (i = 0),
  25797. e.angle = t || i,
  25798. e.xAngle = t,
  25799. e.yAngle = i,
  25800. e.angleTravelled = 0,
  25801. e.playerDirection.copy(n.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  25802. n.getDirection(e.playerDirection),
  25803. e.lastFacingDirection.copy(e.playerDirection),
  25804. e.projectVectors(),
  25805. e.onDone = r,
  25806. e.player = n,
  25807. e()
  25808. }
  25809. ,
  25810. e.projectVectors = function() {
  25811. e.xAngle && (e.playerDirection.projectOnPlane(I.UP),
  25812. e.lastFacingDirection.projectOnPlane(I.UP))
  25813. }
  25814. ,
  25815. e
  25816. }()
  25817. , O = function() {
  25818. var e = new c.Vector3;
  25819. return function(t) {
  25820. t ? (e.copy(t.position),
  25821. e.add(t.discPosition),
  25822. p.projectPositionToCanvas(e, this.player.camera, e),
  25823. this.click(e.x, e.y)) : R.warn("Showcase -> clicktagObject: Unable to find tag.")
  25824. }
  25825. }()
  25826. , L = function() {
  25827. return this.player.mode === E.PANORAMA ? S.insideLookLimitUp : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.minPolarAngle) : null
  25828. }
  25829. , D = function() {
  25830. return this.player.mode === E.PANORAMA ? S.insideLookLimitDown : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.maxPolarAngle) : null
  25831. }
  25832. , N = function(e) {
  25833. var t = new c.Vector3;
  25834. return function(e) {
  25835. var i = this.player.getDirection();
  25836. t.copy(i);
  25837. var n = t.y;
  25838. t.y = 0,
  25839. t.normalize();
  25840. var r = c.Math.radToDeg(t.angleTo(i)) * (n < 0 ? -1 : 1);
  25841. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.PANORAMA)
  25842. return 0 !== e && R.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  25843. 0;
  25844. this.player.mode === E.DOLLHOUSE && (r = -r);
  25845. var o = L.call(this) - .1
  25846. , a = D.call(this) + .1
  25847. , s = r + e;
  25848. s > o ? s = o : s < a && (s = a);
  25849. var l = s - r;
  25850. return e > 0 && l < .01 && (l = 0),
  25851. e < 0 && l > -.01 && (l = 0),
  25852. l
  25853. }
  25854. }()
  25855. , B = function() {
  25856. var e = new c.Euler;
  25857. return function(t) {
  25858. return e.setFromQuaternion(t.quaternion, "YXZ"),
  25859. {
  25860. position: {
  25861. x: t.position.x,
  25862. y: t.position.y,
  25863. z: t.position.z
  25864. },
  25865. rotation: {
  25866. x: c.Math.radToDeg(e.x),
  25867. y: c.Math.radToDeg(e.y),
  25868. z: 0
  25869. },
  25870. pano: t.currentPano ? t.currentPano.id : null,
  25871. mode: t.mode
  25872. }
  25873. }
  25874. }()
  25875. , F = null;
  25876. t.exports = {
  25877. init: function(e, t, i, n, r) {
  25878. V.init(e, t, i, r),
  25879. F = new Promise(function(e, t) {
  25880. i.on(w.Ready, function() {
  25881. e()
  25882. })
  25883. }
  25884. .bind(this));
  25885. var o = new h(window)
  25886. , a = o.waitForConnection();
  25887. a.then(function(e) {
  25888. o.on(g.ACTION, V.onMessageReceive.bind(V))
  25889. });
  25890. var s = function() {
  25891. var e = Date.now();
  25892. return function() {
  25893. if (!(Date.now() - e < 100)) {
  25894. var t = B(i);
  25895. o.sendEvent(_.MOVE, {
  25896. state: t
  25897. }),
  25898. e = Date.now()
  25899. }
  25900. }
  25901. }();
  25902. i.on(w.Move, s),
  25903. i.on(w.ViewChanged, s),
  25904. n.on(f.ActiveModelChanged, function(e) {
  25905. function t(e) {
  25906. var t, i = e.newPano.id;
  25907. e.oldPano && (t = e.oldPano.id),
  25908. i !== t && o.sendEvent(_.ENTER_PANO, {
  25909. oldPano: t,
  25910. newPano: i
  25911. })
  25912. }
  25913. var i = e.model
  25914. , n = e.oldModel;
  25915. V.model = i,
  25916. a.then(function() {
  25917. o.sendEvent(_.MODEL_LOADED, {
  25918. metadata: l(i)
  25919. })
  25920. }),
  25921. n && n.panos.forEach(function(e) {
  25922. e.removeEventListener("enter", t)
  25923. }),
  25924. i.panos.forEach(function(e) {
  25925. e.on("enter", t)
  25926. })
  25927. })
  25928. }
  25929. };
  25930. var V = {
  25931. director: null,
  25932. player: null,
  25933. controls: null,
  25934. sceneRenderer: null,
  25935. model: null,
  25936. init: function(e, t, i, n) {
  25937. this.director = e,
  25938. this.player = i,
  25939. this.controls = t,
  25940. this.sceneRenderer = n
  25941. },
  25942. handleToObject: {},
  25943. objectToHandle: {},
  25944. handleCount: 0,
  25945. onMessageReceive: function(e) {
  25946. if (e) {
  25947. var t = e.targetFunction
  25948. , i = e.params
  25949. , n = e.onDone;
  25950. t && this[t] && this[t](i, n)
  25951. }
  25952. },
  25953. waitForInit: function(e, t) {
  25954. F.then(t.bind({
  25955. success: !0,
  25956. message: "Init complete."
  25957. }))
  25958. },
  25959. moveToPano: function(e, t) {
  25960. var i = new c.Euler(0,0,0,"YXZ")
  25961. , n = new c.Quaternion;
  25962. return function(e, t) {
  25963. var r = e.pano
  25964. , o = e.rotation
  25965. , a = e.transition;
  25966. if (!this.model)
  25967. return t({
  25968. success: !1,
  25969. error: "The model has not been loaded yet"
  25970. });
  25971. var s = this.model.panos.get(r);
  25972. if (!s)
  25973. return t({
  25974. success: !1,
  25975. error: r + " does not exist in this model"
  25976. });
  25977. if (!o)
  25978. return t({
  25979. sucess: !1,
  25980. erorr: o + " is not a valid rotation"
  25981. });
  25982. i.set(c.Math.degToRad(o.x || 0), c.Math.degToRad(o.y || 0), c.Math.degToRad(o.z || 0), "YXZ"),
  25983. console.log(o.z);
  25984. var l = {
  25985. success: !0,
  25986. message: r
  25987. };
  25988. if (a === A.FADEOUT)
  25989. n.setFromEuler(i),
  25990. this.player.warpToPano(s, n, null, null, b.BLACK, null, null, t.bind(this, l));
  25991. else {
  25992. var h, u;
  25993. a === A.INSTANT && (h = 0,
  25994. u = 0);
  25995. var d = I.FORWARD.clone().applyEuler(i).add(s.position);
  25996. this.player.flyToPano({
  25997. pano: s,
  25998. lookAtPoint: d,
  25999. duration: h,
  26000. aimDuration: u
  26001. }, t.bind(this, l))
  26002. }
  26003. }
  26004. }(),
  26005. moveInDirection: function(e, t) {
  26006. var i = e.direction;
  26007. return "undefined" == typeof v[i] ? (R.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  26008. void (t && t({
  26009. success: !1,
  26010. error: "Invalid direction."
  26011. }))) : void this.player.flyLocalDirection(I[i].clone()).then(function(e) {
  26012. t(e ? {
  26013. success: !0,
  26014. message: "moved " + i
  26015. } : {
  26016. success: !1,
  26017. error: "Cannot move in direction: " + i
  26018. })
  26019. })
  26020. },
  26021. getPose: function(e, t) {
  26022. this.player.camera.position,
  26023. (new c.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ");
  26024. return t({
  26025. success: !0,
  26026. message: B(this.player)
  26027. })
  26028. },
  26029. takeScreenShot: function() {
  26030. var e = new c.PerspectiveCamera
  26031. , t = new c.WebGLRenderTarget;
  26032. return function(i, n) {
  26033. if (!i.resolution)
  26034. return n({
  26035. success: !1,
  26036. error: "An invalid resolution was specified"
  26037. });
  26038. if (i.resolution.width === -1 || i.resolution.height === -1) {
  26039. var r = this.sceneRenderer.renderer.getSize();
  26040. i.resolution.width = r.width,
  26041. i.resolution.height = r.height
  26042. }
  26043. e.layers.set(x.DEFAULT),
  26044. i.visibleObjects && (i.visibleObjects.showtags && e.layers.enable(x.TAG),
  26045. i.visibleObjects.showPucks && e.layers.enable(x.PANOMARKERS),
  26046. i.visibleObjects.showReticule && e.layers.enable(x.RETICULE));
  26047. var o = i.resolution.width
  26048. , a = i.resolution.height
  26049. , s = o / a;
  26050. e.position.copy(this.sceneRenderer.camera.position),
  26051. e.quaternion.copy(this.sceneRenderer.camera.quaternion),
  26052. e.projectionMatrix.copy(this.player.camera.projectionMatrix),
  26053. e.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / s,
  26054. t.setSize(o, a),
  26055. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, e, t);
  26056. var l = new Uint8Array(o * a * 4);
  26057. this.sceneRenderer.renderer.readRenderTargetPixels(t, 0, 0, o, a, l);
  26058. var c = M.encode({
  26059. data: l,
  26060. width: o,
  26061. height: a,
  26062. heading: 180,
  26063. pitch: 0
  26064. }, {
  26065. quality: 75,
  26066. flipY: !0
  26067. })
  26068. , h = "data:image/jpg;base64," + d.uint8ToBase64(c.data);
  26069. n({
  26070. success: !0,
  26071. message: h
  26072. })
  26073. }
  26074. }(),
  26075. findRankedPano: function(e, t) {
  26076. var i = new c.Vector3
  26077. , r = new c.Vector3;
  26078. return function(e, t) {
  26079. s(this.player, r),
  26080. n(t, r, i);
  26081. var o = this.player.rankedPanoInDirection(e, i);
  26082. if (o) {
  26083. var a = this.objectToHandle[o.id];
  26084. return a || (this.objectToHandle[o.id] = a = this.handleCount++,
  26085. this.handleToObject[a] = o),
  26086. a
  26087. }
  26088. return R.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  26089. -1
  26090. }
  26091. }(),
  26092. findRankedtag: function(e, t) {
  26093. var i = new c.Vector3
  26094. , r = new c.Vector3;
  26095. return function(e, t) {
  26096. s(this.player, r),
  26097. n(t, r, i);
  26098. var o = this.player.rankedtagInDirection(e, i);
  26099. if (o) {
  26100. var a = this.objectToHandle[o.sid];
  26101. return a || (this.objectToHandle[o.sid] = a = this.handleCount++,
  26102. this.handleToObject[a] = o),
  26103. a
  26104. }
  26105. return R.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  26106. -1
  26107. }
  26108. }(),
  26109. clickNearesttag: function(e) {
  26110. this.clickRankedtag(0, e)
  26111. },
  26112. clickRankedtag: function(e, t) {
  26113. var i = a.call(this, e, t);
  26114. i && O.call(this, i)
  26115. },
  26116. clickNearestPano: function(e, t) {
  26117. this.clickRankedPano(0, e, t)
  26118. },
  26119. clickRankedPano: function(e, t, i) {
  26120. var n = o.call(this, e, t);
  26121. n ? r.call(this, n, i) : i(null)
  26122. },
  26123. clickPano: function(e, t) {
  26124. var i = this.handleTable[e];
  26125. i ? r.call(this, i, t) : t(null)
  26126. },
  26127. rotateDirection: function() {
  26128. return function(e, t) {
  26129. var i = e.direction
  26130. , n = e.angle;
  26131. if (!P.active) {
  26132. var r = 0
  26133. , o = 0
  26134. , a = 0
  26135. , s = 0;
  26136. if (!n || isNaN(n))
  26137. return R.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  26138. void (t && t({
  26139. success: !1,
  26140. error: "Invalid rotation angle."
  26141. }));
  26142. if (this.player.mode === E.TRANSITIONING)
  26143. return R.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  26144. void (t && t({
  26145. success: !1,
  26146. error: "Cannot rotate while transitioning"
  26147. }));
  26148. if (i === v.RIGHT || i === v.LEFT)
  26149. i === v.RIGHT && (n = -n),
  26150. r = n > 0 ? -1 : 1,
  26151. a = n;
  26152. else {
  26153. if (i !== v.UP && i !== v.DOWN)
  26154. return R.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  26155. void (t && t({
  26156. success: !1,
  26157. error: "Invalid direction for rotation."
  26158. }));
  26159. if (this.player.mode === E.FLOORPLAN)
  26160. return R.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  26161. void (t && t({
  26162. success: !1,
  26163. error: "Cannot rotate " + i + " in floorplan mode"
  26164. }));
  26165. if (i === v.DOWN && (n = -n),
  26166. n = N.call(this, n),
  26167. 0 === n)
  26168. return R.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  26169. void (t && t({
  26170. success: !1,
  26171. error: "Already at maximum rotation in direction: " + i
  26172. }));
  26173. o = n > 0 ? 1 : -1,
  26174. s = n
  26175. }
  26176. var l = n;
  26177. n = c.Math.degToRad(n),
  26178. a = c.Math.degToRad(a),
  26179. s = c.Math.degToRad(s);
  26180. var h = this.controls.activeControl
  26181. , u = function() {
  26182. h.stopRotating(!0),
  26183. t && t({
  26184. success: !0,
  26185. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  26186. })
  26187. };
  26188. h.startRotating(r, o),
  26189. P.start(a, s, this.player, u)
  26190. }
  26191. }
  26192. }(),
  26193. rotate: function() {
  26194. var e = new c.Vector3
  26195. , t = new c.Vector3;
  26196. return function(i, n) {
  26197. var r = i.xAngle
  26198. , o = i.yAngle;
  26199. if (!P.active) {
  26200. if (r = r || 0,
  26201. o = o || 0,
  26202. isNaN(r) || isNaN(o))
  26203. return R.warn("Showcase -> rotate: Invalid rotation angle."),
  26204. void (n && n({
  26205. success: !1,
  26206. error: "Invalid rotation angle."
  26207. }));
  26208. if (this.player.mode === E.TRANSITIONING)
  26209. return R.warn("Automation -> rotate: Cannot rotate while transitioning"),
  26210. void (n && n({
  26211. success: !1,
  26212. error: "Cannot rotate while transitioning"
  26213. }));
  26214. Math.abs(r) < .01 && (r = 0),
  26215. Math.abs(o) < .01 && (o = 0);
  26216. var a = o;
  26217. o = N.call(this, o),
  26218. r = -r;
  26219. var s = a > 0 ? "UP" : "DOWN";
  26220. if (!r && a && !o)
  26221. return R.warn("Showcase -> rotate: Already at maximum rotation in direction: " + s),
  26222. void (n && n({
  26223. success: !1,
  26224. error: "Already at maximum rotation in direction: " + s
  26225. }));
  26226. a > o && R.warn("Showcase -> rotate: Reached maximum rotation in direction: " + s);
  26227. var l = o;
  26228. o = c.Math.degToRad(o),
  26229. r = c.Math.degToRad(r),
  26230. e.copy(this.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  26231. this.player.getDirection(e),
  26232. t.copy(e).applyAxisAngle(I.UP, r),
  26233. t.applyAxisAngle(I.RIGHT, o);
  26234. var h = (e.angleTo(t),
  26235. r > 0 ? -1 : r < 0 ? 1 : 0)
  26236. , u = o > 0 ? 1 : o < 0 ? -1 : 0;
  26237. Math.abs(r) > Math.abs(o) ? u *= Math.abs(o / r) : Math.abs(o) > Math.abs(r) && (h *= Math.abs(r / o));
  26238. var d = this.controls.activeControl
  26239. , p = function() {
  26240. d.stopRotating(!0),
  26241. n && n({
  26242. success: !0,
  26243. message: "Rotated " + i.xAngle.toFixed(2) + "° horizontally, " + l.toFixed(2) + "° vertically"
  26244. })
  26245. };
  26246. d.startRotating(h, u),
  26247. P.start(r, o, this.player, p)
  26248. }
  26249. }
  26250. }(),
  26251. panCamera: function(e, t) {
  26252. function i(e) {
  26253. switch (r.removeAllListeners(T.AutoPanComplete),
  26254. r.removeAllListeners(T.AutoPanInterrupt),
  26255. r.removeAllListeners(T.AutoPanClamped),
  26256. e) {
  26257. case T.AutoPanInterrupt:
  26258. t({
  26259. success: !0,
  26260. message: "Camera panning interrupted."
  26261. });
  26262. break;
  26263. case T.AutoPanClamped:
  26264. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  26265. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  26266. return void t({
  26267. success: !1,
  26268. error: "Already at edge of current model bounds."
  26269. });
  26270. var i = "The view point is outside the bounds for the current model. ";
  26271. i += "The view point was clamped to " + o(r.target.x, r.target.z),
  26272. console.warn(i)
  26273. }
  26274. case T.AutoPanComplete:
  26275. t({
  26276. success: !0,
  26277. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  26278. })
  26279. }
  26280. }
  26281. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.FLOORPLAN)
  26282. return t({
  26283. success: !1,
  26284. error: "Camera panning is not available in the current mode: " + this.player.mode
  26285. });
  26286. var n = e.position
  26287. , r = this.player.control;
  26288. r.setAutoPanPosition(n.x, n.z),
  26289. r.autoPan = !0;
  26290. var o = function(e, t) {
  26291. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  26292. };
  26293. r.on(T.AutoPanComplete, i.bind(this, T.AutoPanComplete)),
  26294. r.on(T.AutoPanInterrupt, i.bind(this, T.AutoPanInterrupt)),
  26295. r.on(T.AutoPanClamped, i.bind(this, T.AutoPanClamped))
  26296. },
  26297. click: function(e, t) {
  26298. var i = e.x
  26299. , n = e.y
  26300. , r = e.percentage;
  26301. r === !0 && (i = i / 100 * $("#player").width(),
  26302. n = n / 100 * $("#player").height()),
  26303. this.player.handleInputStart(i, n),
  26304. this.player.updateIntersect(),
  26305. this.player.handleInputEnd(i, n)
  26306. },
  26307. mouseOver: function(e, t) {
  26308. var i = e.x
  26309. , n = e.y
  26310. , r = e.percentage;
  26311. r === !0 && (i = i / 100 * $("#player").width(),
  26312. n = n / 100 * $("#player").height()),
  26313. this.player.handleInputMove(i, n),
  26314. this.player.updateIntersect()
  26315. },
  26316. moveToMode: function(e, t) {
  26317. function i(e) {
  26318. t(e ? {
  26319. success: !1,
  26320. error: "Failed to load new mode: " + e
  26321. } : {
  26322. success: !0,
  26323. message: "Moved to new mode: " + n
  26324. })
  26325. }
  26326. var n = e.mode;
  26327. n === E.PANORAMA || n === E.DOLLHOUSE || n === E.FLOORPLAN ? this.director.changeMode(n).then(function() {
  26328. i()
  26329. }, function(e) {
  26330. i(e)
  26331. }) : t({
  26332. success: !1,
  26333. error: "Invalid mode selection"
  26334. })
  26335. }
  26336. }
  26337. }
  26338. ).call(this, "/js/sdk/automation.js")
  26339. }
  26340. , {
  26341. "../constants": 8,
  26342. "../enum/AlignmentType": 17,
  26343. "../enum/ControlEvents": 21,
  26344. "../enum/Direction": 22,
  26345. "../enum/GLCubeFaces": 25,
  26346. "../enum/Keys": 30,
  26347. "../enum/ModelManagerEvents": 33,
  26348. "../enum/PlayerEvents": 40,
  26349. "../enum/RenderLayers": 41,
  26350. "../enum/Vectors": 50,
  26351. "../enum/Viewmode": 51,
  26352. "../enum/WarpStyle": 52,
  26353. "../lib/jpeg_encoder": 94,
  26354. "../sdk/SdkEvents": 161,
  26355. "../settings": 166,
  26356. "../util/common": 185,
  26357. "../util/logger": 189,
  26358. "../util/math": 190,
  26359. "../util/panorama": 191,
  26360. "./ApiHost": 159,
  26361. "./PostMessageType": 160,
  26362. "./TransitionStyles": 162,
  26363. three: 217
  26364. }],
  26365. 165: [function(e, t, i) {
  26366. "use strict";
  26367. function n(e) {
  26368. this.sourceWindow = e,
  26369. this.targetWindow = null,
  26370. this.targetOrigin = null,
  26371. this.id = Math.floor(1e5 * Math.random()),
  26372. this.bindEvents()
  26373. }
  26374. var r = e("./PostMessageType")
  26375. , o = e("events").EventEmitter;
  26376. n.prototype = Object.create(o.prototype),
  26377. n.prototype.bindEvents = function() {
  26378. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  26379. }
  26380. ,
  26381. n.prototype.setTarget = function(e, t) {
  26382. this.targetWindow = e,
  26383. this.targetOrigin = t
  26384. }
  26385. ,
  26386. n.prototype.onPostmessageReceived = function(e) {
  26387. var t = e.origin || e.originalEvent.origin
  26388. , i = e.source;
  26389. switch (e.data.type) {
  26390. case r.CONNECT:
  26391. break;
  26392. case r.RESPONSE:
  26393. if (this.id !== e.data.toId)
  26394. return;
  26395. default:
  26396. if (!this.validateMessageOrigin(t))
  26397. return
  26398. }
  26399. var n = e.data;
  26400. n.source = i,
  26401. n.origin = t,
  26402. n.timestamp = Date.now(),
  26403. this.emit(e.data.type, n)
  26404. }
  26405. ,
  26406. n.prototype.validateMessageOrigin = function(e) {
  26407. return "*" === this.targetOrigin || e === this.targetOrigin
  26408. }
  26409. ,
  26410. n.prototype.send = function(e) {
  26411. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  26412. this.targetWindow.postMessage(e, this.targetOrigin))
  26413. }
  26414. ,
  26415. t.exports = n
  26416. }
  26417. , {
  26418. "./PostMessageType": 160,
  26419. events: 202
  26420. }],
  26421. 166: [function(e, t, i) {
  26422. "use strict";
  26423. var n = e("three")
  26424. , r = e("./util/browser")
  26425. , o = e("./enum/Viewmode")
  26426. , a = e("./enum/VROption")
  26427. , s = e("./enum/Colors")
  26428. , l = e("./enum/WarpStyle")
  26429. , c = e("./util/easing")
  26430. , h = e("./util/common")
  26431. , u = e("./util/showcase")
  26432. , d = e("./constants")
  26433. , p = {
  26434. debug: !1,
  26435. version: "2.25.6-0-gd87e5b1",
  26436. languageTag: r.valueFromHash("lang", null),
  26437. pageTitle: "四维虚拟漫游",
  26438. authorizationHeader: u.getAuthorizationHeader(),
  26439. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  26440. logLevel: r.valueFromHash("log", 2),
  26441. skyboxRadius: 2500,
  26442. modelBoundsPadding: 5,
  26443. showNeighbors: !1,
  26444. brand: r.valueFromHash("brand", !0),
  26445. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  26446. startHighlights: r.valueFromHash("hl", -1),
  26447. specialEdition: r.valueFromHash("bn", 0),
  26448. useWheel: r.valueFromHash("wh", !0),
  26449. crossOrigin: "anonymous",
  26450. fancierTransition: !1,
  26451. wireframe: !1,
  26452. skyboxWireframe: !1,
  26453. modelAlpha: 1,
  26454. highlightPanoSelection: !1,
  26455. showSweeps: !0,
  26456. showSkyboxes: !1,
  26457. showMesh: !0,
  26458. showFloors: !1,
  26459. showFloorDuration: 300,
  26460. showFloorDelay: 300,
  26461. hideFloorDuration: 300,
  26462. hideFloorDelay: 0,
  26463. reticuleOpacityTransitionTime: 250,
  26464. reticuleColor: window.DATA.mouseMarkerColor || s.newBlue, // 方奕卓 配置鼠标标志颜色
  26465. markerOpacityTransitionTime: 500,
  26466. guiAnimationSpeed: 250,
  26467. highlightAnimationDuration: 500,
  26468. modelComponentLoadSpinnerDelay: 150,
  26469. captureErrors: !1,
  26470. maxMobileTextures: 6,
  26471. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  26472. startupFlyinDelay: 3e3,
  26473. dollhouseDefault: {
  26474. minDistance: 15,
  26475. maxDistance: 50,
  26476. minPolarAngle: n.Math.degToRad(10),
  26477. maxPolarAngle: n.Math.degToRad(90)
  26478. },
  26479. hideReticuleTimeout: 1e3,
  26480. analytics: {
  26481. inactivityThreshold: 30,
  26482. sessionTrackingRate: .15,
  26483. maxTrackedErrors: 20,
  26484. sessionDurationPingFrequency: 10,
  26485. sessionDurationTimeout: 15
  26486. },
  26487. flydown: {
  26488. movementEasing: "easeInOutQuad",
  26489. movementDelay: .001,
  26490. rotationEasing: "easeInOutQuad",
  26491. rotationDelay: .5,
  26492. modelTextureDelay: .75,
  26493. skyboxDelay: .75
  26494. },
  26495. transition: {
  26496. flySpeed: .001,
  26497. flyTime: 750,
  26498. flytimeMaxDistanceThreshold: 5,
  26499. flytimeDistanceMultiplier: 150,
  26500. aimTime: 1500,
  26501. aimSlowFactor: 1.5,
  26502. blur: 0.8,
  26503. movementEasing: "easeInOutQuad",
  26504. blendEasing: "easeInOutQuad",
  26505. fastForwardFactor: 4,//r.valueFromHash("mfis", 3) //快速停止导览的速度,原先是3
  26506. },
  26507. show360Views: {
  26508. enabled: !0,
  26509. transitionTime: 1e3
  26510. },
  26511. quickstart: {
  26512. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  26513. animation: 1400,
  26514. showTextDelay: 500,
  26515. fadeOutDelay: 3e3,
  26516. fovChange: 10
  26517. },
  26518. appConfig: {
  26519. webvr_version: null,
  26520. segment_key: null,
  26521. embedly_key: null,
  26522. branch_key: null,
  26523. keen_write_key: null,
  26524. keen_project_id: null
  26525. },
  26526. vr: {
  26527. enabled: !0,
  26528. allowWebVR: !1,
  26529. option: r.valueFromHash("vr", a.CONTEXTUAL)
  26530. },
  26531. share: {
  26532. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  26533. },
  26534. input: {
  26535. longTapThreshold: 200,
  26536. moveToleranceNDC: 0.01,//.08,
  26537. touchMoveThreshold: 25
  26538. },
  26539. help: {
  26540. modalStayDuration: 600
  26541. },
  26542. immersive: {
  26543. timeToShowAgain: 1250,
  26544. uiStayDuration: 600
  26545. },
  26546. tourInteraction: {
  26547. disabled: "0" === r.valueFromHash("tourcta", null),
  26548. showPauseButton: 1e3,
  26549. showModal: 1500,
  26550. allowNextClick: 200,
  26551. largeModal: "1" === r.valueFromHash("tourcta", null),
  26552. smallModal: "2" === r.valueFromHash("tourcta", null)
  26553. },
  26554. labels: {
  26555. enabled: !1,
  26556. hideUntilStart: !0,
  26557. fadeInDuration: 250,
  26558. fadeInDelay: 250,
  26559. fadeOutDuration: 250,
  26560. fadeOutDelay: 0,
  26561. zoomHideThreshhold: {
  26562. mobile: r.isSmallScreen() ? .45 : .6,
  26563. desktop: 2
  26564. },
  26565. zoomTruncateThreshhold: {
  26566. mobile: r.isSmallScreen() ? .35 : .45,
  26567. desktop: .85
  26568. },
  26569. minLengthForTruncate: 16,
  26570. truncateLength: 12,
  26571. truncateSuffix: "..."
  26572. },
  26573. tags: {
  26574. enabled: r.valueFromHash("mt", 1),
  26575. startup: {
  26576. hideUntilStart: !0,
  26577. fadeInDuration: 500,
  26578. fadeInDelay: 100
  26579. },
  26580. visibility: {
  26581. anyDistance: !0,
  26582. visibleDistance: 8,
  26583. cameraClearance: .1,
  26584. alphaTestLevel: .05,
  26585. hideViaFloor: !0,
  26586. hideOffScreenDisc: !1,
  26587. hideOffScreenObject: !1
  26588. },
  26589. disc: {
  26590. opacity: 1,
  26591. disabledOpacity: .5,
  26592. scale: {
  26593. nearBound: 1.5,
  26594. farBound: 4.8,
  26595. linkFarBound: !1,
  26596. linkPercent: 40,
  26597. maxSize: 80,
  26598. minSize: 40,
  26599. baseViewportSize: 800,
  26600. responsiveness: 100
  26601. }
  26602. },
  26603. pole: {
  26604. enabled: !0,
  26605. height: .5,
  26606. width: 2,
  26607. opacity: .5,
  26608. color: "white"
  26609. },
  26610. navigate: {
  26611. nearestPano: !0,
  26612. lineOfSight: !0,
  26613. reactivate: !0,
  26614. aimAt: "disc",
  26615. tiltTolerance: 25,
  26616. rotateSpeedFactor: .6
  26617. }
  26618. },
  26619. path: {
  26620. color: window.DATA.floorMarkerColor || s.newBlue, // 方奕卓 配置导览标志颜色
  26621. colorUp: s._desat(s.newBlue, .5),
  26622. colorDown: s._darken(s.newBlue, .35),
  26623. opacity: .5,
  26624. style: "ribbon",
  26625. height: .025,
  26626. ribbonWidth: .24,
  26627. outsideHeight: .5,
  26628. waypointRadius: .5,
  26629. waypointIndoorRadius: .24,
  26630. waypointPulse: 1e3,
  26631. typ: l.BLACK,
  26632. meshFree: r.valueFromHash("mf", 1),
  26633. mapGuides: r.valueFromHash("guides", !0),
  26634. fadeInTime: 400,
  26635. fadeOutTime: 300
  26636. },
  26637. warp: {
  26638. nearPanoDist: .1,
  26639. matchCam: !1,
  26640. blur: .33,
  26641. fastTime: 1500,
  26642. teleportTime: 1500,//瞬间过渡的时间
  26643. flytimeDistanceMultiplier:150,//add
  26644. flyTime:750,//add
  26645. outsideTime: 2e3,
  26646. lookAheadMax: .3,
  26647. lookAheadDist: 2.5,
  26648. softPushDist: .37,
  26649. softPushEnd: .3,
  26650. softBendAngle: 8,
  26651. softBendTilt: 4,
  26652. softBendEnd: .3,
  26653. doBurns: true, //r.valueFromHash("kb", !0),
  26654. burnsAngle: 8, //导览在每个点停留时的旋转角度
  26655. minBurnsAngle: 35,
  26656. minDownAngle: -35,
  26657. maxTurnPerSec: 280,
  26658. maxAimPerSec: 35,
  26659. minRotation: 12,
  26660. maxAimRotation: 33.2,
  26661. turnFriction: .2,
  26662. flySpeed: .01,
  26663. minWarpTime: 1200,
  26664. warpInterruptionRedirectTime: 500,
  26665. tourStepDelay: r.valueFromHash("st", 0),
  26666. walkDelay: 0,
  26667. walkMaxDist: 50,
  26668. walkMinDist: .8,
  26669. walkSlideShowThreshhold: 3000,
  26670. walkExtraPanosDistance: .4,
  26671. timePerMeter: 1200,
  26672. motionLeadTime: 5000,
  26673. movementEasing: "easeInOutQuad",
  26674. blendEasing: "easeInOutQuad",
  26675. showBunny: !1,
  26676. loop: r.valueFromHash("lp", !1),
  26677. auto: r.valueFromHash("ts", -1),
  26678. eOrder: 'YXZ', //"YXZ",
  26679. stepFactor: .25,
  26680. brakeStrength: 2,
  26681. minBrakeAngle: .1,
  26682. maxBrakeAngle: 1.8,
  26683. climbEffort: 4
  26684. },
  26685. rotationFriction: .05,
  26686. rotationAccelerationInside: 4.5,
  26687. rotationAccelerationOutside: .15,
  26688. rotationAfterMoveMultiplier: 40,
  26689. rotationAfterMoveHistoryCount: 5,
  26690. panFriction: .09,
  26691. panAccelerationOutside: 60,
  26692. onload: r.valueFromHash("onload", o.PANORAMA),
  26693. zoomNearLimit: .1,
  26694. zoomFarLimit: 50,
  26695. navigation: {
  26696. panoScores: !1,
  26697. mouseDirection: !0,
  26698. filterStrictness: .75,
  26699. angleFactor: -30,
  26700. directionFactor: 10,
  26701. distanceFactor: -1,
  26702. optionalityFactor: 3
  26703. },
  26704. sdkInit: !1,
  26705. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  26706. console: r.valueFromHash("console", !1),
  26707. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  26708. panoramaNeighbourMaxDistance: 5,
  26709. panoFloorClickRadius: .35,
  26710. showScreenshotLocations: !1,
  26711. showAxis: !1,
  26712. showNeighbourRaycasts: !1,
  26713. colorMarkerOnLoad: !1,
  26714. colorMarkerByFloor: !1,
  26715. tiling: {
  26716. panoPreRenderRepeatDelay: 2500,
  26717. panoPreRenderDelay: 500,
  26718. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  26719. tilingFlagNames: ["usetiles", "tiles"],
  26720. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  26721. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  26722. overlayStyle: r.valueFromHash("tileoverlay", 0),
  26723. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  26724. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  26725. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 1/* 2 */),
  26726. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  26727. customCompression: r.valueFromHash("tilecustcomp", 0),
  26728. // mobileHighQualityOverride: !1,
  26729. mobileHighQualityOverride: 1,
  26730. allowUltraHighResolution: true
  26731. },
  26732. zoom: {
  26733. enabled: true,
  26734. forceOff: r.valueFromHash("nozoom", 0),
  26735. overridemax: r.valueFromHash("maxzoom", null),
  26736. overridemin: r.valueFromHash("minzoom", null),
  26737. max: d.highQualityMaxZoom,
  26738. min: 1,
  26739. transitionStyle: r.valueFromHash("zoomtrans", 1),
  26740. activationThreshold: 1.1,
  26741. restoreTime: 500
  26742. },
  26743. profiling: {
  26744. enabled: r.valueFromHash("mem", !1)
  26745. }
  26746. };
  26747. p = h.deepExtend(p, d, {
  26748. insideFOV: r.valueFromHash("fov", d.insideFOV),
  26749. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  26750. panorama: {
  26751. transitionTime: 1e3,
  26752. modelAlpha: 0,
  26753. modelAlphaDelay: p.flydown.modelTextureDelay,
  26754. modelAlphaLength: 1,
  26755. skyboxOpacity: 1,
  26756. skyboxOpacityDelay: p.flydown.skyboxDelay,
  26757. skyboxOpacityLength: .9,
  26758. fovLength: 1,
  26759. fovDelay: 0,
  26760. cameraMatrixDuration: .8,
  26761. cameraMatrixDelay: 0,
  26762. cameraMatrixEase: c.easeInCubic,
  26763. reticuleOpacity: 1,
  26764. markerOpacity: .3,
  26765. markerOpacityOnHover: 1
  26766. },
  26767. dollhouse: {
  26768. transitionTime: 1e3,
  26769. modelAlpha: 1,
  26770. modelAlphaDelay: 0,
  26771. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  26772. skyboxOpacity: 0,
  26773. skyboxOpacityDelay: 0,
  26774. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  26775. fovLength: 1,
  26776. fovDelay: 0,
  26777. cameraMatrixDuration: .8,
  26778. cameraMatrixDelay: .3,
  26779. cameraMatrixEase: c.easeInCubic,
  26780. reticuleOpacity: 1,
  26781. markerOpacity: 0,
  26782. markerOpacityOnHover: 0
  26783. },
  26784. floorplan: {
  26785. transitionTime: 1e3,
  26786. modelAlpha: 1,
  26787. modelAlphaDelay: 0,
  26788. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  26789. skyboxOpacity: 0,
  26790. skyboxOpacityDelay: 0,
  26791. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  26792. fovLength: 1,
  26793. fovDelay: 0,
  26794. cameraMatrixDuration: .5,
  26795. cameraMatrixDelay: 0,
  26796. cameraMatrixEase: c.easeOutCubic,
  26797. reticuleOpacity: 1,
  26798. markerOpacity: 0,
  26799. markerOpacityOnHover: 0,
  26800. cameraHeight: 50
  26801. },
  26802. transitioning: {
  26803. reticuleOpacity: 0,
  26804. markerOpacity: .3,
  26805. markerOpacityOnHover: 1
  26806. },
  26807. "floorplan-dollhouse": {
  26808. rotationDelay: 0,
  26809. rotationDuration: 1
  26810. },
  26811. "floorplan-panorama": {
  26812. rotationDelay: .5,
  26813. rotationDuration: 1
  26814. },
  26815. "dollhouse-panorama": {
  26816. rotationDelay: .5,
  26817. rotationDuration: 1
  26818. },
  26819. "dollhouse-floorplan": {
  26820. rotationDelay: 0,
  26821. rotationDuration: 1,
  26822. cameraMatrixDuration: 1.05,
  26823. cameraMatrixDelay: .5
  26824. },
  26825. "panorama-dollhouse": {
  26826. rotationDelay: 0,
  26827. rotationDuration: .5
  26828. },
  26829. "panorama-floorplan": {
  26830. transitionTime: 1500,
  26831. rotationDelay: 0,
  26832. rotationDuration: .5
  26833. }
  26834. }),
  26835. p.path.meshFree && (p.path.typ = l.WALK),
  26836. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  26837. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  26838. window._settings = t.exports = p
  26839. }
  26840. , {
  26841. "./constants": 8,
  26842. "./enum/Colors": 19,
  26843. "./enum/VROption": 47,
  26844. "./enum/Viewmode": 51,
  26845. "./enum/WarpStyle": 52,
  26846. "./util/browser": 182,
  26847. "./util/common": 185,
  26848. "./util/easing": 186,
  26849. "./util/showcase": 193,
  26850. three: 217
  26851. }],
  26852. 167: [function(e, t, i) {
  26853. "use strict";
  26854. var n = e("three")
  26855. , r = e("./settings")
  26856. , 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"
  26857. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  26858. t.exports = {
  26859. basicTextured: {
  26860. uniforms: {
  26861. tDiffuse: {
  26862. type: "t",
  26863. value: null
  26864. },
  26865. alpha: {
  26866. type: "f",
  26867. value: 1
  26868. }
  26869. },
  26870. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  26871. 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}"
  26872. },
  26873. copyCubeMap: {
  26874. uniforms: {
  26875. tDiffuse: {
  26876. type: "t",
  26877. value: null
  26878. },
  26879. alpha: {
  26880. type: "f",
  26881. value: 1
  26882. }
  26883. },
  26884. 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}",
  26885. 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}"
  26886. },
  26887. cube: {
  26888. uniforms: {
  26889. map: {
  26890. type: "t",
  26891. value: null
  26892. },
  26893. opacity: {
  26894. type: "f",
  26895. value: 1
  26896. }
  26897. },
  26898. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  26899. 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"
  26900. },
  26901. model: {
  26902. uniforms: {
  26903. map: {
  26904. type: "t",
  26905. value: null
  26906. },
  26907. modelAlpha: {
  26908. type: "f",
  26909. value: r.modelAlpha
  26910. },
  26911. opacity: {
  26912. type: "f",
  26913. value: 1
  26914. },
  26915. progress: {
  26916. type: "f",
  26917. value: 0
  26918. },
  26919. blackout: {
  26920. type: "i",
  26921. value: 0
  26922. },
  26923. pano0Map: {
  26924. type: "t",
  26925. value: null
  26926. },
  26927. pano0Position: {
  26928. type: "v3",
  26929. value: new n.Vector3
  26930. },
  26931. pano0Matrix: {
  26932. type: "m4",
  26933. value: new n.Matrix4
  26934. },
  26935. pano1Map: {
  26936. type: "t",
  26937. value: null
  26938. },
  26939. pano1Position: {
  26940. type: "v3",
  26941. value: new n.Vector3
  26942. },
  26943. pano1Matrix: {
  26944. type: "m4",
  26945. value: new n.Matrix4
  26946. }
  26947. },
  26948. vertexShader: o + `uniform vec3 pano0Position;
  26949. uniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\n
  26950. uniform mat4 pano1Matrix;\n\nvarying vec2 vUv;\n
  26951. varying vec3 vWorldPosition0;
  26952. varying vec3 vWorldPosition1;
  26953. uniform int blackout;
  26954. void main() {
  26955. vUv = uv;
  26956. vec4 worldPosition = modelMatrix * vec4(position, 1.0);
  26957. vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;
  26958. vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;
  26959. vWorldPosition0.x *= -1.0;
  26960. vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;
  26961. vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;
  26962. vWorldPosition1.x *= -1.0;
  26963. gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  26964. }`,
  26965. fragmentShader: a + `uniform sampler2D map;\nuniform float modelAlpha;\nuniform float opacity;\n
  26966. uniform float progress;\nuniform int blackout;\n\nuniform vec3 pano0Position;\nuniform samplerCube pano0Map;\n\nuniform vec3 pano1Position;\nuniform samplerCube pano1Map;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\n\n
  26967. void main() {
  26968. const vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);
  26969. const vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);
  26970. vec4 colorFromPanos;
  26971. if (blackout == 5){//add for TransitionPass
  26972. colorFromPanos = textureCube( pano1Map, vWorldPosition1.xyz) ;
  26973. }else{
  26974. vec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);
  26975. vec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);
  26976. if (blackout == 0) {colorFromPanos = mix(colorFromPano0, colorFromPano1, progress);}
  26977. else if (blackout == 1) {
  26978. colorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));
  26979. colorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));
  26980. }
  26981. else if (blackout == 2) {colorFromPanos = mix(colorFromPano0, BLACK, progress);}
  26982. else if (blackout == 3) {colorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));}
  26983. }
  26984. //#ifdef useModelMap //起不了作用为啥
  26985. if(modelAlpha>0.0){
  26986. vec4 colorFromTexture = texture2D( map, vUv );
  26987. colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);
  26988. }
  26989. //#endif
  26990. float whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);
  26991. colorFromPanos = mix(colorFromPanos, GREY, whiteness);
  26992. gl_FragColor = vec4(colorFromPanos.rgb, opacity);
  26993. }`
  26994. },
  26995. hot:{
  26996. uniforms:{
  26997. color:{
  26998. type: "c",
  26999. value: new n.Color( 0xff2200 )
  27000. },
  27001. opac:{
  27002. type: "f",
  27003. value: 0
  27004. },
  27005. texture1:{
  27006. type: "t",
  27007. value: null
  27008. },
  27009. texture2:{
  27010. type: "t",
  27011. value: null
  27012. }
  27013. },
  27014. vertexShader:"varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  27015. 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"
  27016. },
  27017. modelOutside: {
  27018. uniforms: {
  27019. map: {
  27020. type: "t",
  27021. value: null
  27022. },
  27023. opacity: {
  27024. type: "f",
  27025. value: 1
  27026. }
  27027. },
  27028. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  27029. 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"
  27030. },
  27031. ribbon: {
  27032. uniforms: {
  27033. map: {
  27034. type: "t",
  27035. value: null
  27036. },
  27037. opacity: {
  27038. type: "f",
  27039. value: 1
  27040. },
  27041. color: {
  27042. type: "c",
  27043. value: new n.Color(r.path.color)
  27044. }
  27045. },
  27046. 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",
  27047. 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"
  27048. },
  27049. waypoint: {
  27050. uniforms: {
  27051. map: {
  27052. type: "t",
  27053. value: null
  27054. },
  27055. opacity: {
  27056. type: "f",
  27057. value: 1
  27058. },
  27059. pulse: {
  27060. type: "f",
  27061. value: 1
  27062. },
  27063. nearFade: {
  27064. type: "v2",
  27065. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  27066. },
  27067. color: {
  27068. type: "c",
  27069. value: new n.Color(r.reticuleColor)
  27070. }
  27071. },
  27072. 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",
  27073. 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"
  27074. },
  27075. modelDebug: {
  27076. uniforms: {
  27077. map: {
  27078. type: "t",
  27079. value: null
  27080. },
  27081. modelAlpha: {
  27082. type: "f",
  27083. value: r.modelAlpha
  27084. },
  27085. depthmapRatio: {
  27086. type: "f",
  27087. value: 0
  27088. },
  27089. opacity: {
  27090. type: "f",
  27091. value: 1
  27092. },
  27093. progress: {
  27094. type: "f",
  27095. value: 0
  27096. },
  27097. considerOcclusion: {
  27098. type: "i",
  27099. value: r.fancierTransition
  27100. },
  27101. highlightPanoSelection: {
  27102. type: "i",
  27103. value: 0
  27104. },
  27105. useThirdPano: {
  27106. type: "i",
  27107. value: r.useThirdPano
  27108. },
  27109. pano0Map: {
  27110. type: "t",
  27111. value: null
  27112. },
  27113. pano0Depth: {
  27114. type: "t",
  27115. value: null
  27116. },
  27117. pano0Position: {
  27118. type: "v3",
  27119. value: new n.Vector3
  27120. },
  27121. pano0Matrix: {
  27122. type: "m4",
  27123. value: new n.Matrix4
  27124. },
  27125. pano0Weight: {
  27126. type: "f",
  27127. value: r.transition.pano0Weight
  27128. },
  27129. pano1Map: {
  27130. type: "t",
  27131. value: null
  27132. },
  27133. pano1Depth: {
  27134. type: "t",
  27135. value: null
  27136. },
  27137. pano1Position: {
  27138. type: "v3",
  27139. value: new n.Vector3
  27140. },
  27141. pano1Matrix: {
  27142. type: "m4",
  27143. value: new n.Matrix4
  27144. },
  27145. pano1Weight: {
  27146. type: "f",
  27147. value: r.transition.pano1Weight
  27148. },
  27149. pano2Map: {
  27150. type: "t",
  27151. value: null
  27152. },
  27153. pano2Depth: {
  27154. type: "t",
  27155. value: null
  27156. },
  27157. pano2Position: {
  27158. type: "v3",
  27159. value: new n.Vector3
  27160. },
  27161. pano2Matrix: {
  27162. type: "m4",
  27163. value: new n.Matrix4
  27164. },
  27165. pano2Weight: {
  27166. type: "f",
  27167. value: r.transition.pano2Weight
  27168. }
  27169. },
  27170. 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",
  27171. 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"
  27172. },
  27173. customDepth: {
  27174. uniforms: {
  27175. panoPosition: {
  27176. type: "v3",
  27177. value: new n.Vector3
  27178. }
  27179. },
  27180. 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",
  27181. 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"
  27182. },
  27183. skysphere: {
  27184. uniforms: {
  27185. radius: {
  27186. type: "f",
  27187. value: 0
  27188. }
  27189. },
  27190. 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",
  27191. 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"
  27192. },
  27193. tagDisc: {
  27194. uniforms: {
  27195. opacity: {
  27196. type: "f",
  27197. value: 0
  27198. },
  27199. color: {
  27200. type: "c",
  27201. value: new n.Color
  27202. },
  27203. bg: {
  27204. type: "t",
  27205. value: null
  27206. },
  27207. mask: {
  27208. type: "t",
  27209. value: null
  27210. }
  27211. },
  27212. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  27213. 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"
  27214. }
  27215. }
  27216. }
  27217. , {
  27218. "./settings": 166,
  27219. three: 217
  27220. }],
  27221. 168: [function(e, t, i) {
  27222. (function(i) {
  27223. "use strict";
  27224. var n = e("three")
  27225. , r = (e("url"),
  27226. e("./util/ajax"))
  27227. , o = e("./settings")
  27228. , a = e("./util/logger")
  27229. , s = e("./util/math")
  27230. , l = e("./util/showcase")
  27231. , c = e("./objects/Panorama")
  27232. , h = new a(i)
  27233. , u = e("./model/Model")
  27234. , d = e("./shaders")
  27235. , p = e("./util/transitions")
  27236. , f = e("./objects/Chunk")
  27237. , g = e("./objects/Reticule")
  27238. , m = e("./objects/Skybox")
  27239. , v = e("./objects/Floor")
  27240. , A = e("./cameras/DollhouseCamera")
  27241. , y = e("./cameras/FloorplanCamera")
  27242. , C = e("./cameras/PanoramaCamera")
  27243. , I = e("./controls/DollhouseControls")
  27244. , E = e("./controls/FloorplanControls")
  27245. , b = e("./controls/PanoramaControls");
  27246. n.ImageUtils.crossOrigin = o.crossOrigin,
  27247. t.exports = {
  27248. shaders: d,
  27249. transitions: p,
  27250. Model: u,
  27251. Chunk: f,
  27252. Floor: v,
  27253. Skybox: m,
  27254. Reticule: g,
  27255. Panorama: c,
  27256. DollhouseCamera: A,
  27257. FloorplanCamera: y,
  27258. PanoramaCamera: C,
  27259. DollhouseControls: I,
  27260. FloorplanControls: E,
  27261. PanoramaControls: b,
  27262. getModel: function(e) {
  27263. if (!e.url)
  27264. throw 'getModel(): missing parameter "url"';
  27265. e.autoload = void 0 === e.autoload || e.autoload;
  27266. var t = l.parseSidUrl(e.url);
  27267. e.urlBase = t.urlBase,
  27268. e.urlModel = t.urlModel,
  27269. e.urlFiles = t.urlFiles;
  27270. var i = this._getPlatformError();
  27271. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  27272. this._loadModel().then(this._buildModel.bind(this)))
  27273. },
  27274. _getPlatformError: function() {
  27275. 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"
  27276. },
  27277. _loadModel: function() {
  27278. return r.get(this.options.urlModel, {
  27279. responseType: "json",
  27280. prefetchFrom: "model",
  27281. auth: l.getAuthorizationHeader()
  27282. }).then(null, function() {
  27283. return h.warn("Model loading failed at initial metadata load"),
  27284. "loading-failed"
  27285. })
  27286. },
  27287. _buildModel: function(e) {
  27288. e = l.normalizeModeldata(e, s);
  27289. var t = new u(this.options,e);
  27290. return this.options.autoload ? t.load(!0) : $.when(t)
  27291. }
  27292. }
  27293. }
  27294. ).call(this, "/js/showcase.js")
  27295. }
  27296. , {
  27297. "./cameras/DollhouseCamera": 5,
  27298. "./cameras/FloorplanCamera": 6,
  27299. "./cameras/PanoramaCamera": 7,
  27300. "./controls/DollhouseControls": 10,
  27301. "./controls/FloorplanControls": 11,
  27302. "./controls/PanoramaControls": 13,
  27303. "./model/Model": 139,
  27304. "./objects/Chunk": 144,
  27305. "./objects/Floor": 146,
  27306. "./objects/Panorama": 148,
  27307. "./objects/Reticule": 149,
  27308. "./objects/Skybox": 152,
  27309. "./settings": 166,
  27310. "./shaders": 167,
  27311. "./util/ajax": 181,
  27312. "./util/logger": 189,
  27313. "./util/math": 190,
  27314. "./util/showcase": 193,
  27315. "./util/transitions": 195,
  27316. three: 217,
  27317. url: 208
  27318. }],
  27319. 169: [function(e, t, i) {
  27320. "use strict";
  27321. function n() {
  27322. var e = {
  27323. renderTarget: null,
  27324. inUse: !1,
  27325. size: -1,
  27326. pano: null
  27327. };
  27328. return e
  27329. }
  27330. function r(e) {
  27331. M.push(e)
  27332. }
  27333. function o(e) {
  27334. var t = n();
  27335. return t.inUse = !0,
  27336. t.size = e,
  27337. r(t),
  27338. t
  27339. }
  27340. function a(e) {
  27341. for (var t = 0; t < M.length; t++) {
  27342. var i = M[t];
  27343. if (!i.inUse && i.size === e)
  27344. return i.inUse = !0,
  27345. i
  27346. }
  27347. return null
  27348. }
  27349. function s(e) {
  27350. for (var t = 0; t < M.length; t++) {
  27351. var i = M[t];
  27352. if (i.renderTarget === e)
  27353. return i.inUse = !1,
  27354. !0
  27355. }
  27356. return !1
  27357. }
  27358. function l() {
  27359. this.tileDirectory = {},
  27360. this.activeRenderTargetDescriptors = {},
  27361. this.activePanos = [],
  27362. this.panoLODDescriptors = {},
  27363. this.panoDescriptors = {},
  27364. this.tileTrees = {},
  27365. this.sceneRenderer = null,
  27366. this.tileDownloader = null,
  27367. this.forceQueue = [],
  27368. this.uploadQueues = {},
  27369. this.uploadInterval = null,
  27370. this.uploadIntervalCancelled = !1,
  27371. this.usingTileOverlay = !1,
  27372. this.overlayTilesLoaded = !1,
  27373. this.overlayTileBase = null,
  27374. this.overlayTilesBasic = {},
  27375. this.overlayTilesEnhanced = {},
  27376. this.zoomRenderTarget = null,
  27377. this.zoomPano = null,
  27378. this.zoomingActive = !1,
  27379. this.zoomPanoId = null,
  27380. this.zoomPanoRenderingDisabled = !1,
  27381. this.direction = new h.Vector3,
  27382. this.initTime = -1,
  27383. this.maxBaseUploadsPerFrame = x,
  27384. this.maxNonBaseUploadsPerFrame = T
  27385. }
  27386. function c() {
  27387. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (b = !0,
  27388. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  27389. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(w) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  27390. }
  27391. /* function c() {
  27392. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (b = !0,
  27393. this.updateUploadQueue(1, 2),
  27394. w = 18,
  27395. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(w) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  27396. } */
  27397. var h = e("three")
  27398. , u = e("../exception/BasicException")
  27399. , d = e("../settings")
  27400. , p = e("../enum/PanoSizeClass")
  27401. , f = (e("../objects/Panorama"),
  27402. e("../enum/PanoRendererEvents"))
  27403. , g = e("../enum/SceneRendererEvents")
  27404. , m = e("../enum/TileDownloaderEvents")
  27405. , v = e("../enum/Vectors")
  27406. , A = (e("../enum/GLCubeFaces"),
  27407. e("../objects/Panorama"),
  27408. e("./TileTree"))
  27409. , y = (e("./TileDownloader"),
  27410. e("./TilePrioritizer"))
  27411. , C = e("./TileUtils")
  27412. , p = e("../enum/PanoSizeClass")
  27413. , I = (e("../util/browser"),
  27414. e("../util/panorama"))
  27415. , E = e("events").EventEmitter
  27416. , b = !1
  27417. , w = d.tiling.uploadIntervalDelay
  27418. , _ = d.tiling.initialIntervalDelay
  27419. , T = d.tiling.maxNonBaseUploadsPerFrame
  27420. , x = d.tiling.maxBaseUploadsPerFrame
  27421. , S = {
  27422. Base: 0,
  27423. Remaining: 1
  27424. }
  27425. ,M = [];
  27426. window.targetList = M
  27427. l.prototype = Object.create(E.prototype),
  27428. l.prototype.init = function(e, t, i) {
  27429. this.sceneRenderer = e,
  27430. this.tileDownloader = t,
  27431. this.qualityManager = i,
  27432. this.bindEvents(),
  27433. this.sceneRenderer.on(g.ContextCreated, this.loadOverlayTiles.bind(this)),
  27434. this.initTime = performance.now()
  27435. }
  27436. ,
  27437. l.prototype.getActivePanoTextures = function(e) {
  27438. e = e || [];
  27439. for (var t = 0; t < M.length; t++) {
  27440. var i = M[t];
  27441. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  27442. }
  27443. }
  27444. ,
  27445. l.prototype.hasQueuedTiles = function() {
  27446. var e = this.peekNextFromUploadQueue();
  27447. return null !== e && void 0 !== e
  27448. }
  27449. ,
  27450. l.prototype.getActiveRenderTargetDescriptor = function(e) {
  27451. return this.activeRenderTargetDescriptors[e]
  27452. }
  27453. ,
  27454. l.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  27455. this.activeRenderTargetDescriptors[e] = t
  27456. }
  27457. ,
  27458. l.prototype.loadOverlayTiles = function() {
  27459. if (0 !== d.tiling.overlayStyle) {
  27460. var e = 0
  27461. , t = function(t, n, r) {
  27462. t = n ? t[n] = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping),
  27463. this.sceneRenderer.uploadTexture2D(r, t, 0, 0, C.TILE_SIZE, C.TILE_SIZE),
  27464. e++,
  27465. e === i.length && (this.overlayTilesLoaded = !0)
  27466. }
  27467. .bind(this)
  27468. , 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)]];
  27469. i.forEach(function(e) {
  27470. this.tileDownloader.loadImage(e[0], 0, e[1])
  27471. }
  27472. .bind(this)),
  27473. this.usingTileOverlay = !0
  27474. } else
  27475. this.usingTileOverlay = !1
  27476. }
  27477. ,
  27478. l.prototype.bindEvents = function() {
  27479. this.tileDownloader.on(m.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  27480. }
  27481. ,
  27482. l.prototype.setupZoomRenderTarget = function() {
  27483. var targets = {};
  27484. return function(){
  27485. if(this.qualityManager.maxRenderTargetSize == '2k' && this.qualityManager.getMaxNavPanoSize()=='2k')return; //不使用zoomTarget 直接用pano的tiledPanoRenderTarget,防崩溃
  27486. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  27487. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  27488. return;
  27489. var e = this.zoomRenderTarget;
  27490. var size = this.qualityManager.getMaxZoomPanoSize()
  27491. if(size > this.qualityManager.maxRenderTargetSize){
  27492. return
  27493. }
  27494. if(targets[size]){
  27495. this.zoomRenderTarget = targets[size]
  27496. }else{
  27497. this.zoomRenderTarget = this.initTiledPano(size, true )//放大后不使用抗锯齿,否则消耗更多内存
  27498. targets[size] = this.zoomRenderTarget
  27499. }
  27500. if(e) {//将旧的zoomRenderTarget渲染到新zoomRenderTarget上
  27501. var t = e.width
  27502. , i = this.zoomRenderTarget.width;
  27503. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  27504. e.texture.dispose(),
  27505. e.texture.loaded = !1,
  27506. e.texture.version = 0,
  27507. this.sceneRenderer.deallocateCubeTexture(e.texture),
  27508. e.texture = null
  27509. }
  27510. this.zoomPanoRenderingDisabled = !1
  27511. } else
  27512. this.zoomPanoRenderingDisabled = !0
  27513. }
  27514. }()
  27515. ,
  27516. l.prototype.enableHighQuality = function(e) {
  27517. //xzw add 如果最多只要2k图的话enableUltraHighQualityMode替换成这个
  27518. if (!this.qualityManager.highQualityModeStarted) {
  27519. this.setupZoomRenderTarget()
  27520. e()
  27521. this.qualityManager.highQualityModeStarted = true
  27522. }
  27523. }
  27524. ,
  27525. l.prototype.enableUltraHighQualityMode = function(e) {
  27526. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  27527. var t = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  27528. this.tileDownloader.testDownload(t, C.TILE_SIZE, function(t) {
  27529. t && (this.qualityManager.enableUltraHighQualityMode(),
  27530. this.setupZoomRenderTarget(),
  27531. e())
  27532. }
  27533. .bind(this))
  27534. }
  27535. }
  27536. ,
  27537. l.prototype.activateTiledPano = function(e, t, i) {
  27538. i && this.clearAllQueuedUploads();
  27539. for (var n = 0; n < C.FACES_PER_PANO; n++)
  27540. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  27541. this.linkAllTilesAndNodes(e);
  27542. var r = this.getActiveRenderTargetDescriptor(e.id)
  27543. , l = t;
  27544. if (l > this.qualityManager.getMaxNavPanoSize() && (l = this.qualityManager.getMaxNavPanoSize()),
  27545. !r || l !== r.size) {
  27546. if (r && s(r.renderTarget),
  27547. r = a(l),
  27548. !r) {
  27549. var c = this.initTiledPano(l, !browser.isMobile()/* !1 */);
  27550. r = o(c.width),
  27551. r.renderTarget = c
  27552. }
  27553. r.pano = e,
  27554. this.resetPanoDescriptor(e.id),
  27555. this.resetPanoLODDescriptors(e.id),
  27556. this.resetRenderStatus(e.id, !0, !0)
  27557. }
  27558. this.setActiveRenderTargetDescriptor(e.id, r);
  27559. var h = i ? 0 : 1;
  27560. return this.updateActivePanos(e, h),
  27561. r.renderTarget
  27562. }
  27563. ,
  27564. l.prototype.deactivateTiledPano = function(e) {
  27565. var t = this.getActiveRenderTargetDescriptor(e.id);
  27566. this.isRenderTargetDescriptorValid(t) && s(t.renderTarget),
  27567. this.setActiveRenderTargetDescriptor(e.id, null);
  27568. var i = this.getUploadQueueForPano(e.id);
  27569. this.clearUploadQueue(i),
  27570. this.updateActivePanos()
  27571. }
  27572. ,
  27573. l.prototype.updateActivePanos = function() {
  27574. var e = [];
  27575. return function(t, i) {
  27576. e.length = 0;
  27577. for (var n = 0; n < this.activePanos.length; n++) {
  27578. t && e.length === i && e.push(t);
  27579. var r = this.activePanos[n]
  27580. , o = this.getActiveRenderTargetDescriptor(r.id);
  27581. t && r.id === t.id || !this.isRenderTargetDescriptorValid(o) || e.push(r)
  27582. }
  27583. t && i >= e.length && e.push(t),
  27584. this.activePanos.length = 0,
  27585. this.activePanos.push.apply(this.activePanos, e)
  27586. }
  27587. }(),
  27588. l.prototype.getActivePanoCount = function() {
  27589. return this.activePanos.length
  27590. }
  27591. ,
  27592. l.prototype.resetRenderStatus = function(e, t, i, n) {
  27593. var r = null;
  27594. n && (r = A.getLevelCountForSize(C.TILE_SIZE, n) + 1);
  27595. for (var o = function(e, n, r, o) {
  27596. i && (n.tile.zoomUploaded = !1),
  27597. t && (n.tile.uploaded = !1)
  27598. }, a = 0; a < C.FACES_PER_PANO; a++) {
  27599. var s = this.getTileTree(e, a);
  27600. s.breadthFirst({
  27601. callback: o.bind(this, a),
  27602. minLevel: r
  27603. })
  27604. }
  27605. }
  27606. ,
  27607. l.prototype.copyBaseRenderStatusToZoomed = function(e) {
  27608. for (var t = A.getLevelCountForSize(C.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  27609. t.tile.zoomUploaded = t.tile.uploaded,
  27610. t.zoomCovered = t.covered
  27611. }, n = 0; n < C.FACES_PER_PANO; n++) {
  27612. var r = this.getTileTree(e, n);
  27613. r.breadthFirst({
  27614. callback: i.bind(this, n),
  27615. maxLevel: t
  27616. })
  27617. }
  27618. }
  27619. ,
  27620. l.prototype.renderPanoTiles = function() {
  27621. var e = [];
  27622. return function(t, i, n, r) {
  27623. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  27624. i = i || this.direction || v.FORWARD;
  27625. var o = this.getActiveRenderTargetDescriptor(t);
  27626. if (!this.isRenderTargetDescriptorValid(o))
  27627. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  27628. for (var a = 0; a < C.FACES_PER_PANO; a++) {
  27629. var s = this.getTileTree(t, a);
  27630. e.length = 0,
  27631. s.breadthFirst({
  27632. saveVisited: e
  27633. });
  27634. for (var l = 0; l < e.length; l++) {
  27635. var c = e[l];
  27636. this.queueTileUpload(c.tile, !1, r || 0 === l && n)
  27637. }
  27638. }
  27639. this.updateDirection(i)
  27640. }
  27641. }(),
  27642. l.prototype.isRenderTargetDescriptorValid = function(e) {
  27643. return e && e.renderTarget
  27644. }
  27645. ,
  27646. l.prototype.isPanoActive = function(e) {
  27647. var t = this.getActiveRenderTargetDescriptor(e);
  27648. return this.isRenderTargetDescriptorValid(t)
  27649. }
  27650. ,
  27651. l.prototype.isPanoZoomed = function(e) {
  27652. return this.zoomingActive && this.zoomPanoId === e
  27653. }
  27654. ,
  27655. l.prototype.initTileTree = function(e, t, i) {
  27656. var n = this.tileTrees[e];
  27657. n || (n = [],
  27658. this.tileTrees[e] = n);
  27659. var r = n[t];
  27660. if (!r) {
  27661. var o = A.getLevelCountForSize(C.TILE_SIZE, i);
  27662. r = new A(C.TILE_SIZE,o),
  27663. n[t] = r
  27664. }
  27665. }
  27666. ,
  27667. l.prototype.getTileTree = function(e, t) {
  27668. var i = this.tileTrees[e];
  27669. if (!i)
  27670. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  27671. var n = i[t];
  27672. if (!n)
  27673. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  27674. return n
  27675. }
  27676. ,
  27677. l.prototype.initTiledPano = function(e, antialias) {
  27678. var i = this.sceneRenderer.renderer
  27679. , n = (i.context,
  27680. new h.WebGLRenderTargetCube(e,e,{
  27681. stencilBuffer: !1
  27682. }))
  27683. , r = new h.CubeTexture([]);
  27684. n.texture = r,
  27685. r.image = [null, null, null, null, null, null],
  27686. r.flipY = !0,
  27687. //antialias: 如果抗锯齿的话,采用mipmap,会增加一倍的存储消耗。原版本都是不抗锯齿的。但是抗锯齿效果更柔和
  27688. antialias ? (r.generateMipmaps = !0,
  27689. r.magFilter = h.LinearFilter,
  27690. r.minFilter = h.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  27691. r.magFilter = h.LinearFilter,
  27692. r.minFilter = h.LinearFilter),
  27693. r.format = h.RGBAFormat,
  27694. i.setRenderTarget(n),
  27695. i.setRenderTarget(null);
  27696. var o = i.properties.get(r);
  27697. return o.__image__webglTextureCube = o.__webglTexture,
  27698. n
  27699. }
  27700. ,
  27701. l.prototype.getUploadQueueForPano = function(e) {
  27702. var t = this.uploadQueues[e];
  27703. return t || (t = [],
  27704. this.uploadQueues[e] = t),
  27705. t
  27706. }
  27707. ,
  27708. l.prototype.isTileUploaded = function(e) {
  27709. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  27710. }
  27711. ,
  27712. l.prototype.setUploaded = function(e, t) {
  27713. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  27714. }
  27715. ,
  27716. l.prototype.queueTileUpload = function(e, t, i) {
  27717. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  27718. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  27719. var r = this.getUploadQueueForPano(e.panoId);
  27720. 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),
  27721. e.uploadQueued = !0,
  27722. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  27723. }
  27724. }
  27725. ,
  27726. l.prototype.shoulPushToFrontOfQueue = function(e) {
  27727. return 0 === A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  27728. }
  27729. ,
  27730. l.prototype.getTopUploadQueue = function() {
  27731. for (var e = null, t = null, i = S.Base; i <= S.Remaining; i++)
  27732. for (var n = 0; n < this.activePanos.length; n++)
  27733. if (e = this.activePanos[n],
  27734. t = this.getUploadQueueForPano(e.id),
  27735. t.length > 0)
  27736. switch (i) {
  27737. case S.Base:
  27738. if (0 === t[0].level)
  27739. return t;
  27740. break;
  27741. case S.Remaining:
  27742. return t
  27743. }
  27744. return null
  27745. }
  27746. ,
  27747. l.prototype.getNextFromUploadQueue = function() {
  27748. var e = function(e) {
  27749. var t = e.shift();
  27750. return t.uploadQueued = !1,
  27751. t
  27752. };
  27753. return function() {
  27754. if (this.forceQueue.length > 0)
  27755. return e(this.forceQueue);
  27756. var t = this.getTopUploadQueue();
  27757. return t && t.length > 0 ? e(t) : null
  27758. }
  27759. }(),
  27760. l.prototype.peekNextFromUploadQueue = function() {
  27761. if (this.forceQueue.length > 0)
  27762. return this.forceQueue[0];
  27763. var e = this.getTopUploadQueue();
  27764. return e && e.length > 0 ? e[0] : null
  27765. }
  27766. ,
  27767. l.prototype.clearAllQueuedUploads = function() {
  27768. this.clearAllUploadQueues(null, 0)
  27769. }
  27770. ,
  27771. l.prototype.clearAllQueuedUploadsForPano = function(e) {
  27772. this.clearAllUploadQueues(e, 0)
  27773. }
  27774. ,
  27775. l.prototype.clearAllUploadQueues = function(e, t) {
  27776. if (e)
  27777. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  27778. this.clearUploadQueue(this.forceQueue, t, e);
  27779. else {
  27780. for (var i = 0; i < this.activePanos.length; i++) {
  27781. var n = this.activePanos[i];
  27782. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  27783. }
  27784. this.clearUploadQueue(this.forceQueue, t)
  27785. }
  27786. }
  27787. ,
  27788. l.prototype.clearUploadQueue = function(e, t, i) {
  27789. void 0 !== t && null !== t || (t = 0);
  27790. for (var n = 0; n < e.length; ) {
  27791. var r = e[n];
  27792. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  27793. e.splice(n, 1)) : n++
  27794. }
  27795. }
  27796. ,
  27797. l.prototype.refreshUploadInterval = function() {
  27798. var e = null;
  27799. return function(t) {
  27800. this.uploadIntervalCancelled || (e || (e = c.bind(this)),
  27801. null !== t && void 0 !== t || (t = w),
  27802. b || (t = _),
  27803. this.uploadInterval = window.setTimeout(e, t),
  27804. this.uploadIntervalDelay = t)
  27805. }
  27806. }(),
  27807. l.prototype.update = function() {
  27808. var e = performance.now()
  27809. , t = 0;
  27810. return function() {
  27811. this.uploadIntervalCancelled = !0,
  27812. window.clearTimeout(this.uploadInterval),
  27813. this.uploadInterval = null;
  27814. var i = performance.now() - e;
  27815. !(i > w || 0 === t) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  27816. e = performance.now()),
  27817. t++
  27818. }
  27819. }(),
  27820. l.prototype.updateUploadQueue = function(e, t) {
  27821. e || (e = 1);
  27822. for (var i = 0, n = 0; ; ) {
  27823. if (n >= t || i >= e)
  27824. break;
  27825. var r = this.getNextFromUploadQueue();
  27826. if (!r)
  27827. break;
  27828. if (0 !== r.level ? i++ : n++,
  27829. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  27830. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  27831. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  27832. }
  27833. }
  27834. }
  27835. ,
  27836. l.prototype.updateDirection = function(e) {
  27837. if (e = e || this.direction) {
  27838. this.direction = e;
  27839. for (var t = 0; t < this.activePanos.length; t++) {
  27840. var i = this.activePanos[t]
  27841. , n = this.getUploadQueueForPano(i.id);
  27842. y.sortPanoTiles(n, i, this.direction)
  27843. }
  27844. }
  27845. }
  27846. ,
  27847. l.prototype.uploadTile = function() {
  27848. var e = {}
  27849. , t = (new h.Vector4,
  27850. d.tiling.overlayStyle);
  27851. //var failHistory = {};
  27852. return function(i, n) {
  27853. var r = i.panoId
  27854. , o = i.image
  27855. , a = i.tileSize
  27856. , s = i.panoSize
  27857. , l = i.tileIndex
  27858. , c = (i.faceTileIndex,
  27859. i.totalTiles)
  27860. , u = (i.face,
  27861. i.tileX)
  27862. , d = i.tileY
  27863. , p = !0
  27864. , g = !1
  27865. , m = (this.getPanoDescriptor(r),
  27866. this.getPanoLODDescriptor(r, s))
  27867. , v = this.getActiveRenderTargetDescriptor(r)
  27868. , A = v.renderTarget
  27869. , y = v.size;
  27870. if (this.isPanoZoomed(r) && (A = this.zoomRenderTarget,
  27871. y = A.width), //this.qualityManager.getMaxZoomPanoSize()),
  27872. this.isRenderTargetDescriptorValid(v) || (p = !1,
  27873. g = !1),
  27874. n || (this.anyUploaded(i.node) && (p = !1,
  27875. g = !0),
  27876. this.isTileUploaded(i) && (p = !1,
  27877. g = !1)),
  27878. p) {
  27879. /* if(failHistory[''+r+s+l]){
  27880. console.log('uploadTile retry', r, s, l)
  27881. }
  27882. console.log('uploadTile 成功', r, s, l)
  27883. */
  27884. var C = u * a
  27885. , I = d * a
  27886. , E = a / s * y
  27887. , b = C / s * y
  27888. , w = I / s * y;
  27889. if (s > this.qualityManager.maxRenderTargetSize) {
  27890. player.model.getHighImage(o, i.cubeFace, u, d)
  27891. }else{
  27892. e[a] || (e[a] = this.sceneRenderer.initSizedTexture2D(a, h.ClampToEdgeWrapping));
  27893. var _ = e[a]
  27894. this.sceneRenderer.uploadTexture2D(o, _, 0, 0, a, a)
  27895. if ( 1 === t || 2 === t) {
  27896. var T = 1 === t ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  27897. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace),
  27898. this.sceneRenderer.renderToCubeMap(T[s], A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace, h.NormalBlending, !0, .5)
  27899. } else
  27900. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace);
  27901. }
  27902. m.uploadCount++,
  27903. this.emit(f.TileRenderSuccess, r, s, l, c),
  27904. m.uploadCount === c && this.emit(f.PanoRenderComplete, r, s, c),
  27905. this.setUploaded(i, !0),
  27906. this.addCoverageForNode(i.node)
  27907. } else{
  27908. this.setUploaded(i, !1);
  27909. //console.log('uploadTile 失败', r, s, l)
  27910. //failHistory[''+r+s+l] = true;
  27911. }
  27912. return i.uploadAttempted || (m.uploadAttempts++,
  27913. this.emit(f.TileUploadAttempted, r, s, l, c)),
  27914. i.uploadAttempted = !0,
  27915. m.uploadAttempts === c && this.emit(f.UploadAttemptedForAllTiles, r, s, c),
  27916. g
  27917. }
  27918. }(),
  27919. l.prototype.linkTileAndNode = function(e, t) {
  27920. t.tile = e,
  27921. e.node = t
  27922. }
  27923. ,
  27924. l.prototype.linkAllTilesAndNodes = function(e) {
  27925. for (var t = function(t, i, n, r, o) {
  27926. var a = this.getTileDirectoryEntry(e.id, i, r, o);
  27927. this.linkTileAndNode(a, n)
  27928. }, i = 0; i < C.FACES_PER_PANO; i++) {
  27929. var n = this.getTileTree(e.id, i);
  27930. n.breadthFirst({
  27931. callback: t.bind(this, n, i)
  27932. })
  27933. }
  27934. }
  27935. ,
  27936. l.prototype.anyUploaded = function(e) {
  27937. if (!e)
  27938. return !1;
  27939. if (e.tile && this.isTileUploaded(e.tile))
  27940. return !0;
  27941. if (e.children)
  27942. for (var t = 0; t < e.children.length; t++) {
  27943. var i = e.children[t];
  27944. if (this.anyUploaded(i))
  27945. return !0
  27946. }
  27947. return !1
  27948. }
  27949. ,
  27950. l.prototype.setNodeCovered = function(e, t) {
  27951. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  27952. }
  27953. ,
  27954. l.prototype.isNodeCovered = function(e) {
  27955. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  27956. }
  27957. ,
  27958. l.prototype.addCoverageForNode = function(e) {
  27959. if (this.setNodeCovered(e, !0),
  27960. e.parent && e.covered) {
  27961. var t = e.parent;
  27962. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  27963. }
  27964. }
  27965. ,
  27966. l.prototype.calcFullCoverage = function(e) {
  27967. var t = !1;
  27968. if (e.children)
  27969. for (var i = 0; i < e.children.length; i++) {
  27970. var n = e.children[i];
  27971. t = t || this.calcFullCoverage(n)
  27972. }
  27973. e.covered = e.tile.uploaded || t
  27974. }
  27975. ,
  27976. l.prototype.nodeSubcovered = function(e) {
  27977. if (!e.children)
  27978. return !1;
  27979. for (var t = 0; t < e.children.length; t++)
  27980. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  27981. return !1;
  27982. return !0
  27983. }
  27984. ,
  27985. l.prototype.resetPanoDescriptor = function(e) {
  27986. this.getPanoDescriptor(e)
  27987. }
  27988. ,
  27989. l.prototype.getPanoDescriptor = function(e) {
  27990. var t = this.panoDescriptors[e];
  27991. return t || (t = {},
  27992. this.panoDescriptors[e] = t),
  27993. t
  27994. }
  27995. ,
  27996. l.prototype.resetPanoLODDescriptors = function(e) {
  27997. var t = this.getPanoLODDescriptors(e);
  27998. for (var i in t)
  27999. if (t.hasOwnProperty(i)) {
  28000. var n = t[i];
  28001. n.uploadCount = 0,
  28002. n.uploadAttempts = 0
  28003. }
  28004. }
  28005. ,
  28006. l.prototype.getPanoLODDescriptor = function(e, t) {
  28007. var i = this.getPanoLODDescriptors(e)
  28008. , n = i[t];
  28009. return n || (n = {
  28010. uploadCount: 0,
  28011. uploadAttempts: 0
  28012. },
  28013. i[t] = n),
  28014. n
  28015. }
  28016. ,
  28017. l.prototype.getPanoLODDescriptors = function(e) {
  28018. var t = this.panoLODDescriptors[e];
  28019. return t || (t = {},
  28020. this.panoLODDescriptors[e] = t),
  28021. t
  28022. }
  28023. ,
  28024. l.prototype.onTileDownloaded = function(e) {
  28025. var t = A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  28026. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  28027. if (i.downloaded = !0,
  28028. i.image = e.image,
  28029. i.panoSize = e.panoSize,
  28030. i.tileX = e.tileX,
  28031. i.tileY = e.tileY,
  28032. i.totalTiles = e.totalTiles,
  28033. i.tileIndex = e.tileIndex,
  28034. i.faceTileIndex = e.faceTileIndex,
  28035. i.face = e.face,
  28036. i.cubeFace = I.mapFaceToCubemapFace(e.face),
  28037. i.panoId = e.panoId,
  28038. i.tileSize = e.tileSize,
  28039. i.direction = (new h.Vector3).copy(e.direction),
  28040. i.node = null,
  28041. i.level = A.getLevelCountForSize(C.TILE_SIZE, i.panoSize),
  28042. this.isPanoActive(i.panoId)) {
  28043. var n = this.getTileTree(i.panoId, i.face)
  28044. , r = n.getSubNode(i.panoSize, i.tileX, i.tileY);
  28045. this.linkTileAndNode(i, r),
  28046. this.queueTileUpload(i, !0)
  28047. }
  28048. }
  28049. ,
  28050. l.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  28051. var r = this.tileDirectory[e];
  28052. r || (r = {},
  28053. this.tileDirectory[e] = r);
  28054. var o = 16384 * t + 1024 * i + n
  28055. , a = r[o];
  28056. return a || (a = {
  28057. downloaded: !1,
  28058. uploaded: !1,
  28059. zoomUploaded: !1
  28060. },
  28061. r[o] = a),
  28062. a._key = e + ":" + t + ":" + i + ":" + n,
  28063. a._tileKey = o,
  28064. a
  28065. }
  28066. ,
  28067. l.prototype.setZoomingActive = function(e, t, i) {
  28068. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  28069. this.zoomPanoId = t.id,
  28070. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  28071. }
  28072. ,
  28073. l.prototype.updateZoomedPanoFromBase = function(e) {
  28074. if (!this.zoomPanoRenderingDisabled) {
  28075. var t = this.getActiveRenderTargetDescriptor(e.id);
  28076. if (t && t.renderTarget) {
  28077. var i = Math.min(this.qualityManager.maxRenderTargetSize, this.qualityManager.getMaxZoomPanoSize()), //this.qualityManager.getMaxZoomPanoSize()
  28078. n = t.renderTarget
  28079. , r = t.size;
  28080. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  28081. this.copyBaseRenderStatusToZoomed(e.id)
  28082. }
  28083. }
  28084. }
  28085. ,
  28086. t.exports = l
  28087. }
  28088. , {
  28089. "../enum/GLCubeFaces": 25,
  28090. "../enum/PanoRendererEvents": 35,
  28091. "../enum/PanoSizeClass": 36,
  28092. "../enum/SceneRendererEvents": 43,
  28093. "../enum/TileDownloaderEvents": 45,
  28094. "../enum/Vectors": 50,
  28095. "../exception/BasicException": 55,
  28096. "../objects/Panorama": 148,
  28097. "../settings": 166,
  28098. "../util/browser": 182,
  28099. "../util/panorama": 191,
  28100. "./TileDownloader": 171,
  28101. "./TilePrioritizer": 172,
  28102. "./TileTree": 173,
  28103. "./TileUtils": 174,
  28104. events: 202,
  28105. three: 217
  28106. }],
  28107. 170: [function(e, t, i) {
  28108. "use strict";
  28109. function n(e, t, i) {
  28110. this.maxNavPanoSize = -1,
  28111. this.maxZoomPanoSize = -1,
  28112. this.devicePixelDensity = e,
  28113. this.deviceScreenSize = t,
  28114. this.clientBandwidth = i,
  28115. this.panoSizeClassMap = {},
  28116. this.useHighResolutionPanos = !0,
  28117. this.useUltraHighResolutionPanos = !1,
  28118. this.modelHasUltraHighPanos = !1
  28119. this.maxRenderTargetSize = a.isMobile() ? 2048 : 4096 //add
  28120. this.maxRenderTargetSize = Math.min( common.getMaxCubemapSize(), this.maxRenderTargetSize)//add
  28121. }
  28122. var r = e("../enum/PanoSizeClass")
  28123. , o = e("../settings")
  28124. , a = e("../util/browser")
  28125. , s = e("../constants")
  28126. , l = e("../util/showcase")
  28127. , c = e("../enum/ModelManagerEvents");
  28128. n.prototype.init = function(e) {
  28129. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  28130. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  28131. this.highSize = this.getPanoSize(r.HIGH),
  28132. this.standardSize = this.getPanoSize(r.STANDARD),
  28133. this.baseSize = this.getPanoSize(r.BASE),
  28134. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  28135. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  28136. this.updateMaximums(),
  28137. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  28138. }
  28139. ,
  28140. n.prototype.updateFromModel = function(e) {
  28141. this.updateHighResolutionSettings(e),
  28142. this.updateUltraHighResolutionSettings(e)
  28143. }
  28144. ,
  28145. n.prototype.updateHighResolutionSettings = function(e) {
  28146. //---------------------许钟文---------原始的会判断modeldata里version,以致useHighResolutionPanos为false,所以我直接变为true啦----------------------------------
  28147. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  28148. //this.useHighResolutionPanos = !0;
  28149. //----------------------e n d -----------------------------------------------------------------
  28150. this.updateMaximums()
  28151. }
  28152. ,
  28153. n.prototype.updateUltraHighResolutionSettings = function(e) {
  28154. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  28155. this.updateMaximums()
  28156. }
  28157. ,
  28158. n.prototype.enableUltraHighQualityMode = function() {
  28159. this.modelHasUltraHighPanos = !0,
  28160. this.updateUltraHighResolutionSettings(null)
  28161. }
  28162. ,
  28163. n.prototype.ultraHighQualityModeEnabled = function() {
  28164. return this.modelHasUltraHighPanos
  28165. }
  28166. ,
  28167. n.prototype.onModelChanged = function(e) {
  28168. this.updateFromModel(e.model),
  28169. this.updateMaximums()
  28170. }
  28171. ,
  28172. n.prototype.updateMaximums = function() {
  28173. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  28174. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  28175. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  28176. }
  28177. ,
  28178. n.prototype.buildPanoSizeClassMap = function() {
  28179. this.panoSizeClassMap[r.BASE] = 512,
  28180. this.panoSizeClassMap[r.STANDARD] = 1024,
  28181. this.panoSizeClassMap[r.HIGH] = 2048,
  28182. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  28183. }
  28184. ,
  28185. n.prototype.getPanoSize = function(e) {
  28186. return this.panoSizeClassMap[e]
  28187. }
  28188. ,
  28189. n.prototype.getMaxPossiblePanoSize = function() {
  28190. return this.getPanoSize(r.ULTRAHIGH)
  28191. }
  28192. ,
  28193. n.prototype.getMaxPanoSize = function() {
  28194. return this.maxZoomPanoSize
  28195. }
  28196. ,
  28197. n.prototype.getMaxNavPanoSize = function() {
  28198. return this.maxNavPanoSize
  28199. }
  28200. ,
  28201. n.prototype.getMaxZoomPanoSize = function() {
  28202. return this.maxZoomPanoSize
  28203. }
  28204. ,
  28205. /* n.prototype.detectMaxNavPanoSizeClass = function() {
  28206. if(settings.mobileNavHigh)return r.HIGH //改
  28207. else return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  28208. } */
  28209. n.prototype.detectDevice = function(){//add
  28210. if(a.isMobile()){
  28211. let area = $("#player").width() * $("#player").height()
  28212. if(area < 768 * 1024){//ipad mini full screen 大场景拍的质量很好默认不需要很高清
  28213. return 'mobile'
  28214. }else{
  28215. return 'bigMobile'
  28216. }
  28217. }else{
  28218. return 'pc'
  28219. }
  28220. }
  28221. n.prototype.detectMaxNavPanoSizeClass = function() { //xzw 改
  28222. switch(this.getNavZoomClass()){
  28223. case '1k':
  28224. return r.STANDARD;
  28225. break;
  28226. case '2k':
  28227. default:
  28228. return r.HIGH;
  28229. case '4k':
  28230. return r.ULTRAHIGH;
  28231. }
  28232. }
  28233. ,
  28234. n.prototype.detectMaxNavPanoSize = function() {
  28235. var e = this.detectMaxNavPanoSizeClass();
  28236. return this.getPanoSize(e)
  28237. }
  28238. ,
  28239. n.prototype.getMaxZoomClass = function(){//add
  28240. let type = this.detectDevice()
  28241. let setting = settings.tileClass[type] //见manage.js的settings
  28242. return setting.max
  28243. }
  28244. n.prototype.getNavZoomClass = function(){//add
  28245. let type = this.detectDevice()
  28246. let setting = settings.tileClass[type]
  28247. return setting.nav
  28248. }
  28249. ,
  28250. n.prototype.detectMaxZoomPanoSize = function() {//获取当前zoomRenderTarget应下载的最高级别
  28251. //若是有三个级别,每次只需要加载到当前的zoomLevel;而两级时因为有zoomed来判断是使用基本贴图还是zoomRenderTarget,所以只需要返回最大的即可
  28252. if (this.zoomLevelResolution) {//有三个级别
  28253. if (this.zoomLevelResolution == '4k' && this.useUltraHighResolutionPanos) {
  28254. return this.getPanoSize(r.ULTRAHIGH)
  28255. } else if (this.zoomLevelResolution == '1k' || !this.useHighResolutionPanos) {
  28256. return this.getPanoSize(r.STANDARD)
  28257. } else {
  28258. return this.getPanoSize(r.HIGH)
  28259. }
  28260. } else {
  28261. let tileClass = this.getMaxZoomClass()
  28262. if(tileClass == '1k')return this.getPanoSize(r.STANDARD);
  28263. if(tileClass == '4k' && this.useUltraHighResolutionPanos ){
  28264. return this.getPanoSize(r.ULTRAHIGH);
  28265. }else{//'2k'
  28266. return this.getPanoSize(r.HIGH);
  28267. }
  28268. }
  28269. }
  28270. /* n.prototype.detectMaxZoomPanoSize = function() {
  28271. 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)
  28272. } */
  28273. ,
  28274. t.exports = n
  28275. }
  28276. , {
  28277. "../constants": 8,
  28278. "../enum/ModelManagerEvents": 33,
  28279. "../enum/PanoSizeClass": 36,
  28280. "../settings": 166,
  28281. "../util/browser": 182,
  28282. "../util/showcase": 193
  28283. }],
  28284. 171: [function(e, t, i) {
  28285. (function(i) {
  28286. "use strict";
  28287. function n(e) {
  28288. this.panos = null,
  28289. this.retryMinimumTime = 1e4,
  28290. this.urls = null,
  28291. this.panoLoadCallbacks = {},
  28292. this.downloadDescriptors = {},
  28293. this.priorityQueue = [],
  28294. this.forceQueue = [],
  28295. this.activeDownloads = [],
  28296. this.qualityManager = null,
  28297. this.tilePrioritizer = null,
  28298. this.refreshInterval = null,
  28299. this.processPriorityQueue = !1,
  28300. this.concurrentDownloads = e.concurrentDownloads || 1,
  28301. this.downloadTestResults = {}
  28302. }
  28303. var r = e("three")
  28304. , o = (e("../enum/Viewmode"),
  28305. e("../settings"))
  28306. , a = (e("../objects/Panorama"),
  28307. e("../util/logger"))
  28308. , s = (e("../enum/Vectors"),
  28309. e("../enum/PanoSizeClass"),
  28310. e("../enum/TileDownloaderEvents"))
  28311. , l = e("./TilePrioritizer")
  28312. , c = e("./TileUtils")
  28313. , h = (e("../enum/GLCubeFaces"),
  28314. e("../enum/DownloadStatus"))
  28315. , u = e("../util/panorama")
  28316. , d = e("../util/ajax")
  28317. , p = e("../ab")
  28318. , f = e("events").EventEmitter
  28319. , g = (new a(i),
  28320. Object.freeze({
  28321. Testing: 1,
  28322. Success: 2,
  28323. Fail: 3
  28324. }));
  28325. n.prototype = Object.create(f.prototype),
  28326. n.IDLE_REFRESH_DELAY = 500,
  28327. n.ACTIVE_REFRESH_DELAY = 16,
  28328. n.DOWNLOAD_RETRIES = 4,
  28329. n.prototype.init = function(e) {
  28330. this.qualityManager = e
  28331. }
  28332. ,
  28333. n.prototype.setUrls = function(e) {
  28334. this.urls = e
  28335. }
  28336. ,
  28337. n.prototype.setPanoData = function(e, t, i) {
  28338. this.panos = e,
  28339. this.imagePanos = t,
  28340. this.panoGroupId = i
  28341. }
  28342. ,
  28343. n.prototype.start = function() {
  28344. this.refreshUpdateInterval(0)
  28345. }
  28346. ,
  28347. n.prototype.stop = function() {
  28348. window.cancel(this.refreshInterval)
  28349. }
  28350. ,
  28351. n.prototype.refreshUpdateInterval = function(e) {
  28352. e || (e = 0),
  28353. this.refreshInterval = window.setTimeout(function() {
  28354. var e = this.update();
  28355. e ? this.refreshUpdateInterval(n.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(n.IDLE_REFRESH_DELAY)
  28356. }
  28357. .bind(this), e)
  28358. }
  28359. ,
  28360. n.prototype.update = function() {
  28361. var e = this.forceQueue.length > 0;
  28362. return this.processQueueForDownloading(this.forceQueue),
  28363. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  28364. this.priorityQueue.length > 0 && (e = !0),
  28365. this.processQueueForDownloading(this.priorityQueue)),
  28366. e
  28367. }
  28368. ,
  28369. n.prototype.forceQueueTilesForPano = function() {
  28370. var e = []
  28371. , t = [];
  28372. return function(i, n, r, o, a, s) {
  28373. e.length = 0;
  28374. for (var u = this.getTileDownloadDescriptors(i, n), d = 0; d < u.length; d++) {
  28375. var p = u[d];
  28376. p.status !== h.None && p.status !== h.Queued || e.push(p)
  28377. }
  28378. if (r && e.length > 0) {
  28379. l.sortPanoTiles(e, i, r),
  28380. t.length = 0,
  28381. c.matchingTilesInDirection(i, n, r, o, a, t);
  28382. for (var f = 0, g = function(e) {
  28383. return e.face === m.face && e.faceTileIndex === m.faceTileIndex
  28384. }; f < e.length; ) {
  28385. var m = e[f]
  28386. , v = t.findIndex(g);
  28387. v < 0 ? e.splice(f, 1) : f++
  28388. }
  28389. }
  28390. for (var A = 0; A < e.length; A++)
  28391. this.forceQueue.push(e[A]);
  28392. this.setStatusForAllDescriptors(this.forceQueue, h.ForceQueued),
  28393. this.clearFromQueue(this.priorityQueue, h.ForceQueued, !1),
  28394. s && this.processQueueForDownloading(this.forceQueue, !0)
  28395. }
  28396. }(),
  28397. n.prototype.clearForceQueue = function() {
  28398. this.clearQueue(this.forceQueue)
  28399. }
  28400. ,
  28401. n.prototype.queuePrioritizedTilesForPanos = function(e) {
  28402. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  28403. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  28404. this.clearFromQueue(this.priorityQueue, h.None, !0),
  28405. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, h.Queued))
  28406. }
  28407. ,
  28408. n.prototype.clearQueue = function(e) {
  28409. this.setStatusForAllDescriptors(e, h.None),
  28410. e.length = 0
  28411. }
  28412. ,
  28413. n.prototype.clearFromQueue = function(e, t, i) {
  28414. for (var n = 0; n < e.length; n++) {
  28415. var r = e[n];
  28416. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  28417. }
  28418. }
  28419. ,
  28420. n.prototype.setStatusForAllDescriptors = function(e, t) {
  28421. for (var i = 0; i < e.length; i++) {
  28422. var n = e[i];
  28423. n && (n.status = t)
  28424. }
  28425. }
  28426. ,
  28427. n.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  28428. for (var i = 0; i < e.length; i++) {
  28429. var n = e[i];
  28430. n && (n.status !== t ? n.status = t : e[i] = null)
  28431. }
  28432. }
  28433. ,
  28434. n.prototype.getTileDownloadDescriptors = function(e, t) {
  28435. var i = this.getAllTileDownloadDescriptorsForPano(e)
  28436. , n = i[t];
  28437. return n || (n = this.buildDownloadDescriptorArray(t),
  28438. i[t] = n,
  28439. this.initTileDownloadDescriptors(n, e, t)),
  28440. n
  28441. }
  28442. ,
  28443. n.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  28444. var t = this.downloadDescriptors[e.id];
  28445. return t || (t = {},
  28446. this.downloadDescriptors[e.id] = t),
  28447. t
  28448. }
  28449. ,
  28450. n.prototype.processQueueForDownloading = function(e, t) {
  28451. if (this.cleanupActiveDownloads(),
  28452. this.activeDownloads.length < this.concurrentDownloads || t)
  28453. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0, r = 0; n < i && e.length > 0; r++) {
  28454. var o = e.shift();
  28455. o && (this.startDownload(o),
  28456. n++)
  28457. }
  28458. }
  28459. ,
  28460. n.prototype.testDownload = function(e, t, i) {
  28461. var n = this.downloadTestResults[e];
  28462. if (n)
  28463. return void (n === g.Success ? i(!0) : n === g.Fail && i(!1));
  28464. this.downloadTestResults[e] = g.Testing;
  28465. var r = this.panos.list[0]
  28466. , o = this.getTileUrl(r.id, e, t, 0)
  28467. , a = function(t) {
  28468. this.downloadTestResults[e] = g.Success,
  28469. i(!0)
  28470. }
  28471. .bind(this)
  28472. , s = function() {
  28473. this.downloadTestResults[e] = g.Fail,
  28474. i(!1)
  28475. }
  28476. .bind(this);
  28477. this.loadImage(o, 0, a, s)
  28478. }
  28479. ,
  28480. n.prototype.startDownload = function(e) {
  28481. e.status = h.Downloading;
  28482. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  28483. this.activeDownloads.push(e),
  28484. this.loadImage(t, n.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  28485. }
  28486. ,
  28487. n.prototype.downloadFailed = function(e, t) {}
  28488. ,
  28489. n.prototype.downloadComplete = function(e, t) {
  28490. if (e.panoGroupId === this.panoGroupId) {
  28491. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  28492. e.status = h.Downloaded,
  28493. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  28494. var n = {
  28495. panoId: e.pano.id,
  28496. image: t,
  28497. tileSize: e.tileSize,
  28498. panoSize: e.panoSize,
  28499. tileIndex: e.tileIndex,
  28500. faceTileIndex: e.faceTileIndex,
  28501. totalTiles: e.totalTiles,
  28502. face: e.face,
  28503. tileX: e.tileX,
  28504. tileY: e.tileY,
  28505. direction: e.direction
  28506. };
  28507. e.image = t,
  28508. this.emit(s.TileDownloadSuccess, n),
  28509. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  28510. panoId: e.pano.id,
  28511. tileSize: e.tileSize,
  28512. panoSize: e.panoSize
  28513. },
  28514. this.emit(s.PanoDownloadComplete, n),
  28515. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  28516. }
  28517. }
  28518. ,
  28519. n.prototype.cleanupActiveDownloads = function() {
  28520. var e = [];
  28521. return function() {
  28522. e.length = 0;
  28523. for (var t = 0; t < this.activeDownloads.length; t++) {
  28524. var i = this.activeDownloads[t];
  28525. i.status !== h.Downloaded && i.status !== h.Failed && e.push(i)
  28526. }
  28527. this.activeDownloads.length = 0,
  28528. this.activeDownloads.push.apply(this.activeDownloads, e)
  28529. }
  28530. }(),
  28531. n.prototype.isPanoDownloaded = function(e, t) {
  28532. var i = this.getTileDownloadDescriptors(e, t);
  28533. if (i.length <= 0)
  28534. return !1;
  28535. for (var n = 0; n < i.length; n++) {
  28536. var r = i[n];
  28537. if (r.status !== h.Downloaded)
  28538. return !1
  28539. }
  28540. return !0
  28541. }
  28542. ,
  28543. n.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  28544. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  28545. this.panoLoadCallbacks[o] = {
  28546. onLoad: i,
  28547. onFail: n,
  28548. onProgress: r
  28549. }
  28550. }
  28551. ,
  28552. n.prototype.getPanoLoadCallbacks = function(e, t) {
  28553. var i = e.id + ":" + t;
  28554. return this.panoLoadCallbacks[i]
  28555. }
  28556. ,
  28557. n.prototype.buildDownloadDescriptorArray = function(e) {
  28558. for (var t = c.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  28559. var r = this.buildDownloadDescriptor();
  28560. i.push(r)
  28561. }
  28562. return i
  28563. }
  28564. ,
  28565. n.prototype.buildDownloadDescriptor = function() {
  28566. var e = {
  28567. panoGroupId: null,
  28568. pano: null,
  28569. panoSize: -1,
  28570. tileSize: -1,
  28571. tileIndex: -1,
  28572. totalTiles: -1,
  28573. faceTileIndex: -1,
  28574. status: h.None,
  28575. url: null,
  28576. image: null,
  28577. direction: new r.Vector3,
  28578. face: -1,
  28579. cubeFace: -1,
  28580. tileX: -1,
  28581. tileY: -1
  28582. };
  28583. return e
  28584. }
  28585. ,
  28586. n.prototype.initTileDownloadDescriptors = function(e, t, i) {
  28587. for (var n = 0; n < e.length; n++) {
  28588. var r = e[n];
  28589. this.initTileDownloadDescriptor(r, t, i, n)
  28590. }
  28591. }
  28592. ,
  28593. n.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  28594. var r = i >= c.TILE_SIZE ? c.TILE_SIZE : i;
  28595. e.face = c.getFaceForTile(i, n),
  28596. e.cubeFace = u.mapFaceToCubemapFace(e.face),
  28597. e.panoGroupId = this.panoGroupId,
  28598. e.pano = t,
  28599. e.panoSize = i,
  28600. e.tileSize = r,
  28601. e.tileIndex = n,
  28602. e.totalTiles = c.getTileCountForSize(i),
  28603. e.status = h.None,
  28604. e.image = null,
  28605. c.getTileLocation(e.panoSize, e.tileIndex, e),
  28606. c.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, c.LocationOnTile.Center, 0, e.direction)
  28607. }
  28608. ,
  28609. n.prototype.getTileUrl = function() {
  28610. var e = {
  28611. 256: "256",
  28612. 512: "512",
  28613. 1024: "1k",
  28614. 2048: "2k",
  28615. 4096: "4k"
  28616. }
  28617. , t = {
  28618. face: -1,
  28619. faceTileIndex: -1,
  28620. tileX: -1,
  28621. tileY: -1
  28622. };
  28623. return function(i, n, r, a) {
  28624. c.getTileLocation(n, a, t);
  28625. var s = Math.floor(n / r)
  28626. , l = s * s
  28627. , h = Math.floor(a / l)
  28628. , u = "";
  28629. 1 === o.tiling.customCompression && (u = "_" + o.tiling["q" + e[n]]);
  28630. var d = this.urls.get("tiles/" + i + "/" + e[n] + u + "_face" + h + "_" + t.tileX + "_" + t.tileY + ".jpg");
  28631. return d = p.changeIfTileGenerating(d)
  28632. }
  28633. }(),
  28634. n.prototype.loadImage = function(e, t, i, n) {
  28635. d.getImage(e, t).then(function(e) {
  28636. i(e)
  28637. }).fail(n)
  28638. }
  28639. ,
  28640. t.exports = n
  28641. }
  28642. ).call(this, "/js/tile/TileDownloader.js")
  28643. }
  28644. , {
  28645. "../ab": 3,
  28646. "../enum/DownloadStatus": 24,
  28647. "../enum/GLCubeFaces": 25,
  28648. "../enum/PanoSizeClass": 36,
  28649. "../enum/TileDownloaderEvents": 45,
  28650. "../enum/Vectors": 50,
  28651. "../enum/Viewmode": 51,
  28652. "../objects/Panorama": 148,
  28653. "../settings": 166,
  28654. "../util/ajax": 181,
  28655. "../util/logger": 189,
  28656. "../util/panorama": 191,
  28657. "./TilePrioritizer": 172,
  28658. "./TileUtils": 174,
  28659. events: 202,
  28660. three: 217
  28661. }],
  28662. 172: [function(e, t, i) {
  28663. (function(i) {
  28664. "use strict";
  28665. function n(e, t, i, o, a) {
  28666. this.qualityManager = e,
  28667. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  28668. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  28669. this.baseSize = t,
  28670. this.standardSize = i,
  28671. this.highSize = o,
  28672. this.ultraHighSize = a,
  28673. this.priorityCriteria = new n.PriorityCriteria(null,new r.Vector3(0,0,0),new r.Vector3(0,0,-1),new r.Vector3(0,0,-1))
  28674. }
  28675. var r = e("three")
  28676. , o = (e("../enum/Viewmode"),
  28677. e("../settings"),
  28678. e("../settings"),
  28679. e("../objects/Panorama"))
  28680. , a = e("../util/logger")
  28681. , s = (e("../enum/Vectors"),
  28682. e("../enum/PanoSizeClass"),
  28683. e("../enum/ModelManagerEvents"),
  28684. e("../enum/GLCubeFaces"),
  28685. e("../enum/DownloadStatus"))
  28686. , l = (e("../util/browser"),
  28687. e("./TileUtils"))
  28688. , c = e("../util/math")
  28689. , h = (e("events").EventEmitter,
  28690. new a(i),
  28691. Object.freeze({
  28692. None: 0,
  28693. DirectionalFOV: 1
  28694. }));
  28695. n.PriorityCriteria = function(e, t, i, n, o) {
  28696. this.pano = e,
  28697. this.cameraPosition = (new r.Vector3).copy(t),
  28698. this.cameraDir = (new r.Vector3).copy(i),
  28699. this.panoSpaceDir = (new r.Vector3).copy(n),
  28700. this.upcomingPanos = o,
  28701. this.copy = function(e) {
  28702. this.pano = e.pano,
  28703. this.cameraPosition.copy(e.cameraPosition),
  28704. this.cameraDir.copy(e.cameraDir),
  28705. this.panoSpaceDir.copy(e.panoSpaceDir),
  28706. this.upcomingPanos = o
  28707. }
  28708. ,
  28709. this.zoomingActive = !1
  28710. }
  28711. ,
  28712. n.DIRECTIONAL_FOV = 180,
  28713. n.DIRECTIONAL_FOV_NARROW = 120,
  28714. n.MAX_SCORED_PANOS_TOCONSIDER = 6,
  28715. n.MAX_SCORED_PANOS_TOADD = 2,
  28716. n.MAX_UPCOMING_PANOS_TOADD = 3,
  28717. n.DIRECTION_SCORE_STRICTNESS = .75,
  28718. n.appendQueue = function(e, t) {
  28719. if (e && t)
  28720. for (var i = 0; i < t.length; i++)
  28721. e.push(t[i])
  28722. }
  28723. ,
  28724. n.prototype.updateCriteria = function(e, t, i, n) {
  28725. this.priorityCriteria.pano = e,
  28726. this.priorityCriteria.cameraPosition.copy(t),
  28727. this.priorityCriteria.cameraDir.copy(i),
  28728. this.priorityCriteria.upcomingPanos = n,
  28729. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize()
  28730. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  28731. if(!player.panoRenderer.isPanoZoomed(e.id)){ //xzw add,直到到达该点后才能下载4k,否则不会渲染到zoomRenderTarget上
  28732. this.maxNavQuality = Math.min(2048, this.maxNavQuality)
  28733. this.maxZoomQuality = Math.min(2048, this.maxZoomQuality)
  28734. }
  28735. }
  28736. ,
  28737. n.prototype.filterAndPrioritize = function() {
  28738. var e = []
  28739. , t = []
  28740. , i = [];
  28741. return function(r, o, a) {
  28742. this.populateNeighborPanos(this.priorityCriteria.pano, o, e),
  28743. this.populateScoredPanos(this.priorityCriteria.pano, o, t, this.priorityCriteria.cameraDir, n.MAX_SCORED_PANOS_TOCONSIDER);
  28744. var s = this.baseSize
  28745. , l = this.standardSize
  28746. , c = this.highSize
  28747. , h = this.ultraHighSize;
  28748. this.queueTilesForPano(r, a, this.priorityCriteria.pano, s),
  28749. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(r, this.priorityCriteria.upcomingPanos, a, s, n.MAX_UPCOMING_PANOS_TOADD),
  28750. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(r, this.priorityCriteria.upcomingPanos, a, 1024 , n.MAX_UPCOMING_PANOS_TOADD),//更清晰些
  28751. i.length = 0,
  28752. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  28753. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  28754. n.appendQueue(r, i),
  28755. this.queueTilesForPanos(r, t, a, s, n.MAX_SCORED_PANOS_TOADD),
  28756. i.length = 0,
  28757. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  28758. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  28759. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  28760. n.appendQueue(r, i),
  28761. i.length = 0,
  28762. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  28763. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  28764. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  28765. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  28766. n.appendQueue(r, i),
  28767. this.queueTilesForPanos(r, e, a, s)
  28768. }
  28769. }(),
  28770. n.prototype.canDownloadSize = function(e) {
  28771. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  28772. }
  28773. ,
  28774. n.prototype.populateNeighborPanos = function(e, t, i) {
  28775. i = i || [],
  28776. i.length = 0;
  28777. var n = t.getNeighbours(e);
  28778. for (var r in n)
  28779. if (n.hasOwnProperty(r)) {
  28780. var o = t.get(r);
  28781. i.push(o)
  28782. }
  28783. return i
  28784. }
  28785. ,
  28786. n.prototype.populateScoredPanos = function(e, t, i, r, a) {
  28787. i = i || [],
  28788. i.length = 0;
  28789. var s = [o.filters.inPanoDirection(e.position, r, n.DIRECTION_SCORE_STRICTNESS), o.filters.not(e)]
  28790. , l = [o.scoreFunctions.distanceSquared(e), o.scoreFunctions.direction(e.position, r)]
  28791. , c = t.sortByScore(s, l);
  28792. if (c)
  28793. for (var h = 0; h < c.length && h < a; h++) {
  28794. var u = c[h].item;
  28795. i.push(u)
  28796. }
  28797. return i
  28798. }
  28799. ,
  28800. n.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  28801. for (var o = 0, a = 0; a < t.length; a++) {
  28802. var s = t[a]
  28803. , l = this.queueTilesForPano(e, i, s, n);
  28804. if (o += l > 0 ? 1 : 0,
  28805. r && o >= r)
  28806. break
  28807. }
  28808. return o
  28809. }
  28810. ,
  28811. n.prototype.queueTilesForPano = function() {
  28812. var e = {
  28813. filter: h.None
  28814. };
  28815. return function(t, i, n, r) {
  28816. return this.filterAndQueueTileDownloadDescriptors(t, i, n, r, e)
  28817. }
  28818. }(),
  28819. n.prototype.queueTilesForPanosInDirection = function() {
  28820. var e = new r.Vector3;
  28821. return function(t, i, n, r, o, a, s, l) {
  28822. for (var h = 0, u = 0; u < n.length; u++) {
  28823. var d = n[u];
  28824. e.copy(d.position),
  28825. e.sub(o),
  28826. e.normalize();
  28827. var p = Math.max(Math.min(a.dot(e), 1), -1)
  28828. , f = c.getFOVDotThreshold(s);
  28829. if (p >= f) {
  28830. var g = this.queueTilesInDirectionForPano(t, i, d, r, o, a, s);
  28831. if (h += g > 0 ? 1 : 0,
  28832. l && h >= l)
  28833. break
  28834. }
  28835. }
  28836. return h
  28837. }
  28838. }(),
  28839. n.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  28840. for (var l = 0, c = 0; c < i.length; c++) {
  28841. var h = i[c]
  28842. , u = this.queueTilesInDirectionForPano(e, t, h, n, o, a);
  28843. if (l += u > 0 ? 1 : 0,
  28844. s && l >= s)
  28845. break
  28846. }
  28847. return l
  28848. }
  28849. ,
  28850. n.prototype.queueTilesInDirectionForPano = function() {
  28851. var e = {
  28852. filter: h.DirectionalFOV,
  28853. direction: new r.Vector3,
  28854. fov: 60
  28855. }
  28856. , t = new r.Vector3;
  28857. return function(i, n, r, o, a, s, c) {
  28858. return t.copy(s),
  28859. l.getRelativeDirection(r.quaternion, t),
  28860. e.direction.copy(t),
  28861. e.fov = c,
  28862. this.filterAndQueueTileDownloadDescriptors(i, n, r, o, e)
  28863. }
  28864. }(),
  28865. n.prototype.filterAndQueueTileDownloadDescriptors = function() {
  28866. var e = [];
  28867. return function(t, i, n, r, o) {
  28868. var a = i.getTileDownloadDescriptors(n, r);
  28869. e.length = 0,
  28870. this.filterTileDownloadDescriptors(n, a, e, o);
  28871. for (var s = 0, l = 0; l < e.length; l++) {
  28872. var c = e[l];
  28873. c && (t.push(c),
  28874. s++)
  28875. }
  28876. return s
  28877. }
  28878. }(),
  28879. n.prototype.filterTileDownloadDescriptors = function() {
  28880. new r.Vector3;
  28881. return function(e, t, i, n) {
  28882. var r, o;
  28883. switch (n.filter) {
  28884. case h.DirectionalFOV:
  28885. for (r = 0; r < t.length; r++)
  28886. o = t[r],
  28887. l.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  28888. break;
  28889. default:
  28890. for (r = 0; r < t.length; r++)
  28891. o = t[r],
  28892. i.push(o)
  28893. }
  28894. for (r = 0; r < i.length; r++)
  28895. o = i[r],
  28896. this.canIncludeDescriptor(o) || (i[r] = null)
  28897. }
  28898. }(),
  28899. n.prototype.canIncludeDescriptor = function(e) {
  28900. return e.status !== s.Downloading && e.status !== s.Downloaded
  28901. }
  28902. ,
  28903. n.prototype.canIncludePano = function(e, t) {
  28904. return !e.isLoaded(t)
  28905. }
  28906. ,
  28907. n.getFOVDotThreshold = function(e) {
  28908. return Math.cos(r.Math.degToRad(e / 2))
  28909. }
  28910. ;
  28911. var u = function() {
  28912. var e = function e(t, i) {
  28913. var n = e._panoSpaceDir
  28914. , r = e._fovThreshold
  28915. , o = e._fovThresholdNarrow
  28916. , a = Math.max(Math.min(n.dot(t.direction), 1), -1)
  28917. , s = Math.max(Math.min(n.dot(i.direction), 1), -1);
  28918. return t._dot = a,
  28919. i._dot = s,
  28920. 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)
  28921. };
  28922. return e._panoSpaceDir = new r.Vector3,
  28923. e._fovThreshold = -1,
  28924. e._fovThresholdNarrow = -1,
  28925. e
  28926. }();
  28927. n.sortPanoTiles = function(e, t, i) {
  28928. u._panoSpaceDir.copy(i),
  28929. l.getRelativeDirection(t.quaternion, u._panoSpaceDir),
  28930. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  28931. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV),
  28932. e.sort(u)
  28933. }
  28934. ,
  28935. n.insertSortedPanoTile = function(e, t, i, r) {
  28936. u._panoSpaceDir.copy(r),
  28937. l.getRelativeDirection(i.quaternion, u._panoSpaceDir),
  28938. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  28939. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV);
  28940. for (var o = -1, a = 0; a < e.length; a++) {
  28941. var s = u(t, e[a]);
  28942. if (s <= 0) {
  28943. o = a;
  28944. break
  28945. }
  28946. }
  28947. if (o === -1)
  28948. e[e.length] = t;
  28949. else {
  28950. for (var h = e.length; h > o; h--)
  28951. e[h] = e[h - 1];
  28952. e[o] = t
  28953. }
  28954. }
  28955. ,
  28956. n.prototype.setZoomingActive = function(e) {
  28957. e !== this.zoomingActive && (this.zoomingActive = e)
  28958. }
  28959. ,
  28960. t.exports = n
  28961. }
  28962. ).call(this, "/js/tile/TilePrioritizer.js")
  28963. }
  28964. , {
  28965. "../enum/DownloadStatus": 24,
  28966. "../enum/GLCubeFaces": 25,
  28967. "../enum/ModelManagerEvents": 33,
  28968. "../enum/PanoSizeClass": 36,
  28969. "../enum/Vectors": 50,
  28970. "../enum/Viewmode": 51,
  28971. "../objects/Panorama": 148,
  28972. "../settings": 166,
  28973. "../util/browser": 182,
  28974. "../util/logger": 189,
  28975. "../util/math": 190,
  28976. "./TileUtils": 174,
  28977. events: 202,
  28978. three: 217
  28979. }],
  28980. 173: [function(e, t, i) {
  28981. "use strict";
  28982. function n(e, t) {
  28983. this.levels = t,
  28984. this.tileSize = e,
  28985. this.root = null,
  28986. this.allNodes = [],
  28987. a(this)
  28988. }
  28989. function r(e, t) {
  28990. this.tree = e,
  28991. this.parent = t,
  28992. this.children = [],
  28993. this.id = ++u
  28994. }
  28995. function o(e, t, i, r, a, s, l, h) {
  28996. if (e) {
  28997. l = l || n.TraversalType.PreOrder;
  28998. var u = r * c + i;
  28999. if (l === n.TraversalType.PreOrder && (a && a(e, t, u, i, r),
  29000. s && s.push(e)),
  29001. e.children && 0 !== e.children.length) {
  29002. for (var d = r * c, p = i * c, f = 0; f < c; f++)
  29003. for (var g = 0; g < c; g++)
  29004. o(e.children[g * c + f], t + 1, p + f, d + g, a, s, l, h);
  29005. l === n.TraversalType.PostOrder && (a && a(e, t, u, i, r),
  29006. s && s.push(e))
  29007. }
  29008. }
  29009. }
  29010. function a(e) {
  29011. e.root = s(e, null, 0)
  29012. }
  29013. function s(e, t, i) {
  29014. if (i > e.levels)
  29015. return null;
  29016. var n = new r(e,t);
  29017. e.allNodes.push(n);
  29018. for (var o = 0; o < h; o++)
  29019. n.children[o] = s(e, n, i + 1);
  29020. return n
  29021. }
  29022. function l(e, t, i, n, r) {
  29023. if (!e)
  29024. return null;
  29025. if (0 === i)
  29026. return e;
  29027. if (!e.children || 0 === e.children.length)
  29028. return null;
  29029. var o = Math.pow(c, i)
  29030. , a = o / c
  29031. , s = n % a
  29032. , h = r % a
  29033. , u = Math.floor(r / a)
  29034. , d = Math.floor(n / a)
  29035. , p = u * c + d
  29036. , f = e.children[p];
  29037. return l(f, t + 1, i - 1, s, h)
  29038. }
  29039. var c = (e("three"),
  29040. e("./TileUtils"),
  29041. e("../objects/Panorama"),
  29042. e("../util/panorama"),
  29043. e("events").EventEmitter,
  29044. 2)
  29045. , h = c * c;
  29046. n.TraversalType = Object.freeze({
  29047. PreOrder: 0,
  29048. PostOrder: 1
  29049. });
  29050. var u = 0;
  29051. n.getLevelCountForSize = function(e, t) {
  29052. var i = 0;
  29053. for (t < e && (t = e); ; ) {
  29054. if (t /= c,
  29055. t < e)
  29056. break;
  29057. i++
  29058. }
  29059. return i
  29060. }
  29061. ,
  29062. n.getSizeForLevel = function(e, t) {
  29063. return Math.pow(c, t) * e
  29064. }
  29065. ,
  29066. n.prototype.getSubNode = function(e, t, i) {
  29067. (!t || e < this.tileSize) && (t = 0),
  29068. (!i || e < this.tileSize) && (i = 0),
  29069. e < this.tileSize && (e = this.tileSize);
  29070. var r = n.getLevelCountForSize(this.tileSize, e)
  29071. , o = l(this.root, 0, r, t, i);
  29072. return o
  29073. }
  29074. ,
  29075. n.prototype.breadthFirst = function(e) {
  29076. e = e || {};
  29077. var t = !!e.nullLevelEnd
  29078. , i = e.maxLevel
  29079. , n = e.minLevel
  29080. , r = e.callback
  29081. , o = e.saveVisited
  29082. , a = []
  29083. , s = {}
  29084. , l = 0
  29085. , c = 0;
  29086. for (a.push(this.root),
  29087. a.push(s); a.length > 0 && !(i && l > i); ) {
  29088. var h = a.shift();
  29089. if (h === s)
  29090. (!n || l >= n) && (r && t && r(null),
  29091. o && t && o.push(null)),
  29092. a.length > 0 && a.push(s),
  29093. l++,
  29094. c = 0;
  29095. else {
  29096. if (h.children)
  29097. for (var u = 0; u < h.children.length; u++) {
  29098. var d = h.children[u];
  29099. d && a.push(h.children[u])
  29100. }
  29101. var p = this.getFaceIndexFromNode(h);
  29102. (!n || l >= n) && (r && r(h, l, p),
  29103. o && o.push(h)),
  29104. c++
  29105. }
  29106. }
  29107. }
  29108. ,
  29109. n.prototype.getFaceIndexFromNode = function(e) {
  29110. if (!e)
  29111. return -1;
  29112. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  29113. var o = i.parent;
  29114. if (!o)
  29115. break;
  29116. for (var a = -1, s = 0; s < o.children.length; s++)
  29117. o.children[s] === i && (a = s);
  29118. var l = a % c
  29119. , h = Math.floor(a / c);
  29120. n = l * t + n,
  29121. r = h * t + r,
  29122. t *= c,
  29123. i = o
  29124. }
  29125. return r * t + n
  29126. }
  29127. ,
  29128. n.prototype.depthFirst = function(e, t, i) {
  29129. o(this.root, 0, 0, 0, e, t, i, this.tileSize)
  29130. }
  29131. ,
  29132. t.exports = n
  29133. }
  29134. , {
  29135. "../objects/Panorama": 148,
  29136. "../util/panorama": 191,
  29137. "./TileUtils": 174,
  29138. events: 202,
  29139. three: 217
  29140. }],
  29141. 174: [function(e, t, i) {
  29142. "use strict";
  29143. var n = e("../enum/GLCubeFaces")
  29144. , r = e("../util/MathLight")
  29145. , o = {};
  29146. o.TILE_SIZE = 512,
  29147. o.FACES_PER_PANO = 6,
  29148. o.LocationOnTile = {
  29149. Center: 0,
  29150. UpperLeft: 1,
  29151. UpperRight: 2,
  29152. LowerRight: 3,
  29153. LowerLeft: 4
  29154. },
  29155. o.getTileVector = function() {
  29156. return function(e, t, i, a, s, l, c, h) {
  29157. l = l || o.LocationOnTile.Center;
  29158. var u = e / t
  29159. , d = a / u;
  29160. s = -s + (u - 1);
  29161. var p = s / u
  29162. , f = t / e
  29163. , g = 2 * f
  29164. , m = g / 2
  29165. , v = 2 * d - 1 + m
  29166. , A = 2 * p - 1 + m;
  29167. switch (l) {
  29168. case o.LocationOnTile.UpperLeft:
  29169. v -= m,
  29170. A += m,
  29171. v += c * g;
  29172. break;
  29173. case o.LocationOnTile.UpperRight:
  29174. v += m,
  29175. A += m,
  29176. A -= c * g;
  29177. break;
  29178. case o.LocationOnTile.LowerRight:
  29179. v += m,
  29180. A -= m,
  29181. v -= c * g;
  29182. break;
  29183. case o.LocationOnTile.LowerLeft:
  29184. v -= m,
  29185. A -= m,
  29186. A += c * g;
  29187. break;
  29188. case o.LocationOnTile.Center:
  29189. }
  29190. switch (i) {
  29191. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  29192. r.setVector(h, -1, A, -v);
  29193. break;
  29194. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  29195. r.setVector(h, 1, A, v);
  29196. break;
  29197. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  29198. r.setVector(h, -v, 1, -A);
  29199. break;
  29200. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  29201. r.setVector(h, -v, -1, A);
  29202. break;
  29203. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  29204. r.setVector(h, -v, A, 1);
  29205. break;
  29206. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  29207. r.setVector(h, v, A, -1)
  29208. }
  29209. r.normalize(h)
  29210. }
  29211. }(),
  29212. o.getFaceForTile = function(e, t) {
  29213. var i = o.TILE_SIZE;
  29214. e < o.TILE_SIZE && (i = e);
  29215. var n = Math.floor(e / i)
  29216. , r = n * n;
  29217. return Math.floor(t / r)
  29218. }
  29219. ,
  29220. o.getTileLocation = function(e, t, i) {
  29221. var n = o.TILE_SIZE;
  29222. e < o.TILE_SIZE && (n = e);
  29223. var r = o.getFaceForTile(e, t)
  29224. , a = Math.floor(e / n)
  29225. , s = a * a
  29226. , l = t - r * s;
  29227. i.tileX = l % a,
  29228. i.tileY = Math.floor(l / a),
  29229. i.face = r,
  29230. i.faceTileIndex = l
  29231. }
  29232. ,
  29233. o.getTileCountForSize = function(e) {
  29234. if (e <= o.TILE_SIZE)
  29235. return o.FACES_PER_PANO;
  29236. var t = Math.floor(e / o.TILE_SIZE)
  29237. , i = t * t
  29238. , n = i * o.FACES_PER_PANO;
  29239. return n
  29240. }
  29241. ,
  29242. o.getRelativeDirection = function() {
  29243. var e = new r.Matrix4
  29244. , t = new r.Quaternion;
  29245. return function(i, n) {
  29246. t.copy(i),
  29247. t.inverse(),
  29248. e.makeRotationFromQuaternion(t),
  29249. e.applyToVector3(n),
  29250. r.normalize(n)
  29251. }
  29252. }(),
  29253. o.matchingTilesInDirection = function() {
  29254. var e = new r.Vector3
  29255. , t = new r.Vector3(0,0,-1)
  29256. , i = new r.Quaternion
  29257. , n = function(e, t) {
  29258. e.push({
  29259. face: t.face,
  29260. faceTileIndex: t.faceTileIndex,
  29261. tileX: t.tileX,
  29262. tileY: t.tileY
  29263. })
  29264. }
  29265. , a = function() {
  29266. var e = {
  29267. face: -1,
  29268. faceTileIndex: -1,
  29269. tileX: -1,
  29270. tileY: -1
  29271. };
  29272. return function(t, i, r) {
  29273. for (var a = o.getTileCountForSize(t), s = 0, l = 0; l < a; l++)
  29274. o.getTileLocation(t, l, e),
  29275. i && !i(e) || (s++,
  29276. r && n(r, e));
  29277. return s
  29278. }
  29279. }();
  29280. return function(n, s, l, c, h, u) {
  29281. var d = s < o.TILE_SIZE ? s : o.TILE_SIZE;
  29282. o.getTileCountForSize(s);
  29283. if (!c && !h)
  29284. return a(s, null, u);
  29285. var p = !!h;
  29286. if (h = h || c,
  29287. h = Math.max(0, Math.min(h, 360)),
  29288. c = Math.max(0, Math.min(c, 360)),
  29289. r.copyVector(l, e),
  29290. o.getRelativeDirection(n.quaternion, e),
  29291. p) {
  29292. i.setFromUnitVectors(e, t);
  29293. var f = function(e) {
  29294. return o.isTileWithinFrustum(s, d, e.face, e.tileX, e.tileY, i, c, h)
  29295. };
  29296. return a(s, f, u)
  29297. }
  29298. var g = function(t) {
  29299. return o.isTileWithinFOV(s, d, t.face, t.tileX, t.tileY, e, c)
  29300. };
  29301. return a(s, g, u)
  29302. }
  29303. }(),
  29304. o.isTileWithinFrustum = function() {
  29305. var e = new r.Vector3
  29306. , t = 1e-5;
  29307. return function(i, n, a, s, l, c, h, u) {
  29308. 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++)
  29309. if (o.getTileVector(i, n, m, s, l, b, 0, e),
  29310. r.applyQuaternionToVector(c, e),
  29311. e.z >= -t)
  29312. I++;
  29313. else {
  29314. var w = -1 / e.z
  29315. , _ = e.x * w
  29316. , T = e.y * w;
  29317. T > d ? v++ : T < p && A++,
  29318. _ > f ? y++ : _ < g && C++,
  29319. E++
  29320. }
  29321. return A !== E && v !== E && y !== E && C !== E
  29322. }
  29323. }(),
  29324. o.isTileWithinFOV = function() {
  29325. var e = new r.Vector3
  29326. , t = new r.Vector3(0,1,0)
  29327. , i = new r.Vector3(1,0,0);
  29328. return function(n, a, s, l, c, h, u) {
  29329. var d = o.mapFaceToCubemapFace(s);
  29330. if (r.cross(h, t, i),
  29331. o.getTileVector(n, a, d, l, c, o.LocationOnTile.Center, 0, e),
  29332. o.isWithinFOV(e, h, u, null))
  29333. return !0;
  29334. for (var p = u / 360, f = Math.floor(1 / p), g = 0, m = 0; m < f; m++) {
  29335. for (var v = o.LocationOnTile.UpperLeft; v <= o.LocationOnTile.LowerLeft; v++)
  29336. if (o.getTileVector(n, a, d, l, c, v, g, e),
  29337. o.isWithinFOV(e, h, u, null))
  29338. return !0;
  29339. g += p
  29340. }
  29341. return !1
  29342. }
  29343. }(),
  29344. o.isWithinFOV = function() {
  29345. var e = new r.Vector3
  29346. , t = new r.Vector3;
  29347. return function(i, n, o, a) {
  29348. if (r.copyVector(i, t),
  29349. a) {
  29350. r.copyVector(a, e),
  29351. r.normalize(e);
  29352. var s = r.dot(e, i);
  29353. e.x *= s,
  29354. e.y *= s,
  29355. e.z *= s,
  29356. r.subVector(t, e)
  29357. }
  29358. var l = o / 2 * r.RADIANS_PER_DEGREE
  29359. , c = Math.cos(l)
  29360. , h = r.dot(t, n);
  29361. return h >= c
  29362. }
  29363. }(),
  29364. o.mapFaceToCubemapFace = function() {
  29365. var e = {
  29366. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  29367. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  29368. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  29369. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  29370. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  29371. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  29372. };
  29373. return function(t) {
  29374. return e[t]
  29375. }
  29376. }(),
  29377. t.exports = o
  29378. }
  29379. , {
  29380. "../enum/GLCubeFaces": 25,
  29381. "../util/MathLight": 176
  29382. }],
  29383. 175: [function(e, t, i) {
  29384. (function(i) {
  29385. "use strict";
  29386. function n() {
  29387. this.list = [],
  29388. this.index = {},
  29389. Object.defineProperty(this, "length", {
  29390. get: function() {
  29391. return this.list.length
  29392. }
  29393. })
  29394. }
  29395. var r = (e("./common"),
  29396. e("./logger"));
  29397. new r(i);
  29398. n.prototype.forEach = function(e) {
  29399. this.list.forEach(e)
  29400. }
  29401. ,
  29402. n.prototype.add = function(e) {
  29403. this.list.push(e),
  29404. this.index[this.getIndex(e)] = e
  29405. }
  29406. ,
  29407. n.prototype.getIndex = function(e) {
  29408. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  29409. }
  29410. ,
  29411. n.prototype.extend = function(e) {
  29412. for (var t = 0; t < e.length; t++)
  29413. this.add(e[t])
  29414. }
  29415. ,
  29416. n.prototype.get = function(e) {
  29417. return this.index[e]
  29418. }
  29419. ,
  29420. n.prototype.first = function() {
  29421. return this.list[0]
  29422. }
  29423. ,
  29424. n.prototype.last = function() {
  29425. return this.list[this.list.length - 1]
  29426. }
  29427. ,
  29428. n.prototype.reIndex = function() {
  29429. this.index = {};
  29430. var e = this;
  29431. this.forEach(function(t) {
  29432. e.index[e.getIndex(t)] = t
  29433. })
  29434. }
  29435. ,
  29436. n.prototype.filter = function(e) {
  29437. var t = this.list.filter(e);
  29438. return this.reIndex(),
  29439. t
  29440. }
  29441. ,
  29442. n.prototype.reduce = function(e, t) {
  29443. return this.list.reduce(e, t)
  29444. }
  29445. ,
  29446. n.prototype.sort = function(e) {
  29447. return this.list.sort(e)
  29448. }
  29449. ,
  29450. n.prototype.indexOf = function(e) {
  29451. for (var t = 0; t < this.list.length; ++t)
  29452. if (this.list[t] === e)
  29453. return t;
  29454. return -1
  29455. }
  29456. ,
  29457. t.exports = n
  29458. }
  29459. ).call(this, "/js/util/IndexedCollection.js")
  29460. }
  29461. , {
  29462. "./common": 185,
  29463. "./logger": 189
  29464. }],
  29465. 176: [function(e, t, i) {
  29466. "use strict";
  29467. var n = e("../constants")
  29468. , r = {};
  29469. r.RADIANS_PER_DEGREE = Math.PI / 180,
  29470. r.DEGREES_PER_RADIAN = 180 / Math.PI,
  29471. r.Vector3 = function(e, t, i) {
  29472. this.x = e || 0,
  29473. this.y = t || 0,
  29474. this.z = i || 0
  29475. }
  29476. ,
  29477. r.Matrix4 = function() {
  29478. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  29479. arguments.length > 0 && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  29480. }
  29481. ,
  29482. r.Matrix4.prototype = {
  29483. identity: function() {
  29484. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  29485. this
  29486. },
  29487. copy: function(e) {
  29488. return this.elements.set(e.elements),
  29489. this
  29490. },
  29491. applyToVector3: function(e) {
  29492. var t = e.x
  29493. , i = e.y
  29494. , n = e.z
  29495. , r = this.elements;
  29496. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  29497. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  29498. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  29499. this
  29500. },
  29501. getInverse: function(e, t) {
  29502. var i = this.elements
  29503. , n = e.elements
  29504. , r = n[0]
  29505. , o = n[1]
  29506. , a = n[2]
  29507. , s = n[3]
  29508. , l = n[4]
  29509. , c = n[5]
  29510. , h = n[6]
  29511. , u = n[7]
  29512. , d = n[8]
  29513. , p = n[9]
  29514. , f = n[10]
  29515. , g = n[11]
  29516. , m = n[12]
  29517. , v = n[13]
  29518. , A = n[14]
  29519. , y = n[15]
  29520. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  29521. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  29522. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  29523. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  29524. , w = r * C + o * I + a * E + s * b;
  29525. if (0 === w) {
  29526. var _ = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  29527. if (t)
  29528. throw new Error(_);
  29529. return console.warn(_),
  29530. this.identity()
  29531. }
  29532. var T = 1 / w;
  29533. return i[0] = C * T,
  29534. i[1] = (v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y) * T,
  29535. i[2] = (c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y) * T,
  29536. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  29537. i[4] = I * T,
  29538. i[5] = (d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y) * T,
  29539. i[6] = (m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y) * T,
  29540. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  29541. i[8] = E * T,
  29542. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y) * T,
  29543. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y) * T,
  29544. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  29545. i[12] = b * T,
  29546. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A) * T,
  29547. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A) * T,
  29548. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  29549. this
  29550. },
  29551. makeRotationFromQuaternion: function(e) {
  29552. var t = this.elements
  29553. , i = e.x
  29554. , n = e.y
  29555. , r = e.z
  29556. , o = e.w
  29557. , a = i + i
  29558. , s = n + n
  29559. , l = r + r
  29560. , c = i * a
  29561. , h = i * s
  29562. , u = i * l
  29563. , d = n * s
  29564. , p = n * l
  29565. , f = r * l
  29566. , g = o * a
  29567. , m = o * s
  29568. , v = o * l;
  29569. return t[0] = 1 - (d + f),
  29570. t[4] = h - v,
  29571. t[8] = u + m,
  29572. t[1] = h + v,
  29573. t[5] = 1 - (c + f),
  29574. t[9] = p - g,
  29575. t[2] = u - m,
  29576. t[6] = p + g,
  29577. t[10] = 1 - (c + d),
  29578. t[3] = 0,
  29579. t[7] = 0,
  29580. t[11] = 0,
  29581. t[12] = 0,
  29582. t[13] = 0,
  29583. t[14] = 0,
  29584. t[15] = 1,
  29585. this
  29586. }
  29587. },
  29588. r.Quaternion = function(e, t, i, n) {
  29589. this._x = e || 0,
  29590. this._y = t || 0,
  29591. this._z = i || 0,
  29592. this._w = void 0 !== n ? n : 1
  29593. }
  29594. ,
  29595. r.Quaternion.prototype = {
  29596. get x() {
  29597. return this._x
  29598. },
  29599. set x(e) {
  29600. this._x = e
  29601. },
  29602. get y() {
  29603. return this._y
  29604. },
  29605. set y(e) {
  29606. this._y = e
  29607. },
  29608. get z() {
  29609. return this._z
  29610. },
  29611. set z(e) {
  29612. this._z = e
  29613. },
  29614. get w() {
  29615. return this._w
  29616. },
  29617. set w(e) {
  29618. this._w = e
  29619. },
  29620. copy: function(e) {
  29621. this._x = e.x,
  29622. this._y = e.y,
  29623. this._z = e.z,
  29624. this._w = e.w
  29625. },
  29626. inverse: function() {
  29627. return this.conjugate().normalize()
  29628. },
  29629. conjugate: function() {
  29630. return this._x *= -1,
  29631. this._y *= -1,
  29632. this._z *= -1,
  29633. this
  29634. },
  29635. length: function() {
  29636. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  29637. },
  29638. normalize: function() {
  29639. var e = this.length();
  29640. return 0 === e ? (this._x = 0,
  29641. this._y = 0,
  29642. this._z = 0,
  29643. this._w = 1) : (e = 1 / e,
  29644. this._x = this._x * e,
  29645. this._y = this._y * e,
  29646. this._z = this._z * e,
  29647. this._w = this._w * e),
  29648. this
  29649. },
  29650. setFromAxisAngle: function(e, t) {
  29651. var i = t / 2
  29652. , n = Math.sin(i);
  29653. return this._x = e.x * n,
  29654. this._y = e.y * n,
  29655. this._z = e.z * n,
  29656. this._w = Math.cos(i),
  29657. this
  29658. },
  29659. setFromUnitVectors: function() {
  29660. var e, t, i = 1e-6;
  29661. return function(n, o) {
  29662. return void 0 === e && (e = new r.Vector3),
  29663. t = r.dot(n, o) + 1,
  29664. t < i ? (t = 0,
  29665. 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),
  29666. this._x = e.x,
  29667. this._y = e.y,
  29668. this._z = e.z,
  29669. this._w = t,
  29670. this.normalize()
  29671. }
  29672. }(),
  29673. multiply: function(e) {
  29674. return this.multiplyQuaternions(this, e)
  29675. },
  29676. premultiply: function(e) {
  29677. return this.multiplyQuaternions(e, this)
  29678. },
  29679. multiplyQuaternions: function(e, t) {
  29680. var i = e._x
  29681. , n = e._y
  29682. , r = e._z
  29683. , o = e._w
  29684. , a = t._x
  29685. , s = t._y
  29686. , l = t._z
  29687. , c = t._w;
  29688. return this._x = i * c + o * a + n * l - r * s,
  29689. this._y = n * c + o * s + r * a - i * l,
  29690. this._z = r * c + o * l + i * s - n * a,
  29691. this._w = o * c - i * a - n * s - r * l,
  29692. this
  29693. }
  29694. },
  29695. r.convertWorkshopVector = function(e) {
  29696. return new r.Vector3(-e.x,e.y,e.z)
  29697. }
  29698. ,
  29699. r.convertWorkshopQuaternion = function(e) {
  29700. 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))
  29701. }
  29702. ;
  29703. r.convertWorkshopOrthoZoom = function(e) {//xzw
  29704. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / n.workshopApsect
  29705. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  29706. }
  29707. ,
  29708. r.convertWorkshopPanoramaQuaternion = function(e) {
  29709. 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))
  29710. }
  29711. ,
  29712. r.normalize = function(e) {
  29713. var t = e.x * e.x + e.y * e.y + e.z * e.z
  29714. , i = Math.sqrt(t);
  29715. e.x /= i,
  29716. e.y /= i,
  29717. e.z /= i
  29718. }
  29719. ,
  29720. r.dot = function(e, t) {
  29721. return e.x * t.x + e.y * t.y + e.z * t.z
  29722. }
  29723. ,
  29724. r.cross = function(e, t, i) {
  29725. var n = e.x
  29726. , r = e.y
  29727. , o = e.z;
  29728. i.x = r * t.z - o * t.y,
  29729. i.y = o * t.x - n * t.z,
  29730. i.z = n * t.y - r * t.x
  29731. }
  29732. ,
  29733. r.setVector = function(e, t, i, n) {
  29734. e.x = t,
  29735. e.y = i,
  29736. e.z = n
  29737. }
  29738. ,
  29739. r.copyVector = function(e, t) {
  29740. t.x = e.x,
  29741. t.y = e.y,
  29742. t.z = e.z
  29743. }
  29744. ,
  29745. r.addVector = function(e, t) {
  29746. e.x += t.x,
  29747. e.y += t.y,
  29748. e.z += t.z
  29749. }
  29750. ,
  29751. r.subVector = function(e, t) {
  29752. e.x -= t.x,
  29753. e.y -= t.y,
  29754. e.z -= t.z
  29755. }
  29756. ,
  29757. r.applyQuaternionToVector = function(e, t) {
  29758. var i = t.x
  29759. , n = t.y
  29760. , r = t.z
  29761. , o = e.x
  29762. , a = e.y
  29763. , s = e.z
  29764. , l = e.w
  29765. , c = l * i + a * r - s * n
  29766. , h = l * n + s * i - o * r
  29767. , u = l * r + o * n - a * i
  29768. , d = -o * i - a * n - s * r;
  29769. t.x = c * l + d * -o + h * -s - u * -a,
  29770. t.y = h * l + d * -a + u * -o - c * -s,
  29771. t.z = u * l + d * -s + c * -a - h * -o
  29772. }
  29773. ,
  29774. r.angleBetweenVectors = function(e, t) {
  29775. return Math.acos(r.dot(e, t))
  29776. }
  29777. ,
  29778. t.exports = r
  29779. }
  29780. , {
  29781. "../constants": 8
  29782. }],
  29783. 177: [function(e, t, i) {
  29784. (function(i) {
  29785. "use strict";
  29786. function n(e) {
  29787. this.cache = null,
  29788. this.expires = 0
  29789. }
  29790. function r() {
  29791. this.baseUrl = null,
  29792. this.cache = null,
  29793. this.expires = 0
  29794. }
  29795. function o() {
  29796. this.baseUrl = null,
  29797. this.expires = 0
  29798. }
  29799. function a(e) {
  29800. this.initialLoadingPromise = null,
  29801. this.endpoint = e + "?type=3",
  29802. this.urlContainer = null,
  29803. this.authorizationHeader = h.getAuthorizationHeader(),
  29804. this.containerClasses = [o, r, n]
  29805. }
  29806. var s = e("./ajax")
  29807. , l = e("./logger")
  29808. , c = e("../constants")
  29809. , h = e("./showcase")
  29810. , u = (e("../ab"),
  29811. new l(i));
  29812. n.prototype = {
  29813. version: 1,
  29814. validate: function(e) {
  29815. return "catalog.json"in e && Object.keys(e).length > 0
  29816. },
  29817. update: function(e) {
  29818. return this.cache = e,
  29819. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  29820. $.when()
  29821. },
  29822. get: function(e) {
  29823. return this.cache[e]
  29824. }
  29825. },
  29826. r.prototype = {
  29827. version: 2,
  29828. validate: function(e) {
  29829. return "catalog.json"in e && "base.url"in e && Object.keys(e).length > 1
  29830. },
  29831. update: function(e) {
  29832. return this.baseUrl = e["base.url"],
  29833. this.cache = e,
  29834. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  29835. $.when()
  29836. },
  29837. get: function(e) {
  29838. var t = this.cache[e];
  29839. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  29840. }
  29841. },
  29842. o.prototype = {
  29843. version: 3,
  29844. validate: function(e) {
  29845. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  29846. },
  29847. update: function(e) {
  29848. return this.baseUrl = e.templates[0],
  29849. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  29850. $.when()
  29851. },
  29852. get: function(e) {
  29853. return this.baseUrl.replace("{{filename}}", e)
  29854. }
  29855. },
  29856. a.prototype = {
  29857. init: function() {
  29858. return this.initialLoadingPromise ? this.initialLoadingPromise : (setInterval(function() {
  29859. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  29860. Date.now() + c.signedUrlRefreshBuffer > e && (u.debug("Refreshing urls..."),
  29861. this.refresh().done(function() {
  29862. u.debug("Refreshed")
  29863. }).fail(function() {
  29864. u.error("Failed url refresh, urls might go stale soon")
  29865. }))
  29866. }
  29867. .bind(this), c.signedUrlCheckInterval),
  29868. this.initialLoadingPromise = this.refresh(),
  29869. this.initialLoadingPromise)
  29870. },
  29871. refresh: function(e) { //已经在someData.js里加载过了 不用再加载file了吧
  29872. e = e || {};
  29873. /*var t = void 0 === e.cache || e.cache;
  29874. return s.get( this.endpoint , { //file
  29875. responseType: "json",
  29876. prefetchFrom: t ? "files" : null,
  29877. cache: t,
  29878. auth: this.authorizationHeader
  29879. }).then(function(e) {
  29880. if (this.urlContainer && this.urlContainer.validate(e))
  29881. return this.urlContainer.update(e);
  29882. for (var i = 0; i < this.containerClasses.length; i++) {
  29883. var n = this.containerClasses[i]
  29884. , r = new n;
  29885. if (r.validate(e))
  29886. return u.info("Using urls version " + r.version),
  29887. this.urlContainer = r,
  29888. this.urlContainer.update(e)
  29889. }
  29890. return t ? this.refresh({
  29891. cache: !1
  29892. }) : $.Deferred().reject("missing-urls")
  29893. }
  29894. .bind(this), function(e) {
  29895. return "loading-failed"
  29896. }) */
  29897. return $.Deferred().resolve();
  29898. },
  29899. get: function(e) {
  29900. //return this.urlContainer.get(e)
  29901. return window.DATA.files.templates[0].replace("{{filename}}", e)
  29902. }
  29903. },
  29904. t.exports = a
  29905. }
  29906. ).call(this, "/js/util/ModelUrls.js")
  29907. }
  29908. , {
  29909. "../ab": 3,
  29910. "../constants": 8,
  29911. "./ajax": 181,
  29912. "./logger": 189,
  29913. "./showcase": 193
  29914. }],
  29915. 178: [function(e, t, i) {
  29916. (function(i) {
  29917. "use strict";
  29918. function n() {
  29919. u.call(this),
  29920. this.neighbourMap = {},
  29921. this.map = null
  29922. }
  29923. var r = e("three")
  29924. , o = e("./common")
  29925. , a = e("../settings")
  29926. , s = e("../objects/Panorama")
  29927. , a = e("../settings")
  29928. , l = e("./aStar")
  29929. , c = e("./logger")
  29930. , h = new c(i)
  29931. , u = e("./IndexedCollection")
  29932. , d = e("./transitions");
  29933. o.inherit(n, u),
  29934. n.prototype.getIndex = function(e) {
  29935. return e.id
  29936. }
  29937. ,
  29938. n.prototype.find = function(e, t) {
  29939. var i = o.filterAll(this.list, e);
  29940. return 0 === i.length ? null : (t && t.forEach(function(e) {
  29941. i = o.stableSort(i, e)
  29942. }),
  29943. i[0])
  29944. }
  29945. /* n.prototype.sortByScore = function(e, t) {
  29946. var i = o.filterAll(this.list, e);
  29947. return 0 === i.length ? null : i = i.map(function(e) {
  29948. return {
  29949. pano: e,
  29950. score: t.reduce(function(t, i) {
  29951. return t + i(e)
  29952. }, 0)
  29953. }
  29954. }).sort(function(e, t) {
  29955. return t.score - e.score;
  29956. })
  29957. } */
  29958. ,
  29959. n.prototype.sortByScore = function( request, rank){
  29960. return common.sortByScore(this.list, request, rank)
  29961. }
  29962. ,
  29963. n.prototype.lowestByScore = function(e, t, i) {
  29964. return this.findRankedByScore(0, e, t, i)
  29965. }
  29966. ,
  29967. n.prototype.findRankedByScore = function(e, t, i, n) {
  29968. n && (n.candidates = null,
  29969. n.pano = null),
  29970. e || (e = 0);
  29971. var r = this.sortByScore(t, i);
  29972. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  29973. n.pano = r[e].item),
  29974. r[e].item)
  29975. }
  29976. ,
  29977. n.prototype.showPanoScores = function(e) {
  29978. this.list.forEach(function(e) {
  29979. e.removeTextSprite()
  29980. });
  29981. var t = 6344768;
  29982. e.forEach(function(e) {
  29983. e.pano.addTextSprite(e.score.toFixed(2), t),
  29984. t = 16428055
  29985. })
  29986. }
  29987. ,
  29988. n.prototype.isNeighbour = function(e, t) {
  29989. return this.neighbourMap[e.id][t.id]
  29990. }
  29991. ,
  29992. n.prototype.getNeighbours = function(e) {
  29993. return this.neighbourMap[e.id]
  29994. }
  29995. ,
  29996. n.prototype.setNeighbour = function(e, t, i) {
  29997. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  29998. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  29999. this.neighbourMap[e.id][e.id] = !0,
  30000. this.neighbourMap[t.id][t.id] = !0,
  30001. this.neighbourMap[e.id][t.id] = i,
  30002. this.neighbourMap[t.id][e.id] = i,
  30003. this.neighbourMap[e.id]
  30004. }
  30005. ,
  30006. n.prototype.findClosest = function(e, t) {
  30007. var i = [s.filters.isPanoAligned()];
  30008. return t && i.push(s.filters.inDirection(e, t, .75)),
  30009. this.find(i, [s.sortFunctions.distanceToPoint(e)])
  30010. }
  30011. ,
  30012. n.prototype.dualNeighbors = function(e, t) {
  30013. var i, n = [];
  30014. for (i in this.neighbourMap[e.id])
  30015. this.neighbourMap[t.id][i] && n.push(i);
  30016. return n
  30017. }
  30018. ,
  30019. n.prototype.populate_path_graph = function() {
  30020. 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;
  30021. for (e = 0; e < this.list.length; e += 1) {
  30022. o = this.list[e],
  30023. s = {},
  30024. l = !1,
  30025. i = o.neighbourPanos || o.findNeighourPanos();
  30026. for (t in i)
  30027. if (i[t]) {
  30028. a = this.index[t],
  30029. p.copy(o.floorPosition),
  30030. p.sub(a.floorPosition);
  30031. var m = Math.sqrt(p.x * p.x + p.z * p.z)
  30032. , v = (Math.abs(p.y) / Math.max(m, .01),
  30033. Math.max(0, Math.abs(p.y) - .2));
  30034. v > 0 ? (f += 1,
  30035. v = Math.pow(4 * v, 2),
  30036. m = Math.pow(m, 2),
  30037. n = Math.sqrt(v * v + m * m)) : (g += 1,
  30038. n = p.length()),
  30039. s[a.id] = n,
  30040. l = !0
  30041. }
  30042. l ? u[o.id] = s : d += 1
  30043. }
  30044. this.map = u,
  30045. h.info("graph ready in " + (Date.now() - c) + "ms, " + d + " had no neighbors")
  30046. }
  30047. ,
  30048. n.prototype.aStarSearch = function(e, t) {
  30049. var i = Date.now()
  30050. , n = new l({
  30051. start: e,
  30052. isEnd: function(e) {
  30053. return e === t
  30054. },
  30055. neighbor: function(e) {
  30056. var t = e.neighbourPanos || e.findNeighourPanos()
  30057. , i = [];
  30058. for (var n in t)
  30059. t[n] && i.push(this.index[n]); //add: t[n] &&
  30060. return i
  30061. }
  30062. .bind(this),
  30063. distance: function(e, t) {
  30064. var i = this.map[e.id]
  30065. , n = i[t.id];
  30066. return n
  30067. }
  30068. .bind(this),
  30069. heuristic: function(e, t) {
  30070. return 1
  30071. }
  30072. .bind(this),
  30073. hash: function(e) {
  30074. return e.id
  30075. },
  30076. timeout: 5e3
  30077. });
  30078. if (h.debug("A* search in " + (Date.now() - i) + "ms"),
  30079. "success" !== n.status)
  30080. return h.debug("Did not find A* path from " + e + " to " + t),
  30081. null;
  30082. h.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  30083. var r = [];
  30084. return n.path.forEach(function(e) {
  30085. r.push(e.id)
  30086. }),
  30087. r
  30088. }
  30089. ,
  30090. n.prototype.includeNodesNearPath = function() {
  30091. var e = new r.Vector3
  30092. , t = new r.Vector3
  30093. , i = new r.Vector3
  30094. , n = new r.Vector3
  30095. , o = new r.Vector3
  30096. , a = new r.Vector3
  30097. , s = new r.Vector3
  30098. , l = new r.Vector3
  30099. , c = []
  30100. , h = new r.Vector3
  30101. , u = new r.Vector3;
  30102. return function(r, d) {
  30103. if (r)
  30104. for (var p = function(e, t, i) {
  30105. return o.copy(t).sub(e),
  30106. o.dot(i)
  30107. }, f = function(e, t) {
  30108. return p(h, e.position, i) - p(h, t.position, i)
  30109. }, g = 0; g < r.length - 1; ) {
  30110. var m = r[g]
  30111. , v = r[g + 1]
  30112. , A = this.index[m]
  30113. , y = this.index[v];
  30114. h.copy(A.position),
  30115. u.copy(y.position),
  30116. c.length = 0,
  30117. e.copy(u).sub(h),
  30118. i.copy(e).normalize();
  30119. for (var C = 0; C < this.list.length; C++) {
  30120. var I = this.list[C];
  30121. o.copy(I.position).sub(h);
  30122. var E = o.dot(i);
  30123. if (E > 0) {
  30124. s.copy(i),
  30125. s.multiplyScalar(E),
  30126. a.copy(o),
  30127. a.sub(s);
  30128. var b = a.length();
  30129. if (b < d) {
  30130. t.copy(e).negate(),
  30131. n.copy(t).normalize(),
  30132. l.copy(I.position).sub(u);
  30133. var w = l.dot(n);
  30134. w > 0 && c.push(I)
  30135. }
  30136. }
  30137. }
  30138. if (c.length > 0) {
  30139. c.sort(f);
  30140. for (var _ = r.length + c.length - 1; _ >= g + c.length; _--)
  30141. r[_] = r[_ - c.length];
  30142. for (var T = 0; T < c.length; T++)
  30143. r[T + g + 1] = c[T].id
  30144. }
  30145. g += c.length + 1
  30146. }
  30147. }
  30148. }(),
  30149. /* n.prototype. = function(e, t) {
  30150. var i = void 0 === e ? a.panorama.markerOpacity : e
  30151. , n = this.list.findIndex(function(e) {
  30152. return e.marker
  30153. });
  30154. if (!(n < 0)) {
  30155. var r = this.list[n].marker.material.opacity;
  30156. if (r !== e) {
  30157. var o = i - r;
  30158. d.trigger({
  30159. func: function(e, t) {
  30160. var i = r + e * o;
  30161. this.forEach(function(e) {
  30162. e.marker && (e.marker.material.opacity = i)
  30163. })
  30164. }
  30165. .bind(this),
  30166. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  30167. name: "_fpm"
  30168. })
  30169. }
  30170. }
  30171. } */
  30172. n.prototype.fadeMarkerOpacity = function(e, t, gr) {
  30173. d.cancelById('fadeMarkerOpacity')
  30174. var n = this.list.findIndex(function (e) {
  30175. //why? 难道没有marker的pano吗 findeIndex:获取数组中函数返回值不为fasle的第一个元素索引位置
  30176. return e.marker
  30177. })
  30178. if (n < 0) {
  30179. //logger.info('marker findIndex<0')
  30180. return
  30181. }
  30182. var group
  30183. var tran = function (list, index) {
  30184. list.member = list.member.filter(function (m) {
  30185. return m.marker && m.marker.material.opacity != list.toOp
  30186. })
  30187. transitions.trigger({
  30188. func: function (e, t) {
  30189. //e:0-1
  30190. list.member.forEach(function (m) {
  30191. var o = m.marker.oldOpacity
  30192. var i = o + e * (list.toOp - o)
  30193. m.marker && (m.marker.material.opacity = i)
  30194. })
  30195. }.bind(this),
  30196. duration: void 0 == t ? a.markerOpacityTransitionTime : t,
  30197. name: '_fpm_' + index,
  30198. id: 'fadeMarkerOpacity',
  30199. })
  30200. }
  30201. this.forEach(function (e) {
  30202. //先记录旧的opacity
  30203. e.marker && (e.marker.oldOpacity = e.marker.material.opacity)
  30204. })
  30205. group = gr
  30206. /* if (e > 0 && gr) {
  30207. group = gr
  30208. } else {
  30209. group = [
  30210. {
  30211. member: this.list,
  30212. toOp: 0,
  30213. },
  30214. ]
  30215. } */
  30216. for (var i = 0; i < group.length; i++) {
  30217. tran(group[i], i)
  30218. }
  30219. }
  30220. ,
  30221. t.exports = n
  30222. }
  30223. ).call(this, "/js/util/PanoramaCollection.js")
  30224. }
  30225. , {
  30226. "../objects/Panorama": 148,
  30227. "../settings": 166,
  30228. "./IndexedCollection": 175,
  30229. "./aStar": 180,
  30230. "./common": 185,
  30231. "./logger": 189,
  30232. "./transitions": 195,
  30233. three: 217
  30234. }],
  30235. 179: [function(e, t, i) {
  30236. "use strict";
  30237. function n() {
  30238. this.actionSequence = [],
  30239. this.actionSequenceInProgress = !1
  30240. }
  30241. function r(e, t, i, n) {
  30242. s.trackAlways("zoom_" + e, {
  30243. from: t,
  30244. to: i,
  30245. pano: n
  30246. })
  30247. }
  30248. function o(e, t) {
  30249. r("initial", 1, e, t)
  30250. }
  30251. function a(e, t, i) {
  30252. r("followup", e, t, i)
  30253. }
  30254. var s = e("../analytics");
  30255. n.prototype.reset = function(e) {
  30256. this.actionSequenceInProgress = !1,
  30257. this.actionSequence.length = 0
  30258. }
  30259. ,
  30260. n.prototype.addZoomAction = function() {
  30261. var e = null
  30262. , t = null
  30263. , i = !1
  30264. , n = function() {
  30265. if (e = null,
  30266. this.actionSequence.length > 0) {
  30267. var i = this.actionSequence[0].start
  30268. , n = this.actionSequence[this.actionSequence.length - 1].end;
  30269. 1 === i ? o(n, t) : a(i, n, t)
  30270. }
  30271. this.reset()
  30272. };
  30273. return function(r, o, a) {
  30274. if (r !== o) {
  30275. i || (n = n.bind(this),
  30276. i = !0),
  30277. e && (window.clearTimeout(e),
  30278. e = null),
  30279. a === t && this.actionSequenceInProgress || (this.reset(),
  30280. t = a),
  30281. this.actionSequenceInProgress = !0;
  30282. var s = {
  30283. start: r,
  30284. end: o
  30285. };
  30286. this.actionSequence.push(s),
  30287. e = window.setTimeout(n, 150)
  30288. }
  30289. }
  30290. }(),
  30291. t.exports = n
  30292. }
  30293. , {
  30294. "../analytics": 4
  30295. }],
  30296. 180: [function(e, t, i) {
  30297. "use strict";
  30298. function n(e) {
  30299. void 0 === e.timeout && (e.timeout = 1 / 0);
  30300. var t = e.hash || o
  30301. , i = {
  30302. data: e.start,
  30303. g: 0,
  30304. h: e.heuristic(e.start)
  30305. }
  30306. , n = i;
  30307. i.f = i.h;
  30308. var h = new s
  30309. , u = new l(a)
  30310. , d = c();
  30311. u.push(i),
  30312. d.set(t(i.data), i);
  30313. for (var p = new Date; u.size(); ) {
  30314. if (new Date - p > e.timeout)
  30315. return {
  30316. status: "timeout",
  30317. cost: n.g,
  30318. path: r(n)
  30319. };
  30320. var f = u.pop();
  30321. if (d.delete(t(f.data)),
  30322. e.isEnd(f.data))
  30323. return {
  30324. status: "success",
  30325. cost: f.g,
  30326. path: r(f)
  30327. };
  30328. h.add(t(f.data));
  30329. for (var g = e.neighbor(f.data), m = 0; m < g.length; m++) {
  30330. var v = g[m];
  30331. if (!h.contains(t(v))) {
  30332. var A = f.g + e.distance(f.data, v)
  30333. , y = d.get(t(v))
  30334. , C = !1;
  30335. if (void 0 === y)
  30336. y = {
  30337. data: v
  30338. },
  30339. d.set(t(v), y);
  30340. else {
  30341. if (y.g < A)
  30342. continue;
  30343. C = !0
  30344. }
  30345. y.parent = f,
  30346. y.g = A,
  30347. y.h = e.heuristic(v),
  30348. y.f = A + y.h,
  30349. y.h < n.h && (n = y),
  30350. C ? u.heapify() : u.push(y)
  30351. }
  30352. }
  30353. }
  30354. return {
  30355. status: "noPath",
  30356. cost: n.g,
  30357. path: r(n)
  30358. }
  30359. }
  30360. function r(e) {
  30361. if (void 0 !== e.parent) {
  30362. var t = r(e.parent);
  30363. return t.push(e.data),
  30364. t
  30365. }
  30366. return [e.data]
  30367. }
  30368. function o(e) {
  30369. return e.toString()
  30370. }
  30371. function a(e, t) {
  30372. return e.f - t.f
  30373. }
  30374. var s = e("Set")
  30375. , l = e("heap")
  30376. , c = e("dict");
  30377. t.exports = n
  30378. }
  30379. , {
  30380. Set: 196,
  30381. dict: 210,
  30382. heap: 211
  30383. }],
  30384. 181: [function(e, t, i) {
  30385. (function(i) {
  30386. "use strict";
  30387. function n(e, t, i) {
  30388. var n = new XMLHttpRequest;
  30389. if (i && "withCredentials"in n)
  30390. n.open(e, t, i);
  30391. else if ("undefined" != typeof XDomainRequest)
  30392. n = new XDomainRequest,
  30393. n.open(e, t);
  30394. else {
  30395. if (i)
  30396. throw "Browser does not support CORS!";
  30397. n.open(e, t)
  30398. }
  30399. return n
  30400. }
  30401. function r(e, t, i) {
  30402. function o() {
  30403. u.warn("Retrying ", t),
  30404. r(e, t, i).done(c.resolve.bind(c)).progress(c.notify.bind(c)).fail(c.reject.bind(c))
  30405. }
  30406. function a(e, t) {
  30407. var i = e.response;
  30408. if ("json" === t && "object" != typeof i)
  30409. try {
  30410. i = JSON.parse(e.responseText)
  30411. } catch (e) {
  30412. return void c.reject({
  30413. error: "Failed parsing JSON"
  30414. })
  30415. }
  30416. else if ("image/jpeg" === t) {
  30417. var n = new Uint8Array(e.response)
  30418. , r = new Blob([n],{
  30419. type: "image/jpeg"
  30420. })
  30421. , o = URL.createObjectURL(r);
  30422. i = new Image,
  30423. i.src = o,
  30424. i.crossOrigin = "Anonymous",
  30425. i.onload = function() {
  30426. URL.revokeObjectURL(o)
  30427. }
  30428. }
  30429. return i
  30430. }
  30431. var s = n(e, t, !1);
  30432. if (i = i || {},
  30433. i.retries = void 0 !== i.retries ? i.retries : 0,
  30434. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  30435. i.responseType)
  30436. if (["arraybuffer", "text", "json"].indexOf(i.responseType) > -1)
  30437. s.responseType = i.responseType;
  30438. else {
  30439. if ("image/jpeg" !== i.responseType)
  30440. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  30441. s.responseType = "arraybuffer"
  30442. }
  30443. if ("json" === i.responseType && s.setRequestHeader("Accept", "application/json"),
  30444. i.auth && s.setRequestHeader("Authorization", i.auth),
  30445. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  30446. s.setRequestHeader("Content-Type", "application/json")),
  30447. "object" == typeof i.headers)
  30448. for (var l in i.headers)
  30449. s.setRequestHeader(l, i.headers[l]);
  30450. var c = $.Deferred();
  30451. return s.onreadystatechange = function(e) {
  30452. if (4 === this.readyState)
  30453. if (this.status >= 500 && this.status <= 600 && i.retry && i.retries < 3)
  30454. i.retries++,
  30455. setTimeout(o, 1e3);
  30456. else if (200 === this.status) {
  30457. var t = a(this, i.responseType);
  30458. c.resolve(t)
  30459. } else
  30460. c.reject(this)
  30461. }
  30462. ,
  30463. s.onprogress = function(e) {
  30464. c.notify(e)
  30465. }
  30466. ,
  30467. s.send(i.data),
  30468. c.promise()
  30469. }
  30470. function o(e) {
  30471. return Object.keys(e).sort().map(function(t) {
  30472. return {
  30473. key: t,
  30474. value: e[t]
  30475. }
  30476. })
  30477. }
  30478. function a(e, t) {
  30479. var i = t.responseType || null
  30480. , n = t.auth || null
  30481. , r = t.prefetchFrom || null
  30482. , a = e + "__" + i + "__" + n + "__" + r;
  30483. return t.headers && o(t.headers).forEach(function(e) {
  30484. a += "__" + e.key + ":" + e.value
  30485. }),
  30486. a
  30487. }
  30488. function s(e, t) {
  30489. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[a(e, t)] : null
  30490. }
  30491. function l(e, t, i) {
  30492. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[a(e, t)] = i)
  30493. }
  30494. var c = e("./logger")
  30495. , h = e("../ab")
  30496. , u = new c(i);
  30497. window.URL = window.URL || window.webkitURL,
  30498. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  30499. window.DATA = window.DATA || {}
  30500. /* setTimeout(function() {//MP-- xzw delete
  30501. window.MP_REQUEST_CACHE = null,
  30502. window.DATA = {}
  30503. }, 6e4),
  30504. window.onpageshow = function(e) {
  30505. e.persisted && (window.MP_REQUEST_CACHE = null,
  30506. window.DATA = {})
  30507. } */
  30508. ,
  30509. t.exports = {
  30510. get: function(e, t) {
  30511. t = t || {};
  30512. var i = void 0 === t.cache || t.cache;
  30513. if (i) {
  30514. var n = s(e, t);
  30515. if (n)
  30516. return n
  30517. }
  30518. var o;
  30519. return o = t.prefetchFrom && window.DATA[t.prefetchFrom] ? $.when(window.DATA[t.prefetchFrom]) : r("GET", e, t),
  30520. i && l(e, t, o),
  30521. o
  30522. },
  30523. post: function(e, t) {
  30524. return r("POST", e, t)
  30525. },
  30526. patch: function(e, t) {
  30527. return r("PATCH", e, t)
  30528. },
  30529. getImage: function(e, t) { //xzw改 遇到部分图片在ios16以上显示不出,ios18更严重。查阅解决方法为使用decode
  30530. function i() {
  30531. u.warn("Retrying ", e),
  30532. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  30533. }
  30534. var n = $.Deferred()
  30535. , r = new Image
  30536. , o = this;
  30537. e = h.changeIfImageOptimzing(e)
  30538. r.crossOrigin = "anonymous",
  30539. r.src = e
  30540. /* if(browser.texNeedDecode){//
  30541. r.decode().then((e) => {
  30542. let delay = Math.round(r.width * r.height / 30000)
  30543. browser.isMobile() && (delay *= 3)
  30544. //console.log('delay111111111111',delay)
  30545. setTimeout(()=>{n.resolve(r)}, delay ) //需延迟,否则报错 WebGL: INVALID_VALUE: texImage2D: bad image data,但延迟时间不定。 试过定时1秒后更新tex没用。 直接改图为rgb模式了
  30546. }).catch((error) => {
  30547. console.error('Image decoding failed:?!!!!', error);
  30548. });
  30549. }else{//原本的代码: */
  30550. null !== t && void 0 !== t || (t = 3)
  30551. r.onerror = function() {
  30552. t > 0 ? setTimeout(i, 1e3) : n.reject()
  30553. }
  30554. ,
  30555. r.onload = function() {
  30556. n.resolve(r)
  30557. }
  30558. //}
  30559. return n
  30560. /*
  30561. Safari 浏览器在 iOS 上有一个特殊的图像解码策略,称为“懒加载”或“延迟解码”。这意味着图像不会立即解码,而是在需要显示时才解码。这可能会导致某些情况下图像无法及时显示。
  30562. 使用 decode() 方法:如果你使用的是现代浏览器(如 Safari 14+),可以尝试使用 ImageBitmapRenderingContext 的 createImageBitmap() 和 decode() 方法来提前解码图像。
  30563. const image = new Image();
  30564. image.src = 'image.png';
  30565. image.decode().then(() => {
  30566. const texture = new THREE.Texture(image);
  30567. texture.needsUpdate = true;
  30568. }).catch((error) => {
  30569. console.error('Image decoding failed:', error);
  30570. });
  30571. */
  30572. }
  30573. }
  30574. }
  30575. ).call(this, "/js/util/ajax.js")
  30576. }
  30577. , {
  30578. "../ab": 3,
  30579. "./logger": 189
  30580. }],
  30581. 182: [function(e, t, i) {
  30582. "use strict";
  30583. function n(e, t) {
  30584. var i = window.navigator.userAgent
  30585. , n = i.match(e);
  30586. return n = n ? n[1].split(t) : [],
  30587. {
  30588. major: parseInt(n[0]) || 0,
  30589. minor: parseInt(n[1]) || 0,
  30590. patch: parseInt(n[2]) || 0
  30591. }
  30592. }
  30593. var r = e("../exception/DeviceMismatchException");
  30594. t.exports = {
  30595. supportsFullscreen: function() {
  30596. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  30597. },
  30598. isPointerLocked: function() {
  30599. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  30600. },
  30601. requestFullscreen: function(e, t) {
  30602. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  30603. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  30604. },
  30605. requestPointerLock: function() {
  30606. var e;
  30607. if (document.fullscreenElement)
  30608. e = document.fullscreenElement();
  30609. else if (document.mozFullscreenElement)
  30610. e = document.mozFullscreenElement();
  30611. else if (document.mozFullScreenElement)
  30612. e = document.mozFullScreenElement();
  30613. else {
  30614. if (!document.webkitFullscreenElement)
  30615. return;
  30616. e = document.webkitFullscreenElement()
  30617. }
  30618. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  30619. e.requestPointerLock(),
  30620. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  30621. },
  30622. exitPointerLock: function() {
  30623. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  30624. document.exitPointerLock()
  30625. },
  30626. exitFullscreen: function() {
  30627. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  30628. },
  30629. details: function() {
  30630. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  30631. return e ? {
  30632. name: e[1],
  30633. version: parseInt(e[2]),
  30634. platform: navigator.platform
  30635. } : {}
  30636. },
  30637. is: function(e) {
  30638. return this.details() && this.details().name === e
  30639. },
  30640. inIframe: function() {
  30641. return window.parent !== window
  30642. },
  30643. aspectRatio: function() {
  30644. var e = $("#player").width() / $("#player").height();
  30645. return isFinite(e) ? e : 0
  30646. },
  30647. userAgent: function() {
  30648. return window.navigator.userAgent
  30649. },
  30650. isLandscape: function() {
  30651. return this.isMobile && this.aspectRatio() > 1
  30652. },
  30653. isSmallScreen: function() {
  30654. var e = screen.width / window.devicePixelRatio;
  30655. return e < 240
  30656. },
  30657. detectIE: function() {
  30658. var e = window.navigator.userAgent
  30659. , t = e.indexOf("MSIE ");
  30660. return t !== -1 || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  30661. },
  30662. detectSafari: function() {
  30663. var e = window.navigator.userAgent
  30664. , t = e.indexOf("Safari");
  30665. return t !== -1 && !this.detectChrome()//因为 Chrome 的用户代理字符串中也包含 "Safari"。
  30666. },
  30667. SafariVersion: function() {//add
  30668. if(!this.detectSafari())return;
  30669. const match = window.navigator.userAgent.match(/Version\/(\d+)\.(\d+)/);
  30670. if (match) {
  30671. return {
  30672. major: parseInt(match[1], 10),
  30673. minor: parseInt(match[2], 10)
  30674. };
  30675. }
  30676. },
  30677. detectFirefox: function() {
  30678. var e = window.navigator.userAgent;
  30679. return e.indexOf("Firefox") !== -1
  30680. },
  30681. detectChrome: function() {
  30682. var e = window.navigator.userAgent;
  30683. return e.indexOf("Chrome") !== -1 && !this.detectOpera()
  30684. },
  30685. detectOpera: function() {
  30686. var e = window.navigator.userAgent;
  30687. return e.indexOf("OPR") !== -1
  30688. },
  30689. detectIOS: function() {
  30690. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  30691. },
  30692. detectIPad: function() {
  30693. var e = window.navigator.userAgent
  30694. , t = /iPad/;
  30695. return t.test(e)
  30696. },
  30697. detectIPod: function() {
  30698. var e = window.navigator.userAgent
  30699. , t = /iPod/;
  30700. return t.test(e)
  30701. },
  30702. detectIPhone: function() {
  30703. var e = window.navigator.userAgent
  30704. , t = /iPhone/;
  30705. return t.test(e)
  30706. },
  30707. detectAndroid: function() {
  30708. var e = window.navigator.userAgent;
  30709. return e.indexOf("Android") !== -1
  30710. },
  30711. detectAndroidMobile: function() {
  30712. var e = window.navigator.userAgent;
  30713. return this.detectAndroid() && e.indexOf("Mobile") !== -1
  30714. },
  30715. detectSamsungNative: function() {
  30716. var e = window.navigator.userAgent;
  30717. return e.indexOf("SM-G900H") !== -1 || e.indexOf("GT-I9500") !== -1 || e.indexOf("SM-N900") !== -1
  30718. },
  30719. detectSamsungS6: function() {
  30720. var e = window.navigator.userAgent;
  30721. return e.indexOf("SM-G92") !== -1
  30722. },
  30723. /************************************************************fyz改from徐世廷*************************************************************/
  30724. detectHUAWEI5X: function() {
  30725. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  30726. },
  30727. /*******************************************************************************************************************************/
  30728. detectWebVR: function() {
  30729. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  30730. },
  30731. getVRDisplay: function() {
  30732. var e = $.Deferred();
  30733. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(t) {
  30734. t.length >= 1 && e.resolve(t[0]),
  30735. e.reject(null)
  30736. }),
  30737. e) : e.reject(null)
  30738. },
  30739. iosVersion: function() {
  30740. if (!this.detectIOS())
  30741. throw new r("Did not detect an iDevice");
  30742. var e = /((?:\d+\_?){1,3}) like Mac OS/
  30743. , t = "_";
  30744. return n(e, t)
  30745. },
  30746. androidVersion: function() {
  30747. if (!this.detectAndroid())
  30748. throw new r("Did not detect an Android based device");
  30749. var e = /Android ((?:\d+\.?){1,3})/
  30750. , t = ".";
  30751. return n(e, t)
  30752. },
  30753. valueFromCookie: function(e, t) {
  30754. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  30755. if (!i)
  30756. return t;
  30757. var n = i[1];
  30758. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  30759. }
  30760. }
  30761. Object.assign(window.browser, t.exports)
  30762. t.exports = window.browser
  30763. //window.browser.texNeedDecode = true//browser.SafariVersion()?.major > 14
  30764. changeLog()
  30765. }
  30766. , {
  30767. "../exception/DeviceMismatchException": 56
  30768. }],
  30769. 183: [function(e, t, i) {
  30770. (function(i) {
  30771. "use strict";
  30772. function n(e, t) {
  30773. var i = r(t);
  30774. var replaceAll = function (str, f, e) {
  30775. //f全部替换成e
  30776. var reg = new RegExp(f, "g"); //创建正则RegExp对象
  30777. return str.replace(reg, e);
  30778. };
  30779. //获取方法:postFix = `&firstView=pano:${player.currentPano.id},qua:${math.toPrecision(player.quaternion.toArray(),4)}&qs=1`
  30780. var urlFirstView = c.valueFromHash('firstView');
  30781. if(urlFirstView){ //&firstView=pano:e98808cfdb894f33851c3b3d7d0a2679,qua:-0.01515,0.325382,0.0052157,0.9454&qs=1
  30782. try{
  30783. urlFirstView = replaceAll(urlFirstView, "pano:", '"pano":"')
  30784. if(urlFirstView.includes('qua')){
  30785. urlFirstView = replaceAll(urlFirstView, ",qua:", '","qua":[')
  30786. urlFirstView += ']'
  30787. }else{
  30788. urlFirstView+='"'
  30789. }
  30790. urlFirstView = "{"+urlFirstView+"}"
  30791. let info = JSON.parse(urlFirstView);
  30792. i.pano = t.index[info.pano] //panos.get(info.pano)
  30793. if(!i.pano){
  30794. urlFirstView = false
  30795. console.error('检测到firstView但是 找不到该pano')
  30796. }else{
  30797. if(info.qua){
  30798. i.quaternion = new THREE.Quaternion().fromArray(info.qua)
  30799. }else{
  30800. i.quaternion = new THREE.Quaternion()
  30801. }
  30802. i.zoom = -1;
  30803. i.mode = "panorama"
  30804. i.setByUrl = true
  30805. }
  30806. }catch(e){
  30807. urlFirstView = false
  30808. console.error('检测到firstView但是解析出错'+e)
  30809. }
  30810. }
  30811. if (Object.keys(i).length > 0)
  30812. return i;
  30813. if (e.heroImage)
  30814. i = o(e, t);
  30815. else if (window.DATA.camera_start) {
  30816. var n = window.DATA.camera_start;
  30817. try {
  30818. Object.keys(n).length > 0 && !l.isEmptyQuaternion(n.camera.quaternion) && (i.mode = h.convertWorkshopModeInt(n.mode),
  30819. i.position = n.camera.position,
  30820. //i.quaternion = n.camera.quaternion,
  30821. i.quaternion = new th.Quaternion().fromArray(n.camera.quaternion),//xzw
  30822. i.zoom = l.convertWorkshopOrthoZoom(n.camera.zoom),
  30823. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  30824. d.debug("Using camera_start"),
  30825. d.debug("Modeldata pano: ", i.pano.quaternion),
  30826. d.debug("Camera start pano: ", n.pano.quaternion)),
  30827. i.mode !== h.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility))
  30828. } catch (e) {
  30829. d.warn(e.message)
  30830. if(i.mode == "panorama" && !i.pano)i.pano = t.list[0]
  30831. }
  30832. }
  30833. if (e.outsideAllowed() || i.mode === h.PANORAMA || (i = {}),
  30834. i.mode === h.MESH && i.position && (i.mode = h.PANORAMA,
  30835. i.pano = t.findClosest(i.position),
  30836. i.quaternion = i.pano.quaternion),
  30837. 0 === Object.keys(i).length) {
  30838. var a = t.list[0];
  30839. a && (i.mode = h.PANORAMA,
  30840. i.pano = a,
  30841. i.position = a.position,
  30842. i.quaternion = a.quaternion,
  30843. d.info("Starting at 1st pano " + a.id))
  30844. }
  30845. return i.mode = i.mode || h.DOLLHOUSE,
  30846. i
  30847. }
  30848. function r(e) {
  30849. var t = c.valueFromHash("start", "")
  30850. , i = {};
  30851. if ("" !== t) {
  30852. d.debug("Start override found in parameters, trying to parse..."),
  30853. i = a(t) || {};
  30854. var n = c.valueFromHash("tag", null);
  30855. n && (i.tag = n),
  30856. i.panoId && (i.pano = e.get(i.panoId))
  30857. }
  30858. return i
  30859. }
  30860. function o(e, t) {
  30861. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  30862. return {};
  30863. var i = {}
  30864. , n = e.heroImage.metadata;
  30865. d.debug("Using start position from thumbnail image"),
  30866. i.position = n.camera_position,
  30867. i.quaternion = n.camera_quaternion;
  30868. try {
  30869. i.mode = h.convertWorkshopModeInt(n.camera_mode),
  30870. i.mode === h.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  30871. } catch (e) {
  30872. d.debug(e.message)
  30873. }
  30874. return i
  30875. }
  30876. function a(e) {
  30877. return s.deserialize(e)
  30878. }
  30879. var s = e("../controls/serializer")
  30880. , l = e("../util/math")
  30881. , c = e("./browser")
  30882. , h = e("../enum/Viewmode")
  30883. , u = e("../util/logger")
  30884. , th = e("three")//xzw
  30885. , d = new u(i);
  30886. t.exports = {
  30887. getStartCameraOptions: n
  30888. }
  30889. }
  30890. ).call(this, "/js/util/camera.js")
  30891. }
  30892. , {
  30893. "../controls/serializer": 14,
  30894. "../enum/Viewmode": 51,
  30895. "../util/logger": 189,
  30896. "../util/math": 190,
  30897. "./browser": 182,
  30898. "three": 217
  30899. }],
  30900. 184: [function(e, t, i) {
  30901. "use strict";
  30902. function n(e, t, i) {
  30903. return o(e.fov, t, i)
  30904. }
  30905. var r = e("./MathLight")
  30906. , o = function(e, t, i) {
  30907. var n = t
  30908. , o = i
  30909. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (n / o)) * r.DEGREES_PER_RADIAN;
  30910. return a
  30911. }
  30912. , a = function(e, t, i) {
  30913. var n = t
  30914. , o = i
  30915. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (o / n)) * r.DEGREES_PER_RADIAN;
  30916. return a
  30917. }
  30918. , s = function(e, t, i, n) {
  30919. var r = o(e, i, n);
  30920. return r > t ? a(t, i, n) : e
  30921. };
  30922. t.exports = {
  30923. clampVFOV: s,
  30924. getHFOVForCamera: n,
  30925. getHFOVFromVFOV: o,
  30926. getVFOVFromHFOV: a
  30927. }
  30928. window.MathLight = t.exports
  30929. MathLight.closeTo = function(e1,e2, precision){//xzw add 判断e1,e2是否接近
  30930. var prec = Math.pow(10, - (precision || 4));
  30931. var s1 = Math.abs(e1.x - e2.x) < prec && Math.abs(e1.y - e2.y) < prec && Math.abs(e1.z - e2.z) < prec
  30932. if(e1.w){
  30933. return s1 && Math.abs(e1.w - e2.w) < prec
  30934. }else return s1
  30935. }
  30936. }
  30937. , {
  30938. "./MathLight": 176
  30939. }],
  30940. 185: [function(e, t, i) {
  30941. "use strict";
  30942. var n = e("three");
  30943. t.exports = {
  30944. delayOneFrame: function(e) {
  30945. window.setTimeout(e, 1)
  30946. },
  30947. normalizeUrl: function(e) {
  30948. return e.replace("https://", "http://")
  30949. },
  30950. domainFromUrl: function(e) {
  30951. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  30952. return t ? t[3] : e
  30953. },
  30954. average: function(e, t) {
  30955. if (0 === e.length)
  30956. return null;
  30957. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  30958. var o = t ? e[r][t] : e[r];
  30959. i += o,
  30960. n++
  30961. }
  30962. return i / n
  30963. },
  30964. countUnique: function(e) {
  30965. for (var t = {}, i = 0; i < e.length; i++)
  30966. t[e[i]] = 1 + (t[e[i]] || 0);
  30967. return Object.keys(t).length
  30968. },
  30969. averageVectors: function(e, t) {
  30970. var i = new n.Vector3;
  30971. if (0 === e.length)
  30972. return i;
  30973. for (var r = 0, o = 0; o < e.length; o++) {
  30974. var a = t ? e[o][t] : e[o];
  30975. i.add(a),
  30976. r++
  30977. }
  30978. return i.divideScalar(r)
  30979. },
  30980. equalLists: function(e, t) {
  30981. if (e.length !== t.length)
  30982. return !1;
  30983. for (var i = 0; i < e.length; i++)
  30984. if (e[i] !== t[i])
  30985. return !1;
  30986. return !0
  30987. },
  30988. lowerMedian: function(e, t) {
  30989. if (0 === e.length)
  30990. return null;
  30991. t = t || 2,
  30992. e.sort(function(e, t) {
  30993. return e - t
  30994. });
  30995. var i = Math.floor(e.length / t);
  30996. return e[i]
  30997. },
  30998. stableSort: function(e, t) {
  30999. return e.map(function(e, t) {
  31000. return {
  31001. value: e,
  31002. index: t
  31003. }
  31004. }).sort(function(e, i) {
  31005. var n = t(e.value, i.value);
  31006. return 0 !== n ? n : e.index - i.index
  31007. }).map(function(e) {
  31008. return e.value
  31009. })
  31010. },
  31011. filterAll: function(e, t) {
  31012. return e.filter(function(e) {
  31013. return t.every(function(t) {
  31014. return t(e)
  31015. })
  31016. })
  31017. },
  31018. formatDate: function(e) {
  31019. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  31020. },
  31021. formatDatetime: function(e) {
  31022. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  31023. },
  31024. randomString: function(e) {
  31025. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  31026. t += i.charAt(Math.floor(Math.random() * i.length));
  31027. return t
  31028. },
  31029. uint8ToBase64: function(e, t) {
  31030. t && "number" == typeof t || (t = 8192);
  31031. for (var i = [], n = 0; n < e.length; n += t)
  31032. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  31033. return btoa(i.join(""))
  31034. },
  31035. uuid4: function e(t) {
  31036. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  31037. },
  31038. nth: function(e) {
  31039. return e %= 10,
  31040. 1 === e ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  31041. },
  31042. extendObject: function(e, t) {
  31043. return Object.keys(t).forEach(function(i) {
  31044. e[i] = t[i]
  31045. }),
  31046. e
  31047. },
  31048. deepExtend: function e(t) {
  31049. t = t || {};
  31050. for (var i = 1; i < arguments.length; i++) {
  31051. var n = arguments[i];
  31052. if (n)
  31053. for (var r in n)
  31054. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  31055. }
  31056. return t
  31057. },
  31058. inherit: function(e, t) {
  31059. e.prototype = Object.create(t.prototype),
  31060. e.prototype.constructor = e
  31061. },
  31062. extend: function(e, t) {
  31063. for (var i in t.prototype)
  31064. e.prototype[i] = t.prototype[i]
  31065. }
  31066. ,
  31067. getFileNameFromUrl:function(url){
  31068. return url.split('/').pop();
  31069. },
  31070. },
  31071. Math.sign = function(e) {
  31072. return e < 0 ? -1 : 1
  31073. }
  31074. window.common = t.exports
  31075. expandCommon(common)
  31076. }
  31077. , {
  31078. three: 217
  31079. }],
  31080. 186: [function(e, t, i) {
  31081. "use strict";
  31082. var n = {};
  31083. n.linearTween = function(e, t, i, n) {
  31084. return i * e / n + t
  31085. }
  31086. ,
  31087. n.easeInQuad = function(e, t, i, n) {
  31088. return e /= n,
  31089. i * e * e + t
  31090. }
  31091. ,
  31092. n.easeOutQuad = function(e, t, i, n) {
  31093. return e /= n,
  31094. -i * e * (e - 2) + t
  31095. }
  31096. ,
  31097. n.easeInOutQuad = function(e, t, i, n) {
  31098. return e /= n / 2,
  31099. e < 1 ? i / 2 * e * e + t : (e--,
  31100. -i / 2 * (e * (e - 2) - 1) + t)
  31101. }
  31102. ,
  31103. n.easeInCubic = function(e, t, i, n) {
  31104. return e /= n,
  31105. i * e * e * e + t
  31106. }
  31107. ,
  31108. n.easeOutCubic = function(e, t, i, n) {
  31109. return e /= n,
  31110. e--,
  31111. i * (e * e * e + 1) + t
  31112. }
  31113. ,
  31114. n.easeInOutCubic = function(e, t, i, n) {
  31115. return e /= n / 2,
  31116. e < 1 ? i / 2 * e * e * e + t : (e -= 2,
  31117. i / 2 * (e * e * e + 2) + t)
  31118. }
  31119. ,
  31120. n.easeInQuart = function(e, t, i, n) {
  31121. return e /= n,
  31122. i * e * e * e * e + t
  31123. }
  31124. ,
  31125. n.easeOutQuart = function(e, t, i, n) {
  31126. return e /= n,
  31127. e--,
  31128. -i * (e * e * e * e - 1) + t
  31129. }
  31130. ,
  31131. n.easeInOutQuart = function(e, t, i, n) {
  31132. return e /= n / 2,
  31133. e < 1 ? i / 2 * e * e * e * e + t : (e -= 2,
  31134. -i / 2 * (e * e * e * e - 2) + t)
  31135. }
  31136. ,
  31137. n.easeInQuint = function(e, t, i, n) {
  31138. return e /= n,
  31139. i * e * e * e * e * e + t
  31140. }
  31141. ,
  31142. n.easeOutQuint = function(e, t, i, n) {
  31143. return e /= n,
  31144. e--,
  31145. i * (e * e * e * e * e + 1) + t
  31146. }
  31147. ,
  31148. n.easeInOutQuint = function(e, t, i, n) {
  31149. return e /= n / 2,
  31150. e < 1 ? i / 2 * e * e * e * e * e + t : (e -= 2,
  31151. i / 2 * (e * e * e * e * e + 2) + t)
  31152. }
  31153. ,
  31154. n.easeInSine = function(e, t, i, n) {
  31155. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  31156. }
  31157. ,
  31158. n.easeOutSine = function(e, t, i, n) {
  31159. return i * Math.sin(e / n * (Math.PI / 2)) + t
  31160. }
  31161. ,
  31162. n.easeInOutSine = function(e, t, i, n) {
  31163. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  31164. }
  31165. ,
  31166. n.easeInExpo = function(e, t, i, n) {
  31167. return i * Math.pow(2, 10 * (e / n - 1)) + t
  31168. }
  31169. ,
  31170. n.easeOutExpo = function(e, t, i, n) {
  31171. return i * (-Math.pow(2, -10 * e / n) + 1) + t
  31172. }
  31173. ,
  31174. n.easeInOutExpo = function(e, t, i, n) {
  31175. return e /= n / 2,
  31176. e < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  31177. i / 2 * (-Math.pow(2, -10 * e) + 2) + t)
  31178. }
  31179. ,
  31180. n.easeInCirc = function(e, t, i, n) {
  31181. return e /= n,
  31182. -i * (Math.sqrt(1 - e * e) - 1) + t
  31183. }
  31184. ,
  31185. n.easeOutCirc = function(e, t, i, n) {
  31186. return e /= n,
  31187. e--,
  31188. i * Math.sqrt(1 - e * e) + t
  31189. }
  31190. ,
  31191. n.easeInOutCirc = function(e, t, i, n) {
  31192. return e /= n / 2,
  31193. e < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  31194. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  31195. }
  31196. ,
  31197. n.easeInElastic = function(e, t, i, n) {
  31198. var r = 1.70158
  31199. , o = 0
  31200. , a = i;
  31201. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  31202. a < Math.abs(i) ? (a = i,
  31203. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  31204. -(a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o)) + t)
  31205. }
  31206. ,
  31207. n.easeOutElastic = function(e, t, i, n) {
  31208. var r = 1.70158
  31209. , o = 0
  31210. , a = i;
  31211. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  31212. a < Math.abs(i) ? (a = i,
  31213. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  31214. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  31215. }
  31216. ,
  31217. n.easeInOutElastic = function(e, t, i, n) {
  31218. var r = 1.70158
  31219. , o = 0
  31220. , a = i;
  31221. return 0 === e ? t : 2 === (e /= n / 2) ? t + i : (o || (o = n * (.3 * 1.5)),
  31222. a < Math.abs(i) ? (a = i,
  31223. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  31224. 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)
  31225. }
  31226. ,
  31227. n.easeInBack = function(e, t, i, n, r) {
  31228. return void 0 === r && (r = 1.70158),
  31229. i * (e /= n) * e * ((r + 1) * e - r) + t
  31230. }
  31231. ,
  31232. n.easeOutBack = function(e, t, i, n, r) {
  31233. return void 0 === r && (r = 1.70158),
  31234. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  31235. }
  31236. ,
  31237. n.easeInOutBack = function(e, t, i, n, r) {
  31238. return void 0 === r && (r = 1.70158),
  31239. (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
  31240. }
  31241. ,
  31242. n.easeOutBounce = function(e, t, i, n) {
  31243. 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
  31244. }
  31245. ,
  31246. n.easeInBounce = function(e, t, i, r) {
  31247. return i - n.easeOutBounce(r - e, 0, i, r) + t
  31248. }
  31249. ,
  31250. n.easeInOutBounce = function(e, t, i, r) {
  31251. 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
  31252. }
  31253. ,
  31254. t.exports = n
  31255. window.easing = n
  31256. }
  31257. , {}],
  31258. 187: [function(e, t, i) {
  31259. "use strict";
  31260. function n() {
  31261. this.events = [],
  31262. this.valid = !1
  31263. }
  31264. var r = e("../enum/Joystick");
  31265. n.prototype.push = function(e, t) {
  31266. this.events.push({
  31267. direction: e,
  31268. pano: t
  31269. }),
  31270. this.valid = !0
  31271. }
  31272. ,
  31273. n.prototype.pop = function(e) {
  31274. var t = this.events.pop();
  31275. return this.events.length < 1 && (this.valid = !1),
  31276. t
  31277. }
  31278. ,
  31279. n.prototype.peek = function() {
  31280. return this.events.length ? this.events[this.events.length - 1] : {
  31281. direction: null,
  31282. pano: null
  31283. }
  31284. }
  31285. ,
  31286. n.prototype.invalidate = function() {
  31287. this.events = [],
  31288. this.valid = !1
  31289. }
  31290. ,
  31291. n.prototype.reversePano = function(e) {
  31292. if (!this.valid)
  31293. return null;
  31294. var t = this.peek();
  31295. return r.opposite(e) === t.direction ? (this.pop(),
  31296. t.pano) : null
  31297. }
  31298. ,
  31299. t.exports = n
  31300. }
  31301. , {
  31302. "../enum/Joystick": 29
  31303. }],
  31304. 188: [function(e, t, i) {
  31305. "use strict";
  31306. window.lerp = t.exports = {
  31307. vector: function(e, t) {
  31308. var i = e.clone();
  31309. return t = t.clone(),
  31310. function(n) {
  31311. e.set(i.x * (1 - n) + t.x * n, i.y * (1 - n) + t.y * n, i.z * (1 - n) + t.z * n)
  31312. }
  31313. },
  31314. quaternion: function(e, t) {
  31315. var i = e.clone();
  31316. return function(n) {
  31317. e.copy(i).slerp(t, n)
  31318. }
  31319. },
  31320. property: function(e, t, i, n) {
  31321. var r = e[t];
  31322. return function(o) {
  31323. e[t] = r * (1 - o) + i * o,
  31324. n && n(e[t])
  31325. }
  31326. },
  31327. uniform: function(e, t, i) {
  31328. var n = e.material.uniforms[t].value;
  31329. return function(r) {
  31330. e.material.uniforms[t] && (e.material.uniforms[t].value = n * (1 - r) + i * r)
  31331. }
  31332. },
  31333. matrix4: function(e, t) {
  31334. var i = e.clone();
  31335. return function(n) {
  31336. for (var r = e.elements, o = i.elements, a = t.elements, s = 0; s < 16; s++)
  31337. r[s] = o[s] * (1 - n) + a[s] * n
  31338. }
  31339. },
  31340. allUniforms: function(e, t, i) {
  31341. var n = e.map(function(e) {
  31342. return this.uniform(e, t, i)
  31343. }
  31344. .bind(this));
  31345. return function(e) {
  31346. n.forEach(function(t) {
  31347. t(e)
  31348. })
  31349. }
  31350. }
  31351. }
  31352. }
  31353. , {}],
  31354. 189: [function(e, t, i) {
  31355. "use strict";
  31356. function n(e) {
  31357. var t, i, o, a, s = e.split("/"), l = "[" + s[s.length - 1].replace(".js", "") + "]", c = {};
  31358. if (n.consoleEnabled) {
  31359. var h = function(e) {
  31360. $("#debug-console").append("<p>" + e + "</p>"),
  31361. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  31362. };
  31363. t = function(e) {
  31364. h(Array.prototype.slice.call(arguments).join(" "))
  31365. }
  31366. ,
  31367. i = function(e) {
  31368. h(Array.prototype.slice.call(arguments).join(" "))
  31369. }
  31370. ,
  31371. o = function(e) {
  31372. h("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  31373. }
  31374. ,
  31375. a = function(e) {
  31376. h("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  31377. }
  31378. } else
  31379. console.log ? (t = console.log,
  31380. i = console.info ? console.info : console.log,
  31381. o = console.warn ? console.warn : console.log,
  31382. a = console.error ? console.error : console.log) : t = i = o = a = function() {}
  31383. ;
  31384. var u = function(e) {
  31385. return [l, n.timestamp()].concat(Array.prototype.slice.call(e))
  31386. }
  31387. , d = function(t, i) {
  31388. if (r) {
  31389. var o = Array.prototype.slice.call(t).join(" ");
  31390. r.captureMessage(o, {
  31391. level: i,
  31392. path: e,
  31393. timestamp: n.timestamp()
  31394. })
  31395. }
  31396. }
  31397. , p = function(t, i) {
  31398. if (r) {
  31399. var o = Array.prototype.slice.call(t).join(" ");
  31400. r.captureException(new Error(o), {
  31401. level: i,
  31402. path: e,
  31403. timestamp: n.timestamp()
  31404. })
  31405. }
  31406. };
  31407. return {
  31408. debug: function() {
  31409. n.level >= n.levels.debug && t.apply(console, u(arguments))
  31410. },
  31411. info: function() {
  31412. n.level >= n.levels.info && i.apply(console, u(arguments))
  31413. },
  31414. warn: function() {
  31415. d(arguments, "warn"),
  31416. n.level >= n.levels.warn && o.apply(console, u(arguments))
  31417. },
  31418. error: function() {
  31419. p(arguments, "error"),
  31420. n.level >= n.levels.error && a.apply(console, u(arguments))
  31421. },
  31422. v3str: function(e, t) {
  31423. var i = void 0 === t ? 2 : t;
  31424. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  31425. },
  31426. eulstr: function(e, t) {
  31427. var i = void 0 === t ? 2 : t;
  31428. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  31429. },
  31430. time: function(e) {
  31431. n.level >= n.levels.debug && (c[e] = Date.now())
  31432. },
  31433. timeEnd: function(e) {
  31434. if (n.level >= n.levels.debug) {
  31435. var t = c[e];
  31436. if (!t)
  31437. return;
  31438. var i = (Date.now() - t) / 1e3;
  31439. this.debug(e, i + "s")
  31440. }
  31441. }
  31442. }
  31443. }
  31444. var r = window.Raven;
  31445. n.timestamp = function() {
  31446. return (Date.now() - window.navigationStart) / 1e3 + "s"
  31447. }
  31448. ,
  31449. n.levels = {
  31450. debug: 3,
  31451. info: 2,
  31452. warn: 1,
  31453. error: 0
  31454. },
  31455. n.level = n.levels.info,
  31456. t.exports = n
  31457. }
  31458. , {}],
  31459. 190: [function(e, t, i) {
  31460. "use strict";
  31461. var n = e("three")
  31462. , r = e("../enum/GLCubeFaces")
  31463. , o = e("../constants");
  31464. t.exports = {
  31465. convertVisionVector: function(e) {
  31466. return new n.Vector3(e.x,e.z,-e.y)
  31467. },
  31468. convertVisionQuaternion: function(e) {
  31469. 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)))
  31470. },
  31471. convertWorkshopVector: function(e) {
  31472. return new n.Vector3(-e.x,e.y,e.z)
  31473. },
  31474. convertWorkshopQuaternion: function(e) {
  31475. 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))
  31476. },
  31477. convertWorkshopPanoramaQuaternion: function(e) {
  31478. 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)))
  31479. },
  31480. convertWorkshopOrthoZoom: function(e) {// xzw
  31481. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / o.workshopApsect
  31482. //return e;
  31483. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  31484. },
  31485. toPrecision: function(e, t) {//xzw change
  31486. var f = function(e, t){
  31487. var i = Math.pow(10, t);
  31488. return Math.round(e * i) / i
  31489. }
  31490. if(e instanceof Array){
  31491. for(var s=0; s<e.length; s++){
  31492. e[s] = f(e[s],t);
  31493. }
  31494. return e;
  31495. }
  31496. else return f(e,t)
  31497. },
  31498. isEmptyQuaternion: function(e) {
  31499. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  31500. },
  31501. projectPositionToCanvas: function(e, t, i) {
  31502. i = i || new n.Vector3,
  31503. i.copy(e);
  31504. var r = .5 * $("#player").width()
  31505. , o = .5 * $("#player").height();
  31506. return i.project(t),
  31507. i.x = i.x * r + r,
  31508. i.y = -(i.y * o) + o,
  31509. i
  31510. },
  31511. convertScreenPositionToNDC: function(e, t, i) {
  31512. return i = i || new n.Vector2,
  31513. i.x = e / $("#player").width() * 2 - 1,
  31514. i.y = 2 * -(t / $("#player").height()) + 1,
  31515. i
  31516. },
  31517. constrainedTurn: function(e) {
  31518. var t = e % (2 * Math.PI);
  31519. return t = t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  31520. },
  31521. getFOVDotThreshold: function(e) {
  31522. return Math.cos(n.Math.degToRad(e / 2))
  31523. },
  31524. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  31525. switch (e) {
  31526. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  31527. i.set(1, t.y, t.x);
  31528. break;
  31529. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  31530. i.set(-1, t.y, -t.x);
  31531. break;
  31532. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  31533. i.set(-t.x, 1, -t.y);
  31534. break;
  31535. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  31536. i.set(-t.x, -1, t.y);
  31537. break;
  31538. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  31539. i.set(-t.x, t.y, 1);
  31540. break;
  31541. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  31542. i.set(t.x, t.y, -1)
  31543. }
  31544. n && i.normalize()
  31545. },
  31546. //add:
  31547. getPos2d : function(point, camera, dom){
  31548. var camera = camera ;
  31549. var dom = dom;
  31550. 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);
  31551. var x,y;
  31552. x = (pos.x + 1) / 2 * dom.clientWidth;
  31553. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  31554. var inSight = x <= dom.clientWidth && x >= 0
  31555. && y <= dom.clientHeight && y >= 0
  31556. return {
  31557. pos: new THREE.Vector2(x,y),
  31558. vector: pos,
  31559. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  31560. inSight : inSight //在屏幕范围内可见
  31561. };
  31562. },
  31563. getDirByLonLat: function(lon, lat) {
  31564. var dir = new THREE.Vector3();
  31565. var phi = THREE.Math.degToRad(90 - lat);
  31566. var theta = THREE.Math.degToRad(lon);
  31567. dir.x = Math.sin(phi) * Math.cos(theta);
  31568. dir.y = Math.cos(phi);
  31569. dir.z = Math.sin(phi) * Math.sin(theta);
  31570. return dir.negate();
  31571. }
  31572. }
  31573. window.math = t.exports
  31574. expandMath(math)
  31575. }
  31576. , {
  31577. "../constants": 8,
  31578. "../enum/GLCubeFaces": 25,
  31579. three: 217
  31580. }],
  31581. 191: [function(e, t, i) {
  31582. "use strict";
  31583. function n(e, t, i) {
  31584. return a.map(function(n, o) {
  31585. return e.get("pan/" + i + "/" + t + "_skybox" + r(n) + ".jpg")
  31586. }
  31587. .bind(this))
  31588. }
  31589. function r(e) {
  31590. return s[e]
  31591. }
  31592. var o = e("../enum/GLCubeFaces")
  31593. , a = [0, 1, 2, 3, 4, 5]
  31594. , s = {
  31595. 0: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  31596. 1: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  31597. 2: o.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  31598. 3: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  31599. 4: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  31600. 5: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  31601. };
  31602. t.exports = {
  31603. mapFaceToCubemapFace: r,
  31604. getCubemapUrls: n
  31605. }
  31606. }
  31607. , {
  31608. "../enum/GLCubeFaces": 25
  31609. }],
  31610. 192: [function(e, t, i) {
  31611. "use strict";
  31612. t.exports = {
  31613. captureErrors: function(e, t, i) {
  31614. if ("Raven"in window) {
  31615. Raven.config(e, t).install(),
  31616. i && Raven.setTagsContext(i);
  31617. var n = console.warn
  31618. , r = console.error;
  31619. console.warn = function() {
  31620. var e = Array.prototype.slice.call(arguments);
  31621. Raven.captureMessage(e.join(" "), {
  31622. level: "warning"
  31623. }),
  31624. n.apply(console, e)
  31625. }
  31626. ,
  31627. console.error = function() {
  31628. var e = Array.prototype.slice.call(arguments);
  31629. Raven.captureException(new Error(e.join(" ")), {
  31630. level: "error"
  31631. }),
  31632. r.apply(console, e)
  31633. }
  31634. } else
  31635. console.error("Raven not found, not capturing errors.")
  31636. }
  31637. }
  31638. }
  31639. , {}],
  31640. 193: [function(e, t, i) {
  31641. (function(i) {
  31642. "use strict";
  31643. var n = e("./browser")
  31644. , r = e("../constants")
  31645. , o = e("url")
  31646. , a = e("./logger")
  31647. , ss = e('three')
  31648. , s = new a(i)
  31649. , l = {
  31650. getAuthorizationHeader: function() {
  31651. var e = n.valueFromHash("auth");
  31652. if (e)
  31653. return e.replace(",", " ");
  31654. var t = n.valueFromCookie("token");
  31655. return t ? "Token " + t : null
  31656. },
  31657. parseSidUrl: function(e) {
  31658. var t, i;
  31659. t=g_Prefix;
  31660. if (e = e || "",
  31661. e.match(/^https?/)) {
  31662. var n = o.parse(e);
  31663. t = g_Prefix,
  31664. i = e
  31665. } else{
  31666. //xzw 原先的不能用
  31667. //t = window.location.protocol + "//" + window.location.host, //MP
  31668. t = g_Prefix
  31669. //i = t + "/api/player/models/" + e; //MP
  31670. i = t + "data/" + e;
  31671. }
  31672. return {
  31673. urlBase: t,
  31674. urlModel: i,
  31675. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  31676. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  31677. }
  31678. },
  31679. getModelIDFromQueryString: function() {
  31680. return n.valueFromHash("model") || n.valueFromHash("m")
  31681. },
  31682. /* normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  31683. e = JSON.parse(JSON.stringify(e));
  31684. var i = null;
  31685. if (e.images.forEach(function(n) {
  31686. if(!n.metadata) return;
  31687. if ("string" == typeof n.metadata)
  31688. try {
  31689. n.metadata = JSON.parse(n.metadata)
  31690. } catch (e) {
  31691. s.warn("Unable to parse image metadata"),
  31692. n.metadata = null
  31693. }
  31694. else{
  31695. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  31696. }
  31697. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  31698. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  31699. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  31700. }else{
  31701. n.metadata.camera_quaternion && (n.metadata.camera_quaternion = t.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  31702. n.metadata.camera_position && (n.metadata.camera_position = t.convertWorkshopVector(n.metadata.camera_position))
  31703. n.metadata.zoom = n.metadata.zoom || 1;
  31704. }
  31705. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  31706. }),
  31707. //icon初始视角的:
  31708. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  31709. var n = {};
  31710. n.pano = {
  31711. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  31712. position: t.convertWorkshopVector(i.scan_position),
  31713. uuid: i.scan_id
  31714. },
  31715. n.camera = {
  31716. quaternion: i.camera_quaternion,
  31717. position: i.camera_position
  31718. },
  31719. e.startPano = n
  31720. }
  31721. return e
  31722. },
  31723. */
  31724. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  31725. e = JSON.parse(JSON.stringify(e));
  31726. var i = null;
  31727. var deal = function(n) {
  31728. if(!n.metadata) return;
  31729. if ("string" == typeof n.metadata)
  31730. try {
  31731. n.metadata = JSON.parse(n.metadata)
  31732. } catch (e) {
  31733. s.warn("Unable to parse image metadata"),
  31734. n.metadata = null
  31735. }
  31736. else{
  31737. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  31738. }
  31739. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  31740. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  31741. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  31742. }else{
  31743. n.metadata.camera_position = new ss.Vector3().copy(n.metadata.camera_position)
  31744. n.metadata.camera_quaternion = new ss.Quaternion().copy(n.metadata.camera_quaternion)
  31745. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  31746. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  31747. }
  31748. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  31749. }
  31750. //改
  31751. e.images.forEach(info=>{
  31752. if(info.locations){
  31753. info.locations.forEach(a=>deal(a))
  31754. }else{
  31755. deal(info)
  31756. }
  31757. })
  31758. //icon初始视角的:
  31759. if(i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  31760. var n = {};
  31761. n.pano = {
  31762. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  31763. position: t.convertWorkshopVector(i.scan_position),
  31764. uuid: i.scan_id
  31765. },
  31766. n.camera = {
  31767. quaternion: i.camera_quaternion,
  31768. position: i.camera_position
  31769. },
  31770. e.startPano = n
  31771. }
  31772. return e
  31773. },
  31774. visionVersionToInt: function() {
  31775. var e = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join(""));
  31776. return function(t) {
  31777. if (!t)
  31778. throw new Error("Vision version is required");
  31779. var i = e.exec(t);
  31780. if (null === i)
  31781. throw new Error("String is not a vision version: " + t);
  31782. return parseInt(i[1])
  31783. }
  31784. }(),
  31785. modelDataPromisesTiles: function(e) {
  31786. var vision_version = e.vision_version || window.DATA.vision_version
  31787. if (vision_version)
  31788. try {
  31789. return l.visionVersionToInt(vision_version) >= l.visionVersionToInt(r.visionTilingStartVersion)
  31790. } catch (t) {
  31791. s.warn("Invalid vision version: " + vision_version)
  31792. }
  31793. // var t = e.created ? new Date(e.created) : null;
  31794. // return t && t >= r.visionTilingStartDate
  31795. return false
  31796. }
  31797. };
  31798. t.exports = l
  31799. }
  31800. ).call(this, "/js/util/showcase.js")
  31801. }
  31802. , {
  31803. "../constants": 8,
  31804. "./browser": 182,
  31805. "./logger": 189,
  31806. three:217,
  31807. url: 208
  31808. }],
  31809. 194: [function(e, t, i) {
  31810. "use strict";
  31811. var n = e("../util/ajax")
  31812. , r = e("three")
  31813. , o = e("../settings")
  31814. , a = {};
  31815. t.exports = {
  31816. load: function(e, t, i) {
  31817. var s = a[e];
  31818. return s ? (t && setTimeout(function() {
  31819. t(s)
  31820. }, 1),
  31821. s) : (s = new r.Texture,
  31822. o.minimalMemoryMode && (s.minFilter = r.LinearFilter,
  31823. s.magFilter = r.LinearFilter,
  31824. s.generateMipmaps = !1),
  31825. s.sourceFile = e,
  31826. a[e] = s,
  31827. n.getImage(e).then(function(e) {
  31828. s.image = e,
  31829. s.needsUpdate = !0,
  31830. t && t(s)
  31831. }).fail(i),
  31832. s)
  31833. },
  31834. loadBase64: function(e, t) {
  31835. t = t || "png";
  31836. var i = new r.Texture;
  31837. return i.image = document.createElement("img"),
  31838. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  31839. o.minimalMemoryMode && (i.minFilter = r.LinearFilter,
  31840. i.magFilter = r.LinearFilter,
  31841. i.generateMipmaps = !1),
  31842. i.needsUpdate = !0,
  31843. i
  31844. },
  31845. isLoaded: function(e) {
  31846. return !!a[e]
  31847. }
  31848. }
  31849. window.Texture = t.exports
  31850. }
  31851. , {
  31852. "../settings": 166,
  31853. "../util/ajax": 181,
  31854. three: 217
  31855. }],
  31856. 195: [function(e, t, i) {
  31857. "use strict";
  31858. var n = e("./easing");
  31859. window.transitions = t.exports = {
  31860. globalDone: null,
  31861. funcs: [],
  31862. counter: 0,
  31863. uniqueID: 0,
  31864. start: function(e, t, i, r, o, a, s) {
  31865. return r = r || 0,
  31866. this.funcs.push({
  31867. func: e,
  31868. current: -r * Math.abs(t),
  31869. duration: (1 - Math.max(r, 0)) * Math.abs(t),
  31870. done: i,
  31871. easing: o || n.linearTween,
  31872. cycling: t < 0,
  31873. running: !0,
  31874. debug: r < 0,
  31875. name: a || "T" + this.counter,
  31876. id: void 0 === s ? this.counter : s,
  31877. paused: !1
  31878. }),
  31879. e(0, 16),
  31880. this.counter += 1,
  31881. e
  31882. },
  31883. trigger: function(e) {
  31884. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  31885. , i = e.func || function() {}
  31886. , r = void 0 === e.duration ? 0 : e.duration;
  31887. void 0 !== e.cycling && e.cycling && (r = -Math.abs(r));
  31888. var o = e.done || null
  31889. , a = e.easing || n.linearTween
  31890. , s = e.name || "R" + this.counter
  31891. , l = void 0 === e.id ? this.counter : e.id;
  31892. return this.start(i, r, o, t, a, s, l)
  31893. },
  31894. setTimeout: function(e, t, i) {
  31895. var n = void 0 === i ? this.counter : i;
  31896. return this.trigger({
  31897. done: e,
  31898. duration: void 0 === t ? 0 : t,
  31899. name: "O" + this.counter,
  31900. id: n
  31901. })
  31902. },
  31903. pause: function() {
  31904. this.paused = !0
  31905. },
  31906. resume: function() {
  31907. this.paused = !1
  31908. },
  31909. update: function(e) {
  31910. this.funcs.forEach(function(t) {
  31911. if (!(t.paused || (t.current += 1e3 * e,
  31912. t.current < 0)))
  31913. if (t.current >= t.duration && !t.cycling) {
  31914. var i = t.easing(1, 0, 1, 1);
  31915. t.func(i, 1e3 * e),
  31916. t.done && t.done(),
  31917. t.running = !1
  31918. } else {
  31919. var n = t.easing(t.current % t.duration / t.duration, 0, 1, 1)
  31920. , r = t.func(n, 1e3 * e) || !1;
  31921. r && (t.done && t.done(),
  31922. t.running = !1)
  31923. }
  31924. });
  31925. var t = this.funcs.length;
  31926. this.funcs = this.funcs.filter(function(e) {
  31927. return e.running
  31928. });
  31929. var i = this.funcs.length;
  31930. if (t > 0 && 0 === i && this.globalDone) {
  31931. var n = this.globalDone;
  31932. this.globalDone = null,
  31933. n()
  31934. }
  31935. },
  31936. adjustSpeed: function(e, t) {
  31937. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  31938. var r = i[n];
  31939. r.duration /= t,
  31940. r.current /= t
  31941. }
  31942. },
  31943. getById: function(e) {
  31944. return this.funcs.filter(function(t) {
  31945. return e === t.id
  31946. })
  31947. },
  31948. get: function(e) {
  31949. for (var t = 0; t < this.funcs.length; t += 1)
  31950. if (this.funcs[t].func === e)
  31951. return this.funcs[t];
  31952. return null
  31953. },
  31954. isRunning: function(e) {
  31955. var t = this.get(e);
  31956. return null !== t && t.running
  31957. },
  31958. countActive: function() {
  31959. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  31960. e += this.funcs[t].running;
  31961. return e
  31962. },
  31963. listActive: function() {
  31964. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  31965. this.funcs[t].running && e.push(this.funcs[t].name);
  31966. return e
  31967. },
  31968. done: function(e) {
  31969. this.globalDone = e
  31970. },
  31971. cancelById: function(e) {
  31972. var t = void 0 === e ? 0 : e;
  31973. this.funcs = this.funcs.filter(function(e) {
  31974. return e.id !== t
  31975. })
  31976. },
  31977. cancel: function(e) {
  31978. this.funcs = this.funcs.filter(function(t) {
  31979. return t.func !== e
  31980. })
  31981. },
  31982. getUniqueId: function() {
  31983. return this.uniqueID -= 1,
  31984. this.uniqueID
  31985. }
  31986. }
  31987. }
  31988. , {
  31989. "./easing": 186
  31990. }],
  31991. 196: [function(e, t, i) {
  31992. function n(e) {
  31993. if (this.set = {},
  31994. this.infContains = function() {
  31995. return !0
  31996. }
  31997. ,
  31998. "object" == typeof e)
  31999. if (e instanceof Array)
  32000. for (var t = 0; t < e.length; t++)
  32001. this.set[e[t]] = !0;
  32002. else
  32003. this.set = e;
  32004. else if ("function" == typeof e)
  32005. this.infContains = e;
  32006. else if ("undefined" != typeof e)
  32007. throw new Error("set must be either an array or an object.")
  32008. }
  32009. t.exports = n,
  32010. n.prototype.contains = function(e) {
  32011. return !!this.set[e]
  32012. }
  32013. ,
  32014. n.prototype.has = n.prototype.contains,
  32015. n.prototype.add = function(e) {
  32016. if (1 == arguments.length)
  32017. this.set[e] = !0;
  32018. else
  32019. for (var t = 0; t < arguments.length; t++)
  32020. this.set[arguments[t]] = !0
  32021. }
  32022. ,
  32023. n.prototype.addAll = function(e) {
  32024. if ("object" != typeof e && !(e instanceof Array))
  32025. throw new Error("arr must be an array.");
  32026. for (var t = 0; t < e.length; t++)
  32027. this.add(e[t])
  32028. }
  32029. ,
  32030. n.prototype.remove = function(e) {
  32031. if (1 == arguments.length)
  32032. delete this.set[e];
  32033. else
  32034. for (var t = 0; t < arguments.length; t++)
  32035. delete this.set[arguments[t]]
  32036. }
  32037. ,
  32038. n.prototype.delete = n.prototype.remove,
  32039. n.prototype.clear = function() {
  32040. this.set = {}
  32041. }
  32042. ,
  32043. n.prototype.size = function() {
  32044. return Object.keys(this.set).length
  32045. }
  32046. ,
  32047. n.prototype.toString = function() {
  32048. return "{" + Object.keys(this.set).toString() + "}"
  32049. }
  32050. ,
  32051. n.prototype.toArray = function() {
  32052. return "undefined" == typeof this.set ? [] : Object.keys(this.set)
  32053. }
  32054. ,
  32055. n.prototype["*values"] = n.prototype.toArray
  32056. }
  32057. , {}],
  32058. 197: [function(e, t, i) {}
  32059. , {}],
  32060. 198: [function(e, t, i) {
  32061. (function(t) {
  32062. "use strict";
  32063. function n() {
  32064. try {
  32065. var e = new Uint8Array(1);
  32066. return e.__proto__ = {
  32067. __proto__: Uint8Array.prototype,
  32068. foo: function() {
  32069. return 42
  32070. }
  32071. },
  32072. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  32073. } catch (e) {
  32074. return !1
  32075. }
  32076. }
  32077. function r() {
  32078. return a.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  32079. }
  32080. function o(e, t) {
  32081. if (r() < t)
  32082. throw new RangeError("Invalid typed array length");
  32083. return a.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t),
  32084. e.__proto__ = a.prototype) : (null === e && (e = new a(t)),
  32085. e.length = t),
  32086. e
  32087. }
  32088. function a(e, t, i) {
  32089. if (!(a.TYPED_ARRAY_SUPPORT || this instanceof a))
  32090. return new a(e,t,i);
  32091. if ("number" == typeof e) {
  32092. if ("string" == typeof t)
  32093. throw new Error("If encoding is specified then the first argument must be a string");
  32094. return h(this, e)
  32095. }
  32096. return s(this, e, t, i)
  32097. }
  32098. function s(e, t, i, n) {
  32099. if ("number" == typeof t)
  32100. throw new TypeError('"value" argument must not be a number');
  32101. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? p(e, t, i, n) : "string" == typeof t ? u(e, t, i) : f(e, t)
  32102. }
  32103. function l(e) {
  32104. if ("number" != typeof e)
  32105. throw new TypeError('"size" argument must be a number');
  32106. if (e < 0)
  32107. throw new RangeError('"size" argument must not be negative')
  32108. }
  32109. function c(e, t, i, n) {
  32110. return l(t),
  32111. 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)
  32112. }
  32113. function h(e, t) {
  32114. if (l(t),
  32115. e = o(e, t < 0 ? 0 : 0 | g(t)),
  32116. !a.TYPED_ARRAY_SUPPORT)
  32117. for (var i = 0; i < t; ++i)
  32118. e[i] = 0;
  32119. return e
  32120. }
  32121. function u(e, t, i) {
  32122. if ("string" == typeof i && "" !== i || (i = "utf8"),
  32123. !a.isEncoding(i))
  32124. throw new TypeError('"encoding" must be a valid string encoding');
  32125. var n = 0 | v(t, i);
  32126. e = o(e, n);
  32127. var r = e.write(t, i);
  32128. return r !== n && (e = e.slice(0, r)),
  32129. e
  32130. }
  32131. function d(e, t) {
  32132. var i = t.length < 0 ? 0 : 0 | g(t.length);
  32133. e = o(e, i);
  32134. for (var n = 0; n < i; n += 1)
  32135. e[n] = 255 & t[n];
  32136. return e
  32137. }
  32138. function p(e, t, i, n) {
  32139. if (t.byteLength,
  32140. i < 0 || t.byteLength < i)
  32141. throw new RangeError("'offset' is out of bounds");
  32142. if (t.byteLength < i + (n || 0))
  32143. throw new RangeError("'length' is out of bounds");
  32144. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  32145. a.TYPED_ARRAY_SUPPORT ? (e = t,
  32146. e.__proto__ = a.prototype) : e = d(e, t),
  32147. e
  32148. }
  32149. function f(e, t) {
  32150. if (a.isBuffer(t)) {
  32151. var i = 0 | g(t.length);
  32152. return e = o(e, i),
  32153. 0 === e.length ? e : (t.copy(e, 0, 0, i),
  32154. e)
  32155. }
  32156. if (t) {
  32157. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  32158. return "number" != typeof t.length || K(t.length) ? o(e, 0) : d(e, t);
  32159. if ("Buffer" === t.type && $(t.data))
  32160. return d(e, t.data)
  32161. }
  32162. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  32163. }
  32164. function g(e) {
  32165. if (e >= r())
  32166. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + r().toString(16) + " bytes");
  32167. return 0 | e
  32168. }
  32169. function m(e) {
  32170. return +e != e && (e = 0),
  32171. a.alloc(+e)
  32172. }
  32173. function v(e, t) {
  32174. if (a.isBuffer(e))
  32175. return e.length;
  32176. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  32177. return e.byteLength;
  32178. "string" != typeof e && (e = "" + e);
  32179. var i = e.length;
  32180. if (0 === i)
  32181. return 0;
  32182. for (var n = !1; ; )
  32183. switch (t) {
  32184. case "ascii":
  32185. case "latin1":
  32186. case "binary":
  32187. return i;
  32188. case "utf8":
  32189. case "utf-8":
  32190. case void 0:
  32191. return j(e).length;
  32192. case "ucs2":
  32193. case "ucs-2":
  32194. case "utf16le":
  32195. case "utf-16le":
  32196. return 2 * i;
  32197. case "hex":
  32198. return i >>> 1;
  32199. case "base64":
  32200. return Z(e).length;
  32201. default:
  32202. if (n)
  32203. return j(e).length;
  32204. t = ("" + t).toLowerCase(),
  32205. n = !0
  32206. }
  32207. }
  32208. function A(e, t, i) {
  32209. var n = !1;
  32210. if ((void 0 === t || t < 0) && (t = 0),
  32211. t > this.length)
  32212. return "";
  32213. if ((void 0 === i || i > this.length) && (i = this.length),
  32214. i <= 0)
  32215. return "";
  32216. if (i >>>= 0,
  32217. t >>>= 0,
  32218. i <= t)
  32219. return "";
  32220. for (e || (e = "utf8"); ; )
  32221. switch (e) {
  32222. case "hex":
  32223. return L(this, t, i);
  32224. case "utf8":
  32225. case "utf-8":
  32226. return M(this, t, i);
  32227. case "ascii":
  32228. return P(this, t, i);
  32229. case "latin1":
  32230. case "binary":
  32231. return O(this, t, i);
  32232. case "base64":
  32233. return S(this, t, i);
  32234. case "ucs2":
  32235. case "ucs-2":
  32236. case "utf16le":
  32237. case "utf-16le":
  32238. return D(this, t, i);
  32239. default:
  32240. if (n)
  32241. throw new TypeError("Unknown encoding: " + e);
  32242. e = (e + "").toLowerCase(),
  32243. n = !0
  32244. }
  32245. }
  32246. function y(e, t, i) {
  32247. var n = e[t];
  32248. e[t] = e[i],
  32249. e[i] = n
  32250. }
  32251. function C(e, t, i, n, r) {
  32252. if (0 === e.length)
  32253. return -1;
  32254. if ("string" == typeof i ? (n = i,
  32255. i = 0) : i > 2147483647 ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  32256. i = +i,
  32257. isNaN(i) && (i = r ? 0 : e.length - 1),
  32258. i < 0 && (i = e.length + i),
  32259. i >= e.length) {
  32260. if (r)
  32261. return -1;
  32262. i = e.length - 1
  32263. } else if (i < 0) {
  32264. if (!r)
  32265. return -1;
  32266. i = 0
  32267. }
  32268. if ("string" == typeof t && (t = a.from(t, n)),
  32269. a.isBuffer(t))
  32270. return 0 === t.length ? -1 : I(e, t, i, n, r);
  32271. if ("number" == typeof t)
  32272. return t &= 255,
  32273. 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);
  32274. throw new TypeError("val must be string, number or Buffer")
  32275. }
  32276. function I(e, t, i, n, r) {
  32277. function o(e, t) {
  32278. return 1 === a ? e[t] : e.readUInt16BE(t * a)
  32279. }
  32280. var a = 1
  32281. , s = e.length
  32282. , l = t.length;
  32283. if (void 0 !== n && (n = String(n).toLowerCase(),
  32284. "ucs2" === n || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  32285. if (e.length < 2 || t.length < 2)
  32286. return -1;
  32287. a = 2,
  32288. s /= 2,
  32289. l /= 2,
  32290. i /= 2
  32291. }
  32292. var c;
  32293. if (r) {
  32294. var h = -1;
  32295. for (c = i; c < s; c++)
  32296. if (o(e, c) === o(t, h === -1 ? 0 : c - h)) {
  32297. if (h === -1 && (h = c),
  32298. c - h + 1 === l)
  32299. return h * a
  32300. } else
  32301. h !== -1 && (c -= c - h),
  32302. h = -1
  32303. } else
  32304. for (i + l > s && (i = s - l),
  32305. c = i; c >= 0; c--) {
  32306. for (var u = !0, d = 0; d < l; d++)
  32307. if (o(e, c + d) !== o(t, d)) {
  32308. u = !1;
  32309. break
  32310. }
  32311. if (u)
  32312. return c
  32313. }
  32314. return -1
  32315. }
  32316. function E(e, t, i, n) {
  32317. i = Number(i) || 0;
  32318. var r = e.length - i;
  32319. n ? (n = Number(n),
  32320. n > r && (n = r)) : n = r;
  32321. var o = t.length;
  32322. if (o % 2 !== 0)
  32323. throw new TypeError("Invalid hex string");
  32324. n > o / 2 && (n = o / 2);
  32325. for (var a = 0; a < n; ++a) {
  32326. var s = parseInt(t.substr(2 * a, 2), 16);
  32327. if (isNaN(s))
  32328. return a;
  32329. e[i + a] = s
  32330. }
  32331. return a
  32332. }
  32333. function b(e, t, i, n) {
  32334. return q(j(t, e.length - i), e, i, n)
  32335. }
  32336. function w(e, t, i, n) {
  32337. return q(Y(t), e, i, n)
  32338. }
  32339. function _(e, t, i, n) {
  32340. return w(e, t, i, n)
  32341. }
  32342. function T(e, t, i, n) {
  32343. return q(Z(t), e, i, n)
  32344. }
  32345. function x(e, t, i, n) {
  32346. return q(X(t, e.length - i), e, i, n)
  32347. }
  32348. function S(e, t, i) {
  32349. return 0 === t && i === e.length ? Q.fromByteArray(e) : Q.fromByteArray(e.slice(t, i))
  32350. }
  32351. function M(e, t, i) {
  32352. i = Math.min(e.length, i);
  32353. for (var n = [], r = t; r < i; ) {
  32354. var o = e[r]
  32355. , a = null
  32356. , s = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1;
  32357. if (r + s <= i) {
  32358. var l, c, h, u;
  32359. switch (s) {
  32360. case 1:
  32361. o < 128 && (a = o);
  32362. break;
  32363. case 2:
  32364. l = e[r + 1],
  32365. 128 === (192 & l) && (u = (31 & o) << 6 | 63 & l,
  32366. u > 127 && (a = u));
  32367. break;
  32368. case 3:
  32369. l = e[r + 1],
  32370. c = e[r + 2],
  32371. 128 === (192 & l) && 128 === (192 & c) && (u = (15 & o) << 12 | (63 & l) << 6 | 63 & c,
  32372. u > 2047 && (u < 55296 || u > 57343) && (a = u));
  32373. break;
  32374. case 4:
  32375. l = e[r + 1],
  32376. c = e[r + 2],
  32377. h = e[r + 3],
  32378. 128 === (192 & l) && 128 === (192 & c) && 128 === (192 & h) && (u = (15 & o) << 18 | (63 & l) << 12 | (63 & c) << 6 | 63 & h,
  32379. u > 65535 && u < 1114112 && (a = u))
  32380. }
  32381. }
  32382. null === a ? (a = 65533,
  32383. s = 1) : a > 65535 && (a -= 65536,
  32384. n.push(a >>> 10 & 1023 | 55296),
  32385. a = 56320 | 1023 & a),
  32386. n.push(a),
  32387. r += s
  32388. }
  32389. return R(n)
  32390. }
  32391. function R(e) {
  32392. var t = e.length;
  32393. if (t <= ee)
  32394. return String.fromCharCode.apply(String, e);
  32395. for (var i = "", n = 0; n < t; )
  32396. i += String.fromCharCode.apply(String, e.slice(n, n += ee));
  32397. return i
  32398. }
  32399. function P(e, t, i) {
  32400. var n = "";
  32401. i = Math.min(e.length, i);
  32402. for (var r = t; r < i; ++r)
  32403. n += String.fromCharCode(127 & e[r]);
  32404. return n
  32405. }
  32406. function O(e, t, i) {
  32407. var n = "";
  32408. i = Math.min(e.length, i);
  32409. for (var r = t; r < i; ++r)
  32410. n += String.fromCharCode(e[r]);
  32411. return n
  32412. }
  32413. function L(e, t, i) {
  32414. var n = e.length;
  32415. (!t || t < 0) && (t = 0),
  32416. (!i || i < 0 || i > n) && (i = n);
  32417. for (var r = "", o = t; o < i; ++o)
  32418. r += W(e[o]);
  32419. return r
  32420. }
  32421. function D(e, t, i) {
  32422. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  32423. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  32424. return r
  32425. }
  32426. function N(e, t, i) {
  32427. if (e % 1 !== 0 || e < 0)
  32428. throw new RangeError("offset is not uint");
  32429. if (e + t > i)
  32430. throw new RangeError("Trying to access beyond buffer length")
  32431. }
  32432. function B(e, t, i, n, r, o) {
  32433. if (!a.isBuffer(e))
  32434. throw new TypeError('"buffer" argument must be a Buffer instance');
  32435. if (t > r || t < o)
  32436. throw new RangeError('"value" argument is out of bounds');
  32437. if (i + n > e.length)
  32438. throw new RangeError("Index out of range")
  32439. }
  32440. function F(e, t, i, n) {
  32441. t < 0 && (t = 65535 + t + 1);
  32442. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  32443. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  32444. }
  32445. function V(e, t, i, n) {
  32446. t < 0 && (t = 4294967295 + t + 1);
  32447. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  32448. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  32449. }
  32450. function U(e, t, i, n, r, o) {
  32451. if (i + n > e.length)
  32452. throw new RangeError("Index out of range");
  32453. if (i < 0)
  32454. throw new RangeError("Index out of range")
  32455. }
  32456. function k(e, t, i, n, r) {
  32457. return r || U(e, t, i, 4, 3.4028234663852886e38, -3.4028234663852886e38),
  32458. J.write(e, t, i, n, 23, 4),
  32459. i + 4
  32460. }
  32461. function H(e, t, i, n, r) {
  32462. return r || U(e, t, i, 8, 1.7976931348623157e308, -1.7976931348623157e308),
  32463. J.write(e, t, i, n, 52, 8),
  32464. i + 8
  32465. }
  32466. function G(e) {
  32467. if (e = z(e).replace(te, ""),
  32468. e.length < 2)
  32469. return "";
  32470. for (; e.length % 4 !== 0; )
  32471. e += "=";
  32472. return e
  32473. }
  32474. function z(e) {
  32475. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  32476. }
  32477. function W(e) {
  32478. return e < 16 ? "0" + e.toString(16) : e.toString(16)
  32479. }
  32480. function j(e, t) {
  32481. t = t || 1 / 0;
  32482. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  32483. if (i = e.charCodeAt(a),
  32484. i > 55295 && i < 57344) {
  32485. if (!r) {
  32486. if (i > 56319) {
  32487. (t -= 3) > -1 && o.push(239, 191, 189);
  32488. continue
  32489. }
  32490. if (a + 1 === n) {
  32491. (t -= 3) > -1 && o.push(239, 191, 189);
  32492. continue
  32493. }
  32494. r = i;
  32495. continue
  32496. }
  32497. if (i < 56320) {
  32498. (t -= 3) > -1 && o.push(239, 191, 189),
  32499. r = i;
  32500. continue
  32501. }
  32502. i = (r - 55296 << 10 | i - 56320) + 65536
  32503. } else
  32504. r && (t -= 3) > -1 && o.push(239, 191, 189);
  32505. if (r = null,
  32506. i < 128) {
  32507. if ((t -= 1) < 0)
  32508. break;
  32509. o.push(i)
  32510. } else if (i < 2048) {
  32511. if ((t -= 2) < 0)
  32512. break;
  32513. o.push(i >> 6 | 192, 63 & i | 128)
  32514. } else if (i < 65536) {
  32515. if ((t -= 3) < 0)
  32516. break;
  32517. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  32518. } else {
  32519. if (!(i < 1114112))
  32520. throw new Error("Invalid code point");
  32521. if ((t -= 4) < 0)
  32522. break;
  32523. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  32524. }
  32525. }
  32526. return o
  32527. }
  32528. function Y(e) {
  32529. for (var t = [], i = 0; i < e.length; ++i)
  32530. t.push(255 & e.charCodeAt(i));
  32531. return t
  32532. }
  32533. function X(e, t) {
  32534. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  32535. i = e.charCodeAt(a),
  32536. n = i >> 8,
  32537. r = i % 256,
  32538. o.push(r),
  32539. o.push(n);
  32540. return o
  32541. }
  32542. function Z(e) {
  32543. return Q.toByteArray(G(e))
  32544. }
  32545. function q(e, t, i, n) {
  32546. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  32547. t[r + i] = e[r];
  32548. return r
  32549. }
  32550. function K(e) {
  32551. return e !== e
  32552. }
  32553. var Q = e("base64-js")
  32554. , J = e("ieee754")
  32555. , $ = e("isarray");
  32556. i.Buffer = a,
  32557. i.SlowBuffer = m,
  32558. i.INSPECT_MAX_BYTES = 50,
  32559. a.TYPED_ARRAY_SUPPORT = void 0 !== t.TYPED_ARRAY_SUPPORT ? t.TYPED_ARRAY_SUPPORT : n(),
  32560. i.kMaxLength = r(),
  32561. a.poolSize = 8192,
  32562. a._augment = function(e) {
  32563. return e.__proto__ = a.prototype,
  32564. e
  32565. }
  32566. ,
  32567. a.from = function(e, t, i) {
  32568. return s(null, e, t, i)
  32569. }
  32570. ,
  32571. a.TYPED_ARRAY_SUPPORT && (a.prototype.__proto__ = Uint8Array.prototype,
  32572. a.__proto__ = Uint8Array,
  32573. "undefined" != typeof Symbol && Symbol.species && a[Symbol.species] === a && Object.defineProperty(a, Symbol.species, {
  32574. value: null,
  32575. configurable: !0
  32576. })),
  32577. a.alloc = function(e, t, i) {
  32578. return c(null, e, t, i)
  32579. }
  32580. ,
  32581. a.allocUnsafe = function(e) {
  32582. return h(null, e)
  32583. }
  32584. ,
  32585. a.allocUnsafeSlow = function(e) {
  32586. return h(null, e)
  32587. }
  32588. ,
  32589. a.isBuffer = function(e) {
  32590. return !(null == e || !e._isBuffer)
  32591. }
  32592. ,
  32593. a.compare = function(e, t) {
  32594. if (!a.isBuffer(e) || !a.isBuffer(t))
  32595. throw new TypeError("Arguments must be Buffers");
  32596. if (e === t)
  32597. return 0;
  32598. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  32599. if (e[r] !== t[r]) {
  32600. i = e[r],
  32601. n = t[r];
  32602. break
  32603. }
  32604. return i < n ? -1 : n < i ? 1 : 0
  32605. }
  32606. ,
  32607. a.isEncoding = function(e) {
  32608. switch (String(e).toLowerCase()) {
  32609. case "hex":
  32610. case "utf8":
  32611. case "utf-8":
  32612. case "ascii":
  32613. case "latin1":
  32614. case "binary":
  32615. case "base64":
  32616. case "ucs2":
  32617. case "ucs-2":
  32618. case "utf16le":
  32619. case "utf-16le":
  32620. return !0;
  32621. default:
  32622. return !1
  32623. }
  32624. }
  32625. ,
  32626. a.concat = function(e, t) {
  32627. if (!$(e))
  32628. throw new TypeError('"list" argument must be an Array of Buffers');
  32629. if (0 === e.length)
  32630. return a.alloc(0);
  32631. var i;
  32632. if (void 0 === t)
  32633. for (t = 0,
  32634. i = 0; i < e.length; ++i)
  32635. t += e[i].length;
  32636. var n = a.allocUnsafe(t)
  32637. , r = 0;
  32638. for (i = 0; i < e.length; ++i) {
  32639. var o = e[i];
  32640. if (!a.isBuffer(o))
  32641. throw new TypeError('"list" argument must be an Array of Buffers');
  32642. o.copy(n, r),
  32643. r += o.length
  32644. }
  32645. return n
  32646. }
  32647. ,
  32648. a.byteLength = v,
  32649. a.prototype._isBuffer = !0,
  32650. a.prototype.swap16 = function() {
  32651. var e = this.length;
  32652. if (e % 2 !== 0)
  32653. throw new RangeError("Buffer size must be a multiple of 16-bits");
  32654. for (var t = 0; t < e; t += 2)
  32655. y(this, t, t + 1);
  32656. return this
  32657. }
  32658. ,
  32659. a.prototype.swap32 = function() {
  32660. var e = this.length;
  32661. if (e % 4 !== 0)
  32662. throw new RangeError("Buffer size must be a multiple of 32-bits");
  32663. for (var t = 0; t < e; t += 4)
  32664. y(this, t, t + 3),
  32665. y(this, t + 1, t + 2);
  32666. return this
  32667. }
  32668. ,
  32669. a.prototype.swap64 = function() {
  32670. var e = this.length;
  32671. if (e % 8 !== 0)
  32672. throw new RangeError("Buffer size must be a multiple of 64-bits");
  32673. for (var t = 0; t < e; t += 8)
  32674. y(this, t, t + 7),
  32675. y(this, t + 1, t + 6),
  32676. y(this, t + 2, t + 5),
  32677. y(this, t + 3, t + 4);
  32678. return this
  32679. }
  32680. ,
  32681. a.prototype.toString = function() {
  32682. var e = 0 | this.length;
  32683. return 0 === e ? "" : 0 === arguments.length ? M(this, 0, e) : A.apply(this, arguments)
  32684. }
  32685. ,
  32686. a.prototype.equals = function(e) {
  32687. if (!a.isBuffer(e))
  32688. throw new TypeError("Argument must be a Buffer");
  32689. return this === e || 0 === a.compare(this, e)
  32690. }
  32691. ,
  32692. a.prototype.inspect = function() {
  32693. var e = ""
  32694. , t = i.INSPECT_MAX_BYTES;
  32695. return this.length > 0 && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  32696. this.length > t && (e += " ... ")),
  32697. "<Buffer " + e + ">"
  32698. }
  32699. ,
  32700. a.prototype.compare = function(e, t, i, n, r) {
  32701. if (!a.isBuffer(e))
  32702. throw new TypeError("Argument must be a Buffer");
  32703. if (void 0 === t && (t = 0),
  32704. void 0 === i && (i = e ? e.length : 0),
  32705. void 0 === n && (n = 0),
  32706. void 0 === r && (r = this.length),
  32707. t < 0 || i > e.length || n < 0 || r > this.length)
  32708. throw new RangeError("out of range index");
  32709. if (n >= r && t >= i)
  32710. return 0;
  32711. if (n >= r)
  32712. return -1;
  32713. if (t >= i)
  32714. return 1;
  32715. if (t >>>= 0,
  32716. i >>>= 0,
  32717. n >>>= 0,
  32718. r >>>= 0,
  32719. this === e)
  32720. return 0;
  32721. 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)
  32722. if (c[u] !== h[u]) {
  32723. o = c[u],
  32724. s = h[u];
  32725. break
  32726. }
  32727. return o < s ? -1 : s < o ? 1 : 0
  32728. }
  32729. ,
  32730. a.prototype.includes = function(e, t, i) {
  32731. return this.indexOf(e, t, i) !== -1
  32732. }
  32733. ,
  32734. a.prototype.indexOf = function(e, t, i) {
  32735. return C(this, e, t, i, !0)
  32736. }
  32737. ,
  32738. a.prototype.lastIndexOf = function(e, t, i) {
  32739. return C(this, e, t, i, !1)
  32740. }
  32741. ,
  32742. a.prototype.write = function(e, t, i, n) {
  32743. if (void 0 === t)
  32744. n = "utf8",
  32745. i = this.length,
  32746. t = 0;
  32747. else if (void 0 === i && "string" == typeof t)
  32748. n = t,
  32749. i = this.length,
  32750. t = 0;
  32751. else {
  32752. if (!isFinite(t))
  32753. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  32754. t |= 0,
  32755. isFinite(i) ? (i |= 0,
  32756. void 0 === n && (n = "utf8")) : (n = i,
  32757. i = void 0)
  32758. }
  32759. var r = this.length - t;
  32760. if ((void 0 === i || i > r) && (i = r),
  32761. e.length > 0 && (i < 0 || t < 0) || t > this.length)
  32762. throw new RangeError("Attempt to write outside buffer bounds");
  32763. n || (n = "utf8");
  32764. for (var o = !1; ; )
  32765. switch (n) {
  32766. case "hex":
  32767. return E(this, e, t, i);
  32768. case "utf8":
  32769. case "utf-8":
  32770. return b(this, e, t, i);
  32771. case "ascii":
  32772. return w(this, e, t, i);
  32773. case "latin1":
  32774. case "binary":
  32775. return _(this, e, t, i);
  32776. case "base64":
  32777. return T(this, e, t, i);
  32778. case "ucs2":
  32779. case "ucs-2":
  32780. case "utf16le":
  32781. case "utf-16le":
  32782. return x(this, e, t, i);
  32783. default:
  32784. if (o)
  32785. throw new TypeError("Unknown encoding: " + n);
  32786. n = ("" + n).toLowerCase(),
  32787. o = !0
  32788. }
  32789. }
  32790. ,
  32791. a.prototype.toJSON = function() {
  32792. return {
  32793. type: "Buffer",
  32794. data: Array.prototype.slice.call(this._arr || this, 0)
  32795. }
  32796. }
  32797. ;
  32798. var ee = 4096;
  32799. a.prototype.slice = function(e, t) {
  32800. var i = this.length;
  32801. e = ~~e,
  32802. t = void 0 === t ? i : ~~t,
  32803. e < 0 ? (e += i,
  32804. e < 0 && (e = 0)) : e > i && (e = i),
  32805. t < 0 ? (t += i,
  32806. t < 0 && (t = 0)) : t > i && (t = i),
  32807. t < e && (t = e);
  32808. var n;
  32809. if (a.TYPED_ARRAY_SUPPORT)
  32810. n = this.subarray(e, t),
  32811. n.__proto__ = a.prototype;
  32812. else {
  32813. var r = t - e;
  32814. n = new a(r,void 0);
  32815. for (var o = 0; o < r; ++o)
  32816. n[o] = this[o + e]
  32817. }
  32818. return n
  32819. }
  32820. ,
  32821. a.prototype.readUIntLE = function(e, t, i) {
  32822. e |= 0,
  32823. t |= 0,
  32824. i || N(e, t, this.length);
  32825. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  32826. n += this[e + o] * r;
  32827. return n
  32828. }
  32829. ,
  32830. a.prototype.readUIntBE = function(e, t, i) {
  32831. e |= 0,
  32832. t |= 0,
  32833. i || N(e, t, this.length);
  32834. for (var n = this[e + --t], r = 1; t > 0 && (r *= 256); )
  32835. n += this[e + --t] * r;
  32836. return n
  32837. }
  32838. ,
  32839. a.prototype.readUInt8 = function(e, t) {
  32840. return t || N(e, 1, this.length),
  32841. this[e]
  32842. }
  32843. ,
  32844. a.prototype.readUInt16LE = function(e, t) {
  32845. return t || N(e, 2, this.length),
  32846. this[e] | this[e + 1] << 8
  32847. }
  32848. ,
  32849. a.prototype.readUInt16BE = function(e, t) {
  32850. return t || N(e, 2, this.length),
  32851. this[e] << 8 | this[e + 1]
  32852. }
  32853. ,
  32854. a.prototype.readUInt32LE = function(e, t) {
  32855. return t || N(e, 4, this.length),
  32856. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  32857. }
  32858. ,
  32859. a.prototype.readUInt32BE = function(e, t) {
  32860. return t || N(e, 4, this.length),
  32861. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  32862. }
  32863. ,
  32864. a.prototype.readIntLE = function(e, t, i) {
  32865. e |= 0,
  32866. t |= 0,
  32867. i || N(e, t, this.length);
  32868. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  32869. n += this[e + o] * r;
  32870. return r *= 128,
  32871. n >= r && (n -= Math.pow(2, 8 * t)),
  32872. n
  32873. }
  32874. ,
  32875. a.prototype.readIntBE = function(e, t, i) {
  32876. e |= 0,
  32877. t |= 0,
  32878. i || N(e, t, this.length);
  32879. for (var n = t, r = 1, o = this[e + --n]; n > 0 && (r *= 256); )
  32880. o += this[e + --n] * r;
  32881. return r *= 128,
  32882. o >= r && (o -= Math.pow(2, 8 * t)),
  32883. o
  32884. }
  32885. ,
  32886. a.prototype.readInt8 = function(e, t) {
  32887. return t || N(e, 1, this.length),
  32888. 128 & this[e] ? (255 - this[e] + 1) * -1 : this[e]
  32889. }
  32890. ,
  32891. a.prototype.readInt16LE = function(e, t) {
  32892. t || N(e, 2, this.length);
  32893. var i = this[e] | this[e + 1] << 8;
  32894. return 32768 & i ? 4294901760 | i : i
  32895. }
  32896. ,
  32897. a.prototype.readInt16BE = function(e, t) {
  32898. t || N(e, 2, this.length);
  32899. var i = this[e + 1] | this[e] << 8;
  32900. return 32768 & i ? 4294901760 | i : i
  32901. }
  32902. ,
  32903. a.prototype.readInt32LE = function(e, t) {
  32904. return t || N(e, 4, this.length),
  32905. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  32906. }
  32907. ,
  32908. a.prototype.readInt32BE = function(e, t) {
  32909. return t || N(e, 4, this.length),
  32910. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  32911. }
  32912. ,
  32913. a.prototype.readFloatLE = function(e, t) {
  32914. return t || N(e, 4, this.length),
  32915. J.read(this, e, !0, 23, 4)
  32916. }
  32917. ,
  32918. a.prototype.readFloatBE = function(e, t) {
  32919. return t || N(e, 4, this.length),
  32920. J.read(this, e, !1, 23, 4)
  32921. }
  32922. ,
  32923. a.prototype.readDoubleLE = function(e, t) {
  32924. return t || N(e, 8, this.length),
  32925. J.read(this, e, !0, 52, 8)
  32926. }
  32927. ,
  32928. a.prototype.readDoubleBE = function(e, t) {
  32929. return t || N(e, 8, this.length),
  32930. J.read(this, e, !1, 52, 8)
  32931. }
  32932. ,
  32933. a.prototype.writeUIntLE = function(e, t, i, n) {
  32934. if (e = +e,
  32935. t |= 0,
  32936. i |= 0,
  32937. !n) {
  32938. var r = Math.pow(2, 8 * i) - 1;
  32939. B(this, e, t, i, r, 0)
  32940. }
  32941. var o = 1
  32942. , a = 0;
  32943. for (this[t] = 255 & e; ++a < i && (o *= 256); )
  32944. this[t + a] = e / o & 255;
  32945. return t + i
  32946. }
  32947. ,
  32948. a.prototype.writeUIntBE = function(e, t, i, n) {
  32949. if (e = +e,
  32950. t |= 0,
  32951. i |= 0,
  32952. !n) {
  32953. var r = Math.pow(2, 8 * i) - 1;
  32954. B(this, e, t, i, r, 0)
  32955. }
  32956. var o = i - 1
  32957. , a = 1;
  32958. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  32959. this[t + o] = e / a & 255;
  32960. return t + i
  32961. }
  32962. ,
  32963. a.prototype.writeUInt8 = function(e, t, i) {
  32964. return e = +e,
  32965. t |= 0,
  32966. i || B(this, e, t, 1, 255, 0),
  32967. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  32968. this[t] = 255 & e,
  32969. t + 1
  32970. }
  32971. ,
  32972. a.prototype.writeUInt16LE = function(e, t, i) {
  32973. return e = +e,
  32974. t |= 0,
  32975. i || B(this, e, t, 2, 65535, 0),
  32976. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  32977. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  32978. t + 2
  32979. }
  32980. ,
  32981. a.prototype.writeUInt16BE = function(e, t, i) {
  32982. return e = +e,
  32983. t |= 0,
  32984. i || B(this, e, t, 2, 65535, 0),
  32985. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  32986. this[t + 1] = 255 & e) : F(this, e, t, !1),
  32987. t + 2
  32988. }
  32989. ,
  32990. a.prototype.writeUInt32LE = function(e, t, i) {
  32991. return e = +e,
  32992. t |= 0,
  32993. i || B(this, e, t, 4, 4294967295, 0),
  32994. a.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  32995. this[t + 2] = e >>> 16,
  32996. this[t + 1] = e >>> 8,
  32997. this[t] = 255 & e) : V(this, e, t, !0),
  32998. t + 4
  32999. }
  33000. ,
  33001. a.prototype.writeUInt32BE = function(e, t, i) {
  33002. return e = +e,
  33003. t |= 0,
  33004. i || B(this, e, t, 4, 4294967295, 0),
  33005. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  33006. this[t + 1] = e >>> 16,
  33007. this[t + 2] = e >>> 8,
  33008. this[t + 3] = 255 & e) : V(this, e, t, !1),
  33009. t + 4
  33010. }
  33011. ,
  33012. a.prototype.writeIntLE = function(e, t, i, n) {
  33013. if (e = +e,
  33014. t |= 0,
  33015. !n) {
  33016. var r = Math.pow(2, 8 * i - 1);
  33017. B(this, e, t, i, r - 1, -r)
  33018. }
  33019. var o = 0
  33020. , a = 1
  33021. , s = 0;
  33022. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  33023. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  33024. this[t + o] = (e / a >> 0) - s & 255;
  33025. return t + i
  33026. }
  33027. ,
  33028. a.prototype.writeIntBE = function(e, t, i, n) {
  33029. if (e = +e,
  33030. t |= 0,
  33031. !n) {
  33032. var r = Math.pow(2, 8 * i - 1);
  33033. B(this, e, t, i, r - 1, -r)
  33034. }
  33035. var o = i - 1
  33036. , a = 1
  33037. , s = 0;
  33038. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  33039. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  33040. this[t + o] = (e / a >> 0) - s & 255;
  33041. return t + i
  33042. }
  33043. ,
  33044. a.prototype.writeInt8 = function(e, t, i) {
  33045. return e = +e,
  33046. t |= 0,
  33047. i || B(this, e, t, 1, 127, -128),
  33048. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  33049. e < 0 && (e = 255 + e + 1),
  33050. this[t] = 255 & e,
  33051. t + 1
  33052. }
  33053. ,
  33054. a.prototype.writeInt16LE = function(e, t, i) {
  33055. return e = +e,
  33056. t |= 0,
  33057. i || B(this, e, t, 2, 32767, -32768),
  33058. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  33059. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  33060. t + 2
  33061. }
  33062. ,
  33063. a.prototype.writeInt16BE = function(e, t, i) {
  33064. return e = +e,
  33065. t |= 0,
  33066. i || B(this, e, t, 2, 32767, -32768),
  33067. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  33068. this[t + 1] = 255 & e) : F(this, e, t, !1),
  33069. t + 2
  33070. }
  33071. ,
  33072. a.prototype.writeInt32LE = function(e, t, i) {
  33073. return e = +e,
  33074. t |= 0,
  33075. i || B(this, e, t, 4, 2147483647, -2147483648),
  33076. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  33077. this[t + 1] = e >>> 8,
  33078. this[t + 2] = e >>> 16,
  33079. this[t + 3] = e >>> 24) : V(this, e, t, !0),
  33080. t + 4
  33081. }
  33082. ,
  33083. a.prototype.writeInt32BE = function(e, t, i) {
  33084. return e = +e,
  33085. t |= 0,
  33086. i || B(this, e, t, 4, 2147483647, -2147483648),
  33087. e < 0 && (e = 4294967295 + e + 1),
  33088. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  33089. this[t + 1] = e >>> 16,
  33090. this[t + 2] = e >>> 8,
  33091. this[t + 3] = 255 & e) : V(this, e, t, !1),
  33092. t + 4
  33093. }
  33094. ,
  33095. a.prototype.writeFloatLE = function(e, t, i) {
  33096. return k(this, e, t, !0, i)
  33097. }
  33098. ,
  33099. a.prototype.writeFloatBE = function(e, t, i) {
  33100. return k(this, e, t, !1, i)
  33101. }
  33102. ,
  33103. a.prototype.writeDoubleLE = function(e, t, i) {
  33104. return H(this, e, t, !0, i)
  33105. }
  33106. ,
  33107. a.prototype.writeDoubleBE = function(e, t, i) {
  33108. return H(this, e, t, !1, i)
  33109. }
  33110. ,
  33111. a.prototype.copy = function(e, t, i, n) {
  33112. if (i || (i = 0),
  33113. n || 0 === n || (n = this.length),
  33114. t >= e.length && (t = e.length),
  33115. t || (t = 0),
  33116. n > 0 && n < i && (n = i),
  33117. n === i)
  33118. return 0;
  33119. if (0 === e.length || 0 === this.length)
  33120. return 0;
  33121. if (t < 0)
  33122. throw new RangeError("targetStart out of bounds");
  33123. if (i < 0 || i >= this.length)
  33124. throw new RangeError("sourceStart out of bounds");
  33125. if (n < 0)
  33126. throw new RangeError("sourceEnd out of bounds");
  33127. n > this.length && (n = this.length),
  33128. e.length - t < n - i && (n = e.length - t + i);
  33129. var r, o = n - i;
  33130. if (this === e && i < t && t < n)
  33131. for (r = o - 1; r >= 0; --r)
  33132. e[r + t] = this[r + i];
  33133. else if (o < 1e3 || !a.TYPED_ARRAY_SUPPORT)
  33134. for (r = 0; r < o; ++r)
  33135. e[r + t] = this[r + i];
  33136. else
  33137. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  33138. return o
  33139. }
  33140. ,
  33141. a.prototype.fill = function(e, t, i, n) {
  33142. if ("string" == typeof e) {
  33143. if ("string" == typeof t ? (n = t,
  33144. t = 0,
  33145. i = this.length) : "string" == typeof i && (n = i,
  33146. i = this.length),
  33147. 1 === e.length) {
  33148. var r = e.charCodeAt(0);
  33149. r < 256 && (e = r)
  33150. }
  33151. if (void 0 !== n && "string" != typeof n)
  33152. throw new TypeError("encoding must be a string");
  33153. if ("string" == typeof n && !a.isEncoding(n))
  33154. throw new TypeError("Unknown encoding: " + n)
  33155. } else
  33156. "number" == typeof e && (e &= 255);
  33157. if (t < 0 || this.length < t || this.length < i)
  33158. throw new RangeError("Out of range index");
  33159. if (i <= t)
  33160. return this;
  33161. t >>>= 0,
  33162. i = void 0 === i ? this.length : i >>> 0,
  33163. e || (e = 0);
  33164. var o;
  33165. if ("number" == typeof e)
  33166. for (o = t; o < i; ++o)
  33167. this[o] = e;
  33168. else {
  33169. var s = a.isBuffer(e) ? e : j(new a(e,n).toString())
  33170. , l = s.length;
  33171. for (o = 0; o < i - t; ++o)
  33172. this[o + t] = s[o % l]
  33173. }
  33174. return this
  33175. }
  33176. ;
  33177. var te = /[^+\/0-9A-Za-z-_]/g
  33178. }
  33179. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  33180. }
  33181. , {
  33182. "base64-js": 199,
  33183. ieee754: 200,
  33184. isarray: 201
  33185. }],
  33186. 199: [function(e, t, i) {
  33187. "use strict";
  33188. function n(e) {
  33189. var t = e.length;
  33190. if (t % 4 > 0)
  33191. throw new Error("Invalid string. Length must be a multiple of 4");
  33192. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  33193. }
  33194. function r(e) {
  33195. return 3 * e.length / 4 - n(e)
  33196. }
  33197. function o(e) {
  33198. var t, i, r, o, a, s, l = e.length;
  33199. a = n(e),
  33200. s = new u(3 * l / 4 - a),
  33201. r = a > 0 ? l - 4 : l;
  33202. var c = 0;
  33203. for (t = 0,
  33204. i = 0; t < r; t += 4,
  33205. i += 3)
  33206. o = h[e.charCodeAt(t)] << 18 | h[e.charCodeAt(t + 1)] << 12 | h[e.charCodeAt(t + 2)] << 6 | h[e.charCodeAt(t + 3)],
  33207. s[c++] = o >> 16 & 255,
  33208. s[c++] = o >> 8 & 255,
  33209. s[c++] = 255 & o;
  33210. return 2 === a ? (o = h[e.charCodeAt(t)] << 2 | h[e.charCodeAt(t + 1)] >> 4,
  33211. s[c++] = 255 & o) : 1 === a && (o = h[e.charCodeAt(t)] << 10 | h[e.charCodeAt(t + 1)] << 4 | h[e.charCodeAt(t + 2)] >> 2,
  33212. s[c++] = o >> 8 & 255,
  33213. s[c++] = 255 & o),
  33214. s
  33215. }
  33216. function a(e) {
  33217. return c[e >> 18 & 63] + c[e >> 12 & 63] + c[e >> 6 & 63] + c[63 & e]
  33218. }
  33219. function s(e, t, i) {
  33220. for (var n, r = [], o = t; o < i; o += 3)
  33221. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  33222. r.push(a(n));
  33223. return r.join("")
  33224. }
  33225. function l(e) {
  33226. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 16383, l = 0, h = i - n; l < h; l += a)
  33227. o.push(s(e, l, l + a > h ? h : l + a));
  33228. return 1 === n ? (t = e[i - 1],
  33229. r += c[t >> 2],
  33230. r += c[t << 4 & 63],
  33231. r += "==") : 2 === n && (t = (e[i - 2] << 8) + e[i - 1],
  33232. r += c[t >> 10],
  33233. r += c[t >> 4 & 63],
  33234. r += c[t << 2 & 63],
  33235. r += "="),
  33236. o.push(r),
  33237. o.join("")
  33238. }
  33239. i.byteLength = r,
  33240. i.toByteArray = o,
  33241. i.fromByteArray = l;
  33242. for (var c = [], h = [], u = "undefined" != typeof Uint8Array ? Uint8Array : Array, d = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", p = 0, f = d.length; p < f; ++p)
  33243. c[p] = d[p],
  33244. h[d.charCodeAt(p)] = p;
  33245. h["-".charCodeAt(0)] = 62,
  33246. h["_".charCodeAt(0)] = 63
  33247. }
  33248. , {}],
  33249. 200: [function(e, t, i) {
  33250. i.read = function(e, t, i, n, r) {
  33251. 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];
  33252. for (u += d,
  33253. o = p & (1 << -h) - 1,
  33254. p >>= -h,
  33255. h += s; h > 0; o = 256 * o + e[t + u],
  33256. u += d,
  33257. h -= 8)
  33258. ;
  33259. for (a = o & (1 << -h) - 1,
  33260. o >>= -h,
  33261. h += n; h > 0; a = 256 * a + e[t + u],
  33262. u += d,
  33263. h -= 8)
  33264. ;
  33265. if (0 === o)
  33266. o = 1 - c;
  33267. else {
  33268. if (o === l)
  33269. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  33270. a += Math.pow(2, n),
  33271. o -= c
  33272. }
  33273. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  33274. }
  33275. ,
  33276. i.write = function(e, t, i, n, r, o) {
  33277. 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;
  33278. for (t = Math.abs(t),
  33279. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  33280. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  33281. t * (l = Math.pow(2, -a)) < 1 && (a--,
  33282. l *= 2),
  33283. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  33284. t * l >= 2 && (a++,
  33285. l /= 2),
  33286. a + u >= h ? (s = 0,
  33287. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  33288. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  33289. a = 0)); r >= 8; e[i + p] = 255 & s,
  33290. p += f,
  33291. s /= 256,
  33292. r -= 8)
  33293. ;
  33294. for (a = a << r | s,
  33295. c += r; c > 0; e[i + p] = 255 & a,
  33296. p += f,
  33297. a /= 256,
  33298. c -= 8)
  33299. ;
  33300. e[i + p - f] |= 128 * g
  33301. }
  33302. }
  33303. , {}],
  33304. 201: [function(e, t, i) {
  33305. var n = {}.toString;
  33306. t.exports = Array.isArray || function(e) {
  33307. return "[object Array]" == n.call(e)
  33308. }
  33309. }
  33310. , {}],
  33311. 202: [function(e, t, i) {
  33312. function n() {
  33313. this._events = this._events || {},
  33314. this._maxListeners = this._maxListeners || void 0
  33315. }
  33316. function r(e) {
  33317. return "function" == typeof e
  33318. }
  33319. function o(e) {
  33320. return "number" == typeof e
  33321. }
  33322. function a(e) {
  33323. return "object" == typeof e && null !== e
  33324. }
  33325. function s(e) {
  33326. return void 0 === e
  33327. }
  33328. t.exports = n,
  33329. n.EventEmitter = n,
  33330. n.prototype._events = void 0,
  33331. n.prototype._maxListeners = void 0,
  33332. n.defaultMaxListeners = 10,
  33333. n.prototype.setMaxListeners = function(e) {
  33334. if (!o(e) || e < 0 || isNaN(e))
  33335. throw TypeError("n must be a positive number");
  33336. return this._maxListeners = e,
  33337. this
  33338. }
  33339. ,
  33340. n.prototype.emit = function(e) {
  33341. var t, i, n, o, l, c;
  33342. if (this._events || (this._events = {}),
  33343. "error" === e && (!this._events.error || a(this._events.error) && !this._events.error.length)) {
  33344. if (t = arguments[1],
  33345. t instanceof Error)
  33346. throw t;
  33347. var h = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  33348. throw h.context = t,
  33349. h
  33350. }
  33351. if (i = this._events[e],
  33352. s(i))
  33353. return !1;
  33354. if (r(i))
  33355. switch (arguments.length) {
  33356. case 1:
  33357. i.call(this);
  33358. break;
  33359. case 2:
  33360. i.call(this, arguments[1]);
  33361. break;
  33362. case 3:
  33363. i.call(this, arguments[1], arguments[2]);
  33364. break;
  33365. default:
  33366. o = Array.prototype.slice.call(arguments, 1),
  33367. i.apply(this, o)
  33368. }
  33369. else if (a(i))
  33370. for (o = Array.prototype.slice.call(arguments, 1),
  33371. c = i.slice(),
  33372. n = c.length,
  33373. l = 0; l < n; l++)
  33374. c[l].apply(this, o);
  33375. return !0
  33376. }
  33377. ,
  33378. n.prototype.addListener = function(e, t) {
  33379. var i;
  33380. if (!r(t))
  33381. throw TypeError("listener must be a function");
  33382. return this._events || (this._events = {}),
  33383. this._events.newListener && this.emit("newListener", e, r(t.listener) ? t.listener : t),
  33384. this._events[e] ? a(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  33385. a(this._events[e]) && !this._events[e].warned && (i = s(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners,
  33386. i && i > 0 && this._events[e].length > i && (this._events[e].warned = !0,
  33387. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  33388. "function" == typeof console.trace && console.trace())),
  33389. this
  33390. }
  33391. ,
  33392. n.prototype.on = n.prototype.addListener,
  33393. n.prototype.once = function(e, t) {
  33394. function i() {
  33395. this.removeListener(e, i),
  33396. n || (n = !0,
  33397. t.apply(this, arguments))
  33398. }
  33399. if (!r(t))
  33400. throw TypeError("listener must be a function");
  33401. var n = !1;
  33402. return i.listener = t,
  33403. this.on(e, i),
  33404. this
  33405. }
  33406. ,
  33407. n.prototype.removeListener = function(e, t) {
  33408. var i, n, o, s;
  33409. if (!r(t))
  33410. throw TypeError("listener must be a function");
  33411. if (!this._events || !this._events[e])
  33412. return this;
  33413. if (i = this._events[e],
  33414. o = i.length,
  33415. n = -1,
  33416. i === t || r(i.listener) && i.listener === t)
  33417. delete this._events[e],
  33418. this._events.removeListener && this.emit("removeListener", e, t);
  33419. else if (a(i)) {
  33420. for (s = o; s-- > 0; )
  33421. if (i[s] === t || i[s].listener && i[s].listener === t) {
  33422. n = s;
  33423. break
  33424. }
  33425. if (n < 0)
  33426. return this;
  33427. 1 === i.length ? (i.length = 0,
  33428. delete this._events[e]) : i.splice(n, 1),
  33429. this._events.removeListener && this.emit("removeListener", e, t)
  33430. }
  33431. return this
  33432. }
  33433. ,
  33434. n.prototype.removeAllListeners = function(e) {
  33435. var t, i;
  33436. if (!this._events)
  33437. return this;
  33438. if (!this._events.removeListener)
  33439. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  33440. this;
  33441. if (0 === arguments.length) {
  33442. for (t in this._events)
  33443. "removeListener" !== t && this.removeAllListeners(t);
  33444. return this.removeAllListeners("removeListener"),
  33445. this._events = {},
  33446. this
  33447. }
  33448. if (i = this._events[e],
  33449. r(i))
  33450. this.removeListener(e, i);
  33451. else if (i)
  33452. for (; i.length; )
  33453. this.removeListener(e, i[i.length - 1]);
  33454. return delete this._events[e],
  33455. this
  33456. }
  33457. ,
  33458. n.prototype.listeners = function(e) {
  33459. var t;
  33460. return t = this._events && this._events[e] ? r(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  33461. }
  33462. ,
  33463. n.prototype.listenerCount = function(e) {
  33464. if (this._events) {
  33465. var t = this._events[e];
  33466. if (r(t))
  33467. return 1;
  33468. if (t)
  33469. return t.length
  33470. }
  33471. return 0
  33472. }
  33473. ,
  33474. n.listenerCount = function(e, t) {
  33475. return e.listenerCount(t)
  33476. }
  33477. }
  33478. , {}],
  33479. 203: [function(e, t, i) {
  33480. function n() {
  33481. throw new Error("setTimeout has not been defined")
  33482. }
  33483. function r() {
  33484. throw new Error("clearTimeout has not been defined")
  33485. }
  33486. function o(e) {
  33487. if (u === setTimeout)
  33488. return setTimeout(e, 0);
  33489. if ((u === n || !u) && setTimeout)
  33490. return u = setTimeout,
  33491. setTimeout(e, 0);
  33492. try {
  33493. return u(e, 0)
  33494. } catch (t) {
  33495. try {
  33496. return u.call(null, e, 0)
  33497. } catch (t) {
  33498. return u.call(this, e, 0)
  33499. }
  33500. }
  33501. }
  33502. function a(e) {
  33503. if (d === clearTimeout)
  33504. return clearTimeout(e);
  33505. if ((d === r || !d) && clearTimeout)
  33506. return d = clearTimeout,
  33507. clearTimeout(e);
  33508. try {
  33509. return d(e)
  33510. } catch (t) {
  33511. try {
  33512. return d.call(null, e)
  33513. } catch (t) {
  33514. return d.call(this, e)
  33515. }
  33516. }
  33517. }
  33518. function s() {
  33519. m && f && (m = !1,
  33520. f.length ? g = f.concat(g) : v = -1,
  33521. g.length && l())
  33522. }
  33523. function l() {
  33524. if (!m) {
  33525. var e = o(s);
  33526. m = !0;
  33527. for (var t = g.length; t; ) {
  33528. for (f = g,
  33529. g = []; ++v < t; )
  33530. f && f[v].run();
  33531. v = -1,
  33532. t = g.length
  33533. }
  33534. f = null,
  33535. m = !1,
  33536. a(e)
  33537. }
  33538. }
  33539. function c(e, t) {
  33540. this.fun = e,
  33541. this.array = t
  33542. }
  33543. function h() {}
  33544. var u, d, p = t.exports = {};
  33545. !function() {
  33546. try {
  33547. u = "function" == typeof setTimeout ? setTimeout : n
  33548. } catch (e) {
  33549. u = n
  33550. }
  33551. try {
  33552. d = "function" == typeof clearTimeout ? clearTimeout : r
  33553. } catch (e) {
  33554. d = r
  33555. }
  33556. }();
  33557. var f, g = [], m = !1, v = -1;
  33558. p.nextTick = function(e) {
  33559. var t = new Array(arguments.length - 1);
  33560. if (arguments.length > 1)
  33561. for (var i = 1; i < arguments.length; i++)
  33562. t[i - 1] = arguments[i];
  33563. g.push(new c(e,t)),
  33564. 1 !== g.length || m || o(l)
  33565. }
  33566. ,
  33567. c.prototype.run = function() {
  33568. this.fun.apply(null, this.array)
  33569. }
  33570. ,
  33571. p.title = "browser",
  33572. p.browser = !0,
  33573. p.env = {},
  33574. p.argv = [],
  33575. p.version = "",
  33576. p.versions = {},
  33577. p.on = h,
  33578. p.addListener = h,
  33579. p.once = h,
  33580. p.off = h,
  33581. p.removeListener = h,
  33582. p.removeAllListeners = h,
  33583. p.emit = h,
  33584. p.binding = function(e) {
  33585. throw new Error("process.binding is not supported")
  33586. }
  33587. ,
  33588. p.cwd = function() {
  33589. return "/"
  33590. }
  33591. ,
  33592. p.chdir = function(e) {
  33593. throw new Error("process.chdir is not supported")
  33594. }
  33595. ,
  33596. p.umask = function() {
  33597. return 0
  33598. }
  33599. }
  33600. , {}],
  33601. 204: [function(e, t, i) {
  33602. (function(e) {
  33603. !function(n) {
  33604. function r(e) {
  33605. throw new RangeError(L[e])
  33606. }
  33607. function o(e, t) {
  33608. for (var i = e.length, n = []; i--; )
  33609. n[i] = t(e[i]);
  33610. return n
  33611. }
  33612. function a(e, t) {
  33613. var i = e.split("@")
  33614. , n = "";
  33615. i.length > 1 && (n = i[0] + "@",
  33616. e = i[1]),
  33617. e = e.replace(O, ".");
  33618. var r = e.split(".")
  33619. , a = o(r, t).join(".");
  33620. return n + a
  33621. }
  33622. function s(e) {
  33623. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  33624. t = e.charCodeAt(r++),
  33625. t >= 55296 && t <= 56319 && r < o ? (i = e.charCodeAt(r++),
  33626. 56320 == (64512 & i) ? n.push(((1023 & t) << 10) + (1023 & i) + 65536) : (n.push(t),
  33627. r--)) : n.push(t);
  33628. return n
  33629. }
  33630. function l(e) {
  33631. return o(e, function(e) {
  33632. var t = "";
  33633. return e > 65535 && (e -= 65536,
  33634. t += B(e >>> 10 & 1023 | 55296),
  33635. e = 56320 | 1023 & e),
  33636. t += B(e)
  33637. }).join("")
  33638. }
  33639. function c(e) {
  33640. return e - 48 < 10 ? e - 22 : e - 65 < 26 ? e - 65 : e - 97 < 26 ? e - 97 : E
  33641. }
  33642. function h(e, t) {
  33643. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  33644. }
  33645. function u(e, t, i) {
  33646. var n = 0;
  33647. for (e = i ? N(e / T) : e >> 1,
  33648. e += N(e / t); e > D * w >> 1; n += E)
  33649. e = N(e / D);
  33650. return N(n + (D + 1) * e / (e + _))
  33651. }
  33652. function d(e) {
  33653. var t, i, n, o, a, s, h, d, p, f, g = [], m = e.length, v = 0, A = S, y = x;
  33654. for (i = e.lastIndexOf(M),
  33655. i < 0 && (i = 0),
  33656. n = 0; n < i; ++n)
  33657. e.charCodeAt(n) >= 128 && r("not-basic"),
  33658. g.push(e.charCodeAt(n));
  33659. for (o = i > 0 ? i + 1 : 0; o < m; ) {
  33660. for (a = v,
  33661. s = 1,
  33662. h = E; o >= m && r("invalid-input"),
  33663. d = c(e.charCodeAt(o++)),
  33664. (d >= E || d > N((I - v) / s)) && r("overflow"),
  33665. v += d * s,
  33666. p = h <= y ? b : h >= y + w ? w : h - y,
  33667. !(d < p); h += E)
  33668. f = E - p,
  33669. s > N(I / f) && r("overflow"),
  33670. s *= f;
  33671. t = g.length + 1,
  33672. y = u(v - a, t, 0 == a),
  33673. N(v / t) > I - A && r("overflow"),
  33674. A += N(v / t),
  33675. v %= t,
  33676. g.splice(v++, 0, A)
  33677. }
  33678. return l(g)
  33679. }
  33680. function p(e) {
  33681. var t, i, n, o, a, l, c, d, p, f, g, m, v, A, y, C = [];
  33682. for (e = s(e),
  33683. m = e.length,
  33684. t = S,
  33685. i = 0,
  33686. a = x,
  33687. l = 0; l < m; ++l)
  33688. g = e[l],
  33689. g < 128 && C.push(B(g));
  33690. for (n = o = C.length,
  33691. o && C.push(M); n < m; ) {
  33692. for (c = I,
  33693. l = 0; l < m; ++l)
  33694. g = e[l],
  33695. g >= t && g < c && (c = g);
  33696. for (v = n + 1,
  33697. c - t > N((I - i) / v) && r("overflow"),
  33698. i += (c - t) * v,
  33699. t = c,
  33700. l = 0; l < m; ++l)
  33701. if (g = e[l],
  33702. g < t && ++i > I && r("overflow"),
  33703. g == t) {
  33704. for (d = i,
  33705. p = E; f = p <= a ? b : p >= a + w ? w : p - a,
  33706. !(d < f); p += E)
  33707. y = d - f,
  33708. A = E - f,
  33709. C.push(B(h(f + y % A, 0))),
  33710. d = N(y / A);
  33711. C.push(B(h(d, 0))),
  33712. a = u(i, v, n == o),
  33713. i = 0,
  33714. ++n
  33715. }
  33716. ++i,
  33717. ++t
  33718. }
  33719. return C.join("")
  33720. }
  33721. function f(e) {
  33722. return a(e, function(e) {
  33723. return R.test(e) ? d(e.slice(4).toLowerCase()) : e
  33724. })
  33725. }
  33726. function g(e) {
  33727. return a(e, function(e) {
  33728. return P.test(e) ? "xn--" + p(e) : e
  33729. })
  33730. }
  33731. var m = "object" == typeof i && i && !i.nodeType && i
  33732. , v = "object" == typeof t && t && !t.nodeType && t
  33733. , A = "object" == typeof e && e;
  33734. A.global !== A && A.window !== A && A.self !== A || (n = A);
  33735. 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 = {
  33736. overflow: "Overflow: input needs wider integers to process",
  33737. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  33738. "invalid-input": "Invalid input"
  33739. }, D = E - b, N = Math.floor, B = String.fromCharCode;
  33740. if (y = {
  33741. version: "1.4.1",
  33742. ucs2: {
  33743. decode: s,
  33744. encode: l
  33745. },
  33746. decode: d,
  33747. encode: p,
  33748. toASCII: g,
  33749. toUnicode: f
  33750. },
  33751. "function" == typeof define && "object" == typeof define.amd && define.amd)
  33752. define("punycode", function() {
  33753. return y
  33754. });
  33755. else if (m && v)
  33756. if (t.exports == m)
  33757. v.exports = y;
  33758. else
  33759. for (C in y)
  33760. y.hasOwnProperty(C) && (m[C] = y[C]);
  33761. else
  33762. n.punycode = y
  33763. }(this)
  33764. }
  33765. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  33766. }
  33767. , {}],
  33768. 205: [function(e, t, i) {
  33769. "use strict";
  33770. function n(e, t) {
  33771. return Object.prototype.hasOwnProperty.call(e, t)
  33772. }
  33773. t.exports = function(e, t, i, o) {
  33774. t = t || "&",
  33775. i = i || "=";
  33776. var a = {};
  33777. if ("string" != typeof e || 0 === e.length)
  33778. return a;
  33779. var s = /\+/g;
  33780. e = e.split(t);
  33781. var l = 1e3;
  33782. o && "number" == typeof o.maxKeys && (l = o.maxKeys);
  33783. var c = e.length;
  33784. l > 0 && c > l && (c = l);
  33785. for (var h = 0; h < c; ++h) {
  33786. var u, d, p, f, g = e[h].replace(s, "%20"), m = g.indexOf(i);
  33787. m >= 0 ? (u = g.substr(0, m),
  33788. d = g.substr(m + 1)) : (u = g,
  33789. d = ""),
  33790. p = decodeURIComponent(u),
  33791. f = decodeURIComponent(d),
  33792. n(a, p) ? r(a[p]) ? a[p].push(f) : a[p] = [a[p], f] : a[p] = f
  33793. }
  33794. return a
  33795. }
  33796. ;
  33797. var r = Array.isArray || function(e) {
  33798. return "[object Array]" === Object.prototype.toString.call(e)
  33799. }
  33800. }
  33801. , {}],
  33802. 206: [function(e, t, i) {
  33803. "use strict";
  33804. function n(e, t) {
  33805. if (e.map)
  33806. return e.map(t);
  33807. for (var i = [], n = 0; n < e.length; n++)
  33808. i.push(t(e[n], n));
  33809. return i
  33810. }
  33811. var r = function(e) {
  33812. switch (typeof e) {
  33813. case "string":
  33814. return e;
  33815. case "boolean":
  33816. return e ? "true" : "false";
  33817. case "number":
  33818. return isFinite(e) ? e : "";
  33819. default:
  33820. return ""
  33821. }
  33822. };
  33823. t.exports = function(e, t, i, s) {
  33824. return t = t || "&",
  33825. i = i || "=",
  33826. null === e && (e = void 0),
  33827. "object" == typeof e ? n(a(e), function(a) {
  33828. var s = encodeURIComponent(r(a)) + i;
  33829. return o(e[a]) ? n(e[a], function(e) {
  33830. return s + encodeURIComponent(r(e))
  33831. }).join(t) : s + encodeURIComponent(r(e[a]))
  33832. }).join(t) : s ? encodeURIComponent(r(s)) + i + encodeURIComponent(r(e)) : ""
  33833. }
  33834. ;
  33835. var o = Array.isArray || function(e) {
  33836. return "[object Array]" === Object.prototype.toString.call(e)
  33837. }
  33838. , a = Object.keys || function(e) {
  33839. var t = [];
  33840. for (var i in e)
  33841. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  33842. return t
  33843. }
  33844. }
  33845. , {}],
  33846. 207: [function(e, t, i) {
  33847. "use strict";
  33848. i.decode = i.parse = e("./decode"),
  33849. i.encode = i.stringify = e("./encode")
  33850. }
  33851. , {
  33852. "./decode": 205,
  33853. "./encode": 206
  33854. }],
  33855. 208: [function(e, t, i) {
  33856. "use strict";
  33857. function n() {
  33858. this.protocol = null,
  33859. this.slashes = null,
  33860. this.auth = null,
  33861. this.host = null,
  33862. this.port = null,
  33863. this.hostname = null,
  33864. this.hash = null,
  33865. this.search = null,
  33866. this.query = null,
  33867. this.pathname = null,
  33868. this.path = null,
  33869. this.href = null
  33870. }
  33871. function r(e, t, i) {
  33872. if (e && c.isObject(e) && e instanceof n)
  33873. return e;
  33874. var r = new n;
  33875. return r.parse(e, t, i),
  33876. r
  33877. }
  33878. function o(e) {
  33879. return c.isString(e) && (e = r(e)),
  33880. e instanceof n ? e.format() : n.prototype.format.call(e)
  33881. }
  33882. function a(e, t) {
  33883. return r(e, !1, !0).resolve(t)
  33884. }
  33885. function s(e, t) {
  33886. return e ? r(e, !1, !0).resolveObject(t) : t
  33887. }
  33888. var l = e("punycode")
  33889. , c = e("./util");
  33890. i.parse = r,
  33891. i.resolve = a,
  33892. i.resolveObject = s,
  33893. i.format = o,
  33894. i.Url = n;
  33895. var h = /^([a-z0-9.+-]+:)/i
  33896. , u = /:[0-9]*$/
  33897. , d = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  33898. , p = ["<", ">", '"', "`", " ", "\r", "\n", "\t"]
  33899. , f = ["{", "}", "|", "\\", "^", "`"].concat(p)
  33900. , g = ["'"].concat(f)
  33901. , m = ["%", "/", "?", ";", "#"].concat(g)
  33902. , v = ["/", "?", "#"]
  33903. , A = 255
  33904. , y = /^[+a-z0-9A-Z_-]{0,63}$/
  33905. , C = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  33906. , I = {
  33907. javascript: !0,
  33908. "javascript:": !0
  33909. }
  33910. , E = {
  33911. javascript: !0,
  33912. "javascript:": !0
  33913. }
  33914. , b = {
  33915. http: !0,
  33916. https: !0,
  33917. ftp: !0,
  33918. gopher: !0,
  33919. file: !0,
  33920. "http:": !0,
  33921. "https:": !0,
  33922. "ftp:": !0,
  33923. "gopher:": !0,
  33924. "file:": !0
  33925. }
  33926. , w = e("querystring");
  33927. n.prototype.parse = function(e, t, i) {
  33928. if (!c.isString(e))
  33929. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  33930. var n = e.indexOf("?")
  33931. , r = n !== -1 && n < e.indexOf("#") ? "?" : "#"
  33932. , o = e.split(r)
  33933. , a = /\\/g;
  33934. o[0] = o[0].replace(a, "/"),
  33935. e = o.join(r);
  33936. var s = e;
  33937. if (s = s.trim(),
  33938. !i && 1 === e.split("#").length) {
  33939. var u = d.exec(s);
  33940. if (u)
  33941. return this.path = s,
  33942. this.href = s,
  33943. this.pathname = u[1],
  33944. u[2] ? (this.search = u[2],
  33945. t ? this.query = w.parse(this.search.substr(1)) : this.query = this.search.substr(1)) : t && (this.search = "",
  33946. this.query = {}),
  33947. this
  33948. }
  33949. var p = h.exec(s);
  33950. if (p) {
  33951. p = p[0];
  33952. var f = p.toLowerCase();
  33953. this.protocol = f,
  33954. s = s.substr(p.length)
  33955. }
  33956. if (i || p || s.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  33957. var _ = "//" === s.substr(0, 2);
  33958. !_ || p && E[p] || (s = s.substr(2),
  33959. this.slashes = !0)
  33960. }
  33961. if (!E[p] && (_ || p && !b[p])) {
  33962. for (var T = -1, x = 0; x < v.length; x++) {
  33963. var S = s.indexOf(v[x]);
  33964. S !== -1 && (T === -1 || S < T) && (T = S)
  33965. }
  33966. var M, R;
  33967. R = T === -1 ? s.lastIndexOf("@") : s.lastIndexOf("@", T),
  33968. R !== -1 && (M = s.slice(0, R),
  33969. s = s.slice(R + 1),
  33970. this.auth = decodeURIComponent(M)),
  33971. T = -1;
  33972. for (var x = 0; x < m.length; x++) {
  33973. var S = s.indexOf(m[x]);
  33974. S !== -1 && (T === -1 || S < T) && (T = S)
  33975. }
  33976. T === -1 && (T = s.length),
  33977. this.host = s.slice(0, T),
  33978. s = s.slice(T),
  33979. this.parseHost(),
  33980. this.hostname = this.hostname || "";
  33981. var P = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  33982. if (!P)
  33983. for (var O = this.hostname.split(/\./), x = 0, L = O.length; x < L; x++) {
  33984. var D = O[x];
  33985. if (D && !D.match(y)) {
  33986. for (var N = "", B = 0, F = D.length; B < F; B++)
  33987. N += D.charCodeAt(B) > 127 ? "x" : D[B];
  33988. if (!N.match(y)) {
  33989. var V = O.slice(0, x)
  33990. , U = O.slice(x + 1)
  33991. , k = D.match(C);
  33992. k && (V.push(k[1]),
  33993. U.unshift(k[2])),
  33994. U.length && (s = "/" + U.join(".") + s),
  33995. this.hostname = V.join(".");
  33996. break
  33997. }
  33998. }
  33999. }
  34000. this.hostname.length > A ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  34001. P || (this.hostname = l.toASCII(this.hostname));
  34002. var H = this.port ? ":" + this.port : ""
  34003. , G = this.hostname || "";
  34004. this.host = G + H,
  34005. this.href += this.host,
  34006. P && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  34007. "/" !== s[0] && (s = "/" + s))
  34008. }
  34009. if (!I[f])
  34010. for (var x = 0, L = g.length; x < L; x++) {
  34011. var z = g[x];
  34012. if (s.indexOf(z) !== -1) {
  34013. var W = encodeURIComponent(z);
  34014. W === z && (W = escape(z)),
  34015. s = s.split(z).join(W)
  34016. }
  34017. }
  34018. var j = s.indexOf("#");
  34019. j !== -1 && (this.hash = s.substr(j),
  34020. s = s.slice(0, j));
  34021. var Y = s.indexOf("?");
  34022. if (Y !== -1 ? (this.search = s.substr(Y),
  34023. this.query = s.substr(Y + 1),
  34024. t && (this.query = w.parse(this.query)),
  34025. s = s.slice(0, Y)) : t && (this.search = "",
  34026. this.query = {}),
  34027. s && (this.pathname = s),
  34028. b[f] && this.hostname && !this.pathname && (this.pathname = "/"),
  34029. this.pathname || this.search) {
  34030. var H = this.pathname || ""
  34031. , X = this.search || "";
  34032. this.path = H + X
  34033. }
  34034. return this.href = this.format(),
  34035. this
  34036. }
  34037. ,
  34038. n.prototype.format = function() {
  34039. var e = this.auth || "";
  34040. e && (e = encodeURIComponent(e),
  34041. e = e.replace(/%3A/i, ":"),
  34042. e += "@");
  34043. var t = this.protocol || ""
  34044. , i = this.pathname || ""
  34045. , n = this.hash || ""
  34046. , r = !1
  34047. , o = "";
  34048. this.host ? r = e + this.host : this.hostname && (r = e + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]"),
  34049. this.port && (r += ":" + this.port)),
  34050. this.query && c.isObject(this.query) && Object.keys(this.query).length && (o = w.stringify(this.query));
  34051. var a = this.search || o && "?" + o || "";
  34052. return t && ":" !== t.substr(-1) && (t += ":"),
  34053. this.slashes || (!t || b[t]) && r !== !1 ? (r = "//" + (r || ""),
  34054. i && "/" !== i.charAt(0) && (i = "/" + i)) : r || (r = ""),
  34055. n && "#" !== n.charAt(0) && (n = "#" + n),
  34056. a && "?" !== a.charAt(0) && (a = "?" + a),
  34057. i = i.replace(/[?#]/g, function(e) {
  34058. return encodeURIComponent(e)
  34059. }),
  34060. a = a.replace("#", "%23"),
  34061. t + r + i + a + n
  34062. }
  34063. ,
  34064. n.prototype.resolve = function(e) {
  34065. return this.resolveObject(r(e, !1, !0)).format()
  34066. }
  34067. ,
  34068. n.prototype.resolveObject = function(e) {
  34069. if (c.isString(e)) {
  34070. var t = new n;
  34071. t.parse(e, !1, !0),
  34072. e = t
  34073. }
  34074. for (var i = new n, r = Object.keys(this), o = 0; o < r.length; o++) {
  34075. var a = r[o];
  34076. i[a] = this[a]
  34077. }
  34078. if (i.hash = e.hash,
  34079. "" === e.href)
  34080. return i.href = i.format(),
  34081. i;
  34082. if (e.slashes && !e.protocol) {
  34083. for (var s = Object.keys(e), l = 0; l < s.length; l++) {
  34084. var h = s[l];
  34085. "protocol" !== h && (i[h] = e[h])
  34086. }
  34087. return b[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  34088. i.href = i.format(),
  34089. i
  34090. }
  34091. if (e.protocol && e.protocol !== i.protocol) {
  34092. if (!b[e.protocol]) {
  34093. for (var u = Object.keys(e), d = 0; d < u.length; d++) {
  34094. var p = u[d];
  34095. i[p] = e[p]
  34096. }
  34097. return i.href = i.format(),
  34098. i
  34099. }
  34100. if (i.protocol = e.protocol,
  34101. e.host || E[e.protocol])
  34102. i.pathname = e.pathname;
  34103. else {
  34104. for (var f = (e.pathname || "").split("/"); f.length && !(e.host = f.shift()); )
  34105. ;
  34106. e.host || (e.host = ""),
  34107. e.hostname || (e.hostname = ""),
  34108. "" !== f[0] && f.unshift(""),
  34109. f.length < 2 && f.unshift(""),
  34110. i.pathname = f.join("/")
  34111. }
  34112. if (i.search = e.search,
  34113. i.query = e.query,
  34114. i.host = e.host || "",
  34115. i.auth = e.auth,
  34116. i.hostname = e.hostname || e.host,
  34117. i.port = e.port,
  34118. i.pathname || i.search) {
  34119. var g = i.pathname || ""
  34120. , m = i.search || "";
  34121. i.path = g + m
  34122. }
  34123. return i.slashes = i.slashes || e.slashes,
  34124. i.href = i.format(),
  34125. i
  34126. }
  34127. var v = i.pathname && "/" === i.pathname.charAt(0)
  34128. , A = e.host || e.pathname && "/" === e.pathname.charAt(0)
  34129. , y = A || v || i.host && e.pathname
  34130. , C = y
  34131. , I = i.pathname && i.pathname.split("/") || []
  34132. , f = e.pathname && e.pathname.split("/") || []
  34133. , w = i.protocol && !b[i.protocol];
  34134. if (w && (i.hostname = "",
  34135. i.port = null,
  34136. i.host && ("" === I[0] ? I[0] = i.host : I.unshift(i.host)),
  34137. i.host = "",
  34138. e.protocol && (e.hostname = null,
  34139. e.port = null,
  34140. e.host && ("" === f[0] ? f[0] = e.host : f.unshift(e.host)),
  34141. e.host = null),
  34142. y = y && ("" === f[0] || "" === I[0])),
  34143. A)
  34144. i.host = e.host || "" === e.host ? e.host : i.host,
  34145. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  34146. i.search = e.search,
  34147. i.query = e.query,
  34148. I = f;
  34149. else if (f.length)
  34150. I || (I = []),
  34151. I.pop(),
  34152. I = I.concat(f),
  34153. i.search = e.search,
  34154. i.query = e.query;
  34155. else if (!c.isNullOrUndefined(e.search)) {
  34156. if (w) {
  34157. i.hostname = i.host = I.shift();
  34158. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  34159. _ && (i.auth = _.shift(),
  34160. i.host = i.hostname = _.shift())
  34161. }
  34162. return i.search = e.search,
  34163. i.query = e.query,
  34164. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  34165. i.href = i.format(),
  34166. i
  34167. }
  34168. if (!I.length)
  34169. return i.pathname = null,
  34170. i.search ? i.path = "/" + i.search : i.path = null,
  34171. i.href = i.format(),
  34172. i;
  34173. 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--)
  34174. T = I[M],
  34175. "." === T ? I.splice(M, 1) : ".." === T ? (I.splice(M, 1),
  34176. S++) : S && (I.splice(M, 1),
  34177. S--);
  34178. if (!y && !C)
  34179. for (; S--; S)
  34180. I.unshift("..");
  34181. !y || "" === I[0] || I[0] && "/" === I[0].charAt(0) || I.unshift(""),
  34182. x && "/" !== I.join("/").substr(-1) && I.push("");
  34183. var R = "" === I[0] || I[0] && "/" === I[0].charAt(0);
  34184. if (w) {
  34185. i.hostname = i.host = R ? "" : I.length ? I.shift() : "";
  34186. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  34187. _ && (i.auth = _.shift(),
  34188. i.host = i.hostname = _.shift())
  34189. }
  34190. return y = y || i.host && I.length,
  34191. y && !R && I.unshift(""),
  34192. I.length ? i.pathname = I.join("/") : (i.pathname = null,
  34193. i.path = null),
  34194. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  34195. i.auth = e.auth || i.auth,
  34196. i.slashes = i.slashes || e.slashes,
  34197. i.href = i.format(),
  34198. i
  34199. }
  34200. ,
  34201. n.prototype.parseHost = function() {
  34202. var e = this.host
  34203. , t = u.exec(e);
  34204. t && (t = t[0],
  34205. ":" !== t && (this.port = t.substr(1)),
  34206. e = e.substr(0, e.length - t.length)),
  34207. e && (this.hostname = e)
  34208. }
  34209. }
  34210. , {
  34211. "./util": 209,
  34212. punycode: 204,
  34213. querystring: 207
  34214. }],
  34215. 209: [function(e, t, i) {
  34216. "use strict";
  34217. t.exports = {
  34218. isString: function(e) {
  34219. return "string" == typeof e
  34220. },
  34221. isObject: function(e) {
  34222. return "object" == typeof e && null !== e
  34223. },
  34224. isNull: function(e) {
  34225. return null === e
  34226. },
  34227. isNullOrUndefined: function(e) {
  34228. return null == e
  34229. }
  34230. }
  34231. }
  34232. , {}],
  34233. 210: [function(e, t, i) {
  34234. "use strict";
  34235. function n(e) {
  34236. return l + e
  34237. }
  34238. function r(e) {
  34239. return e.substring(l.length)
  34240. }
  34241. function o(e, t) {
  34242. for (var i in t)
  34243. Object.defineProperty(e, i, {
  34244. value: t[i],
  34245. configurable: !0,
  34246. writable: !0
  34247. })
  34248. }
  34249. function a(e) {
  34250. if ("string" != typeof e)
  34251. throw new TypeError("key must be a string.")
  34252. }
  34253. var s = Object.prototype.hasOwnProperty
  34254. , l = "~";
  34255. t.exports = function(e) {
  34256. var t = Object.create(null)
  34257. , i = 0
  34258. , l = {};
  34259. return o(l, {
  34260. get: function(e, i) {
  34261. a(e);
  34262. var r = n(e);
  34263. return r in t ? t[r] : i
  34264. },
  34265. set: function(e, r) {
  34266. a(e);
  34267. var o = n(e);
  34268. return o in t || ++i,
  34269. t[o] = r
  34270. },
  34271. has: function(e) {
  34272. return a(e),
  34273. n(e)in t
  34274. },
  34275. delete: function(e) {
  34276. a(e);
  34277. var r = n(e);
  34278. return r in t && (--i,
  34279. delete t[r],
  34280. !0)
  34281. },
  34282. clear: function() {
  34283. t = Object.create(null),
  34284. i = 0
  34285. },
  34286. forEach: function(e, i) {
  34287. if ("function" != typeof e)
  34288. throw new TypeError("`callback` must be a function");
  34289. for (var n in t)
  34290. if (s.call(t, n)) {
  34291. var o = r(n)
  34292. , a = t[n];
  34293. e.call(i, a, o, l)
  34294. }
  34295. }
  34296. }),
  34297. Object.defineProperty(l, "size", {
  34298. get: function() {
  34299. return i
  34300. },
  34301. configurable: !0
  34302. }),
  34303. "object" == typeof e && null !== e && Object.keys(e).forEach(function(t) {
  34304. l.set(t, e[t])
  34305. }),
  34306. l
  34307. }
  34308. }
  34309. , {}],
  34310. 211: [function(e, t, i) {
  34311. t.exports = e("./lib/heap")
  34312. }
  34313. , {
  34314. "./lib/heap": 212
  34315. }],
  34316. 212: [function(e, t, i) {
  34317. (function() {
  34318. var e, n, r, o, a, s, l, c, h, u, d, p, f, g, m;
  34319. r = Math.floor,
  34320. u = Math.min,
  34321. n = function(e, t) {
  34322. return e < t ? -1 : e > t ? 1 : 0
  34323. }
  34324. ,
  34325. h = function(e, t, i, o, a) {
  34326. var s;
  34327. if (null == i && (i = 0),
  34328. null == a && (a = n),
  34329. i < 0)
  34330. throw new Error("lo must be non-negative");
  34331. for (null == o && (o = e.length); i < o; )
  34332. s = r((i + o) / 2),
  34333. a(t, e[s]) < 0 ? o = s : i = s + 1;
  34334. return [].splice.apply(e, [i, i - i].concat(t)),
  34335. t
  34336. }
  34337. ,
  34338. s = function(e, t, i) {
  34339. return null == i && (i = n),
  34340. e.push(t),
  34341. g(e, 0, e.length - 1, i)
  34342. }
  34343. ,
  34344. a = function(e, t) {
  34345. var i, r;
  34346. return null == t && (t = n),
  34347. i = e.pop(),
  34348. e.length ? (r = e[0],
  34349. e[0] = i,
  34350. m(e, 0, t)) : r = i,
  34351. r
  34352. }
  34353. ,
  34354. c = function(e, t, i) {
  34355. var r;
  34356. return null == i && (i = n),
  34357. r = e[0],
  34358. e[0] = t,
  34359. m(e, 0, i),
  34360. r
  34361. }
  34362. ,
  34363. l = function(e, t, i) {
  34364. var r;
  34365. return null == i && (i = n),
  34366. e.length && i(e[0], t) < 0 && (r = [e[0], t],
  34367. t = r[0],
  34368. e[0] = r[1],
  34369. m(e, 0, i)),
  34370. t
  34371. }
  34372. ,
  34373. o = function(e, t) {
  34374. var i, o, a, s, l, c;
  34375. for (null == t && (t = n),
  34376. s = function() {
  34377. c = [];
  34378. for (var t = 0, i = r(e.length / 2); 0 <= i ? t < i : t > i; 0 <= i ? t++ : t--)
  34379. c.push(t);
  34380. return c
  34381. }
  34382. .apply(this).reverse(),
  34383. l = [],
  34384. o = 0,
  34385. a = s.length; o < a; o++)
  34386. i = s[o],
  34387. l.push(m(e, i, t));
  34388. return l
  34389. }
  34390. ,
  34391. f = function(e, t, i) {
  34392. var r;
  34393. if (null == i && (i = n),
  34394. r = e.indexOf(t),
  34395. r !== -1)
  34396. return g(e, 0, r, i),
  34397. m(e, r, i)
  34398. }
  34399. ,
  34400. d = function(e, t, i) {
  34401. var r, a, s, c, h;
  34402. if (null == i && (i = n),
  34403. a = e.slice(0, t),
  34404. !a.length)
  34405. return a;
  34406. for (o(a, i),
  34407. h = e.slice(t),
  34408. s = 0,
  34409. c = h.length; s < c; s++)
  34410. r = h[s],
  34411. l(a, r, i);
  34412. return a.sort(i).reverse()
  34413. }
  34414. ,
  34415. p = function(e, t, i) {
  34416. var r, s, l, c, d, p, f, g, m, v;
  34417. if (null == i && (i = n),
  34418. 10 * t <= e.length) {
  34419. if (c = e.slice(0, t).sort(i),
  34420. !c.length)
  34421. return c;
  34422. for (l = c[c.length - 1],
  34423. g = e.slice(t),
  34424. d = 0,
  34425. f = g.length; d < f; d++)
  34426. r = g[d],
  34427. i(r, l) < 0 && (h(c, r, 0, null, i),
  34428. c.pop(),
  34429. l = c[c.length - 1]);
  34430. return c
  34431. }
  34432. for (o(e, i),
  34433. v = [],
  34434. s = p = 0,
  34435. m = u(t, e.length); 0 <= m ? p < m : p > m; s = 0 <= m ? ++p : --p)
  34436. v.push(a(e, i));
  34437. return v
  34438. }
  34439. ,
  34440. g = function(e, t, i, r) {
  34441. var o, a, s;
  34442. for (null == r && (r = n),
  34443. o = e[i]; i > t && (s = i - 1 >> 1,
  34444. a = e[s],
  34445. r(o, a) < 0); )
  34446. e[i] = a,
  34447. i = s;
  34448. return e[i] = o
  34449. }
  34450. ,
  34451. m = function(e, t, i) {
  34452. var r, o, a, s, l;
  34453. for (null == i && (i = n),
  34454. o = e.length,
  34455. l = t,
  34456. a = e[t],
  34457. r = 2 * t + 1; r < o; )
  34458. s = r + 1,
  34459. s < o && !(i(e[r], e[s]) < 0) && (r = s),
  34460. e[t] = e[r],
  34461. t = r,
  34462. r = 2 * t + 1;
  34463. return e[t] = a,
  34464. g(e, l, t, i)
  34465. }
  34466. ,
  34467. e = function() {
  34468. function e(e) {
  34469. this.cmp = null != e ? e : n,
  34470. this.nodes = []
  34471. }
  34472. return e.push = s,
  34473. e.pop = a,
  34474. e.replace = c,
  34475. e.pushpop = l,
  34476. e.heapify = o,
  34477. e.updateItem = f,
  34478. e.nlargest = d,
  34479. e.nsmallest = p,
  34480. e.prototype.push = function(e) {
  34481. return s(this.nodes, e, this.cmp)
  34482. }
  34483. ,
  34484. e.prototype.pop = function() {
  34485. return a(this.nodes, this.cmp)
  34486. }
  34487. ,
  34488. e.prototype.peek = function() {
  34489. return this.nodes[0]
  34490. }
  34491. ,
  34492. e.prototype.contains = function(e) {
  34493. return this.nodes.indexOf(e) !== -1
  34494. }
  34495. ,
  34496. e.prototype.replace = function(e) {
  34497. return c(this.nodes, e, this.cmp)
  34498. }
  34499. ,
  34500. e.prototype.pushpop = function(e) {
  34501. return l(this.nodes, e, this.cmp)
  34502. }
  34503. ,
  34504. e.prototype.heapify = function() {
  34505. return o(this.nodes, this.cmp)
  34506. }
  34507. ,
  34508. e.prototype.updateItem = function(e) {
  34509. return f(this.nodes, e, this.cmp)
  34510. }
  34511. ,
  34512. e.prototype.clear = function() {
  34513. return this.nodes = []
  34514. }
  34515. ,
  34516. e.prototype.empty = function() {
  34517. return 0 === this.nodes.length
  34518. }
  34519. ,
  34520. e.prototype.size = function() {
  34521. return this.nodes.length
  34522. }
  34523. ,
  34524. e.prototype.clone = function() {
  34525. var t;
  34526. return t = new e,
  34527. t.nodes = this.nodes.slice(0),
  34528. t
  34529. }
  34530. ,
  34531. e.prototype.toArray = function() {
  34532. return this.nodes.slice(0)
  34533. }
  34534. ,
  34535. e.prototype.insert = e.prototype.push,
  34536. e.prototype.top = e.prototype.peek,
  34537. e.prototype.front = e.prototype.peek,
  34538. e.prototype.has = e.prototype.contains,
  34539. e.prototype.copy = e.prototype.clone,
  34540. e
  34541. }(),
  34542. function(e, n) {
  34543. return "function" == typeof define && define.amd ? define([], n) : "object" == typeof i ? t.exports = n() : e.Heap = n()
  34544. }(this, function() {
  34545. return e
  34546. })
  34547. }
  34548. ).call(this)
  34549. }
  34550. , {}],
  34551. 213: [function(e, t, i) {
  34552. !function(e) {
  34553. function i() {}
  34554. function n(e, t) {
  34555. return function() {
  34556. e.apply(t, arguments)
  34557. }
  34558. }
  34559. function r(e) {
  34560. if ("object" != typeof this)
  34561. throw new TypeError("Promises must be constructed via new");
  34562. if ("function" != typeof e)
  34563. throw new TypeError("not a function");
  34564. this._state = 0,
  34565. this._handled = !1,
  34566. this._value = void 0,
  34567. this._deferreds = [],
  34568. h(e, this)
  34569. }
  34570. function o(e, t) {
  34571. for (; 3 === e._state; )
  34572. e = e._value;
  34573. return 0 === e._state ? void e._deferreds.push(t) : (e._handled = !0,
  34574. void r._immediateFn(function() {
  34575. var i = 1 === e._state ? t.onFulfilled : t.onRejected;
  34576. if (null === i)
  34577. return void (1 === e._state ? a : s)(t.promise, e._value);
  34578. var n;
  34579. try {
  34580. n = i(e._value)
  34581. } catch (e) {
  34582. return void s(t.promise, e)
  34583. }
  34584. a(t.promise, n)
  34585. }))
  34586. }
  34587. function a(e, t) {
  34588. try {
  34589. if (t === e)
  34590. throw new TypeError("A promise cannot be resolved with itself.");
  34591. if (t && ("object" == typeof t || "function" == typeof t)) {
  34592. var i = t.then;
  34593. if (t instanceof r)
  34594. return e._state = 3,
  34595. e._value = t,
  34596. void l(e);
  34597. if ("function" == typeof i)
  34598. return void h(n(i, t), e)
  34599. }
  34600. e._state = 1,
  34601. e._value = t,
  34602. l(e)
  34603. } catch (t) {
  34604. s(e, t)
  34605. }
  34606. }
  34607. function s(e, t) {
  34608. e._state = 2,
  34609. e._value = t,
  34610. l(e)
  34611. }
  34612. function l(e) {
  34613. 2 === e._state && 0 === e._deferreds.length && r._immediateFn(function() {
  34614. e._handled || r._unhandledRejectionFn(e._value)
  34615. });
  34616. for (var t = 0, i = e._deferreds.length; t < i; t++)
  34617. o(e, e._deferreds[t]);
  34618. e._deferreds = null
  34619. }
  34620. function c(e, t, i) {
  34621. this.onFulfilled = "function" == typeof e ? e : null,
  34622. this.onRejected = "function" == typeof t ? t : null,
  34623. this.promise = i
  34624. }
  34625. function h(e, t) {
  34626. var i = !1;
  34627. try {
  34628. e(function(e) {
  34629. i || (i = !0,
  34630. a(t, e))
  34631. }, function(e) {
  34632. i || (i = !0,
  34633. s(t, e))
  34634. })
  34635. } catch (e) {
  34636. if (i)
  34637. return;
  34638. i = !0,
  34639. s(t, e)
  34640. }
  34641. }
  34642. var u = setTimeout;
  34643. r.prototype.catch = function(e) {
  34644. return this.then(null, e)
  34645. }
  34646. ,
  34647. r.prototype.then = function(e, t) {
  34648. var n = new this.constructor(i);
  34649. return o(this, new c(e,t,n)),
  34650. n
  34651. }
  34652. ,
  34653. r.all = function(e) {
  34654. var t = Array.prototype.slice.call(e);
  34655. return new r(function(e, i) {
  34656. function n(o, a) {
  34657. try {
  34658. if (a && ("object" == typeof a || "function" == typeof a)) {
  34659. var s = a.then;
  34660. if ("function" == typeof s)
  34661. return void s.call(a, function(e) {
  34662. n(o, e)
  34663. }, i)
  34664. }
  34665. t[o] = a,
  34666. 0 === --r && e(t)
  34667. } catch (e) {
  34668. i(e)
  34669. }
  34670. }
  34671. if (0 === t.length)
  34672. return e([]);
  34673. for (var r = t.length, o = 0; o < t.length; o++)
  34674. n(o, t[o])
  34675. }
  34676. )
  34677. }
  34678. ,
  34679. r.resolve = function(e) {
  34680. return e && "object" == typeof e && e.constructor === r ? e : new r(function(t) {
  34681. t(e)
  34682. }
  34683. )
  34684. }
  34685. ,
  34686. r.reject = function(e) {
  34687. return new r(function(t, i) {
  34688. i(e)
  34689. }
  34690. )
  34691. }
  34692. ,
  34693. r.race = function(e) {
  34694. return new r(function(t, i) {
  34695. for (var n = 0, r = e.length; n < r; n++)
  34696. e[n].then(t, i)
  34697. }
  34698. )
  34699. }
  34700. ,
  34701. r._immediateFn = "function" == typeof setImmediate && function(e) {
  34702. setImmediate(e)
  34703. }
  34704. || function(e) {
  34705. u(e, 0)
  34706. }
  34707. ,
  34708. r._unhandledRejectionFn = function(e) {
  34709. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  34710. }
  34711. ,
  34712. r._setImmediateFn = function(e) {
  34713. r._immediateFn = e
  34714. }
  34715. ,
  34716. r._setUnhandledRejectionFn = function(e) {
  34717. r._unhandledRejectionFn = e
  34718. }
  34719. ,
  34720. "undefined" != typeof t && t.exports ? t.exports = r : e.Promise || (e.Promise = r)
  34721. }(this)
  34722. }
  34723. , {}],
  34724. 214: [function(e, t, i) {
  34725. (function(i) {
  34726. !function(i, n) {
  34727. "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)
  34728. }(this, function(t, n) {
  34729. "use strict";
  34730. var r = {};
  34731. return r.ByteBuffer = t,
  34732. r.Long = t.Long || null,
  34733. r.VERSION = "5.0.1",
  34734. r.WIRE_TYPES = {},
  34735. r.WIRE_TYPES.VARINT = 0,
  34736. r.WIRE_TYPES.BITS64 = 1,
  34737. r.WIRE_TYPES.LDELIM = 2,
  34738. r.WIRE_TYPES.STARTGROUP = 3,
  34739. r.WIRE_TYPES.ENDGROUP = 4,
  34740. r.WIRE_TYPES.BITS32 = 5,
  34741. r.PACKABLE_WIRE_TYPES = [r.WIRE_TYPES.VARINT, r.WIRE_TYPES.BITS64, r.WIRE_TYPES.BITS32],
  34742. r.TYPES = {
  34743. int32: {
  34744. name: "int32",
  34745. wireType: r.WIRE_TYPES.VARINT,
  34746. defaultValue: 0
  34747. },
  34748. uint32: {
  34749. name: "uint32",
  34750. wireType: r.WIRE_TYPES.VARINT,
  34751. defaultValue: 0
  34752. },
  34753. sint32: {
  34754. name: "sint32",
  34755. wireType: r.WIRE_TYPES.VARINT,
  34756. defaultValue: 0
  34757. },
  34758. int64: {
  34759. name: "int64",
  34760. wireType: r.WIRE_TYPES.VARINT,
  34761. defaultValue: r.Long ? r.Long.ZERO : void 0
  34762. },
  34763. uint64: {
  34764. name: "uint64",
  34765. wireType: r.WIRE_TYPES.VARINT,
  34766. defaultValue: r.Long ? r.Long.UZERO : void 0
  34767. },
  34768. sint64: {
  34769. name: "sint64",
  34770. wireType: r.WIRE_TYPES.VARINT,
  34771. defaultValue: r.Long ? r.Long.ZERO : void 0
  34772. },
  34773. bool: {
  34774. name: "bool",
  34775. wireType: r.WIRE_TYPES.VARINT,
  34776. defaultValue: !1
  34777. },
  34778. double: {
  34779. name: "double",
  34780. wireType: r.WIRE_TYPES.BITS64,
  34781. defaultValue: 0
  34782. },
  34783. string: {
  34784. name: "string",
  34785. wireType: r.WIRE_TYPES.LDELIM,
  34786. defaultValue: ""
  34787. },
  34788. bytes: {
  34789. name: "bytes",
  34790. wireType: r.WIRE_TYPES.LDELIM,
  34791. defaultValue: null
  34792. },
  34793. fixed32: {
  34794. name: "fixed32",
  34795. wireType: r.WIRE_TYPES.BITS32,
  34796. defaultValue: 0
  34797. },
  34798. sfixed32: {
  34799. name: "sfixed32",
  34800. wireType: r.WIRE_TYPES.BITS32,
  34801. defaultValue: 0
  34802. },
  34803. fixed64: {
  34804. name: "fixed64",
  34805. wireType: r.WIRE_TYPES.BITS64,
  34806. defaultValue: r.Long ? r.Long.UZERO : void 0
  34807. },
  34808. sfixed64: {
  34809. name: "sfixed64",
  34810. wireType: r.WIRE_TYPES.BITS64,
  34811. defaultValue: r.Long ? r.Long.ZERO : void 0
  34812. },
  34813. float: {
  34814. name: "float",
  34815. wireType: r.WIRE_TYPES.BITS32,
  34816. defaultValue: 0
  34817. },
  34818. enum: {
  34819. name: "enum",
  34820. wireType: r.WIRE_TYPES.VARINT,
  34821. defaultValue: 0
  34822. },
  34823. message: {
  34824. name: "message",
  34825. wireType: r.WIRE_TYPES.LDELIM,
  34826. defaultValue: null
  34827. },
  34828. group: {
  34829. name: "group",
  34830. wireType: r.WIRE_TYPES.STARTGROUP,
  34831. defaultValue: null
  34832. }
  34833. },
  34834. 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],
  34835. r.ID_MIN = 1,
  34836. r.ID_MAX = 536870911,
  34837. r.convertFieldsToCamelCase = !1,
  34838. r.populateAccessors = !0,
  34839. r.populateDefaults = !0,
  34840. r.Util = function() {
  34841. var t = {};
  34842. return t.IS_NODE = !("object" != typeof i || i + "" != "[object process]" || i.browser),
  34843. t.XHR = function() {
  34844. for (var e = [function() {
  34845. return new XMLHttpRequest
  34846. }
  34847. , function() {
  34848. return new ActiveXObject("Msxml2.XMLHTTP")
  34849. }
  34850. , function() {
  34851. return new ActiveXObject("Msxml3.XMLHTTP")
  34852. }
  34853. , function() {
  34854. return new ActiveXObject("Microsoft.XMLHTTP")
  34855. }
  34856. ], t = null, i = 0; i < e.length; i++) {
  34857. try {
  34858. t = e[i]()
  34859. } catch (e) {
  34860. continue
  34861. }
  34862. break
  34863. }
  34864. if (!t)
  34865. throw Error("XMLHttpRequest is not supported");
  34866. return t
  34867. }
  34868. ,
  34869. t.fetch = function(i, n) {
  34870. if (n && "function" != typeof n && (n = null),
  34871. t.IS_NODE) {
  34872. var r = e("fs");
  34873. if (n)
  34874. r.readFile(i, function(e, t) {
  34875. n(e ? null : "" + t)
  34876. });
  34877. else
  34878. try {
  34879. return r.readFileSync(i)
  34880. } catch (e) {
  34881. return null
  34882. }
  34883. } else {
  34884. var o = t.XHR();
  34885. if (o.open("GET", i, !!n),
  34886. o.setRequestHeader("Accept", "text/plain"),
  34887. "function" == typeof o.overrideMimeType && o.overrideMimeType("text/plain"),
  34888. !n)
  34889. return o.send(null),
  34890. 200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null;
  34891. if (o.onreadystatechange = function() {
  34892. 4 == o.readyState && n(200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null)
  34893. }
  34894. ,
  34895. 4 == o.readyState)
  34896. return;
  34897. o.send(null)
  34898. }
  34899. }
  34900. ,
  34901. t.toCamelCase = function(e) {
  34902. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  34903. return t.toUpperCase()
  34904. })
  34905. }
  34906. ,
  34907. t
  34908. }(),
  34909. r.Lang = {
  34910. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  34911. RULE: /^(?:required|optional|repeated|map)$/,
  34912. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  34913. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  34914. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  34915. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  34916. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  34917. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  34918. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  34919. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  34920. NUMBER_OCT: /^0[0-7]+$/,
  34921. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  34922. BOOL: /^(?:true|false)$/i,
  34923. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  34924. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  34925. WHITESPACE: /\s/,
  34926. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  34927. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  34928. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  34929. },
  34930. r.DotProto = function(e, t) {
  34931. function i(e, i) {
  34932. var n = -1
  34933. , r = 1;
  34934. if ("-" == e.charAt(0) && (r = -1,
  34935. e = e.substring(1)),
  34936. t.NUMBER_DEC.test(e))
  34937. n = parseInt(e);
  34938. else if (t.NUMBER_HEX.test(e))
  34939. n = parseInt(e.substring(2), 16);
  34940. else {
  34941. if (!t.NUMBER_OCT.test(e))
  34942. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  34943. n = parseInt(e.substring(1), 8)
  34944. }
  34945. if (n = r * n | 0,
  34946. !i && n < 0)
  34947. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  34948. return n
  34949. }
  34950. function n(e) {
  34951. var i = 1;
  34952. if ("-" == e.charAt(0) && (i = -1,
  34953. e = e.substring(1)),
  34954. t.NUMBER_DEC.test(e))
  34955. return i * parseInt(e, 10);
  34956. if (t.NUMBER_HEX.test(e))
  34957. return i * parseInt(e.substring(2), 16);
  34958. if (t.NUMBER_OCT.test(e))
  34959. return i * parseInt(e.substring(1), 8);
  34960. if ("inf" === e)
  34961. return i * (1 / 0);
  34962. if ("nan" === e)
  34963. return NaN;
  34964. if (t.NUMBER_FLT.test(e))
  34965. return i * parseFloat(e);
  34966. throw Error("illegal number value: " + (i < 0 ? "-" : "") + e)
  34967. }
  34968. function r(e, t, i) {
  34969. "undefined" == typeof e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  34970. e[t].push(i))
  34971. }
  34972. var o = {}
  34973. , a = function(e) {
  34974. this.source = e + "",
  34975. this.index = 0,
  34976. this.line = 1,
  34977. this.stack = [],
  34978. this._stringOpen = null
  34979. }
  34980. , s = a.prototype;
  34981. s._readString = function() {
  34982. var e = '"' === this._stringOpen ? t.STRING_DQ : t.STRING_SQ;
  34983. e.lastIndex = this.index - 1;
  34984. var i = e.exec(this.source);
  34985. if (!i)
  34986. throw Error("unterminated string");
  34987. return this.index = e.lastIndex,
  34988. this.stack.push(this._stringOpen),
  34989. this._stringOpen = null,
  34990. i[1]
  34991. }
  34992. ,
  34993. s.next = function() {
  34994. if (this.stack.length > 0)
  34995. return this.stack.shift();
  34996. if (this.index >= this.source.length)
  34997. return null;
  34998. if (null !== this._stringOpen)
  34999. return this._readString();
  35000. var e, i, n;
  35001. do {
  35002. for (e = !1; t.WHITESPACE.test(n = this.source.charAt(this.index)); )
  35003. if ("\n" === n && ++this.line,
  35004. ++this.index === this.source.length)
  35005. return null;
  35006. if ("/" === this.source.charAt(this.index))
  35007. if (++this.index,
  35008. "/" === this.source.charAt(this.index)) {
  35009. for (; "\n" !== this.source.charAt(++this.index); )
  35010. if (this.index == this.source.length)
  35011. return null;
  35012. ++this.index,
  35013. ++this.line,
  35014. e = !0
  35015. } else {
  35016. if ("*" !== (n = this.source.charAt(this.index)))
  35017. return "/";
  35018. do {
  35019. if ("\n" === n && ++this.line,
  35020. ++this.index === this.source.length)
  35021. return null;
  35022. i = n,
  35023. n = this.source.charAt(this.index)
  35024. } while ("*" !== i || "/" !== n);++this.index,
  35025. e = !0
  35026. }
  35027. } while (e);if (this.index === this.source.length)
  35028. return null;
  35029. var r = this.index;
  35030. t.DELIM.lastIndex = 0;
  35031. var o = t.DELIM.test(this.source.charAt(r++));
  35032. if (!o)
  35033. for (; r < this.source.length && !t.DELIM.test(this.source.charAt(r)); )
  35034. ++r;
  35035. var a = this.source.substring(this.index, this.index = r);
  35036. return '"' !== a && "'" !== a || (this._stringOpen = a),
  35037. a
  35038. }
  35039. ,
  35040. s.peek = function() {
  35041. if (0 === this.stack.length) {
  35042. var e = this.next();
  35043. if (null === e)
  35044. return null;
  35045. this.stack.push(e)
  35046. }
  35047. return this.stack[0]
  35048. }
  35049. ,
  35050. s.skip = function(e) {
  35051. var t = this.next();
  35052. if (t !== e)
  35053. throw Error("illegal '" + t + "', '" + e + "' expected")
  35054. }
  35055. ,
  35056. s.omit = function(e) {
  35057. return this.peek() === e && (this.next(),
  35058. !0)
  35059. }
  35060. ,
  35061. s.toString = function() {
  35062. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  35063. }
  35064. ,
  35065. o.Tokenizer = a;
  35066. var l = function(e) {
  35067. this.tn = new a(e),
  35068. this.proto3 = !1
  35069. }
  35070. , c = l.prototype;
  35071. return c.parse = function() {
  35072. var e, i, n = {
  35073. name: "[ROOT]",
  35074. package: null,
  35075. messages: [],
  35076. enums: [],
  35077. imports: [],
  35078. options: {},
  35079. services: []
  35080. }, r = !0;
  35081. try {
  35082. for (; e = this.tn.next(); )
  35083. switch (e) {
  35084. case "package":
  35085. if (!r || null !== n.package)
  35086. throw Error("unexpected 'package'");
  35087. if (e = this.tn.next(),
  35088. !t.TYPEREF.test(e))
  35089. throw Error("illegal package name: " + e);
  35090. this.tn.skip(";"),
  35091. n.package = e;
  35092. break;
  35093. case "import":
  35094. if (!r)
  35095. throw Error("unexpected 'import'");
  35096. e = this.tn.peek(),
  35097. ("public" === e || (i = "weak" === e)) && this.tn.next(),
  35098. e = this._readString(),
  35099. this.tn.skip(";"),
  35100. i || n.imports.push(e);
  35101. break;
  35102. case "syntax":
  35103. if (!r)
  35104. throw Error("unexpected 'syntax'");
  35105. this.tn.skip("="),
  35106. "proto3" === (n.syntax = this._readString()) && (this.proto3 = !0),
  35107. this.tn.skip(";");
  35108. break;
  35109. case "message":
  35110. this._parseMessage(n, null),
  35111. r = !1;
  35112. break;
  35113. case "enum":
  35114. this._parseEnum(n),
  35115. r = !1;
  35116. break;
  35117. case "option":
  35118. this._parseOption(n);
  35119. break;
  35120. case "service":
  35121. this._parseService(n);
  35122. break;
  35123. case "extend":
  35124. this._parseExtend(n);
  35125. break;
  35126. default:
  35127. throw Error("unexpected '" + e + "'")
  35128. }
  35129. } catch (e) {
  35130. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  35131. e
  35132. }
  35133. return delete n.name,
  35134. n
  35135. }
  35136. ,
  35137. l.parse = function(e) {
  35138. return new l(e).parse()
  35139. }
  35140. ,
  35141. c._readString = function() {
  35142. var e, t, i = "";
  35143. do {
  35144. if (t = this.tn.next(),
  35145. "'" !== t && '"' !== t)
  35146. throw Error("illegal string delimiter: " + t);
  35147. i += this.tn.next(),
  35148. this.tn.skip(t),
  35149. e = this.tn.peek()
  35150. } while ('"' === e || '"' === e);return i
  35151. }
  35152. ,
  35153. c._readValue = function(e) {
  35154. var i = this.tn.peek();
  35155. if ('"' === i || "'" === i)
  35156. return this._readString();
  35157. if (this.tn.next(),
  35158. t.NUMBER.test(i))
  35159. return n(i);
  35160. if (t.BOOL.test(i))
  35161. return "true" === i.toLowerCase();
  35162. if (e && t.TYPEREF.test(i))
  35163. return i;
  35164. throw Error("illegal value: " + i)
  35165. }
  35166. ,
  35167. c._parseOption = function(e, i) {
  35168. var n = this.tn.next()
  35169. , r = !1;
  35170. if ("(" === n && (r = !0,
  35171. n = this.tn.next()),
  35172. !t.TYPEREF.test(n))
  35173. throw Error("illegal option name: " + n);
  35174. var o = n;
  35175. r && (this.tn.skip(")"),
  35176. o = "(" + o + ")",
  35177. n = this.tn.peek(),
  35178. t.FQTYPEREF.test(n) && (o += n,
  35179. this.tn.next())),
  35180. this.tn.skip("="),
  35181. this._parseOptionValue(e, o),
  35182. i || this.tn.skip(";")
  35183. }
  35184. ,
  35185. c._parseOptionValue = function(e, i) {
  35186. var n = this.tn.peek();
  35187. if ("{" !== n)
  35188. r(e.options, i, this._readValue(!0));
  35189. else
  35190. for (this.tn.skip("{"); "}" !== (n = this.tn.next()); ) {
  35191. if (!t.NAME.test(n))
  35192. throw Error("illegal option name: " + i + "." + n);
  35193. this.tn.omit(":") ? r(e.options, i + "." + n, this._readValue(!0)) : this._parseOptionValue(e, i + "." + n)
  35194. }
  35195. }
  35196. ,
  35197. c._parseService = function(e) {
  35198. var i = this.tn.next();
  35199. if (!t.NAME.test(i))
  35200. throw Error("illegal service name at line " + this.tn.line + ": " + i);
  35201. var n = i
  35202. , r = {
  35203. name: n,
  35204. rpc: {},
  35205. options: {}
  35206. };
  35207. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  35208. if ("option" === i)
  35209. this._parseOption(r);
  35210. else {
  35211. if ("rpc" !== i)
  35212. throw Error("illegal service token: " + i);
  35213. this._parseServiceRPC(r)
  35214. }
  35215. this.tn.omit(";"),
  35216. e.services.push(r)
  35217. }
  35218. ,
  35219. c._parseServiceRPC = function(e) {
  35220. var i = "rpc"
  35221. , n = this.tn.next();
  35222. if (!t.NAME.test(n))
  35223. throw Error("illegal rpc service method name: " + n);
  35224. var r = n
  35225. , o = {
  35226. request: null,
  35227. response: null,
  35228. request_stream: !1,
  35229. response_stream: !1,
  35230. options: {}
  35231. };
  35232. if (this.tn.skip("("),
  35233. n = this.tn.next(),
  35234. "stream" === n.toLowerCase() && (o.request_stream = !0,
  35235. n = this.tn.next()),
  35236. !t.TYPEREF.test(n))
  35237. throw Error("illegal rpc service request type: " + n);
  35238. if (o.request = n,
  35239. this.tn.skip(")"),
  35240. n = this.tn.next(),
  35241. "returns" !== n.toLowerCase())
  35242. throw Error("illegal rpc service request type delimiter: " + n);
  35243. if (this.tn.skip("("),
  35244. n = this.tn.next(),
  35245. "stream" === n.toLowerCase() && (o.response_stream = !0,
  35246. n = this.tn.next()),
  35247. o.response = n,
  35248. this.tn.skip(")"),
  35249. n = this.tn.peek(),
  35250. "{" === n) {
  35251. for (this.tn.next(); "}" !== (n = this.tn.next()); ) {
  35252. if ("option" !== n)
  35253. throw Error("illegal rpc service token: " + n);
  35254. this._parseOption(o)
  35255. }
  35256. this.tn.omit(";")
  35257. } else
  35258. this.tn.skip(";");
  35259. "undefined" == typeof e[i] && (e[i] = {}),
  35260. e[i][r] = o
  35261. }
  35262. ,
  35263. c._parseMessage = function(e, n) {
  35264. var r = !!n
  35265. , o = this.tn.next()
  35266. , a = {
  35267. name: "",
  35268. fields: [],
  35269. enums: [],
  35270. messages: [],
  35271. options: {},
  35272. services: [],
  35273. oneofs: {}
  35274. };
  35275. if (!t.NAME.test(o))
  35276. throw Error("illegal " + (r ? "group" : "message") + " name: " + o);
  35277. for (a.name = o,
  35278. r && (this.tn.skip("="),
  35279. n.id = i(this.tn.next()),
  35280. a.isGroup = !0),
  35281. o = this.tn.peek(),
  35282. "[" === o && n && this._parseFieldOptions(n),
  35283. this.tn.skip("{"); "}" !== (o = this.tn.next()); )
  35284. if (t.RULE.test(o))
  35285. this._parseMessageField(a, o);
  35286. else if ("oneof" === o)
  35287. this._parseMessageOneOf(a);
  35288. else if ("enum" === o)
  35289. this._parseEnum(a);
  35290. else if ("message" === o)
  35291. this._parseMessage(a);
  35292. else if ("option" === o)
  35293. this._parseOption(a);
  35294. else if ("service" === o)
  35295. this._parseService(a);
  35296. else if ("extensions" === o)
  35297. a.extensions = this._parseExtensionRanges();
  35298. else if ("reserved" === o)
  35299. this._parseIgnored();
  35300. else if ("extend" === o)
  35301. this._parseExtend(a);
  35302. else {
  35303. if (!t.TYPEREF.test(o))
  35304. throw Error("illegal message token: " + o);
  35305. if (!this.proto3)
  35306. throw Error("illegal field rule: " + o);
  35307. this._parseMessageField(a, "optional", o)
  35308. }
  35309. return this.tn.omit(";"),
  35310. e.messages.push(a),
  35311. a
  35312. }
  35313. ,
  35314. c._parseIgnored = function() {
  35315. for (; ";" !== this.tn.peek(); )
  35316. this.tn.next();
  35317. this.tn.skip(";")
  35318. }
  35319. ,
  35320. c._parseMessageField = function(e, n, r) {
  35321. if (!t.RULE.test(n))
  35322. throw Error("illegal message field rule: " + n);
  35323. var o, a = {
  35324. rule: n,
  35325. type: "",
  35326. name: "",
  35327. options: {},
  35328. id: 0
  35329. };
  35330. if ("map" === n) {
  35331. if (r)
  35332. throw Error("illegal type: " + r);
  35333. if (this.tn.skip("<"),
  35334. o = this.tn.next(),
  35335. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  35336. throw Error("illegal message field type: " + o);
  35337. if (a.keytype = o,
  35338. this.tn.skip(","),
  35339. o = this.tn.next(),
  35340. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  35341. throw Error("illegal message field: " + o);
  35342. if (a.type = o,
  35343. this.tn.skip(">"),
  35344. o = this.tn.next(),
  35345. !t.NAME.test(o))
  35346. throw Error("illegal message field name: " + o);
  35347. a.name = o,
  35348. this.tn.skip("="),
  35349. a.id = i(this.tn.next()),
  35350. o = this.tn.peek(),
  35351. "[" === o && this._parseFieldOptions(a),
  35352. this.tn.skip(";")
  35353. } else if (r = "undefined" != typeof r ? r : this.tn.next(),
  35354. "group" === r) {
  35355. var s = this._parseMessage(e, a);
  35356. if (!/^[A-Z]/.test(s.name))
  35357. throw Error("illegal group name: " + s.name);
  35358. a.type = s.name,
  35359. a.name = s.name.toLowerCase(),
  35360. this.tn.omit(";")
  35361. } else {
  35362. if (!t.TYPE.test(r) && !t.TYPEREF.test(r))
  35363. throw Error("illegal message field type: " + r);
  35364. if (a.type = r,
  35365. o = this.tn.next(),
  35366. !t.NAME.test(o))
  35367. throw Error("illegal message field name: " + o);
  35368. a.name = o,
  35369. this.tn.skip("="),
  35370. a.id = i(this.tn.next()),
  35371. o = this.tn.peek(),
  35372. "[" === o && this._parseFieldOptions(a),
  35373. this.tn.skip(";")
  35374. }
  35375. return e.fields.push(a),
  35376. a
  35377. }
  35378. ,
  35379. c._parseMessageOneOf = function(e) {
  35380. var i = this.tn.next();
  35381. if (!t.NAME.test(i))
  35382. throw Error("illegal oneof name: " + i);
  35383. var n, r = i, o = [];
  35384. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  35385. n = this._parseMessageField(e, "optional", i),
  35386. n.oneof = r,
  35387. o.push(n.id);
  35388. this.tn.omit(";"),
  35389. e.oneofs[r] = o
  35390. }
  35391. ,
  35392. c._parseFieldOptions = function(e) {
  35393. this.tn.skip("[");
  35394. for (var t, i = !0; "]" !== (t = this.tn.peek()); )
  35395. i || this.tn.skip(","),
  35396. this._parseOption(e, !0),
  35397. i = !1;
  35398. this.tn.next()
  35399. }
  35400. ,
  35401. c._parseEnum = function(e) {
  35402. var n = {
  35403. name: "",
  35404. values: [],
  35405. options: {}
  35406. }
  35407. , r = this.tn.next();
  35408. if (!t.NAME.test(r))
  35409. throw Error("illegal name: " + r);
  35410. for (n.name = r,
  35411. this.tn.skip("{"); "}" !== (r = this.tn.next()); )
  35412. if ("option" === r)
  35413. this._parseOption(n);
  35414. else {
  35415. if (!t.NAME.test(r))
  35416. throw Error("illegal name: " + r);
  35417. this.tn.skip("=");
  35418. var o = {
  35419. name: r,
  35420. id: i(this.tn.next(), !0)
  35421. };
  35422. r = this.tn.peek(),
  35423. "[" === r && this._parseFieldOptions({
  35424. options: {}
  35425. }),
  35426. this.tn.skip(";"),
  35427. n.values.push(o)
  35428. }
  35429. this.tn.omit(";"),
  35430. e.enums.push(n)
  35431. }
  35432. ,
  35433. c._parseExtensionRanges = function() {
  35434. var t, i, r, o = [];
  35435. do {
  35436. for (i = []; ; ) {
  35437. switch (t = this.tn.next()) {
  35438. case "min":
  35439. r = e.ID_MIN;
  35440. break;
  35441. case "max":
  35442. r = e.ID_MAX;
  35443. break;
  35444. default:
  35445. r = n(t)
  35446. }
  35447. if (i.push(r),
  35448. 2 === i.length)
  35449. break;
  35450. if ("to" !== this.tn.peek()) {
  35451. i.push(r);
  35452. break
  35453. }
  35454. this.tn.next()
  35455. }
  35456. o.push(i)
  35457. } while (this.tn.omit(","));return this.tn.skip(";"),
  35458. o
  35459. }
  35460. ,
  35461. c._parseExtend = function(e) {
  35462. var i = this.tn.next();
  35463. if (!t.TYPEREF.test(i))
  35464. throw Error("illegal extend reference: " + i);
  35465. var n = {
  35466. ref: i,
  35467. fields: []
  35468. };
  35469. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  35470. if (t.RULE.test(i))
  35471. this._parseMessageField(n, i);
  35472. else {
  35473. if (!t.TYPEREF.test(i))
  35474. throw Error("illegal extend token: " + i);
  35475. if (!this.proto3)
  35476. throw Error("illegal field rule: " + i);
  35477. this._parseMessageField(n, "optional", i)
  35478. }
  35479. return this.tn.omit(";"),
  35480. e.messages.push(n),
  35481. n
  35482. }
  35483. ,
  35484. c.toString = function() {
  35485. return "Parser at line " + this.tn.line
  35486. }
  35487. ,
  35488. o.Parser = l,
  35489. o
  35490. }(r, r.Lang),
  35491. r.Reflect = function(e) {
  35492. function i(i) {
  35493. if ("string" == typeof i && (i = e.TYPES[i]),
  35494. "undefined" == typeof i.defaultValue)
  35495. throw Error("default value for type " + i.name + " is not supported");
  35496. return i == e.TYPES.bytes ? new t(0) : i.defaultValue
  35497. }
  35498. function n(t, i) {
  35499. if (t && "number" == typeof t.low && "number" == typeof t.high && "boolean" == typeof t.unsigned && t.low === t.low && t.high === t.high)
  35500. return new e.Long(t.low,t.high,"undefined" == typeof i ? t.unsigned : i);
  35501. if ("string" == typeof t)
  35502. return e.Long.fromString(t, i || !1, 10);
  35503. if ("number" == typeof t)
  35504. return e.Long.fromNumber(t, i || !1);
  35505. throw Error("not convertible to Long")
  35506. }
  35507. function r(t, i) {
  35508. var n = i.readVarint32()
  35509. , o = 7 & n
  35510. , a = n >>> 3;
  35511. switch (o) {
  35512. case e.WIRE_TYPES.VARINT:
  35513. do
  35514. n = i.readUint8();
  35515. while (128 === (128 & n));break;
  35516. case e.WIRE_TYPES.BITS64:
  35517. i.offset += 8;
  35518. break;
  35519. case e.WIRE_TYPES.LDELIM:
  35520. n = i.readVarint32(),
  35521. i.offset += n;
  35522. break;
  35523. case e.WIRE_TYPES.STARTGROUP:
  35524. r(a, i);
  35525. break;
  35526. case e.WIRE_TYPES.ENDGROUP:
  35527. if (a === t)
  35528. return !1;
  35529. throw Error("Illegal GROUPEND after unknown group: " + a + " (" + t + " expected)");
  35530. case e.WIRE_TYPES.BITS32:
  35531. i.offset += 4;
  35532. break;
  35533. default:
  35534. throw Error("Illegal wire type in unknown group " + t + ": " + o)
  35535. }
  35536. return !0
  35537. }
  35538. var o = {}
  35539. , a = function(e, t, i) {
  35540. this.builder = e,
  35541. this.parent = t,
  35542. this.name = i,
  35543. this.className
  35544. }
  35545. , s = a.prototype;
  35546. s.fqn = function() {
  35547. for (var e = this.name, t = this; ; ) {
  35548. if (t = t.parent,
  35549. null == t)
  35550. break;
  35551. e = t.name + "." + e
  35552. }
  35553. return e
  35554. }
  35555. ,
  35556. s.toString = function(e) {
  35557. return (e ? this.className + " " : "") + this.fqn()
  35558. }
  35559. ,
  35560. s.build = function() {
  35561. throw Error(this.toString(!0) + " cannot be built directly")
  35562. }
  35563. ,
  35564. o.T = a;
  35565. var l = function(e, t, i, n, r) {
  35566. a.call(this, e, t, i),
  35567. this.className = "Namespace",
  35568. this.children = [],
  35569. this.options = n || {},
  35570. this.syntax = r || "proto2"
  35571. }
  35572. , c = l.prototype = Object.create(a.prototype);
  35573. c.getChildren = function(e) {
  35574. if (e = e || null,
  35575. null == e)
  35576. return this.children.slice();
  35577. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  35578. this.children[i]instanceof e && t.push(this.children[i]);
  35579. return t
  35580. }
  35581. ,
  35582. c.addChild = function(e) {
  35583. var t;
  35584. if (t = this.getChild(e.name))
  35585. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  35586. t.name = t.originalName;
  35587. else {
  35588. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  35589. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  35590. e.name = e.originalName
  35591. }
  35592. this.children.push(e)
  35593. }
  35594. ,
  35595. c.getChild = function(e) {
  35596. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  35597. if (this.children[i][t] === e)
  35598. return this.children[i];
  35599. return null
  35600. }
  35601. ,
  35602. c.resolve = function(e, t) {
  35603. var i = "string" == typeof e ? e.split(".") : e
  35604. , n = this
  35605. , r = 0;
  35606. if ("" === i[r]) {
  35607. for (; null !== n.parent; )
  35608. n = n.parent;
  35609. r++
  35610. }
  35611. var a;
  35612. do {
  35613. do {
  35614. if (!(n instanceof o.Namespace)) {
  35615. n = null;
  35616. break
  35617. }
  35618. if (a = n.getChild(i[r]),
  35619. !a || !(a instanceof o.T) || t && !(a instanceof o.Namespace)) {
  35620. n = null;
  35621. break
  35622. }
  35623. n = a,
  35624. r++
  35625. } while (r < i.length);if (null != n)
  35626. break;
  35627. if (null !== this.parent)
  35628. return this.parent.resolve(e, t)
  35629. } while (null != n);return n
  35630. }
  35631. ,
  35632. c.qn = function(e) {
  35633. var t = []
  35634. , i = e;
  35635. do
  35636. t.unshift(i.name),
  35637. i = i.parent;
  35638. while (null !== i);for (var n = 1; n <= t.length; n++) {
  35639. var r = t.slice(t.length - n);
  35640. if (e === this.resolve(r, e instanceof o.Namespace))
  35641. return r.join(".")
  35642. }
  35643. return e.fqn()
  35644. }
  35645. ,
  35646. c.build = function() {
  35647. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  35648. e = i[n],
  35649. e instanceof l && (t[e.name] = e.build());
  35650. return Object.defineProperty && Object.defineProperty(t, "$options", {
  35651. value: this.buildOpt()
  35652. }),
  35653. t
  35654. }
  35655. ,
  35656. c.buildOpt = function() {
  35657. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  35658. var r = t[i]
  35659. , o = this.options[t[i]];
  35660. e[r] = o
  35661. }
  35662. return e
  35663. }
  35664. ,
  35665. c.getOption = function(e) {
  35666. return "undefined" == typeof e ? this.options : "undefined" != typeof this.options[e] ? this.options[e] : null
  35667. }
  35668. ,
  35669. o.Namespace = l;
  35670. var h = function(t, i, n, r) {
  35671. if (this.type = t,
  35672. this.resolvedType = i,
  35673. this.isMapKey = n,
  35674. this.syntax = r,
  35675. n && e.MAP_KEY_TYPES.indexOf(t) < 0)
  35676. throw Error("Invalid map key type: " + t.name)
  35677. }
  35678. , u = h.prototype;
  35679. h.defaultFieldValue = i,
  35680. u.verifyValue = function(i) {
  35681. function r(e, t) {
  35682. throw Error("Illegal value for " + o.toString(!0) + " of type " + o.type.name + ": " + e + " (" + t + ")")
  35683. }
  35684. var o = this;
  35685. switch (this.type) {
  35686. case e.TYPES.int32:
  35687. case e.TYPES.sint32:
  35688. case e.TYPES.sfixed32:
  35689. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  35690. i > 4294967295 ? 0 | i : i;
  35691. case e.TYPES.uint32:
  35692. case e.TYPES.fixed32:
  35693. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  35694. i < 0 ? i >>> 0 : i;
  35695. case e.TYPES.int64:
  35696. case e.TYPES.sint64:
  35697. case e.TYPES.sfixed64:
  35698. if (e.Long)
  35699. try {
  35700. return n(i, !1)
  35701. } catch (e) {
  35702. r(typeof i, e.message)
  35703. }
  35704. else
  35705. r(typeof i, "requires Long.js");
  35706. case e.TYPES.uint64:
  35707. case e.TYPES.fixed64:
  35708. if (e.Long)
  35709. try {
  35710. return n(i, !0)
  35711. } catch (e) {
  35712. r(typeof i, e.message)
  35713. }
  35714. else
  35715. r(typeof i, "requires Long.js");
  35716. case e.TYPES.bool:
  35717. return "boolean" != typeof i && r(typeof i, "not a boolean"),
  35718. i;
  35719. case e.TYPES.float:
  35720. case e.TYPES.double:
  35721. return "number" != typeof i && r(typeof i, "not a number"),
  35722. i;
  35723. case e.TYPES.string:
  35724. return "string" == typeof i || i && i instanceof String || r(typeof i, "not a string"),
  35725. "" + i;
  35726. case e.TYPES.bytes:
  35727. return t.isByteBuffer(i) ? i : t.wrap(i, "base64");
  35728. case e.TYPES.enum:
  35729. var a = this.resolvedType.getChildren(e.Reflect.Enum.Value);
  35730. for (l = 0; l < a.length; l++) {
  35731. if (a[l].name == i)
  35732. return a[l].id;
  35733. if (a[l].id == i)
  35734. return a[l].id
  35735. }
  35736. if ("proto3" === this.syntax)
  35737. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  35738. (i > 4294967295 || i < 0) && r(typeof i, "not in range for uint32"),
  35739. i;
  35740. r(i, "not a valid enum value");
  35741. case e.TYPES.group:
  35742. case e.TYPES.message:
  35743. if (i && "object" == typeof i || r(typeof i, "object expected"),
  35744. i instanceof this.resolvedType.clazz)
  35745. return i;
  35746. if (i instanceof e.Builder.Message) {
  35747. var s = {};
  35748. for (var l in i)
  35749. i.hasOwnProperty(l) && (s[l] = i[l]);
  35750. i = s
  35751. }
  35752. return new this.resolvedType.clazz(i)
  35753. }
  35754. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + i + " (undefined type " + this.type + ")")
  35755. }
  35756. ,
  35757. u.calculateLength = function(i, n) {
  35758. if (null === n)
  35759. return 0;
  35760. var r;
  35761. switch (this.type) {
  35762. case e.TYPES.int32:
  35763. return n < 0 ? t.calculateVarint64(n) : t.calculateVarint32(n);
  35764. case e.TYPES.uint32:
  35765. return t.calculateVarint32(n);
  35766. case e.TYPES.sint32:
  35767. return t.calculateVarint32(t.zigZagEncode32(n));
  35768. case e.TYPES.fixed32:
  35769. case e.TYPES.sfixed32:
  35770. case e.TYPES.float:
  35771. return 4;
  35772. case e.TYPES.int64:
  35773. case e.TYPES.uint64:
  35774. return t.calculateVarint64(n);
  35775. case e.TYPES.sint64:
  35776. return t.calculateVarint64(t.zigZagEncode64(n));
  35777. case e.TYPES.fixed64:
  35778. case e.TYPES.sfixed64:
  35779. return 8;
  35780. case e.TYPES.bool:
  35781. return 1;
  35782. case e.TYPES.enum:
  35783. return t.calculateVarint32(n);
  35784. case e.TYPES.double:
  35785. return 8;
  35786. case e.TYPES.string:
  35787. return r = t.calculateUTF8Bytes(n),
  35788. t.calculateVarint32(r) + r;
  35789. case e.TYPES.bytes:
  35790. if (n.remaining() < 0)
  35791. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  35792. return t.calculateVarint32(n.remaining()) + n.remaining();
  35793. case e.TYPES.message:
  35794. return r = this.resolvedType.calculate(n),
  35795. t.calculateVarint32(r) + r;
  35796. case e.TYPES.group:
  35797. return r = this.resolvedType.calculate(n),
  35798. r + t.calculateVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP)
  35799. }
  35800. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  35801. }
  35802. ,
  35803. u.encodeValue = function(i, n, r) {
  35804. if (null === n)
  35805. return r;
  35806. switch (this.type) {
  35807. case e.TYPES.int32:
  35808. n < 0 ? r.writeVarint64(n) : r.writeVarint32(n);
  35809. break;
  35810. case e.TYPES.uint32:
  35811. r.writeVarint32(n);
  35812. break;
  35813. case e.TYPES.sint32:
  35814. r.writeVarint32ZigZag(n);
  35815. break;
  35816. case e.TYPES.fixed32:
  35817. r.writeUint32(n);
  35818. break;
  35819. case e.TYPES.sfixed32:
  35820. r.writeInt32(n);
  35821. break;
  35822. case e.TYPES.int64:
  35823. case e.TYPES.uint64:
  35824. r.writeVarint64(n);
  35825. break;
  35826. case e.TYPES.sint64:
  35827. r.writeVarint64ZigZag(n);
  35828. break;
  35829. case e.TYPES.fixed64:
  35830. r.writeUint64(n);
  35831. break;
  35832. case e.TYPES.sfixed64:
  35833. r.writeInt64(n);
  35834. break;
  35835. case e.TYPES.bool:
  35836. "string" == typeof n ? r.writeVarint32("false" === n.toLowerCase() ? 0 : !!n) : r.writeVarint32(n ? 1 : 0);
  35837. break;
  35838. case e.TYPES.enum:
  35839. r.writeVarint32(n);
  35840. break;
  35841. case e.TYPES.float:
  35842. r.writeFloat32(n);
  35843. break;
  35844. case e.TYPES.double:
  35845. r.writeFloat64(n);
  35846. break;
  35847. case e.TYPES.string:
  35848. r.writeVString(n);
  35849. break;
  35850. case e.TYPES.bytes:
  35851. if (n.remaining() < 0)
  35852. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  35853. var o = n.offset;
  35854. r.writeVarint32(n.remaining()),
  35855. r.append(n),
  35856. n.offset = o;
  35857. break;
  35858. case e.TYPES.message:
  35859. var a = (new t).LE();
  35860. this.resolvedType.encode(n, a),
  35861. r.writeVarint32(a.offset),
  35862. r.append(a.flip());
  35863. break;
  35864. case e.TYPES.group:
  35865. this.resolvedType.encode(n, r),
  35866. r.writeVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP);
  35867. break;
  35868. default:
  35869. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  35870. }
  35871. return r
  35872. }
  35873. ,
  35874. u.decode = function(t, i, n) {
  35875. if (i != this.type.wireType)
  35876. throw Error("Unexpected wire type for element");
  35877. var r, o;
  35878. switch (this.type) {
  35879. case e.TYPES.int32:
  35880. return 0 | t.readVarint32();
  35881. case e.TYPES.uint32:
  35882. return t.readVarint32() >>> 0;
  35883. case e.TYPES.sint32:
  35884. return 0 | t.readVarint32ZigZag();
  35885. case e.TYPES.fixed32:
  35886. return t.readUint32() >>> 0;
  35887. case e.TYPES.sfixed32:
  35888. return 0 | t.readInt32();
  35889. case e.TYPES.int64:
  35890. return t.readVarint64();
  35891. case e.TYPES.uint64:
  35892. return t.readVarint64().toUnsigned();
  35893. case e.TYPES.sint64:
  35894. return t.readVarint64ZigZag();
  35895. case e.TYPES.fixed64:
  35896. return t.readUint64();
  35897. case e.TYPES.sfixed64:
  35898. return t.readInt64();
  35899. case e.TYPES.bool:
  35900. return !!t.readVarint32();
  35901. case e.TYPES.enum:
  35902. return t.readVarint32();
  35903. case e.TYPES.float:
  35904. return t.readFloat();
  35905. case e.TYPES.double:
  35906. return t.readDouble();
  35907. case e.TYPES.string:
  35908. return t.readVString();
  35909. case e.TYPES.bytes:
  35910. if (o = t.readVarint32(),
  35911. t.remaining() < o)
  35912. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + t.remaining());
  35913. return r = t.clone(),
  35914. r.limit = r.offset + o,
  35915. t.offset += o,
  35916. r;
  35917. case e.TYPES.message:
  35918. return o = t.readVarint32(),
  35919. this.resolvedType.decode(t, o);
  35920. case e.TYPES.group:
  35921. return this.resolvedType.decode(t, -1, n)
  35922. }
  35923. throw Error("[INTERNAL] Illegal decode type")
  35924. }
  35925. ,
  35926. u.valueFromString = function(i) {
  35927. if (!this.isMapKey)
  35928. throw Error("valueFromString() called on non-map-key element");
  35929. switch (this.type) {
  35930. case e.TYPES.int32:
  35931. case e.TYPES.sint32:
  35932. case e.TYPES.sfixed32:
  35933. case e.TYPES.uint32:
  35934. case e.TYPES.fixed32:
  35935. return this.verifyValue(parseInt(i));
  35936. case e.TYPES.int64:
  35937. case e.TYPES.sint64:
  35938. case e.TYPES.sfixed64:
  35939. case e.TYPES.uint64:
  35940. case e.TYPES.fixed64:
  35941. return this.verifyValue(i);
  35942. case e.TYPES.bool:
  35943. return "true" === i;
  35944. case e.TYPES.string:
  35945. return this.verifyValue(i);
  35946. case e.TYPES.bytes:
  35947. return t.fromBinary(i)
  35948. }
  35949. }
  35950. ,
  35951. u.valueToString = function(t) {
  35952. if (!this.isMapKey)
  35953. throw Error("valueToString() called on non-map-key element");
  35954. return this.type === e.TYPES.bytes ? t.toString("binary") : t.toString()
  35955. }
  35956. ,
  35957. o.Element = h;
  35958. var d = function(e, t, i, n, r, o) {
  35959. l.call(this, e, t, i, n, o),
  35960. this.className = "Message",
  35961. this.extensions = void 0,
  35962. this.clazz = null,
  35963. this.isGroup = !!r,
  35964. this._fields = null,
  35965. this._fieldsById = null,
  35966. this._fieldsByName = null
  35967. }
  35968. , p = d.prototype = Object.create(l.prototype);
  35969. p.build = function(i) {
  35970. if (this.clazz && !i)
  35971. return this.clazz;
  35972. var n = function(e, i) {
  35973. function n(i, r, o, a) {
  35974. if (null === i || "object" != typeof i) {
  35975. if (a && a instanceof e.Reflect.Enum) {
  35976. var s = e.Reflect.Enum.getName(a.object, i);
  35977. if (null !== s)
  35978. return s
  35979. }
  35980. return i
  35981. }
  35982. if (t.isByteBuffer(i))
  35983. return r ? i.toBase64() : i.toBuffer();
  35984. if (e.Long.isLong(i))
  35985. return o ? i.toString() : e.Long.fromValue(i);
  35986. var l;
  35987. if (Array.isArray(i))
  35988. return l = [],
  35989. i.forEach(function(e, t) {
  35990. l[t] = n(e, r, o, a)
  35991. }),
  35992. l;
  35993. if (l = {},
  35994. i instanceof e.Map) {
  35995. for (var c = i.entries(), h = c.next(); !h.done; h = c.next())
  35996. l[i.keyElem.valueToString(h.value[0])] = n(h.value[1], r, o, i.valueElem.resolvedType);
  35997. return l
  35998. }
  35999. var u = i.$type
  36000. , d = void 0;
  36001. for (var p in i)
  36002. i.hasOwnProperty(p) && (u && (d = u.getChild(p)) ? l[p] = n(i[p], r, o, d.resolvedType) : l[p] = n(i[p], r, o));
  36003. return l
  36004. }
  36005. var r = i.getChildren(e.Reflect.Message.Field)
  36006. , o = i.getChildren(e.Reflect.Message.OneOf)
  36007. , a = function(n, s) {
  36008. e.Builder.Message.call(this);
  36009. for (var l = 0, c = o.length; l < c; ++l)
  36010. this[o[l].name] = null;
  36011. for (l = 0,
  36012. c = r.length; l < c; ++l) {
  36013. var h = r[l];
  36014. this[h.name] = h.repeated ? [] : h.map ? new e.Map(h) : null,
  36015. !h.required && "proto3" !== i.syntax || null === h.defaultValue || (this[h.name] = h.defaultValue)
  36016. }
  36017. if (arguments.length > 0) {
  36018. var u;
  36019. 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)
  36020. for (l = 0,
  36021. c = arguments.length; l < c; ++l)
  36022. "undefined" != typeof (u = arguments[l]) && this.$set(r[l].name, u);
  36023. else
  36024. this.$set(n)
  36025. }
  36026. }
  36027. , s = a.prototype = Object.create(e.Builder.Message.prototype);
  36028. s.add = function(t, n, r) {
  36029. var o = i._fieldsByName[t];
  36030. if (!r) {
  36031. if (!o)
  36032. throw Error(this + "#" + t + " is undefined");
  36033. if (!(o instanceof e.Reflect.Message.Field))
  36034. throw Error(this + "#" + t + " is not a field: " + o.toString(!0));
  36035. if (!o.repeated)
  36036. throw Error(this + "#" + t + " is not a repeated field");
  36037. n = o.verifyValue(n, !0)
  36038. }
  36039. return null === this[t] && (this[t] = []),
  36040. this[t].push(n),
  36041. this
  36042. }
  36043. ,
  36044. s.$add = s.add,
  36045. s.set = function(t, n, r) {
  36046. if (t && "object" == typeof t) {
  36047. r = n;
  36048. for (var o in t)
  36049. t.hasOwnProperty(o) && "undefined" != typeof (n = t[o]) && this.$set(o, n, r);
  36050. return this
  36051. }
  36052. var a = i._fieldsByName[t];
  36053. if (r)
  36054. this[t] = n;
  36055. else {
  36056. if (!a)
  36057. throw Error(this + "#" + t + " is not a field: undefined");
  36058. if (!(a instanceof e.Reflect.Message.Field))
  36059. throw Error(this + "#" + t + " is not a field: " + a.toString(!0));
  36060. this[a.name] = n = a.verifyValue(n)
  36061. }
  36062. if (a && a.oneof) {
  36063. var s = this[a.oneof.name];
  36064. null !== n ? (null !== s && s !== a.name && (this[s] = null),
  36065. this[a.oneof.name] = a.name) : s === t && (this[a.oneof.name] = null)
  36066. }
  36067. return this
  36068. }
  36069. ,
  36070. s.$set = s.set,
  36071. s.get = function(t, n) {
  36072. if (n)
  36073. return this[t];
  36074. var r = i._fieldsByName[t];
  36075. if (!(r && r instanceof e.Reflect.Message.Field))
  36076. throw Error(this + "#" + t + " is not a field: undefined");
  36077. if (!(r instanceof e.Reflect.Message.Field))
  36078. throw Error(this + "#" + t + " is not a field: " + r.toString(!0));
  36079. return this[r.name]
  36080. }
  36081. ,
  36082. s.$get = s.get;
  36083. for (var l = 0; l < r.length; l++) {
  36084. var c = r[l];
  36085. c instanceof e.Reflect.Message.ExtensionField || i.builder.options.populateAccessors && function(e) {
  36086. var t = e.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  36087. return e.toUpperCase().replace("_", "")
  36088. });
  36089. t = t.substring(0, 1).toUpperCase() + t.substring(1);
  36090. var n = e.originalName.replace(/([A-Z])/g, function(e) {
  36091. return "_" + e
  36092. })
  36093. , r = function(t, i) {
  36094. return this[e.name] = i ? t : e.verifyValue(t),
  36095. this
  36096. }
  36097. , o = function() {
  36098. return this[e.name]
  36099. };
  36100. null === i.getChild("set" + t) && (s["set" + t] = r),
  36101. null === i.getChild("set_" + n) && (s["set_" + n] = r),
  36102. null === i.getChild("get" + t) && (s["get" + t] = o),
  36103. null === i.getChild("get_" + n) && (s["get_" + n] = o)
  36104. }(c)
  36105. }
  36106. s.encode = function(e, n) {
  36107. "boolean" == typeof e && (n = e,
  36108. e = void 0);
  36109. var r = !1;
  36110. e || (e = new t,
  36111. r = !0);
  36112. var o = e.littleEndian;
  36113. try {
  36114. return i.encode(this, e.LE(), n),
  36115. (r ? e.flip() : e).LE(o)
  36116. } catch (t) {
  36117. throw e.LE(o),
  36118. t
  36119. }
  36120. }
  36121. ,
  36122. a.encode = function(e, t, i) {
  36123. return new a(e).encode(t, i)
  36124. }
  36125. ,
  36126. s.calculate = function() {
  36127. return i.calculate(this)
  36128. }
  36129. ,
  36130. s.encodeDelimited = function(e, n) {
  36131. var r = !1;
  36132. e || (e = new t,
  36133. r = !0);
  36134. var o = (new t).LE();
  36135. return i.encode(this, o, n).flip(),
  36136. e.writeVarint32(o.remaining()),
  36137. e.append(o),
  36138. r ? e.flip() : e
  36139. }
  36140. ,
  36141. s.encodeAB = function() {
  36142. try {
  36143. return this.encode().toArrayBuffer()
  36144. } catch (e) {
  36145. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  36146. e
  36147. }
  36148. }
  36149. ,
  36150. s.toArrayBuffer = s.encodeAB,
  36151. s.encodeNB = function() {
  36152. try {
  36153. return this.encode().toBuffer()
  36154. } catch (e) {
  36155. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  36156. e
  36157. }
  36158. }
  36159. ,
  36160. s.toBuffer = s.encodeNB,
  36161. s.encode64 = function() {
  36162. try {
  36163. return this.encode().toBase64()
  36164. } catch (e) {
  36165. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  36166. e
  36167. }
  36168. }
  36169. ,
  36170. s.toBase64 = s.encode64,
  36171. s.encodeHex = function() {
  36172. try {
  36173. return this.encode().toHex()
  36174. } catch (e) {
  36175. throw e.encoded && (e.encoded = e.encoded.toHex()),
  36176. e
  36177. }
  36178. }
  36179. ,
  36180. s.toHex = s.encodeHex,
  36181. s.toRaw = function(e, t) {
  36182. return n(this, !!e, !!t, this.$type)
  36183. }
  36184. ,
  36185. s.encodeJSON = function() {
  36186. return JSON.stringify(n(this, !0, !0, this.$type))
  36187. }
  36188. ,
  36189. a.decode = function(e, n, r) {
  36190. "string" == typeof n && (r = n,
  36191. n = -1),
  36192. "string" == typeof e && (e = t.wrap(e, r ? r : "base64")),
  36193. e = t.isByteBuffer(e) ? e : t.wrap(e);
  36194. var o = e.littleEndian;
  36195. try {
  36196. var a = i.decode(e.LE());
  36197. return e.LE(o),
  36198. a
  36199. } catch (t) {
  36200. throw e.LE(o),
  36201. t
  36202. }
  36203. }
  36204. ,
  36205. a.decodeDelimited = function(e, n) {
  36206. if ("string" == typeof e && (e = t.wrap(e, n ? n : "base64")),
  36207. e = t.isByteBuffer(e) ? e : t.wrap(e),
  36208. e.remaining() < 1)
  36209. return null;
  36210. var r = e.offset
  36211. , o = e.readVarint32();
  36212. if (e.remaining() < o)
  36213. return e.offset = r,
  36214. null;
  36215. try {
  36216. var a = i.decode(e.slice(e.offset, e.offset + o).LE());
  36217. return e.offset += o,
  36218. a
  36219. } catch (t) {
  36220. throw e.offset += o,
  36221. t
  36222. }
  36223. }
  36224. ,
  36225. a.decode64 = function(e) {
  36226. return a.decode(e, "base64")
  36227. }
  36228. ,
  36229. a.decodeHex = function(e) {
  36230. return a.decode(e, "hex")
  36231. }
  36232. ,
  36233. a.decodeJSON = function(e) {
  36234. return new a(JSON.parse(e))
  36235. }
  36236. ,
  36237. s.toString = function() {
  36238. return i.toString()
  36239. }
  36240. ;
  36241. return Object.defineProperty && (Object.defineProperty(a, "$options", {
  36242. value: i.buildOpt()
  36243. }),
  36244. Object.defineProperty(s, "$options", {
  36245. value: a.$options
  36246. }),
  36247. Object.defineProperty(a, "$type", {
  36248. value: i
  36249. }),
  36250. Object.defineProperty(s, "$type", {
  36251. value: i
  36252. })),
  36253. a
  36254. }(e, this);
  36255. this._fields = [],
  36256. this._fieldsById = {},
  36257. this._fieldsByName = {};
  36258. for (var r, o = 0, a = this.children.length; o < a; o++)
  36259. if (r = this.children[o],
  36260. r instanceof A || r instanceof d || r instanceof E) {
  36261. if (n.hasOwnProperty(r.name))
  36262. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + r.toString(!0) + " cannot override static property '" + r.name + "'");
  36263. n[r.name] = r.build()
  36264. } else if (r instanceof d.Field)
  36265. r.build(),
  36266. this._fields.push(r),
  36267. this._fieldsById[r.id] = r,
  36268. this._fieldsByName[r.name] = r;
  36269. else if (!(r instanceof d.OneOf || r instanceof I))
  36270. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[o].toString(!0));
  36271. return this.clazz = n
  36272. }
  36273. ,
  36274. p.encode = function(e, t, i) {
  36275. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  36276. n = this._fields[a],
  36277. r = e[n.name],
  36278. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  36279. if (null !== o) {
  36280. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  36281. throw l.encoded = t,
  36282. l
  36283. }
  36284. return t
  36285. }
  36286. ,
  36287. p.calculate = function(e) {
  36288. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  36289. if (t = this._fields[r],
  36290. i = e[t.name],
  36291. t.required && null === i)
  36292. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  36293. n += t.calculate(i, e)
  36294. }
  36295. return n
  36296. }
  36297. ,
  36298. p.decode = function(t, i, n) {
  36299. i = "number" == typeof i ? i : -1;
  36300. for (var o, a, s, l, c = t.offset, h = new this.clazz; t.offset < c + i || i === -1 && t.remaining() > 0; ) {
  36301. if (o = t.readVarint32(),
  36302. a = 7 & o,
  36303. s = o >>> 3,
  36304. a === e.WIRE_TYPES.ENDGROUP) {
  36305. if (s !== n)
  36306. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + s + " (" + (n ? n + " expected" : "not a group") + ")");
  36307. break
  36308. }
  36309. if (l = this._fieldsById[s]) {
  36310. if (l.repeated && !l.options.packed)
  36311. h[l.name].push(l.decode(a, t));
  36312. else if (l.map) {
  36313. var u = l.decode(a, t);
  36314. h[l.name].set(u[0], u[1])
  36315. } else if (h[l.name] = l.decode(a, t),
  36316. l.oneof) {
  36317. var d = h[l.oneof.name];
  36318. null !== d && d !== l.name && (h[d] = null),
  36319. h[l.oneof.name] = l.name
  36320. }
  36321. } else
  36322. switch (a) {
  36323. case e.WIRE_TYPES.VARINT:
  36324. t.readVarint32();
  36325. break;
  36326. case e.WIRE_TYPES.BITS32:
  36327. t.offset += 4;
  36328. break;
  36329. case e.WIRE_TYPES.BITS64:
  36330. t.offset += 8;
  36331. break;
  36332. case e.WIRE_TYPES.LDELIM:
  36333. var p = t.readVarint32();
  36334. t.offset += p;
  36335. break;
  36336. case e.WIRE_TYPES.STARTGROUP:
  36337. for (; r(s, t); )
  36338. ;
  36339. break;
  36340. default:
  36341. throw Error("Illegal wire type for unknown field " + s + " in " + this.toString(!0) + "#decode: " + a)
  36342. }
  36343. }
  36344. for (var f = 0, g = this._fields.length; f < g; ++f)
  36345. if (l = this._fields[f],
  36346. null === h[l.name])
  36347. if ("proto3" === this.syntax)
  36348. h[l.name] = l.defaultValue;
  36349. else {
  36350. if (l.required) {
  36351. var m = Error("Missing at least one required field for " + this.toString(!0) + ": " + l.name);
  36352. throw m.decoded = h,
  36353. m
  36354. }
  36355. e.populateDefaults && null !== l.defaultValue && (h[l.name] = l.defaultValue)
  36356. }
  36357. return h
  36358. }
  36359. ,
  36360. o.Message = d;
  36361. var f = function(t, i, n, r, o, s, l, c, h, u) {
  36362. a.call(this, t, i, s),
  36363. this.className = "Message.Field",
  36364. this.required = "required" === n,
  36365. this.repeated = "repeated" === n,
  36366. this.map = "map" === n,
  36367. this.keyType = r || null,
  36368. this.type = o,
  36369. this.resolvedType = null,
  36370. this.id = l,
  36371. this.options = c || {},
  36372. this.defaultValue = null,
  36373. this.oneof = h || null,
  36374. this.syntax = u || "proto2",
  36375. this.originalName = this.name,
  36376. this.element = null,
  36377. this.keyElement = null,
  36378. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = e.Util.toCamelCase(this.name))
  36379. }
  36380. , g = f.prototype = Object.create(a.prototype);
  36381. g.build = function() {
  36382. this.element = new h(this.type,this.resolvedType,!1,this.syntax),
  36383. this.map && (this.keyElement = new h(this.keyType,void 0,!0,this.syntax)),
  36384. "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)
  36385. }
  36386. ,
  36387. g.verifyValue = function(t, i) {
  36388. function n(e, t) {
  36389. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  36390. }
  36391. i = i || !1;
  36392. var r = this;
  36393. if (null === t)
  36394. return this.required && n(typeof t, "required"),
  36395. "proto3" === this.syntax && this.type !== e.TYPES.message && n(typeof t, "proto3 field without field presence cannot be null"),
  36396. null;
  36397. var o;
  36398. if (this.repeated && !i) {
  36399. Array.isArray(t) || (t = [t]);
  36400. var a = [];
  36401. for (o = 0; o < t.length; o++)
  36402. a.push(this.element.verifyValue(t[o]));
  36403. return a
  36404. }
  36405. return this.map && !i ? t instanceof e.Map ? t : (t instanceof Object || n(typeof t, "expected ProtoBuf.Map or raw object for map field"),
  36406. new e.Map(this,t)) : (!this.repeated && Array.isArray(t) && n(typeof t, "no array expected"),
  36407. this.element.verifyValue(t))
  36408. }
  36409. ,
  36410. g.hasWirePresence = function(t, i) {
  36411. if ("proto3" !== this.syntax)
  36412. return null !== t;
  36413. if (this.oneof && i[this.oneof.name] === this.name)
  36414. return !0;
  36415. switch (this.type) {
  36416. case e.TYPES.int32:
  36417. case e.TYPES.sint32:
  36418. case e.TYPES.sfixed32:
  36419. case e.TYPES.uint32:
  36420. case e.TYPES.fixed32:
  36421. return 0 !== t;
  36422. case e.TYPES.int64:
  36423. case e.TYPES.sint64:
  36424. case e.TYPES.sfixed64:
  36425. case e.TYPES.uint64:
  36426. case e.TYPES.fixed64:
  36427. return 0 !== t.low || 0 !== t.high;
  36428. case e.TYPES.bool:
  36429. return t;
  36430. case e.TYPES.float:
  36431. case e.TYPES.double:
  36432. return 0 !== t;
  36433. case e.TYPES.string:
  36434. return t.length > 0;
  36435. case e.TYPES.bytes:
  36436. return t.remaining() > 0;
  36437. case e.TYPES.enum:
  36438. return 0 !== t;
  36439. case e.TYPES.message:
  36440. return null !== t;
  36441. default:
  36442. return !0
  36443. }
  36444. }
  36445. ,
  36446. g.encode = function(i, n, r) {
  36447. if (null === this.type || "object" != typeof this.type)
  36448. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  36449. if (null === i || this.repeated && 0 == i.length)
  36450. return n;
  36451. try {
  36452. if (this.repeated) {
  36453. var o;
  36454. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  36455. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36456. n.ensureCapacity(n.offset += 1);
  36457. var a = n.offset;
  36458. for (o = 0; o < i.length; o++)
  36459. this.element.encodeValue(this.id, i[o], n);
  36460. var s = n.offset - a
  36461. , l = t.calculateVarint32(s);
  36462. if (l > 1) {
  36463. var c = n.slice(a, n.offset);
  36464. a += l - 1,
  36465. n.offset = a,
  36466. n.append(c)
  36467. }
  36468. n.writeVarint32(s, a - l)
  36469. } else
  36470. for (o = 0; o < i.length; o++)
  36471. n.writeVarint32(this.id << 3 | this.type.wireType),
  36472. this.element.encodeValue(this.id, i[o], n)
  36473. } else
  36474. this.map ? i.forEach(function(i, r, o) {
  36475. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, r) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  36476. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36477. n.writeVarint32(a),
  36478. n.writeVarint32(8 | this.keyType.wireType),
  36479. this.keyElement.encodeValue(1, r, n),
  36480. n.writeVarint32(16 | this.type.wireType),
  36481. this.element.encodeValue(2, i, n)
  36482. }, this) : this.hasWirePresence(i, r) && (n.writeVarint32(this.id << 3 | this.type.wireType),
  36483. this.element.encodeValue(this.id, i, n))
  36484. } catch (e) {
  36485. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  36486. }
  36487. return n
  36488. }
  36489. ,
  36490. g.calculate = function(i, n) {
  36491. if (i = this.verifyValue(i),
  36492. null === this.type || "object" != typeof this.type)
  36493. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  36494. if (null === i || this.repeated && 0 == i.length)
  36495. return 0;
  36496. var r = 0;
  36497. try {
  36498. if (this.repeated) {
  36499. var o, a;
  36500. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  36501. for (r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36502. a = 0,
  36503. o = 0; o < i.length; o++)
  36504. a += this.element.calculateLength(this.id, i[o]);
  36505. r += t.calculateVarint32(a),
  36506. r += a
  36507. } else
  36508. for (o = 0; o < i.length; o++)
  36509. r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  36510. r += this.element.calculateLength(this.id, i[o])
  36511. } else
  36512. this.map ? i.forEach(function(i, n, o) {
  36513. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, n) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  36514. r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36515. r += t.calculateVarint32(a),
  36516. r += a
  36517. }, this) : this.hasWirePresence(i, n) && (r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  36518. r += this.element.calculateLength(this.id, i))
  36519. } catch (e) {
  36520. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  36521. }
  36522. return r
  36523. }
  36524. ,
  36525. g.decode = function(t, i, n) {
  36526. 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;
  36527. if (!a)
  36528. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + t + " (" + this.type.wireType + " expected)");
  36529. if (t == e.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0 && !n) {
  36530. o = i.readVarint32(),
  36531. o = i.offset + o;
  36532. for (var s = []; i.offset < o; )
  36533. s.push(this.decode(this.type.wireType, i, !0));
  36534. return s
  36535. }
  36536. if (this.map) {
  36537. var l = h.defaultFieldValue(this.keyType);
  36538. if (r = h.defaultFieldValue(this.type),
  36539. o = i.readVarint32(),
  36540. i.remaining() < o)
  36541. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + i.remaining());
  36542. var c = i.clone();
  36543. for (c.limit = c.offset + o,
  36544. i.offset += o; c.remaining() > 0; ) {
  36545. var u = c.readVarint32();
  36546. t = 7 & u;
  36547. var d = u >>> 3;
  36548. if (1 === d)
  36549. l = this.keyElement.decode(c, t, d);
  36550. else {
  36551. if (2 !== d)
  36552. throw Error("Unexpected tag in map field key/value submessage");
  36553. r = this.element.decode(c, t, d)
  36554. }
  36555. }
  36556. return [l, r]
  36557. }
  36558. return this.element.decode(i, t, this.id)
  36559. }
  36560. ,
  36561. o.Message.Field = f;
  36562. var m = function(e, t, i, n, r, o, a) {
  36563. f.call(this, e, t, i, null, n, r, o, a),
  36564. this.extension
  36565. };
  36566. m.prototype = Object.create(f.prototype),
  36567. o.Message.ExtensionField = m;
  36568. var v = function(e, t, i) {
  36569. a.call(this, e, t, i),
  36570. this.fields = []
  36571. };
  36572. o.Message.OneOf = v;
  36573. var A = function(e, t, i, n, r) {
  36574. l.call(this, e, t, i, n, r),
  36575. this.className = "Enum",
  36576. this.object = null
  36577. };
  36578. A.getName = function(e, t) {
  36579. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  36580. if (e[i = n[r]] === t)
  36581. return i;
  36582. return null
  36583. }
  36584. ;
  36585. var y = A.prototype = Object.create(l.prototype);
  36586. y.build = function(t) {
  36587. if (this.object && !t)
  36588. return this.object;
  36589. for (var i = new e.Builder.Enum, n = this.getChildren(A.Value), r = 0, o = n.length; r < o; ++r)
  36590. i[n[r].name] = n[r].id;
  36591. return Object.defineProperty && Object.defineProperty(i, "$options", {
  36592. value: this.buildOpt(),
  36593. enumerable: !1
  36594. }),
  36595. this.object = i
  36596. }
  36597. ,
  36598. o.Enum = A;
  36599. var C = function(e, t, i, n) {
  36600. a.call(this, e, t, i),
  36601. this.className = "Enum.Value",
  36602. this.id = n
  36603. };
  36604. C.prototype = Object.create(a.prototype),
  36605. o.Enum.Value = C;
  36606. var I = function(e, t, i, n) {
  36607. a.call(this, e, t, i),
  36608. this.field = n
  36609. };
  36610. I.prototype = Object.create(a.prototype),
  36611. o.Extension = I;
  36612. var E = function(e, t, i, n) {
  36613. l.call(this, e, t, i, n),
  36614. this.className = "Service",
  36615. this.clazz = null
  36616. }
  36617. , b = E.prototype = Object.create(l.prototype);
  36618. b.build = function(i) {
  36619. return this.clazz && !i ? this.clazz : this.clazz = function(e, i) {
  36620. for (var n = function(t) {
  36621. e.Builder.Service.call(this),
  36622. this.rpcImpl = t || function(e, t, i) {
  36623. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  36624. }
  36625. }, r = n.prototype = Object.create(e.Builder.Service.prototype), o = i.getChildren(e.Reflect.Service.RPCMethod), a = 0; a < o.length; a++)
  36626. !function(e) {
  36627. r[e.name] = function(n, r) {
  36628. try {
  36629. try {
  36630. n = e.resolvedRequestType.clazz.decode(t.wrap(n))
  36631. } catch (e) {
  36632. if (!(e instanceof TypeError))
  36633. throw e
  36634. }
  36635. if (null === n || "object" != typeof n)
  36636. throw Error("Illegal arguments");
  36637. n instanceof e.resolvedRequestType.clazz || (n = new e.resolvedRequestType.clazz(n)),
  36638. this.rpcImpl(e.fqn(), n, function(t, n) {
  36639. if (t)
  36640. return void r(t);
  36641. null === n && (n = "");
  36642. try {
  36643. n = e.resolvedResponseType.clazz.decode(n)
  36644. } catch (e) {}
  36645. 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))
  36646. })
  36647. } catch (e) {
  36648. setTimeout(r.bind(this, e), 0)
  36649. }
  36650. }
  36651. ,
  36652. n[e.name] = function(t, i, r) {
  36653. new n(t)[e.name](i, r)
  36654. }
  36655. ,
  36656. Object.defineProperty && (Object.defineProperty(n[e.name], "$options", {
  36657. value: e.buildOpt()
  36658. }),
  36659. Object.defineProperty(r[e.name], "$options", {
  36660. value: n[e.name].$options
  36661. }))
  36662. }(o[a]);
  36663. return Object.defineProperty && (Object.defineProperty(n, "$options", {
  36664. value: i.buildOpt()
  36665. }),
  36666. Object.defineProperty(r, "$options", {
  36667. value: n.$options
  36668. }),
  36669. Object.defineProperty(n, "$type", {
  36670. value: i
  36671. }),
  36672. Object.defineProperty(r, "$type", {
  36673. value: i
  36674. })),
  36675. n
  36676. }(e, this)
  36677. }
  36678. ,
  36679. o.Service = E;
  36680. var w = function(e, t, i, n) {
  36681. a.call(this, e, t, i),
  36682. this.className = "Service.Method",
  36683. this.options = n || {}
  36684. }
  36685. , _ = w.prototype = Object.create(a.prototype);
  36686. _.buildOpt = c.buildOpt,
  36687. o.Service.Method = w;
  36688. var T = function(e, t, i, n, r, o, a, s) {
  36689. w.call(this, e, t, i, s),
  36690. this.className = "Service.RPCMethod",
  36691. this.requestName = n,
  36692. this.responseName = r,
  36693. this.requestStream = o,
  36694. this.responseStream = a,
  36695. this.resolvedRequestType = null,
  36696. this.resolvedResponseType = null
  36697. };
  36698. return T.prototype = Object.create(w.prototype),
  36699. o.Service.RPCMethod = T,
  36700. o
  36701. }(r),
  36702. r.Builder = function(t, i, n) {
  36703. function r(e) {
  36704. e.messages && e.messages.forEach(function(t) {
  36705. t.syntax = e.syntax,
  36706. r(t)
  36707. }),
  36708. e.enums && e.enums.forEach(function(t) {
  36709. t.syntax = e.syntax
  36710. })
  36711. }
  36712. var o = function(e) {
  36713. this.ns = new n.Namespace(this,null,""),
  36714. this.ptr = this.ns,
  36715. this.resolved = !1,
  36716. this.result = null,
  36717. this.files = {},
  36718. this.importRoot = null,
  36719. this.options = e || {}
  36720. }
  36721. , a = o.prototype;
  36722. return o.isMessage = function(e) {
  36723. return "string" == typeof e.name && ("undefined" == typeof e.values && "undefined" == typeof e.rpc)
  36724. }
  36725. ,
  36726. o.isMessageField = function(e) {
  36727. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && "undefined" != typeof e.id
  36728. }
  36729. ,
  36730. o.isEnum = function(e) {
  36731. return "string" == typeof e.name && !("undefined" == typeof e.values || !Array.isArray(e.values) || 0 === e.values.length)
  36732. }
  36733. ,
  36734. o.isService = function(e) {
  36735. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  36736. }
  36737. ,
  36738. o.isExtend = function(e) {
  36739. return "string" == typeof e.ref
  36740. }
  36741. ,
  36742. a.reset = function() {
  36743. return this.ptr = this.ns,
  36744. this
  36745. }
  36746. ,
  36747. a.define = function(e) {
  36748. if ("string" != typeof e || !i.TYPEREF.test(e))
  36749. throw Error("illegal namespace: " + e);
  36750. return e.split(".").forEach(function(e) {
  36751. var t = this.ptr.getChild(e);
  36752. null === t && this.ptr.addChild(t = new n.Namespace(this,this.ptr,e)),
  36753. this.ptr = t
  36754. }, this),
  36755. this
  36756. }
  36757. ,
  36758. a.create = function(e) {
  36759. if (!e)
  36760. return this;
  36761. if (Array.isArray(e)) {
  36762. if (0 === e.length)
  36763. return this;
  36764. e = e.slice()
  36765. } else
  36766. e = [e];
  36767. for (var i = [e]; i.length > 0; ) {
  36768. if (e = i.pop(),
  36769. !Array.isArray(e))
  36770. throw Error("not a valid namespace: " + JSON.stringify(e));
  36771. for (; e.length > 0; ) {
  36772. var r = e.shift();
  36773. if (o.isMessage(r)) {
  36774. var a = new n.Message(this,this.ptr,r.name,r.options,r.isGroup,r.syntax)
  36775. , s = {};
  36776. r.oneofs && Object.keys(r.oneofs).forEach(function(e) {
  36777. a.addChild(s[e] = new n.Message.OneOf(this,a,e))
  36778. }, this),
  36779. r.fields && r.fields.forEach(function(e) {
  36780. if (null !== a.getChild(0 | e.id))
  36781. throw Error("duplicate or invalid field id in " + a.name + ": " + e.id);
  36782. if (e.options && "object" != typeof e.options)
  36783. throw Error("illegal field options in " + a.name + "#" + e.name);
  36784. var t = null;
  36785. if ("string" == typeof e.oneof && !(t = s[e.oneof]))
  36786. throw Error("illegal oneof in " + a.name + "#" + e.name + ": " + e.oneof);
  36787. e = new n.Message.Field(this,a,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,r.syntax),
  36788. t && t.fields.push(e),
  36789. a.addChild(e)
  36790. }, this);
  36791. var l = [];
  36792. if (r.enums && r.enums.forEach(function(e) {
  36793. l.push(e)
  36794. }),
  36795. r.messages && r.messages.forEach(function(e) {
  36796. l.push(e)
  36797. }),
  36798. r.services && r.services.forEach(function(e) {
  36799. l.push(e)
  36800. }),
  36801. r.extensions && ("number" == typeof r.extensions[0] ? a.extensions = [r.extensions] : a.extensions = r.extensions),
  36802. this.ptr.addChild(a),
  36803. l.length > 0) {
  36804. i.push(e),
  36805. e = l,
  36806. l = null,
  36807. this.ptr = a,
  36808. a = null;
  36809. continue
  36810. }
  36811. l = null
  36812. } else if (o.isEnum(r))
  36813. a = new n.Enum(this,this.ptr,r.name,r.options,r.syntax),
  36814. r.values.forEach(function(e) {
  36815. a.addChild(new n.Enum.Value(this,a,e.name,e.id))
  36816. }, this),
  36817. this.ptr.addChild(a);
  36818. else if (o.isService(r))
  36819. a = new n.Service(this,this.ptr,r.name,r.options),
  36820. Object.keys(r.rpc).forEach(function(e) {
  36821. var t = r.rpc[e];
  36822. a.addChild(new n.Service.RPCMethod(this,a,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  36823. }, this),
  36824. this.ptr.addChild(a);
  36825. else {
  36826. if (!o.isExtend(r))
  36827. throw Error("not a valid definition: " + JSON.stringify(r));
  36828. if (a = this.ptr.resolve(r.ref, !0))
  36829. r.fields.forEach(function(e) {
  36830. if (null !== a.getChild(0 | e.id))
  36831. throw Error("duplicate extended field id in " + a.name + ": " + e.id);
  36832. if (a.extensions) {
  36833. var i = !1;
  36834. if (a.extensions.forEach(function(t) {
  36835. e.id >= t[0] && e.id <= t[1] && (i = !0)
  36836. }),
  36837. !i)
  36838. throw Error("illegal extended field id in " + a.name + ": " + e.id + " (not within valid ranges)")
  36839. }
  36840. var r = e.name;
  36841. this.options.convertFieldsToCamelCase && (r = t.Util.toCamelCase(r));
  36842. var o = new n.Message.ExtensionField(this,a,e.rule,e.type,this.ptr.fqn() + "." + r,e.id,e.options)
  36843. , s = new n.Extension(this,this.ptr,e.name,o);
  36844. o.extension = s,
  36845. this.ptr.addChild(s),
  36846. a.addChild(o)
  36847. }, this);
  36848. else if (!/\.?google\.protobuf\./.test(r.ref))
  36849. throw Error("extended message " + r.ref + " is not defined")
  36850. }
  36851. r = null,
  36852. a = null
  36853. }
  36854. e = null,
  36855. this.ptr = this.ptr.parent
  36856. }
  36857. return this.resolved = !1,
  36858. this.result = null,
  36859. this
  36860. }
  36861. ,
  36862. a.import = function(i, n) {
  36863. var o = "/";
  36864. if ("string" == typeof n) {
  36865. if (t.Util.IS_NODE && (n = e("path").resolve(n)),
  36866. this.files[n] === !0)
  36867. return this.reset();
  36868. this.files[n] = !0
  36869. } else if ("object" == typeof n) {
  36870. var a = n.root;
  36871. t.Util.IS_NODE && (a = e("path").resolve(a)),
  36872. (a.indexOf("\\") >= 0 || n.file.indexOf("\\") >= 0) && (o = "\\");
  36873. var s = a + o + n.file;
  36874. if (this.files[s] === !0)
  36875. return this.reset();
  36876. this.files[s] = !0
  36877. }
  36878. if (i.imports && i.imports.length > 0) {
  36879. var l, c = !1;
  36880. "object" == typeof n ? (this.importRoot = n.root,
  36881. c = !0,
  36882. l = this.importRoot,
  36883. n = n.file,
  36884. (l.indexOf("\\") >= 0 || n.indexOf("\\") >= 0) && (o = "\\")) : "string" == typeof n ? this.importRoot ? l = this.importRoot : n.indexOf("/") >= 0 ? (l = n.replace(/\/[^\/]*$/, ""),
  36885. "" === l && (l = "/")) : n.indexOf("\\") >= 0 ? (l = n.replace(/\\[^\\]*$/, ""),
  36886. o = "\\") : l = "." : l = null;
  36887. for (var h = 0; h < i.imports.length; h++)
  36888. if ("string" == typeof i.imports[h]) {
  36889. if (!l)
  36890. throw Error("cannot determine import root");
  36891. var u = i.imports[h];
  36892. if ("google/protobuf/descriptor.proto" === u)
  36893. continue;
  36894. if (u = l + o + u,
  36895. this.files[u] === !0)
  36896. continue;
  36897. /\.proto$/i.test(u) && !t.DotProto && (u = u.replace(/\.proto$/, ".json"));
  36898. var d = t.Util.fetch(u);
  36899. if (null === d)
  36900. throw Error("failed to import '" + u + "' in '" + n + "': file not found");
  36901. /\.json$/i.test(u) ? this.import(JSON.parse(d + ""), u) : this.import(t.DotProto.Parser.parse(d), u)
  36902. } else
  36903. n ? /\.(\w+)$/.test(n) ? this.import(i.imports[h], n.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  36904. return t + "_import" + h + "." + i
  36905. })) : this.import(i.imports[h], n + "_import" + h) : this.import(i.imports[h]);
  36906. c && (this.importRoot = null)
  36907. }
  36908. i.package && this.define(i.package),
  36909. i.syntax && r(i);
  36910. var p = this.ptr;
  36911. return i.options && Object.keys(i.options).forEach(function(e) {
  36912. p.options[e] = i.options[e]
  36913. }),
  36914. i.messages && (this.create(i.messages),
  36915. this.ptr = p),
  36916. i.enums && (this.create(i.enums),
  36917. this.ptr = p),
  36918. i.services && (this.create(i.services),
  36919. this.ptr = p),
  36920. i.extends && this.create(i.extends),
  36921. this.reset()
  36922. }
  36923. ,
  36924. a.resolveAll = function() {
  36925. var e;
  36926. if (null == this.ptr || "object" == typeof this.ptr.type)
  36927. return this;
  36928. if (this.ptr instanceof n.Namespace)
  36929. this.ptr.children.forEach(function(e) {
  36930. this.ptr = e,
  36931. this.resolveAll()
  36932. }, this);
  36933. else if (this.ptr instanceof n.Message.Field) {
  36934. if (i.TYPE.test(this.ptr.type))
  36935. this.ptr.type = t.TYPES[this.ptr.type];
  36936. else {
  36937. if (!i.TYPEREF.test(this.ptr.type))
  36938. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  36939. if (e = (this.ptr instanceof n.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0),
  36940. !e)
  36941. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  36942. if (this.ptr.resolvedType = e,
  36943. e instanceof n.Enum) {
  36944. if (this.ptr.type = t.TYPES.enum,
  36945. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  36946. throw Error("proto3 message cannot reference proto2 enum")
  36947. } else {
  36948. if (!(e instanceof n.Message))
  36949. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  36950. this.ptr.type = e.isGroup ? t.TYPES.group : t.TYPES.message
  36951. }
  36952. }
  36953. if (this.ptr.map) {
  36954. if (!i.TYPE.test(this.ptr.keyType))
  36955. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  36956. this.ptr.keyType = t.TYPES[this.ptr.keyType]
  36957. }
  36958. } else if (this.ptr instanceof t.Reflect.Service.Method) {
  36959. if (!(this.ptr instanceof t.Reflect.Service.RPCMethod))
  36960. throw Error("illegal service type in " + this.ptr.toString(!0));
  36961. if (e = this.ptr.parent.resolve(this.ptr.requestName, !0),
  36962. !(e && e instanceof t.Reflect.Message))
  36963. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  36964. if (this.ptr.resolvedRequestType = e,
  36965. e = this.ptr.parent.resolve(this.ptr.responseName, !0),
  36966. !(e && e instanceof t.Reflect.Message))
  36967. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  36968. this.ptr.resolvedResponseType = e
  36969. } else if (!(this.ptr instanceof t.Reflect.Message.OneOf || this.ptr instanceof t.Reflect.Extension || this.ptr instanceof t.Reflect.Enum.Value))
  36970. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  36971. return this.reset()
  36972. }
  36973. ,
  36974. a.build = function(e) {
  36975. if (this.reset(),
  36976. this.resolved || (this.resolveAll(),
  36977. this.resolved = !0,
  36978. this.result = null),
  36979. null === this.result && (this.result = this.ns.build()),
  36980. !e)
  36981. return this.result;
  36982. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  36983. if (!i[t[n]]) {
  36984. i = null;
  36985. break
  36986. }
  36987. i = i[t[n]]
  36988. }
  36989. return i
  36990. }
  36991. ,
  36992. a.lookup = function(e, t) {
  36993. return e ? this.ns.resolve(e, t) : this.ns
  36994. }
  36995. ,
  36996. a.toString = function() {
  36997. return "Builder"
  36998. }
  36999. ,
  37000. o.Message = function() {}
  37001. ,
  37002. o.Enum = function() {}
  37003. ,
  37004. o.Service = function() {}
  37005. ,
  37006. o
  37007. }(r, r.Lang, r.Reflect),
  37008. r.Map = function(e, t) {
  37009. function i(e) {
  37010. var t = 0;
  37011. return {
  37012. next: function() {
  37013. return t < e.length ? {
  37014. done: !1,
  37015. value: e[t++]
  37016. } : {
  37017. done: !0
  37018. }
  37019. }
  37020. }
  37021. }
  37022. var n = function(e, i) {
  37023. if (!e.map)
  37024. throw Error("field is not a map");
  37025. if (this.field = e,
  37026. this.keyElem = new t.Element(e.keyType,null,!0,e.syntax),
  37027. this.valueElem = new t.Element(e.type,e.resolvedType,!1,e.syntax),
  37028. this.map = {},
  37029. Object.defineProperty(this, "size", {
  37030. get: function() {
  37031. return Object.keys(this.map).length
  37032. }
  37033. }),
  37034. i)
  37035. for (var n = Object.keys(i), r = 0; r < n.length; r++) {
  37036. var o = this.keyElem.valueFromString(n[r])
  37037. , a = this.valueElem.verifyValue(i[n[r]]);
  37038. this.map[this.keyElem.valueToString(o)] = {
  37039. key: o,
  37040. value: a
  37041. }
  37042. }
  37043. }
  37044. , r = n.prototype;
  37045. return r.clear = function() {
  37046. this.map = {}
  37047. }
  37048. ,
  37049. r.delete = function(e) {
  37050. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  37051. , i = t in this.map;
  37052. return delete this.map[t],
  37053. i
  37054. }
  37055. ,
  37056. r.entries = function() {
  37057. for (var e, t = [], n = Object.keys(this.map), r = 0; r < n.length; r++)
  37058. t.push([(e = this.map[n[r]]).key, e.value]);
  37059. return i(t)
  37060. }
  37061. ,
  37062. r.keys = function() {
  37063. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  37064. e.push(this.map[t[n]].key);
  37065. return i(e)
  37066. }
  37067. ,
  37068. r.values = function() {
  37069. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  37070. e.push(this.map[t[n]].value);
  37071. return i(e)
  37072. }
  37073. ,
  37074. r.forEach = function(e, t) {
  37075. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  37076. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  37077. }
  37078. ,
  37079. r.set = function(e, t) {
  37080. var i = this.keyElem.verifyValue(e)
  37081. , n = this.valueElem.verifyValue(t);
  37082. return this.map[this.keyElem.valueToString(i)] = {
  37083. key: i,
  37084. value: n
  37085. },
  37086. this
  37087. }
  37088. ,
  37089. r.get = function(e) {
  37090. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  37091. if (t in this.map)
  37092. return this.map[t].value
  37093. }
  37094. ,
  37095. r.has = function(e) {
  37096. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  37097. return t in this.map
  37098. }
  37099. ,
  37100. n
  37101. }(r, r.Reflect),
  37102. r.loadProto = function(e, t, i) {
  37103. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  37104. t = void 0),
  37105. r.loadJson(r.DotProto.Parser.parse(e), t, i)
  37106. }
  37107. ,
  37108. r.protoFromString = r.loadProto,
  37109. r.loadProtoFile = function(e, t, i) {
  37110. if (t && "object" == typeof t ? (i = t,
  37111. t = null) : t && "function" == typeof t || (t = null),
  37112. t)
  37113. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  37114. if (null === n)
  37115. return void t(Error("Failed to fetch file"));
  37116. try {
  37117. t(null, r.loadProto(n, i, e))
  37118. } catch (e) {
  37119. t(e)
  37120. }
  37121. });
  37122. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  37123. return null === n ? null : r.loadProto(n, i, e)
  37124. }
  37125. ,
  37126. r.protoFromFile = r.loadProtoFile,
  37127. r.newBuilder = function(e) {
  37128. return e = e || {},
  37129. "undefined" == typeof e.convertFieldsToCamelCase && (e.convertFieldsToCamelCase = r.convertFieldsToCamelCase),
  37130. "undefined" == typeof e.populateAccessors && (e.populateAccessors = r.populateAccessors),
  37131. new r.Builder(e)
  37132. }
  37133. ,
  37134. r.loadJson = function(e, t, i) {
  37135. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  37136. t = null),
  37137. t && "object" == typeof t || (t = r.newBuilder()),
  37138. "string" == typeof e && (e = JSON.parse(e)),
  37139. t.import(e, i),
  37140. t.resolveAll(),
  37141. t
  37142. }
  37143. ,
  37144. r.loadJsonFile = function(e, t, i) {
  37145. if (t && "object" == typeof t ? (i = t,
  37146. t = null) : t && "function" == typeof t || (t = null),
  37147. t)
  37148. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  37149. if (null === n)
  37150. return void t(Error("Failed to fetch file"));
  37151. try {
  37152. t(null, r.loadJson(JSON.parse(n), i, e))
  37153. } catch (e) {
  37154. t(e)
  37155. }
  37156. });
  37157. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  37158. return null === n ? null : r.loadJson(JSON.parse(n), i, e)
  37159. }
  37160. ,
  37161. r
  37162. })
  37163. }
  37164. ).call(this, e("_process"))
  37165. }
  37166. , {
  37167. _process: 203,
  37168. bytebuffer: 215,
  37169. fs: 197,
  37170. path: 197
  37171. }],
  37172. 215: [function(e, t, i) {
  37173. !function(i, n) {
  37174. "function" == typeof define && define.amd ? define(["long"], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = function() {
  37175. var t;
  37176. try {
  37177. t = e("long")
  37178. } catch (e) {}
  37179. return n(t)
  37180. }() : (i.dcodeIO = i.dcodeIO || {}).ByteBuffer = n(i.dcodeIO.Long)
  37181. }(this, function(e) {
  37182. "use strict";
  37183. function t(e) {
  37184. var t = 0;
  37185. return function() {
  37186. return t < e.length ? e.charCodeAt(t++) : null
  37187. }
  37188. }
  37189. function i() {
  37190. var e = []
  37191. , t = [];
  37192. return function() {
  37193. return 0 === arguments.length ? t.join("") + l.apply(String, e) : (e.length + arguments.length > 1024 && (t.push(l.apply(String, e)),
  37194. e.length = 0),
  37195. void Array.prototype.push.apply(e, arguments))
  37196. }
  37197. }
  37198. function n(e, t, i, n, r) {
  37199. 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];
  37200. for (u += d,
  37201. o = p & (1 << -h) - 1,
  37202. p >>= -h,
  37203. h += s; h > 0; o = 256 * o + e[t + u],
  37204. u += d,
  37205. h -= 8)
  37206. ;
  37207. for (a = o & (1 << -h) - 1,
  37208. o >>= -h,
  37209. h += n; h > 0; a = 256 * a + e[t + u],
  37210. u += d,
  37211. h -= 8)
  37212. ;
  37213. if (0 === o)
  37214. o = 1 - c;
  37215. else {
  37216. if (o === l)
  37217. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  37218. a += Math.pow(2, n),
  37219. o -= c
  37220. }
  37221. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  37222. }
  37223. function r(e, t, i, n, r, o) {
  37224. 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;
  37225. for (t = Math.abs(t),
  37226. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  37227. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  37228. t * (l = Math.pow(2, -a)) < 1 && (a--,
  37229. l *= 2),
  37230. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  37231. t * l >= 2 && (a++,
  37232. l /= 2),
  37233. a + u >= h ? (s = 0,
  37234. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  37235. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  37236. a = 0)); r >= 8; e[i + p] = 255 & s,
  37237. p += f,
  37238. s /= 256,
  37239. r -= 8)
  37240. ;
  37241. for (a = a << r | s,
  37242. c += r; c > 0; e[i + p] = 255 & a,
  37243. p += f,
  37244. a /= 256,
  37245. c -= 8)
  37246. ;
  37247. e[i + p - f] |= 128 * g
  37248. }
  37249. var o = function(e, t, i) {
  37250. if ("undefined" == typeof e && (e = o.DEFAULT_CAPACITY),
  37251. "undefined" == typeof t && (t = o.DEFAULT_ENDIAN),
  37252. "undefined" == typeof i && (i = o.DEFAULT_NOASSERT),
  37253. !i) {
  37254. if (e |= 0,
  37255. e < 0)
  37256. throw RangeError("Illegal capacity");
  37257. t = !!t,
  37258. i = !!i
  37259. }
  37260. this.buffer = 0 === e ? s : new ArrayBuffer(e),
  37261. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  37262. this.offset = 0,
  37263. this.markedOffset = -1,
  37264. this.limit = e,
  37265. this.littleEndian = t,
  37266. this.noAssert = i
  37267. };
  37268. o.VERSION = "5.0.1",
  37269. o.LITTLE_ENDIAN = !0,
  37270. o.BIG_ENDIAN = !1,
  37271. o.DEFAULT_CAPACITY = 16,
  37272. o.DEFAULT_ENDIAN = o.BIG_ENDIAN,
  37273. o.DEFAULT_NOASSERT = !1,
  37274. o.Long = e || null;
  37275. var a = o.prototype;
  37276. a.__isByteBuffer__,
  37277. Object.defineProperty(a, "__isByteBuffer__", {
  37278. value: !0,
  37279. enumerable: !1,
  37280. configurable: !1
  37281. });
  37282. var s = new ArrayBuffer(0)
  37283. , l = String.fromCharCode;
  37284. o.accessor = function() {
  37285. return Uint8Array
  37286. }
  37287. ,
  37288. o.allocate = function(e, t, i) {
  37289. return new o(e,t,i)
  37290. }
  37291. ,
  37292. o.concat = function(e, t, i, n) {
  37293. "boolean" != typeof t && "string" == typeof t || (n = i,
  37294. i = t,
  37295. t = void 0);
  37296. for (var r, a = 0, s = 0, l = e.length; s < l; ++s)
  37297. o.isByteBuffer(e[s]) || (e[s] = o.wrap(e[s], t)),
  37298. r = e[s].limit - e[s].offset,
  37299. r > 0 && (a += r);
  37300. if (0 === a)
  37301. return new o(0,i,n);
  37302. var c, h = new o(a,i,n);
  37303. for (s = 0; s < l; )
  37304. c = e[s++],
  37305. r = c.limit - c.offset,
  37306. r <= 0 || (h.view.set(c.view.subarray(c.offset, c.limit), h.offset),
  37307. h.offset += r);
  37308. return h.limit = h.offset,
  37309. h.offset = 0,
  37310. h
  37311. }
  37312. ,
  37313. o.isByteBuffer = function(e) {
  37314. return (e && e.__isByteBuffer__) === !0
  37315. }
  37316. ,
  37317. o.type = function() {
  37318. return ArrayBuffer
  37319. }
  37320. ,
  37321. o.wrap = function(e, t, i, n) {
  37322. if ("string" != typeof t && (n = i,
  37323. i = t,
  37324. t = void 0),
  37325. "string" == typeof e)
  37326. switch ("undefined" == typeof t && (t = "utf8"),
  37327. t) {
  37328. case "base64":
  37329. return o.fromBase64(e, i);
  37330. case "hex":
  37331. return o.fromHex(e, i);
  37332. case "binary":
  37333. return o.fromBinary(e, i);
  37334. case "utf8":
  37335. return o.fromUTF8(e, i);
  37336. case "debug":
  37337. return o.fromDebug(e, i);
  37338. default:
  37339. throw Error("Unsupported encoding: " + t)
  37340. }
  37341. if (null === e || "object" != typeof e)
  37342. throw TypeError("Illegal buffer");
  37343. var r;
  37344. if (o.isByteBuffer(e))
  37345. return r = a.clone.call(e),
  37346. r.markedOffset = -1,
  37347. r;
  37348. if (e instanceof Uint8Array)
  37349. r = new o(0,i,n),
  37350. e.length > 0 && (r.buffer = e.buffer,
  37351. r.offset = e.byteOffset,
  37352. r.limit = e.byteOffset + e.byteLength,
  37353. r.view = new Uint8Array(e.buffer));
  37354. else if (e instanceof ArrayBuffer)
  37355. r = new o(0,i,n),
  37356. e.byteLength > 0 && (r.buffer = e,
  37357. r.offset = 0,
  37358. r.limit = e.byteLength,
  37359. r.view = e.byteLength > 0 ? new Uint8Array(e) : null);
  37360. else {
  37361. if ("[object Array]" !== Object.prototype.toString.call(e))
  37362. throw TypeError("Illegal buffer");
  37363. r = new o(e.length,i,n),
  37364. r.limit = e.length;
  37365. for (var s = 0; s < e.length; ++s)
  37366. r.view[s] = e[s]
  37367. }
  37368. return r
  37369. }
  37370. ,
  37371. a.writeBitSet = function(e, t) {
  37372. var i = "undefined" == typeof t;
  37373. if (i && (t = this.offset),
  37374. !this.noAssert) {
  37375. if (!(e instanceof Array))
  37376. throw TypeError("Illegal BitSet: Not an array");
  37377. if ("number" != typeof t || t % 1 !== 0)
  37378. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37379. if (t >>>= 0,
  37380. t < 0 || t + 0 > this.buffer.byteLength)
  37381. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37382. }
  37383. var n, r = t, o = e.length, a = o >> 3, s = 0;
  37384. for (t += this.writeVarint32(o, t); a--; )
  37385. 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,
  37386. this.writeByte(n, t++);
  37387. if (s < o) {
  37388. var l = 0;
  37389. for (n = 0; s < o; )
  37390. n |= (1 & !!e[s++]) << l++;
  37391. this.writeByte(n, t++)
  37392. }
  37393. return i ? (this.offset = t,
  37394. this) : t - r
  37395. }
  37396. ,
  37397. a.readBitSet = function(e) {
  37398. var t = "undefined" == typeof e;
  37399. t && (e = this.offset);
  37400. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  37401. for (e += n.length; o--; )
  37402. i = this.readByte(e++),
  37403. s[a++] = !!(1 & i),
  37404. s[a++] = !!(2 & i),
  37405. s[a++] = !!(4 & i),
  37406. s[a++] = !!(8 & i),
  37407. s[a++] = !!(16 & i),
  37408. s[a++] = !!(32 & i),
  37409. s[a++] = !!(64 & i),
  37410. s[a++] = !!(128 & i);
  37411. if (a < r) {
  37412. var l = 0;
  37413. for (i = this.readByte(e++); a < r; )
  37414. s[a++] = !!(i >> l++ & 1)
  37415. }
  37416. return t && (this.offset = e),
  37417. s
  37418. }
  37419. ,
  37420. a.readBytes = function(e, t) {
  37421. var i = "undefined" == typeof t;
  37422. if (i && (t = this.offset),
  37423. !this.noAssert) {
  37424. if ("number" != typeof t || t % 1 !== 0)
  37425. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37426. if (t >>>= 0,
  37427. t < 0 || t + e > this.buffer.byteLength)
  37428. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  37429. }
  37430. var n = this.slice(t, t + e);
  37431. return i && (this.offset += e),
  37432. n
  37433. }
  37434. ,
  37435. a.writeBytes = a.append,
  37436. a.writeInt8 = function(e, t) {
  37437. var i = "undefined" == typeof t;
  37438. if (i && (t = this.offset),
  37439. !this.noAssert) {
  37440. if ("number" != typeof e || e % 1 !== 0)
  37441. throw TypeError("Illegal value: " + e + " (not an integer)");
  37442. if (e |= 0,
  37443. "number" != typeof t || t % 1 !== 0)
  37444. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37445. if (t >>>= 0,
  37446. t < 0 || t + 0 > this.buffer.byteLength)
  37447. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37448. }
  37449. t += 1;
  37450. var n = this.buffer.byteLength;
  37451. return t > n && this.resize((n *= 2) > t ? n : t),
  37452. t -= 1,
  37453. this.view[t] = e,
  37454. i && (this.offset += 1),
  37455. this
  37456. }
  37457. ,
  37458. a.writeByte = a.writeInt8,
  37459. a.readInt8 = function(e) {
  37460. var t = "undefined" == typeof e;
  37461. if (t && (e = this.offset),
  37462. !this.noAssert) {
  37463. if ("number" != typeof e || e % 1 !== 0)
  37464. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37465. if (e >>>= 0,
  37466. e < 0 || e + 1 > this.buffer.byteLength)
  37467. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37468. }
  37469. var i = this.view[e];
  37470. return 128 === (128 & i) && (i = -(255 - i + 1)),
  37471. t && (this.offset += 1),
  37472. i
  37473. }
  37474. ,
  37475. a.readByte = a.readInt8,
  37476. a.writeUint8 = function(e, t) {
  37477. var i = "undefined" == typeof t;
  37478. if (i && (t = this.offset),
  37479. !this.noAssert) {
  37480. if ("number" != typeof e || e % 1 !== 0)
  37481. throw TypeError("Illegal value: " + e + " (not an integer)");
  37482. if (e >>>= 0,
  37483. "number" != typeof t || t % 1 !== 0)
  37484. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37485. if (t >>>= 0,
  37486. t < 0 || t + 0 > this.buffer.byteLength)
  37487. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37488. }
  37489. t += 1;
  37490. var n = this.buffer.byteLength;
  37491. return t > n && this.resize((n *= 2) > t ? n : t),
  37492. t -= 1,
  37493. this.view[t] = e,
  37494. i && (this.offset += 1),
  37495. this
  37496. }
  37497. ,
  37498. a.writeUInt8 = a.writeUint8,
  37499. a.readUint8 = function(e) {
  37500. var t = "undefined" == typeof e;
  37501. if (t && (e = this.offset),
  37502. !this.noAssert) {
  37503. if ("number" != typeof e || e % 1 !== 0)
  37504. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37505. if (e >>>= 0,
  37506. e < 0 || e + 1 > this.buffer.byteLength)
  37507. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37508. }
  37509. var i = this.view[e];
  37510. return t && (this.offset += 1),
  37511. i
  37512. }
  37513. ,
  37514. a.readUInt8 = a.readUint8,
  37515. a.writeInt16 = function(e, t) {
  37516. var i = "undefined" == typeof t;
  37517. if (i && (t = this.offset),
  37518. !this.noAssert) {
  37519. if ("number" != typeof e || e % 1 !== 0)
  37520. throw TypeError("Illegal value: " + e + " (not an integer)");
  37521. if (e |= 0,
  37522. "number" != typeof t || t % 1 !== 0)
  37523. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37524. if (t >>>= 0,
  37525. t < 0 || t + 0 > this.buffer.byteLength)
  37526. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37527. }
  37528. t += 2;
  37529. var n = this.buffer.byteLength;
  37530. return t > n && this.resize((n *= 2) > t ? n : t),
  37531. t -= 2,
  37532. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  37533. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  37534. this.view[t + 1] = 255 & e),
  37535. i && (this.offset += 2),
  37536. this
  37537. }
  37538. ,
  37539. a.writeShort = a.writeInt16,
  37540. a.readInt16 = function(e) {
  37541. var t = "undefined" == typeof e;
  37542. if (t && (e = this.offset),
  37543. !this.noAssert) {
  37544. if ("number" != typeof e || e % 1 !== 0)
  37545. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37546. if (e >>>= 0,
  37547. e < 0 || e + 2 > this.buffer.byteLength)
  37548. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  37549. }
  37550. var i = 0;
  37551. return this.littleEndian ? (i = this.view[e],
  37552. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  37553. i |= this.view[e + 1]),
  37554. 32768 === (32768 & i) && (i = -(65535 - i + 1)),
  37555. t && (this.offset += 2),
  37556. i
  37557. }
  37558. ,
  37559. a.readShort = a.readInt16,
  37560. a.writeUint16 = function(e, t) {
  37561. var i = "undefined" == typeof t;
  37562. if (i && (t = this.offset),
  37563. !this.noAssert) {
  37564. if ("number" != typeof e || e % 1 !== 0)
  37565. throw TypeError("Illegal value: " + e + " (not an integer)");
  37566. if (e >>>= 0,
  37567. "number" != typeof t || t % 1 !== 0)
  37568. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37569. if (t >>>= 0,
  37570. t < 0 || t + 0 > this.buffer.byteLength)
  37571. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37572. }
  37573. t += 2;
  37574. var n = this.buffer.byteLength;
  37575. return t > n && this.resize((n *= 2) > t ? n : t),
  37576. t -= 2,
  37577. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  37578. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  37579. this.view[t + 1] = 255 & e),
  37580. i && (this.offset += 2),
  37581. this
  37582. }
  37583. ,
  37584. a.writeUInt16 = a.writeUint16,
  37585. a.readUint16 = function(e) {
  37586. var t = "undefined" == typeof e;
  37587. if (t && (e = this.offset),
  37588. !this.noAssert) {
  37589. if ("number" != typeof e || e % 1 !== 0)
  37590. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37591. if (e >>>= 0,
  37592. e < 0 || e + 2 > this.buffer.byteLength)
  37593. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  37594. }
  37595. var i = 0;
  37596. return this.littleEndian ? (i = this.view[e],
  37597. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  37598. i |= this.view[e + 1]),
  37599. t && (this.offset += 2),
  37600. i
  37601. }
  37602. ,
  37603. a.readUInt16 = a.readUint16,
  37604. a.writeInt32 = function(e, t) {
  37605. var i = "undefined" == typeof t;
  37606. if (i && (t = this.offset),
  37607. !this.noAssert) {
  37608. if ("number" != typeof e || e % 1 !== 0)
  37609. throw TypeError("Illegal value: " + e + " (not an integer)");
  37610. if (e |= 0,
  37611. "number" != typeof t || t % 1 !== 0)
  37612. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37613. if (t >>>= 0,
  37614. t < 0 || t + 0 > this.buffer.byteLength)
  37615. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37616. }
  37617. t += 4;
  37618. var n = this.buffer.byteLength;
  37619. return t > n && this.resize((n *= 2) > t ? n : t),
  37620. t -= 4,
  37621. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  37622. this.view[t + 2] = e >>> 16 & 255,
  37623. this.view[t + 1] = e >>> 8 & 255,
  37624. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  37625. this.view[t + 1] = e >>> 16 & 255,
  37626. this.view[t + 2] = e >>> 8 & 255,
  37627. this.view[t + 3] = 255 & e),
  37628. i && (this.offset += 4),
  37629. this
  37630. }
  37631. ,
  37632. a.writeInt = a.writeInt32,
  37633. a.readInt32 = function(e) {
  37634. var t = "undefined" == typeof e;
  37635. if (t && (e = this.offset),
  37636. !this.noAssert) {
  37637. if ("number" != typeof e || e % 1 !== 0)
  37638. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37639. if (e >>>= 0,
  37640. e < 0 || e + 4 > this.buffer.byteLength)
  37641. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  37642. }
  37643. var i = 0;
  37644. return this.littleEndian ? (i = this.view[e + 2] << 16,
  37645. i |= this.view[e + 1] << 8,
  37646. i |= this.view[e],
  37647. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  37648. i |= this.view[e + 2] << 8,
  37649. i |= this.view[e + 3],
  37650. i += this.view[e] << 24 >>> 0),
  37651. i |= 0,
  37652. t && (this.offset += 4),
  37653. i
  37654. }
  37655. ,
  37656. a.readInt = a.readInt32,
  37657. a.writeUint32 = function(e, t) {
  37658. var i = "undefined" == typeof t;
  37659. if (i && (t = this.offset),
  37660. !this.noAssert) {
  37661. if ("number" != typeof e || e % 1 !== 0)
  37662. throw TypeError("Illegal value: " + e + " (not an integer)");
  37663. if (e >>>= 0,
  37664. "number" != typeof t || t % 1 !== 0)
  37665. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37666. if (t >>>= 0,
  37667. t < 0 || t + 0 > this.buffer.byteLength)
  37668. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37669. }
  37670. t += 4;
  37671. var n = this.buffer.byteLength;
  37672. return t > n && this.resize((n *= 2) > t ? n : t),
  37673. t -= 4,
  37674. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  37675. this.view[t + 2] = e >>> 16 & 255,
  37676. this.view[t + 1] = e >>> 8 & 255,
  37677. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  37678. this.view[t + 1] = e >>> 16 & 255,
  37679. this.view[t + 2] = e >>> 8 & 255,
  37680. this.view[t + 3] = 255 & e),
  37681. i && (this.offset += 4),
  37682. this
  37683. }
  37684. ,
  37685. a.writeUInt32 = a.writeUint32,
  37686. a.readUint32 = function(e) {
  37687. var t = "undefined" == typeof e;
  37688. if (t && (e = this.offset),
  37689. !this.noAssert) {
  37690. if ("number" != typeof e || e % 1 !== 0)
  37691. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37692. if (e >>>= 0,
  37693. e < 0 || e + 4 > this.buffer.byteLength)
  37694. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  37695. }
  37696. var i = 0;
  37697. return this.littleEndian ? (i = this.view[e + 2] << 16,
  37698. i |= this.view[e + 1] << 8,
  37699. i |= this.view[e],
  37700. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  37701. i |= this.view[e + 2] << 8,
  37702. i |= this.view[e + 3],
  37703. i += this.view[e] << 24 >>> 0),
  37704. t && (this.offset += 4),
  37705. i
  37706. }
  37707. ,
  37708. a.readUInt32 = a.readUint32,
  37709. e && (a.writeInt64 = function(t, i) {
  37710. var n = "undefined" == typeof i;
  37711. if (n && (i = this.offset),
  37712. !this.noAssert) {
  37713. if ("number" == typeof t)
  37714. t = e.fromNumber(t);
  37715. else if ("string" == typeof t)
  37716. t = e.fromString(t);
  37717. else if (!(t && t instanceof e))
  37718. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  37719. if ("number" != typeof i || i % 1 !== 0)
  37720. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37721. if (i >>>= 0,
  37722. i < 0 || i + 0 > this.buffer.byteLength)
  37723. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37724. }
  37725. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  37726. i += 8;
  37727. var r = this.buffer.byteLength;
  37728. i > r && this.resize((r *= 2) > i ? r : i),
  37729. i -= 8;
  37730. var o = t.low
  37731. , a = t.high;
  37732. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  37733. this.view[i + 2] = o >>> 16 & 255,
  37734. this.view[i + 1] = o >>> 8 & 255,
  37735. this.view[i] = 255 & o,
  37736. i += 4,
  37737. this.view[i + 3] = a >>> 24 & 255,
  37738. this.view[i + 2] = a >>> 16 & 255,
  37739. this.view[i + 1] = a >>> 8 & 255,
  37740. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  37741. this.view[i + 1] = a >>> 16 & 255,
  37742. this.view[i + 2] = a >>> 8 & 255,
  37743. this.view[i + 3] = 255 & a,
  37744. i += 4,
  37745. this.view[i] = o >>> 24 & 255,
  37746. this.view[i + 1] = o >>> 16 & 255,
  37747. this.view[i + 2] = o >>> 8 & 255,
  37748. this.view[i + 3] = 255 & o),
  37749. n && (this.offset += 8),
  37750. this
  37751. }
  37752. ,
  37753. a.writeLong = a.writeInt64,
  37754. a.readInt64 = function(t) {
  37755. var i = "undefined" == typeof t;
  37756. if (i && (t = this.offset),
  37757. !this.noAssert) {
  37758. if ("number" != typeof t || t % 1 !== 0)
  37759. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37760. if (t >>>= 0,
  37761. t < 0 || t + 8 > this.buffer.byteLength)
  37762. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  37763. }
  37764. var n = 0
  37765. , r = 0;
  37766. this.littleEndian ? (n = this.view[t + 2] << 16,
  37767. n |= this.view[t + 1] << 8,
  37768. n |= this.view[t],
  37769. n += this.view[t + 3] << 24 >>> 0,
  37770. t += 4,
  37771. r = this.view[t + 2] << 16,
  37772. r |= this.view[t + 1] << 8,
  37773. r |= this.view[t],
  37774. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  37775. r |= this.view[t + 2] << 8,
  37776. r |= this.view[t + 3],
  37777. r += this.view[t] << 24 >>> 0,
  37778. t += 4,
  37779. n = this.view[t + 1] << 16,
  37780. n |= this.view[t + 2] << 8,
  37781. n |= this.view[t + 3],
  37782. n += this.view[t] << 24 >>> 0);
  37783. var o = new e(n,r,!1);
  37784. return i && (this.offset += 8),
  37785. o
  37786. }
  37787. ,
  37788. a.readLong = a.readInt64,
  37789. a.writeUint64 = function(t, i) {
  37790. var n = "undefined" == typeof i;
  37791. if (n && (i = this.offset),
  37792. !this.noAssert) {
  37793. if ("number" == typeof t)
  37794. t = e.fromNumber(t);
  37795. else if ("string" == typeof t)
  37796. t = e.fromString(t);
  37797. else if (!(t && t instanceof e))
  37798. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  37799. if ("number" != typeof i || i % 1 !== 0)
  37800. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37801. if (i >>>= 0,
  37802. i < 0 || i + 0 > this.buffer.byteLength)
  37803. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37804. }
  37805. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  37806. i += 8;
  37807. var r = this.buffer.byteLength;
  37808. i > r && this.resize((r *= 2) > i ? r : i),
  37809. i -= 8;
  37810. var o = t.low
  37811. , a = t.high;
  37812. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  37813. this.view[i + 2] = o >>> 16 & 255,
  37814. this.view[i + 1] = o >>> 8 & 255,
  37815. this.view[i] = 255 & o,
  37816. i += 4,
  37817. this.view[i + 3] = a >>> 24 & 255,
  37818. this.view[i + 2] = a >>> 16 & 255,
  37819. this.view[i + 1] = a >>> 8 & 255,
  37820. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  37821. this.view[i + 1] = a >>> 16 & 255,
  37822. this.view[i + 2] = a >>> 8 & 255,
  37823. this.view[i + 3] = 255 & a,
  37824. i += 4,
  37825. this.view[i] = o >>> 24 & 255,
  37826. this.view[i + 1] = o >>> 16 & 255,
  37827. this.view[i + 2] = o >>> 8 & 255,
  37828. this.view[i + 3] = 255 & o),
  37829. n && (this.offset += 8),
  37830. this
  37831. }
  37832. ,
  37833. a.writeUInt64 = a.writeUint64,
  37834. a.readUint64 = function(t) {
  37835. var i = "undefined" == typeof t;
  37836. if (i && (t = this.offset),
  37837. !this.noAssert) {
  37838. if ("number" != typeof t || t % 1 !== 0)
  37839. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37840. if (t >>>= 0,
  37841. t < 0 || t + 8 > this.buffer.byteLength)
  37842. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  37843. }
  37844. var n = 0
  37845. , r = 0;
  37846. this.littleEndian ? (n = this.view[t + 2] << 16,
  37847. n |= this.view[t + 1] << 8,
  37848. n |= this.view[t],
  37849. n += this.view[t + 3] << 24 >>> 0,
  37850. t += 4,
  37851. r = this.view[t + 2] << 16,
  37852. r |= this.view[t + 1] << 8,
  37853. r |= this.view[t],
  37854. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  37855. r |= this.view[t + 2] << 8,
  37856. r |= this.view[t + 3],
  37857. r += this.view[t] << 24 >>> 0,
  37858. t += 4,
  37859. n = this.view[t + 1] << 16,
  37860. n |= this.view[t + 2] << 8,
  37861. n |= this.view[t + 3],
  37862. n += this.view[t] << 24 >>> 0);
  37863. var o = new e(n,r,!0);
  37864. return i && (this.offset += 8),
  37865. o
  37866. }
  37867. ,
  37868. a.readUInt64 = a.readUint64),
  37869. a.writeFloat32 = function(e, t) {
  37870. var i = "undefined" == typeof t;
  37871. if (i && (t = this.offset),
  37872. !this.noAssert) {
  37873. if ("number" != typeof e)
  37874. throw TypeError("Illegal value: " + e + " (not a number)");
  37875. if ("number" != typeof t || t % 1 !== 0)
  37876. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37877. if (t >>>= 0,
  37878. t < 0 || t + 0 > this.buffer.byteLength)
  37879. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37880. }
  37881. t += 4;
  37882. var n = this.buffer.byteLength;
  37883. return t > n && this.resize((n *= 2) > t ? n : t),
  37884. t -= 4,
  37885. r(this.view, e, t, this.littleEndian, 23, 4),
  37886. i && (this.offset += 4),
  37887. this
  37888. }
  37889. ,
  37890. a.writeFloat = a.writeFloat32,
  37891. a.readFloat32 = function(e) {
  37892. var t = "undefined" == typeof e;
  37893. if (t && (e = this.offset),
  37894. !this.noAssert) {
  37895. if ("number" != typeof e || e % 1 !== 0)
  37896. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37897. if (e >>>= 0,
  37898. e < 0 || e + 4 > this.buffer.byteLength)
  37899. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  37900. }
  37901. var i = n(this.view, e, this.littleEndian, 23, 4);
  37902. return t && (this.offset += 4),
  37903. i
  37904. }
  37905. ,
  37906. a.readFloat = a.readFloat32,
  37907. a.writeFloat64 = function(e, t) {
  37908. var i = "undefined" == typeof t;
  37909. if (i && (t = this.offset),
  37910. !this.noAssert) {
  37911. if ("number" != typeof e)
  37912. throw TypeError("Illegal value: " + e + " (not a number)");
  37913. if ("number" != typeof t || t % 1 !== 0)
  37914. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37915. if (t >>>= 0,
  37916. t < 0 || t + 0 > this.buffer.byteLength)
  37917. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37918. }
  37919. t += 8;
  37920. var n = this.buffer.byteLength;
  37921. return t > n && this.resize((n *= 2) > t ? n : t),
  37922. t -= 8,
  37923. r(this.view, e, t, this.littleEndian, 52, 8),
  37924. i && (this.offset += 8),
  37925. this
  37926. }
  37927. ,
  37928. a.writeDouble = a.writeFloat64,
  37929. a.readFloat64 = function(e) {
  37930. var t = "undefined" == typeof e;
  37931. if (t && (e = this.offset),
  37932. !this.noAssert) {
  37933. if ("number" != typeof e || e % 1 !== 0)
  37934. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37935. if (e >>>= 0,
  37936. e < 0 || e + 8 > this.buffer.byteLength)
  37937. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  37938. }
  37939. var i = n(this.view, e, this.littleEndian, 52, 8);
  37940. return t && (this.offset += 8),
  37941. i
  37942. }
  37943. ,
  37944. a.readDouble = a.readFloat64,
  37945. o.MAX_VARINT32_BYTES = 5,
  37946. o.calculateVarint32 = function(e) {
  37947. return e >>>= 0,
  37948. e < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  37949. }
  37950. ,
  37951. o.zigZagEncode32 = function(e) {
  37952. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  37953. }
  37954. ,
  37955. o.zigZagDecode32 = function(e) {
  37956. return e >>> 1 ^ -(1 & e) | 0
  37957. }
  37958. ,
  37959. a.writeVarint32 = function(e, t) {
  37960. var i = "undefined" == typeof t;
  37961. if (i && (t = this.offset),
  37962. !this.noAssert) {
  37963. if ("number" != typeof e || e % 1 !== 0)
  37964. throw TypeError("Illegal value: " + e + " (not an integer)");
  37965. if (e |= 0,
  37966. "number" != typeof t || t % 1 !== 0)
  37967. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37968. if (t >>>= 0,
  37969. t < 0 || t + 0 > this.buffer.byteLength)
  37970. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37971. }
  37972. var n, r = o.calculateVarint32(e);
  37973. t += r;
  37974. var a = this.buffer.byteLength;
  37975. for (t > a && this.resize((a *= 2) > t ? a : t),
  37976. t -= r,
  37977. e >>>= 0; e >= 128; )
  37978. n = 127 & e | 128,
  37979. this.view[t++] = n,
  37980. e >>>= 7;
  37981. return this.view[t++] = e,
  37982. i ? (this.offset = t,
  37983. this) : r
  37984. }
  37985. ,
  37986. a.writeVarint32ZigZag = function(e, t) {
  37987. return this.writeVarint32(o.zigZagEncode32(e), t)
  37988. }
  37989. ,
  37990. a.readVarint32 = function(e) {
  37991. var t = "undefined" == typeof e;
  37992. if (t && (e = this.offset),
  37993. !this.noAssert) {
  37994. if ("number" != typeof e || e % 1 !== 0)
  37995. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37996. if (e >>>= 0,
  37997. e < 0 || e + 1 > this.buffer.byteLength)
  37998. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37999. }
  38000. var i, n = 0, r = 0;
  38001. do {
  38002. if (!this.noAssert && e > this.limit) {
  38003. var o = Error("Truncated");
  38004. throw o.truncated = !0,
  38005. o
  38006. }
  38007. i = this.view[e++],
  38008. n < 5 && (r |= (127 & i) << 7 * n),
  38009. ++n
  38010. } while (0 !== (128 & i));return r |= 0,
  38011. t ? (this.offset = e,
  38012. r) : {
  38013. value: r,
  38014. length: n
  38015. }
  38016. }
  38017. ,
  38018. a.readVarint32ZigZag = function(e) {
  38019. var t = this.readVarint32(e);
  38020. return "object" == typeof t ? t.value = o.zigZagDecode32(t.value) : t = o.zigZagDecode32(t),
  38021. t
  38022. }
  38023. ,
  38024. e && (o.MAX_VARINT64_BYTES = 10,
  38025. o.calculateVarint64 = function(t) {
  38026. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t));
  38027. var i = t.toInt() >>> 0
  38028. , n = t.shiftRightUnsigned(28).toInt() >>> 0
  38029. , r = t.shiftRightUnsigned(56).toInt() >>> 0;
  38030. 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
  38031. }
  38032. ,
  38033. o.zigZagEncode64 = function(t) {
  38034. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  38035. t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()
  38036. }
  38037. ,
  38038. o.zigZagDecode64 = function(t) {
  38039. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  38040. t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()
  38041. }
  38042. ,
  38043. a.writeVarint64 = function(t, i) {
  38044. var n = "undefined" == typeof i;
  38045. if (n && (i = this.offset),
  38046. !this.noAssert) {
  38047. if ("number" == typeof t)
  38048. t = e.fromNumber(t);
  38049. else if ("string" == typeof t)
  38050. t = e.fromString(t);
  38051. else if (!(t && t instanceof e))
  38052. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  38053. if ("number" != typeof i || i % 1 !== 0)
  38054. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38055. if (i >>>= 0,
  38056. i < 0 || i + 0 > this.buffer.byteLength)
  38057. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38058. }
  38059. "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned());
  38060. var r = o.calculateVarint64(t)
  38061. , a = t.toInt() >>> 0
  38062. , s = t.shiftRightUnsigned(28).toInt() >>> 0
  38063. , l = t.shiftRightUnsigned(56).toInt() >>> 0;
  38064. i += r;
  38065. var c = this.buffer.byteLength;
  38066. switch (i > c && this.resize((c *= 2) > i ? c : i),
  38067. i -= r,
  38068. r) {
  38069. case 10:
  38070. this.view[i + 9] = l >>> 7 & 1;
  38071. case 9:
  38072. this.view[i + 8] = 9 !== r ? 128 | l : 127 & l;
  38073. case 8:
  38074. this.view[i + 7] = 8 !== r ? s >>> 21 | 128 : s >>> 21 & 127;
  38075. case 7:
  38076. this.view[i + 6] = 7 !== r ? s >>> 14 | 128 : s >>> 14 & 127;
  38077. case 6:
  38078. this.view[i + 5] = 6 !== r ? s >>> 7 | 128 : s >>> 7 & 127;
  38079. case 5:
  38080. this.view[i + 4] = 5 !== r ? 128 | s : 127 & s;
  38081. case 4:
  38082. this.view[i + 3] = 4 !== r ? a >>> 21 | 128 : a >>> 21 & 127;
  38083. case 3:
  38084. this.view[i + 2] = 3 !== r ? a >>> 14 | 128 : a >>> 14 & 127;
  38085. case 2:
  38086. this.view[i + 1] = 2 !== r ? a >>> 7 | 128 : a >>> 7 & 127;
  38087. case 1:
  38088. this.view[i] = 1 !== r ? 128 | a : 127 & a
  38089. }
  38090. return n ? (this.offset += r,
  38091. this) : r
  38092. }
  38093. ,
  38094. a.writeVarint64ZigZag = function(e, t) {
  38095. return this.writeVarint64(o.zigZagEncode64(e), t)
  38096. }
  38097. ,
  38098. a.readVarint64 = function(t) {
  38099. var i = "undefined" == typeof t;
  38100. if (i && (t = this.offset),
  38101. !this.noAssert) {
  38102. if ("number" != typeof t || t % 1 !== 0)
  38103. throw TypeError("Illegal offset: " + t + " (not an integer)");
  38104. if (t >>>= 0,
  38105. t < 0 || t + 1 > this.buffer.byteLength)
  38106. throw RangeError("Illegal offset: 0 <= " + t + " (+1) <= " + this.buffer.byteLength)
  38107. }
  38108. var n = t
  38109. , r = 0
  38110. , o = 0
  38111. , a = 0
  38112. , s = 0;
  38113. if (s = this.view[t++],
  38114. r = 127 & s,
  38115. 128 & s && (s = this.view[t++],
  38116. r |= (127 & s) << 7,
  38117. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38118. r |= (127 & s) << 14,
  38119. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38120. r |= (127 & s) << 21,
  38121. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38122. o = 127 & s,
  38123. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38124. o |= (127 & s) << 7,
  38125. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38126. o |= (127 & s) << 14,
  38127. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38128. o |= (127 & s) << 21,
  38129. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38130. a = 127 & s,
  38131. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38132. a |= (127 & s) << 7,
  38133. 128 & s || this.noAssert && "undefined" == typeof s))))))))))
  38134. throw Error("Buffer overrun");
  38135. var l = e.fromBits(r | o << 28, o >>> 4 | a << 24, !1);
  38136. return i ? (this.offset = t,
  38137. l) : {
  38138. value: l,
  38139. length: t - n
  38140. }
  38141. }
  38142. ,
  38143. a.readVarint64ZigZag = function(t) {
  38144. var i = this.readVarint64(t);
  38145. return i && i.value instanceof e ? i.value = o.zigZagDecode64(i.value) : i = o.zigZagDecode64(i),
  38146. i
  38147. }
  38148. ),
  38149. a.writeCString = function(e, i) {
  38150. var n = "undefined" == typeof i;
  38151. n && (i = this.offset);
  38152. var r, o = e.length;
  38153. if (!this.noAssert) {
  38154. if ("string" != typeof e)
  38155. throw TypeError("Illegal str: Not a string");
  38156. for (r = 0; r < o; ++r)
  38157. if (0 === e.charCodeAt(r))
  38158. throw RangeError("Illegal str: Contains NULL-characters");
  38159. if ("number" != typeof i || i % 1 !== 0)
  38160. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38161. if (i >>>= 0,
  38162. i < 0 || i + 0 > this.buffer.byteLength)
  38163. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38164. }
  38165. o = h.calculateUTF16asUTF8(t(e))[1],
  38166. i += o + 1;
  38167. var a = this.buffer.byteLength;
  38168. return i > a && this.resize((a *= 2) > i ? a : i),
  38169. i -= o + 1,
  38170. h.encodeUTF16toUTF8(t(e), function(e) {
  38171. this.view[i++] = e
  38172. }
  38173. .bind(this)),
  38174. this.view[i++] = 0,
  38175. n ? (this.offset = i,
  38176. this) : o
  38177. }
  38178. ,
  38179. a.readCString = function(e) {
  38180. var t = "undefined" == typeof e;
  38181. if (t && (e = this.offset),
  38182. !this.noAssert) {
  38183. if ("number" != typeof e || e % 1 !== 0)
  38184. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38185. if (e >>>= 0,
  38186. e < 0 || e + 1 > this.buffer.byteLength)
  38187. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  38188. }
  38189. var n, r = e, o = -1;
  38190. return h.decodeUTF8toUTF16(function() {
  38191. if (0 === o)
  38192. return null;
  38193. if (e >= this.limit)
  38194. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  38195. return o = this.view[e++],
  38196. 0 === o ? null : o
  38197. }
  38198. .bind(this), n = i(), !0),
  38199. t ? (this.offset = e,
  38200. n()) : {
  38201. string: n(),
  38202. length: e - r
  38203. }
  38204. }
  38205. ,
  38206. a.writeIString = function(e, i) {
  38207. var n = "undefined" == typeof i;
  38208. if (n && (i = this.offset),
  38209. !this.noAssert) {
  38210. if ("string" != typeof e)
  38211. throw TypeError("Illegal str: Not a string");
  38212. if ("number" != typeof i || i % 1 !== 0)
  38213. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38214. if (i >>>= 0,
  38215. i < 0 || i + 0 > this.buffer.byteLength)
  38216. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38217. }
  38218. var r, o = i;
  38219. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  38220. i += 4 + r;
  38221. var a = this.buffer.byteLength;
  38222. if (i > a && this.resize((a *= 2) > i ? a : i),
  38223. i -= 4 + r,
  38224. this.littleEndian ? (this.view[i + 3] = r >>> 24 & 255,
  38225. this.view[i + 2] = r >>> 16 & 255,
  38226. this.view[i + 1] = r >>> 8 & 255,
  38227. this.view[i] = 255 & r) : (this.view[i] = r >>> 24 & 255,
  38228. this.view[i + 1] = r >>> 16 & 255,
  38229. this.view[i + 2] = r >>> 8 & 255,
  38230. this.view[i + 3] = 255 & r),
  38231. i += 4,
  38232. h.encodeUTF16toUTF8(t(e), function(e) {
  38233. this.view[i++] = e
  38234. }
  38235. .bind(this)),
  38236. i !== o + 4 + r)
  38237. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + 4 + r));
  38238. return n ? (this.offset = i,
  38239. this) : i - o
  38240. }
  38241. ,
  38242. a.readIString = function(e) {
  38243. var t = "undefined" == typeof e;
  38244. if (t && (e = this.offset),
  38245. !this.noAssert) {
  38246. if ("number" != typeof e || e % 1 !== 0)
  38247. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38248. if (e >>>= 0,
  38249. e < 0 || e + 4 > this.buffer.byteLength)
  38250. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  38251. }
  38252. var i = e
  38253. , n = this.readUint32(e)
  38254. , r = this.readUTF8String(n, o.METRICS_BYTES, e += 4);
  38255. return e += r.length,
  38256. t ? (this.offset = e,
  38257. r.string) : {
  38258. string: r.string,
  38259. length: e - i
  38260. }
  38261. }
  38262. ,
  38263. o.METRICS_CHARS = "c",
  38264. o.METRICS_BYTES = "b",
  38265. a.writeUTF8String = function(e, i) {
  38266. var n = "undefined" == typeof i;
  38267. if (n && (i = this.offset),
  38268. !this.noAssert) {
  38269. if ("number" != typeof i || i % 1 !== 0)
  38270. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38271. if (i >>>= 0,
  38272. i < 0 || i + 0 > this.buffer.byteLength)
  38273. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38274. }
  38275. var r, o = i;
  38276. r = h.calculateUTF16asUTF8(t(e))[1],
  38277. i += r;
  38278. var a = this.buffer.byteLength;
  38279. return i > a && this.resize((a *= 2) > i ? a : i),
  38280. i -= r,
  38281. h.encodeUTF16toUTF8(t(e), function(e) {
  38282. this.view[i++] = e
  38283. }
  38284. .bind(this)),
  38285. n ? (this.offset = i,
  38286. this) : i - o
  38287. }
  38288. ,
  38289. a.writeString = a.writeUTF8String,
  38290. o.calculateUTF8Chars = function(e) {
  38291. return h.calculateUTF16asUTF8(t(e))[0]
  38292. }
  38293. ,
  38294. o.calculateUTF8Bytes = function(e) {
  38295. return h.calculateUTF16asUTF8(t(e))[1]
  38296. }
  38297. ,
  38298. o.calculateString = o.calculateUTF8Bytes,
  38299. a.readUTF8String = function(e, t, n) {
  38300. "number" == typeof t && (n = t,
  38301. t = void 0);
  38302. var r = "undefined" == typeof n;
  38303. if (r && (n = this.offset),
  38304. "undefined" == typeof t && (t = o.METRICS_CHARS),
  38305. !this.noAssert) {
  38306. if ("number" != typeof e || e % 1 !== 0)
  38307. throw TypeError("Illegal length: " + e + " (not an integer)");
  38308. if (e |= 0,
  38309. "number" != typeof n || n % 1 !== 0)
  38310. throw TypeError("Illegal offset: " + n + " (not an integer)");
  38311. if (n >>>= 0,
  38312. n < 0 || n + 0 > this.buffer.byteLength)
  38313. throw RangeError("Illegal offset: 0 <= " + n + " (+0) <= " + this.buffer.byteLength)
  38314. }
  38315. var a, s = 0, l = n;
  38316. if (t === o.METRICS_CHARS) {
  38317. if (a = i(),
  38318. h.decodeUTF8(function() {
  38319. return s < e && n < this.limit ? this.view[n++] : null
  38320. }
  38321. .bind(this), function(e) {
  38322. ++s,
  38323. h.UTF8toUTF16(e, a)
  38324. }),
  38325. s !== e)
  38326. throw RangeError("Illegal range: Truncated data, " + s + " == " + e);
  38327. return r ? (this.offset = n,
  38328. a()) : {
  38329. string: a(),
  38330. length: n - l
  38331. }
  38332. }
  38333. if (t === o.METRICS_BYTES) {
  38334. if (!this.noAssert) {
  38335. if ("number" != typeof n || n % 1 !== 0)
  38336. throw TypeError("Illegal offset: " + n + " (not an integer)");
  38337. if (n >>>= 0,
  38338. n < 0 || n + e > this.buffer.byteLength)
  38339. throw RangeError("Illegal offset: 0 <= " + n + " (+" + e + ") <= " + this.buffer.byteLength)
  38340. }
  38341. var c = n + e;
  38342. if (h.decodeUTF8toUTF16(function() {
  38343. return n < c ? this.view[n++] : null
  38344. }
  38345. .bind(this), a = i(), this.noAssert),
  38346. n !== c)
  38347. throw RangeError("Illegal range: Truncated data, " + n + " == " + c);
  38348. return r ? (this.offset = n,
  38349. a()) : {
  38350. string: a(),
  38351. length: n - l
  38352. }
  38353. }
  38354. throw TypeError("Unsupported metrics: " + t)
  38355. }
  38356. ,
  38357. a.readString = a.readUTF8String,
  38358. a.writeVString = function(e, i) {
  38359. var n = "undefined" == typeof i;
  38360. if (n && (i = this.offset),
  38361. !this.noAssert) {
  38362. if ("string" != typeof e)
  38363. throw TypeError("Illegal str: Not a string");
  38364. if ("number" != typeof i || i % 1 !== 0)
  38365. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38366. if (i >>>= 0,
  38367. i < 0 || i + 0 > this.buffer.byteLength)
  38368. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38369. }
  38370. var r, a, s = i;
  38371. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  38372. a = o.calculateVarint32(r),
  38373. i += a + r;
  38374. var l = this.buffer.byteLength;
  38375. if (i > l && this.resize((l *= 2) > i ? l : i),
  38376. i -= a + r,
  38377. i += this.writeVarint32(r, i),
  38378. h.encodeUTF16toUTF8(t(e), function(e) {
  38379. this.view[i++] = e
  38380. }
  38381. .bind(this)),
  38382. i !== s + r + a)
  38383. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + r + a));
  38384. return n ? (this.offset = i,
  38385. this) : i - s
  38386. }
  38387. ,
  38388. a.readVString = function(e) {
  38389. var t = "undefined" == typeof e;
  38390. if (t && (e = this.offset),
  38391. !this.noAssert) {
  38392. if ("number" != typeof e || e % 1 !== 0)
  38393. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38394. if (e >>>= 0,
  38395. e < 0 || e + 1 > this.buffer.byteLength)
  38396. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  38397. }
  38398. var i = e
  38399. , n = this.readVarint32(e)
  38400. , r = this.readUTF8String(n.value, o.METRICS_BYTES, e += n.length);
  38401. return e += r.length,
  38402. t ? (this.offset = e,
  38403. r.string) : {
  38404. string: r.string,
  38405. length: e - i
  38406. }
  38407. }
  38408. ,
  38409. a.append = function(e, t, i) {
  38410. "number" != typeof t && "string" == typeof t || (i = t,
  38411. t = void 0);
  38412. var n = "undefined" == typeof i;
  38413. if (n && (i = this.offset),
  38414. !this.noAssert) {
  38415. if ("number" != typeof i || i % 1 !== 0)
  38416. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38417. if (i >>>= 0,
  38418. i < 0 || i + 0 > this.buffer.byteLength)
  38419. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38420. }
  38421. e instanceof o || (e = o.wrap(e, t));
  38422. var r = e.limit - e.offset;
  38423. if (r <= 0)
  38424. return this;
  38425. i += r;
  38426. var a = this.buffer.byteLength;
  38427. return i > a && this.resize((a *= 2) > i ? a : i),
  38428. i -= r,
  38429. this.view.set(e.view.subarray(e.offset, e.limit), i),
  38430. e.offset += r,
  38431. n && (this.offset += r),
  38432. this
  38433. }
  38434. ,
  38435. a.appendTo = function(e, t) {
  38436. return e.append(this, t),
  38437. this
  38438. }
  38439. ,
  38440. a.assert = function(e) {
  38441. return this.noAssert = !e,
  38442. this
  38443. }
  38444. ,
  38445. a.capacity = function() {
  38446. return this.buffer.byteLength
  38447. }
  38448. ,
  38449. a.clear = function() {
  38450. return this.offset = 0,
  38451. this.limit = this.buffer.byteLength,
  38452. this.markedOffset = -1,
  38453. this
  38454. }
  38455. ,
  38456. a.clone = function(e) {
  38457. var t = new o(0,this.littleEndian,this.noAssert);
  38458. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  38459. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  38460. t.view = this.view),
  38461. t.offset = this.offset,
  38462. t.markedOffset = this.markedOffset,
  38463. t.limit = this.limit,
  38464. t
  38465. }
  38466. ,
  38467. a.compact = function(e, t) {
  38468. if ("undefined" == typeof e && (e = this.offset),
  38469. "undefined" == typeof t && (t = this.limit),
  38470. !this.noAssert) {
  38471. if ("number" != typeof e || e % 1 !== 0)
  38472. throw TypeError("Illegal begin: Not an integer");
  38473. if (e >>>= 0,
  38474. "number" != typeof t || t % 1 !== 0)
  38475. throw TypeError("Illegal end: Not an integer");
  38476. if (t >>>= 0,
  38477. e < 0 || e > t || t > this.buffer.byteLength)
  38478. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38479. }
  38480. if (0 === e && t === this.buffer.byteLength)
  38481. return this;
  38482. var i = t - e;
  38483. if (0 === i)
  38484. return this.buffer = s,
  38485. this.view = null,
  38486. this.markedOffset >= 0 && (this.markedOffset -= e),
  38487. this.offset = 0,
  38488. this.limit = 0,
  38489. this;
  38490. var n = new ArrayBuffer(i)
  38491. , r = new Uint8Array(n);
  38492. return r.set(this.view.subarray(e, t)),
  38493. this.buffer = n,
  38494. this.view = r,
  38495. this.markedOffset >= 0 && (this.markedOffset -= e),
  38496. this.offset = 0,
  38497. this.limit = i,
  38498. this
  38499. }
  38500. ,
  38501. a.copy = function(e, t) {
  38502. if ("undefined" == typeof e && (e = this.offset),
  38503. "undefined" == typeof t && (t = this.limit),
  38504. !this.noAssert) {
  38505. if ("number" != typeof e || e % 1 !== 0)
  38506. throw TypeError("Illegal begin: Not an integer");
  38507. if (e >>>= 0,
  38508. "number" != typeof t || t % 1 !== 0)
  38509. throw TypeError("Illegal end: Not an integer");
  38510. if (t >>>= 0,
  38511. e < 0 || e > t || t > this.buffer.byteLength)
  38512. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38513. }
  38514. if (e === t)
  38515. return new o(0,this.littleEndian,this.noAssert);
  38516. var i = t - e
  38517. , n = new o(i,this.littleEndian,this.noAssert);
  38518. return n.offset = 0,
  38519. n.limit = i,
  38520. n.markedOffset >= 0 && (n.markedOffset -= e),
  38521. this.copyTo(n, 0, e, t),
  38522. n
  38523. }
  38524. ,
  38525. a.copyTo = function(e, t, i, n) {
  38526. var r, a;
  38527. if (!this.noAssert && !o.isByteBuffer(e))
  38528. throw TypeError("Illegal target: Not a ByteBuffer");
  38529. if (t = (a = "undefined" == typeof t) ? e.offset : 0 | t,
  38530. i = (r = "undefined" == typeof i) ? this.offset : 0 | i,
  38531. n = "undefined" == typeof n ? this.limit : 0 | n,
  38532. t < 0 || t > e.buffer.byteLength)
  38533. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  38534. if (i < 0 || n > this.buffer.byteLength)
  38535. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  38536. var s = n - i;
  38537. return 0 === s ? e : (e.ensureCapacity(t + s),
  38538. e.view.set(this.view.subarray(i, n), t),
  38539. r && (this.offset += s),
  38540. a && (e.offset += s),
  38541. this)
  38542. }
  38543. ,
  38544. a.ensureCapacity = function(e) {
  38545. var t = this.buffer.byteLength;
  38546. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  38547. }
  38548. ,
  38549. a.fill = function(e, t, i) {
  38550. var n = "undefined" == typeof t;
  38551. if (n && (t = this.offset),
  38552. "string" == typeof e && e.length > 0 && (e = e.charCodeAt(0)),
  38553. "undefined" == typeof t && (t = this.offset),
  38554. "undefined" == typeof i && (i = this.limit),
  38555. !this.noAssert) {
  38556. if ("number" != typeof e || e % 1 !== 0)
  38557. throw TypeError("Illegal value: " + e + " (not an integer)");
  38558. if (e |= 0,
  38559. "number" != typeof t || t % 1 !== 0)
  38560. throw TypeError("Illegal begin: Not an integer");
  38561. if (t >>>= 0,
  38562. "number" != typeof i || i % 1 !== 0)
  38563. throw TypeError("Illegal end: Not an integer");
  38564. if (i >>>= 0,
  38565. t < 0 || t > i || i > this.buffer.byteLength)
  38566. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  38567. }
  38568. if (t >= i)
  38569. return this;
  38570. for (; t < i; )
  38571. this.view[t++] = e;
  38572. return n && (this.offset = t),
  38573. this
  38574. }
  38575. ,
  38576. a.flip = function() {
  38577. return this.limit = this.offset,
  38578. this.offset = 0,
  38579. this
  38580. }
  38581. ,
  38582. a.mark = function(e) {
  38583. if (e = "undefined" == typeof e ? this.offset : e,
  38584. !this.noAssert) {
  38585. if ("number" != typeof e || e % 1 !== 0)
  38586. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38587. if (e >>>= 0,
  38588. e < 0 || e + 0 > this.buffer.byteLength)
  38589. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  38590. }
  38591. return this.markedOffset = e,
  38592. this
  38593. }
  38594. ,
  38595. a.order = function(e) {
  38596. if (!this.noAssert && "boolean" != typeof e)
  38597. throw TypeError("Illegal littleEndian: Not a boolean");
  38598. return this.littleEndian = !!e,
  38599. this
  38600. }
  38601. ,
  38602. a.LE = function(e) {
  38603. return this.littleEndian = "undefined" == typeof e || !!e,
  38604. this
  38605. }
  38606. ,
  38607. a.BE = function(e) {
  38608. return this.littleEndian = "undefined" != typeof e && !e,
  38609. this
  38610. }
  38611. ,
  38612. a.prepend = function(e, t, i) {
  38613. "number" != typeof t && "string" == typeof t || (i = t,
  38614. t = void 0);
  38615. var n = "undefined" == typeof i;
  38616. if (n && (i = this.offset),
  38617. !this.noAssert) {
  38618. if ("number" != typeof i || i % 1 !== 0)
  38619. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38620. if (i >>>= 0,
  38621. i < 0 || i + 0 > this.buffer.byteLength)
  38622. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38623. }
  38624. e instanceof o || (e = o.wrap(e, t));
  38625. var r = e.limit - e.offset;
  38626. if (r <= 0)
  38627. return this;
  38628. var a = r - i;
  38629. if (a > 0) {
  38630. var s = new ArrayBuffer(this.buffer.byteLength + a)
  38631. , l = new Uint8Array(s);
  38632. l.set(this.view.subarray(i, this.buffer.byteLength), r),
  38633. this.buffer = s,
  38634. this.view = l,
  38635. this.offset += a,
  38636. this.markedOffset >= 0 && (this.markedOffset += a),
  38637. this.limit += a,
  38638. i += a
  38639. } else {
  38640. new Uint8Array(this.buffer)
  38641. }
  38642. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  38643. e.offset = e.limit,
  38644. n && (this.offset -= r),
  38645. this
  38646. }
  38647. ,
  38648. a.prependTo = function(e, t) {
  38649. return e.prepend(this, t),
  38650. this
  38651. }
  38652. ,
  38653. a.printDebug = function(e) {
  38654. "function" != typeof e && (e = console.log.bind(console)),
  38655. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  38656. }
  38657. ,
  38658. a.remaining = function() {
  38659. return this.limit - this.offset
  38660. }
  38661. ,
  38662. a.reset = function() {
  38663. return this.markedOffset >= 0 ? (this.offset = this.markedOffset,
  38664. this.markedOffset = -1) : this.offset = 0,
  38665. this
  38666. }
  38667. ,
  38668. a.resize = function(e) {
  38669. if (!this.noAssert) {
  38670. if ("number" != typeof e || e % 1 !== 0)
  38671. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  38672. if (e |= 0,
  38673. e < 0)
  38674. throw RangeError("Illegal capacity: 0 <= " + e)
  38675. }
  38676. if (this.buffer.byteLength < e) {
  38677. var t = new ArrayBuffer(e)
  38678. , i = new Uint8Array(t);
  38679. i.set(this.view),
  38680. this.buffer = t,
  38681. this.view = i
  38682. }
  38683. return this
  38684. }
  38685. ,
  38686. a.reverse = function(e, t) {
  38687. if ("undefined" == typeof e && (e = this.offset),
  38688. "undefined" == typeof t && (t = this.limit),
  38689. !this.noAssert) {
  38690. if ("number" != typeof e || e % 1 !== 0)
  38691. throw TypeError("Illegal begin: Not an integer");
  38692. if (e >>>= 0,
  38693. "number" != typeof t || t % 1 !== 0)
  38694. throw TypeError("Illegal end: Not an integer");
  38695. if (t >>>= 0,
  38696. e < 0 || e > t || t > this.buffer.byteLength)
  38697. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38698. }
  38699. return e === t ? this : (Array.prototype.reverse.call(this.view.subarray(e, t)),
  38700. this)
  38701. }
  38702. ,
  38703. a.skip = function(e) {
  38704. if (!this.noAssert) {
  38705. if ("number" != typeof e || e % 1 !== 0)
  38706. throw TypeError("Illegal length: " + e + " (not an integer)");
  38707. e |= 0
  38708. }
  38709. var t = this.offset + e;
  38710. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  38711. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  38712. return this.offset = t,
  38713. this
  38714. }
  38715. ,
  38716. a.slice = function(e, t) {
  38717. if ("undefined" == typeof e && (e = this.offset),
  38718. "undefined" == typeof t && (t = this.limit),
  38719. !this.noAssert) {
  38720. if ("number" != typeof e || e % 1 !== 0)
  38721. throw TypeError("Illegal begin: Not an integer");
  38722. if (e >>>= 0,
  38723. "number" != typeof t || t % 1 !== 0)
  38724. throw TypeError("Illegal end: Not an integer");
  38725. if (t >>>= 0,
  38726. e < 0 || e > t || t > this.buffer.byteLength)
  38727. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38728. }
  38729. var i = this.clone();
  38730. return i.offset = e,
  38731. i.limit = t,
  38732. i
  38733. }
  38734. ,
  38735. a.toBuffer = function(e) {
  38736. var t = this.offset
  38737. , i = this.limit;
  38738. if (!this.noAssert) {
  38739. if ("number" != typeof t || t % 1 !== 0)
  38740. throw TypeError("Illegal offset: Not an integer");
  38741. if (t >>>= 0,
  38742. "number" != typeof i || i % 1 !== 0)
  38743. throw TypeError("Illegal limit: Not an integer");
  38744. if (i >>>= 0,
  38745. t < 0 || t > i || i > this.buffer.byteLength)
  38746. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  38747. }
  38748. if (!e && 0 === t && i === this.buffer.byteLength)
  38749. return this.buffer;
  38750. if (t === i)
  38751. return s;
  38752. var n = new ArrayBuffer(i - t);
  38753. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  38754. n
  38755. }
  38756. ,
  38757. a.toArrayBuffer = a.toBuffer,
  38758. a.toString = function(e, t, i) {
  38759. if ("undefined" == typeof e)
  38760. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  38761. switch ("number" == typeof e && (e = "utf8",
  38762. t = e,
  38763. i = t),
  38764. e) {
  38765. case "utf8":
  38766. return this.toUTF8(t, i);
  38767. case "base64":
  38768. return this.toBase64(t, i);
  38769. case "hex":
  38770. return this.toHex(t, i);
  38771. case "binary":
  38772. return this.toBinary(t, i);
  38773. case "debug":
  38774. return this.toDebug();
  38775. case "columns":
  38776. return this.toColumns();
  38777. default:
  38778. throw Error("Unsupported encoding: " + e)
  38779. }
  38780. }
  38781. ;
  38782. var c = function() {
  38783. 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)
  38784. i[t[n]] = n;
  38785. return e.encode = function(e, i) {
  38786. for (var n, r; null !== (n = e()); )
  38787. i(t[n >> 2 & 63]),
  38788. r = (3 & n) << 4,
  38789. null !== (n = e()) ? (r |= n >> 4 & 15,
  38790. i(t[63 & (r | n >> 4 & 15)]),
  38791. r = (15 & n) << 2,
  38792. null !== (n = e()) ? (i(t[63 & (r | n >> 6 & 3)]),
  38793. i(t[63 & n])) : (i(t[63 & r]),
  38794. i(61))) : (i(t[63 & r]),
  38795. i(61),
  38796. i(61))
  38797. }
  38798. ,
  38799. e.decode = function(e, t) {
  38800. function n(e) {
  38801. throw Error("Illegal character code: " + e)
  38802. }
  38803. for (var r, o, a; null !== (r = e()); )
  38804. if (o = i[r],
  38805. "undefined" == typeof o && n(r),
  38806. null !== (r = e()) && (a = i[r],
  38807. "undefined" == typeof a && n(r),
  38808. t(o << 2 >>> 0 | (48 & a) >> 4),
  38809. null !== (r = e()))) {
  38810. if (o = i[r],
  38811. "undefined" == typeof o) {
  38812. if (61 === r)
  38813. break;
  38814. n(r)
  38815. }
  38816. if (t((15 & a) << 4 >>> 0 | (60 & o) >> 2),
  38817. null !== (r = e())) {
  38818. if (a = i[r],
  38819. "undefined" == typeof a) {
  38820. if (61 === r)
  38821. break;
  38822. n(r)
  38823. }
  38824. t((3 & o) << 6 >>> 0 | a)
  38825. }
  38826. }
  38827. }
  38828. ,
  38829. e.test = function(e) {
  38830. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  38831. }
  38832. ,
  38833. e
  38834. }();
  38835. a.toBase64 = function(e, t) {
  38836. if ("undefined" == typeof e && (e = this.offset),
  38837. "undefined" == typeof t && (t = this.limit),
  38838. e |= 0,
  38839. t |= 0,
  38840. e < 0 || t > this.capacity || e > t)
  38841. throw RangeError("begin, end");
  38842. var n;
  38843. return c.encode(function() {
  38844. return e < t ? this.view[e++] : null
  38845. }
  38846. .bind(this), n = i()),
  38847. n()
  38848. }
  38849. ,
  38850. o.fromBase64 = function(e, i) {
  38851. if ("string" != typeof e)
  38852. throw TypeError("str");
  38853. var n = new o(e.length / 4 * 3,i)
  38854. , r = 0;
  38855. return c.decode(t(e), function(e) {
  38856. n.view[r++] = e
  38857. }),
  38858. n.limit = r,
  38859. n
  38860. }
  38861. ,
  38862. o.btoa = function(e) {
  38863. return o.fromBinary(e).toBase64()
  38864. }
  38865. ,
  38866. o.atob = function(e) {
  38867. return o.fromBase64(e).toBinary()
  38868. }
  38869. ,
  38870. a.toBinary = function(e, t) {
  38871. if ("undefined" == typeof e && (e = this.offset),
  38872. "undefined" == typeof t && (t = this.limit),
  38873. e |= 0,
  38874. t |= 0,
  38875. e < 0 || t > this.capacity() || e > t)
  38876. throw RangeError("begin, end");
  38877. if (e === t)
  38878. return "";
  38879. for (var i = [], n = []; e < t; )
  38880. i.push(this.view[e++]),
  38881. i.length >= 1024 && (n.push(String.fromCharCode.apply(String, i)),
  38882. i = []);
  38883. return n.join("") + String.fromCharCode.apply(String, i)
  38884. }
  38885. ,
  38886. o.fromBinary = function(e, t) {
  38887. if ("string" != typeof e)
  38888. throw TypeError("str");
  38889. for (var i, n = 0, r = e.length, a = new o(r,t); n < r; ) {
  38890. if (i = e.charCodeAt(n),
  38891. i > 255)
  38892. throw RangeError("illegal char code: " + i);
  38893. a.view[n++] = i
  38894. }
  38895. return a.limit = r,
  38896. a
  38897. }
  38898. ,
  38899. a.toDebug = function(e) {
  38900. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  38901. if (i !== -1 && (t = this.view[i],
  38902. r += t < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  38903. e && (o += t > 32 && t < 127 ? String.fromCharCode(t) : ".")),
  38904. ++i,
  38905. e && i > 0 && i % 16 === 0 && i !== n) {
  38906. for (; r.length < 51; )
  38907. r += " ";
  38908. a += r + o + "\n",
  38909. r = o = ""
  38910. }
  38911. 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 ? " " : ""
  38912. }
  38913. if (e && " " !== r) {
  38914. for (; r.length < 51; )
  38915. r += " ";
  38916. a += r + o + "\n"
  38917. }
  38918. return e ? a : r
  38919. }
  38920. ,
  38921. o.fromDebug = function(e, t, i) {
  38922. 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; ) {
  38923. switch (n = e.charAt(l++)) {
  38924. case "!":
  38925. if (!i) {
  38926. if (u || d || p) {
  38927. f = !0;
  38928. break
  38929. }
  38930. u = d = p = !0
  38931. }
  38932. s.offset = s.markedOffset = s.limit = c,
  38933. h = !1;
  38934. break;
  38935. case "|":
  38936. if (!i) {
  38937. if (u || p) {
  38938. f = !0;
  38939. break
  38940. }
  38941. u = p = !0
  38942. }
  38943. s.offset = s.limit = c,
  38944. h = !1;
  38945. break;
  38946. case "[":
  38947. if (!i) {
  38948. if (u || d) {
  38949. f = !0;
  38950. break
  38951. }
  38952. u = d = !0
  38953. }
  38954. s.offset = s.markedOffset = c,
  38955. h = !1;
  38956. break;
  38957. case "<":
  38958. if (!i) {
  38959. if (u) {
  38960. f = !0;
  38961. break
  38962. }
  38963. u = !0
  38964. }
  38965. s.offset = c,
  38966. h = !1;
  38967. break;
  38968. case "]":
  38969. if (!i) {
  38970. if (p || d) {
  38971. f = !0;
  38972. break
  38973. }
  38974. p = d = !0
  38975. }
  38976. s.limit = s.markedOffset = c,
  38977. h = !1;
  38978. break;
  38979. case ">":
  38980. if (!i) {
  38981. if (p) {
  38982. f = !0;
  38983. break
  38984. }
  38985. p = !0
  38986. }
  38987. s.limit = c,
  38988. h = !1;
  38989. break;
  38990. case "'":
  38991. if (!i) {
  38992. if (d) {
  38993. f = !0;
  38994. break
  38995. }
  38996. d = !0
  38997. }
  38998. s.markedOffset = c,
  38999. h = !1;
  39000. break;
  39001. case " ":
  39002. h = !1;
  39003. break;
  39004. default:
  39005. if (!i && h) {
  39006. f = !0;
  39007. break
  39008. }
  39009. if (r = parseInt(n + e.charAt(l++), 16),
  39010. !i && (isNaN(r) || r < 0 || r > 255))
  39011. throw TypeError("Illegal str: Not a debug encoded string");
  39012. s.view[c++] = r,
  39013. h = !0
  39014. }
  39015. if (f)
  39016. throw TypeError("Illegal str: Invalid symbol at " + l)
  39017. }
  39018. if (!i) {
  39019. if (!u || !p)
  39020. throw TypeError("Illegal str: Missing offset or limit");
  39021. if (c < s.buffer.byteLength)
  39022. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + c + " < " + a)
  39023. }
  39024. return s
  39025. }
  39026. ,
  39027. a.toHex = function(e, t) {
  39028. if (e = "undefined" == typeof e ? this.offset : e,
  39029. t = "undefined" == typeof t ? this.limit : t,
  39030. !this.noAssert) {
  39031. if ("number" != typeof e || e % 1 !== 0)
  39032. throw TypeError("Illegal begin: Not an integer");
  39033. if (e >>>= 0,
  39034. "number" != typeof t || t % 1 !== 0)
  39035. throw TypeError("Illegal end: Not an integer");
  39036. if (t >>>= 0,
  39037. e < 0 || e > t || t > this.buffer.byteLength)
  39038. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  39039. }
  39040. for (var i, n = new Array(t - e); e < t; )
  39041. i = this.view[e++],
  39042. i < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  39043. return n.join("")
  39044. }
  39045. ,
  39046. o.fromHex = function(e, t, i) {
  39047. if (!i) {
  39048. if ("string" != typeof e)
  39049. throw TypeError("Illegal str: Not a string");
  39050. if (e.length % 2 !== 0)
  39051. throw TypeError("Illegal str: Length not a multiple of 2")
  39052. }
  39053. for (var n, r = e.length, a = new o(r / 2 | 0,t), s = 0, l = 0; s < r; s += 2) {
  39054. if (n = parseInt(e.substring(s, s + 2), 16),
  39055. !i && (!isFinite(n) || n < 0 || n > 255))
  39056. throw TypeError("Illegal str: Contains non-hex characters");
  39057. a.view[l++] = n
  39058. }
  39059. return a.limit = l,
  39060. a
  39061. }
  39062. ;
  39063. var h = function() {
  39064. var e = {};
  39065. return e.MAX_CODEPOINT = 1114111,
  39066. e.encodeUTF8 = function(e, t) {
  39067. var i = null;
  39068. for ("number" == typeof e && (i = e,
  39069. e = function() {
  39070. return null
  39071. }
  39072. ); null !== i || null !== (i = e()); )
  39073. i < 128 ? t(127 & i) : i < 2048 ? (t(i >> 6 & 31 | 192),
  39074. t(63 & i | 128)) : i < 65536 ? (t(i >> 12 & 15 | 224),
  39075. t(i >> 6 & 63 | 128),
  39076. t(63 & i | 128)) : (t(i >> 18 & 7 | 240),
  39077. t(i >> 12 & 63 | 128),
  39078. t(i >> 6 & 63 | 128),
  39079. t(63 & i | 128)),
  39080. i = null
  39081. }
  39082. ,
  39083. e.decodeUTF8 = function(e, t) {
  39084. for (var i, n, r, o, a = function(e) {
  39085. e = e.slice(0, e.indexOf(null));
  39086. var t = Error(e.toString());
  39087. throw t.name = "TruncatedError",
  39088. t.bytes = e,
  39089. t
  39090. }; null !== (i = e()); )
  39091. if (0 === (128 & i))
  39092. t(i);
  39093. else if (192 === (224 & i))
  39094. null === (n = e()) && a([i, n]),
  39095. t((31 & i) << 6 | 63 & n);
  39096. else if (224 === (240 & i))
  39097. (null === (n = e()) || null === (r = e())) && a([i, n, r]),
  39098. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  39099. else {
  39100. if (240 !== (248 & i))
  39101. throw RangeError("Illegal starting byte: " + i);
  39102. (null === (n = e()) || null === (r = e()) || null === (o = e())) && a([i, n, r, o]),
  39103. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  39104. }
  39105. }
  39106. ,
  39107. e.UTF16toUTF8 = function(e, t) {
  39108. for (var i, n = null; ; ) {
  39109. if (null === (i = null !== n ? n : e()))
  39110. break;
  39111. i >= 55296 && i <= 57343 && null !== (n = e()) && n >= 56320 && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  39112. n = null) : t(i)
  39113. }
  39114. null !== n && t(n)
  39115. }
  39116. ,
  39117. e.UTF8toUTF16 = function(e, t) {
  39118. var i = null;
  39119. for ("number" == typeof e && (i = e,
  39120. e = function() {
  39121. return null
  39122. }
  39123. ); null !== i || null !== (i = e()); )
  39124. i <= 65535 ? t(i) : (i -= 65536,
  39125. t((i >> 10) + 55296),
  39126. t(i % 1024 + 56320)),
  39127. i = null
  39128. }
  39129. ,
  39130. e.encodeUTF16toUTF8 = function(t, i) {
  39131. e.UTF16toUTF8(t, function(t) {
  39132. e.encodeUTF8(t, i)
  39133. })
  39134. }
  39135. ,
  39136. e.decodeUTF8toUTF16 = function(t, i) {
  39137. e.decodeUTF8(t, function(t) {
  39138. e.UTF8toUTF16(t, i)
  39139. })
  39140. }
  39141. ,
  39142. e.calculateCodePoint = function(e) {
  39143. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  39144. }
  39145. ,
  39146. e.calculateUTF8 = function(e) {
  39147. for (var t, i = 0; null !== (t = e()); )
  39148. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  39149. return i
  39150. }
  39151. ,
  39152. e.calculateUTF16asUTF8 = function(t) {
  39153. var i = 0
  39154. , n = 0;
  39155. return e.UTF16toUTF8(t, function(e) {
  39156. ++i,
  39157. n += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  39158. }),
  39159. [i, n]
  39160. }
  39161. ,
  39162. e
  39163. }();
  39164. return a.toUTF8 = function(e, t) {
  39165. if ("undefined" == typeof e && (e = this.offset),
  39166. "undefined" == typeof t && (t = this.limit),
  39167. !this.noAssert) {
  39168. if ("number" != typeof e || e % 1 !== 0)
  39169. throw TypeError("Illegal begin: Not an integer");
  39170. if (e >>>= 0,
  39171. "number" != typeof t || t % 1 !== 0)
  39172. throw TypeError("Illegal end: Not an integer");
  39173. if (t >>>= 0,
  39174. e < 0 || e > t || t > this.buffer.byteLength)
  39175. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  39176. }
  39177. var n;
  39178. try {
  39179. h.decodeUTF8toUTF16(function() {
  39180. return e < t ? this.view[e++] : null
  39181. }
  39182. .bind(this), n = i())
  39183. } catch (i) {
  39184. if (e !== t)
  39185. throw RangeError("Illegal range: Truncated data, " + e + " != " + t)
  39186. }
  39187. return n()
  39188. }
  39189. ,
  39190. o.fromUTF8 = function(e, i, n) {
  39191. if (!n && "string" != typeof e)
  39192. throw TypeError("Illegal str: Not a string");
  39193. var r = new o(h.calculateUTF16asUTF8(t(e), !0)[1],i,n)
  39194. , a = 0;
  39195. return h.encodeUTF16toUTF8(t(e), function(e) {
  39196. r.view[a++] = e
  39197. }),
  39198. r.limit = a,
  39199. r
  39200. }
  39201. ,
  39202. o
  39203. })
  39204. }
  39205. , {
  39206. long: 216
  39207. }],
  39208. 216: [function(e, t, i) {
  39209. !function(i, n) {
  39210. "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()
  39211. }(this, function() {
  39212. "use strict";
  39213. function e(e, t, i) {
  39214. this.low = 0 | e,
  39215. this.high = 0 | t,
  39216. this.unsigned = !!i
  39217. }
  39218. function t(e) {
  39219. return (e && e.__isLong__) === !0
  39220. }
  39221. function i(e, t) {
  39222. var i, n, o;
  39223. return t ? (e >>>= 0,
  39224. (o = 0 <= e && e < 256) && (n = l[e]) ? n : (i = r(e, (0 | e) < 0 ? -1 : 0, !0),
  39225. o && (l[e] = i),
  39226. i)) : (e |= 0,
  39227. (o = -128 <= e && e < 128) && (n = s[e]) ? n : (i = r(e, e < 0 ? -1 : 0, !1),
  39228. o && (s[e] = i),
  39229. i))
  39230. }
  39231. function n(e, t) {
  39232. if (isNaN(e) || !isFinite(e))
  39233. return t ? m : g;
  39234. if (t) {
  39235. if (e < 0)
  39236. return m;
  39237. if (e >= d)
  39238. return I
  39239. } else {
  39240. if (e <= -p)
  39241. return E;
  39242. if (e + 1 >= p)
  39243. return C
  39244. }
  39245. return e < 0 ? n(-e, t).neg() : r(e % u | 0, e / u | 0, t)
  39246. }
  39247. function r(t, i, n) {
  39248. return new e(t,i,n)
  39249. }
  39250. function o(e, t, i) {
  39251. if (0 === e.length)
  39252. throw Error("empty string");
  39253. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  39254. return g;
  39255. if ("number" == typeof t ? (i = t,
  39256. t = !1) : t = !!t,
  39257. i = i || 10,
  39258. i < 2 || 36 < i)
  39259. throw RangeError("radix");
  39260. var r;
  39261. if ((r = e.indexOf("-")) > 0)
  39262. throw Error("interior hyphen");
  39263. if (0 === r)
  39264. return o(e.substring(1), t, i).neg();
  39265. for (var a = n(c(i, 8)), s = g, l = 0; l < e.length; l += 8) {
  39266. var h = Math.min(8, e.length - l)
  39267. , u = parseInt(e.substring(l, l + h), i);
  39268. if (h < 8) {
  39269. var d = n(c(i, h));
  39270. s = s.mul(d).add(n(u))
  39271. } else
  39272. s = s.mul(a),
  39273. s = s.add(n(u))
  39274. }
  39275. return s.unsigned = t,
  39276. s
  39277. }
  39278. function a(t) {
  39279. return t instanceof e ? t : "number" == typeof t ? n(t) : "string" == typeof t ? o(t) : r(t.low, t.high, t.unsigned)
  39280. }
  39281. e.prototype.__isLong__,
  39282. Object.defineProperty(e.prototype, "__isLong__", {
  39283. value: !0,
  39284. enumerable: !1,
  39285. configurable: !1
  39286. }),
  39287. e.isLong = t;
  39288. var s = {}
  39289. , l = {};
  39290. e.fromInt = i,
  39291. e.fromNumber = n,
  39292. e.fromBits = r;
  39293. var c = Math.pow;
  39294. e.fromString = o,
  39295. e.fromValue = a;
  39296. var h = 1 << 24
  39297. , u = 4294967296
  39298. , d = 0x10000000000000000
  39299. , p = d / 2
  39300. , f = i(h)
  39301. , g = i(0);
  39302. e.ZERO = g;
  39303. var m = i(0, !0);
  39304. e.UZERO = m;
  39305. var v = i(1);
  39306. e.ONE = v;
  39307. var A = i(1, !0);
  39308. e.UONE = A;
  39309. var y = i(-1);
  39310. e.NEG_ONE = y;
  39311. var C = r(-1, 2147483647, !1);
  39312. e.MAX_VALUE = C;
  39313. var I = r(-1, -1, !0);
  39314. e.MAX_UNSIGNED_VALUE = I;
  39315. var E = r(0, -2147483648, !1);
  39316. e.MIN_VALUE = E;
  39317. var b = e.prototype;
  39318. return b.toInt = function() {
  39319. return this.unsigned ? this.low >>> 0 : this.low
  39320. }
  39321. ,
  39322. b.toNumber = function() {
  39323. return this.unsigned ? (this.high >>> 0) * u + (this.low >>> 0) : this.high * u + (this.low >>> 0)
  39324. }
  39325. ,
  39326. b.toString = function(e) {
  39327. if (e = e || 10,
  39328. e < 2 || 36 < e)
  39329. throw RangeError("radix");
  39330. if (this.isZero())
  39331. return "0";
  39332. if (this.isNegative()) {
  39333. if (this.eq(E)) {
  39334. var t = n(e)
  39335. , i = this.div(t)
  39336. , r = i.mul(t).sub(this);
  39337. return i.toString(e) + r.toInt().toString(e)
  39338. }
  39339. return "-" + this.neg().toString(e)
  39340. }
  39341. for (var o = n(c(e, 6), this.unsigned), a = this, s = ""; ; ) {
  39342. var l = a.div(o)
  39343. , h = a.sub(l.mul(o)).toInt() >>> 0
  39344. , u = h.toString(e);
  39345. if (a = l,
  39346. a.isZero())
  39347. return u + s;
  39348. for (; u.length < 6; )
  39349. u = "0" + u;
  39350. s = "" + u + s
  39351. }
  39352. }
  39353. ,
  39354. b.getHighBits = function() {
  39355. return this.high
  39356. }
  39357. ,
  39358. b.getHighBitsUnsigned = function() {
  39359. return this.high >>> 0
  39360. }
  39361. ,
  39362. b.getLowBits = function() {
  39363. return this.low
  39364. }
  39365. ,
  39366. b.getLowBitsUnsigned = function() {
  39367. return this.low >>> 0
  39368. }
  39369. ,
  39370. b.getNumBitsAbs = function() {
  39371. if (this.isNegative())
  39372. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  39373. for (var e = 0 != this.high ? this.high : this.low, t = 31; t > 0 && 0 == (e & 1 << t); t--)
  39374. ;
  39375. return 0 != this.high ? t + 33 : t + 1
  39376. }
  39377. ,
  39378. b.isZero = function() {
  39379. return 0 === this.high && 0 === this.low
  39380. }
  39381. ,
  39382. b.isNegative = function() {
  39383. return !this.unsigned && this.high < 0
  39384. }
  39385. ,
  39386. b.isPositive = function() {
  39387. return this.unsigned || this.high >= 0
  39388. }
  39389. ,
  39390. b.isOdd = function() {
  39391. return 1 === (1 & this.low)
  39392. }
  39393. ,
  39394. b.isEven = function() {
  39395. return 0 === (1 & this.low)
  39396. }
  39397. ,
  39398. b.equals = function(e) {
  39399. return t(e) || (e = a(e)),
  39400. (this.unsigned === e.unsigned || this.high >>> 31 !== 1 || e.high >>> 31 !== 1) && (this.high === e.high && this.low === e.low)
  39401. }
  39402. ,
  39403. b.eq = b.equals,
  39404. b.notEquals = function(e) {
  39405. return !this.eq(e)
  39406. }
  39407. ,
  39408. b.neq = b.notEquals,
  39409. b.lessThan = function(e) {
  39410. return this.comp(e) < 0
  39411. }
  39412. ,
  39413. b.lt = b.lessThan,
  39414. b.lessThanOrEqual = function(e) {
  39415. return this.comp(e) <= 0
  39416. }
  39417. ,
  39418. b.lte = b.lessThanOrEqual,
  39419. b.greaterThan = function(e) {
  39420. return this.comp(e) > 0
  39421. }
  39422. ,
  39423. b.gt = b.greaterThan,
  39424. b.greaterThanOrEqual = function(e) {
  39425. return this.comp(e) >= 0
  39426. }
  39427. ,
  39428. b.gte = b.greaterThanOrEqual,
  39429. b.compare = function(e) {
  39430. if (t(e) || (e = a(e)),
  39431. this.eq(e))
  39432. return 0;
  39433. var i = this.isNegative()
  39434. , n = e.isNegative();
  39435. 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
  39436. }
  39437. ,
  39438. b.comp = b.compare,
  39439. b.negate = function() {
  39440. return !this.unsigned && this.eq(E) ? E : this.not().add(v)
  39441. }
  39442. ,
  39443. b.neg = b.negate,
  39444. b.add = function(e) {
  39445. t(e) || (e = a(e));
  39446. var i = this.high >>> 16
  39447. , n = 65535 & this.high
  39448. , o = this.low >>> 16
  39449. , s = 65535 & this.low
  39450. , l = e.high >>> 16
  39451. , c = 65535 & e.high
  39452. , h = e.low >>> 16
  39453. , u = 65535 & e.low
  39454. , d = 0
  39455. , p = 0
  39456. , f = 0
  39457. , g = 0;
  39458. return g += s + u,
  39459. f += g >>> 16,
  39460. g &= 65535,
  39461. f += o + h,
  39462. p += f >>> 16,
  39463. f &= 65535,
  39464. p += n + c,
  39465. d += p >>> 16,
  39466. p &= 65535,
  39467. d += i + l,
  39468. d &= 65535,
  39469. r(f << 16 | g, d << 16 | p, this.unsigned)
  39470. }
  39471. ,
  39472. b.subtract = function(e) {
  39473. return t(e) || (e = a(e)),
  39474. this.add(e.neg())
  39475. }
  39476. ,
  39477. b.sub = b.subtract,
  39478. b.multiply = function(e) {
  39479. if (this.isZero())
  39480. return g;
  39481. if (t(e) || (e = a(e)),
  39482. e.isZero())
  39483. return g;
  39484. if (this.eq(E))
  39485. return e.isOdd() ? E : g;
  39486. if (e.eq(E))
  39487. return this.isOdd() ? E : g;
  39488. if (this.isNegative())
  39489. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  39490. if (e.isNegative())
  39491. return this.mul(e.neg()).neg();
  39492. if (this.lt(f) && e.lt(f))
  39493. return n(this.toNumber() * e.toNumber(), this.unsigned);
  39494. var i = this.high >>> 16
  39495. , o = 65535 & this.high
  39496. , s = this.low >>> 16
  39497. , l = 65535 & this.low
  39498. , c = e.high >>> 16
  39499. , h = 65535 & e.high
  39500. , u = e.low >>> 16
  39501. , d = 65535 & e.low
  39502. , p = 0
  39503. , m = 0
  39504. , v = 0
  39505. , A = 0;
  39506. return A += l * d,
  39507. v += A >>> 16,
  39508. A &= 65535,
  39509. v += s * d,
  39510. m += v >>> 16,
  39511. v &= 65535,
  39512. v += l * u,
  39513. m += v >>> 16,
  39514. v &= 65535,
  39515. m += o * d,
  39516. p += m >>> 16,
  39517. m &= 65535,
  39518. m += s * u,
  39519. p += m >>> 16,
  39520. m &= 65535,
  39521. m += l * h,
  39522. p += m >>> 16,
  39523. m &= 65535,
  39524. p += i * d + o * u + s * h + l * c,
  39525. p &= 65535,
  39526. r(v << 16 | A, p << 16 | m, this.unsigned)
  39527. }
  39528. ,
  39529. b.mul = b.multiply,
  39530. b.divide = function(e) {
  39531. if (t(e) || (e = a(e)),
  39532. e.isZero())
  39533. throw Error("division by zero");
  39534. if (this.isZero())
  39535. return this.unsigned ? m : g;
  39536. var i, r, o;
  39537. if (this.unsigned) {
  39538. if (e.unsigned || (e = e.toUnsigned()),
  39539. e.gt(this))
  39540. return m;
  39541. if (e.gt(this.shru(1)))
  39542. return A;
  39543. o = m
  39544. } else {
  39545. if (this.eq(E)) {
  39546. if (e.eq(v) || e.eq(y))
  39547. return E;
  39548. if (e.eq(E))
  39549. return v;
  39550. var s = this.shr(1);
  39551. return i = s.div(e).shl(1),
  39552. i.eq(g) ? e.isNegative() ? v : y : (r = this.sub(e.mul(i)),
  39553. o = i.add(r.div(e)))
  39554. }
  39555. if (e.eq(E))
  39556. return this.unsigned ? m : g;
  39557. if (this.isNegative())
  39558. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  39559. if (e.isNegative())
  39560. return this.div(e.neg()).neg();
  39561. o = g
  39562. }
  39563. for (r = this; r.gte(e); ) {
  39564. i = Math.max(1, Math.floor(r.toNumber() / e.toNumber()));
  39565. 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); )
  39566. i -= h,
  39567. u = n(i, this.unsigned),
  39568. d = u.mul(e);
  39569. u.isZero() && (u = v),
  39570. o = o.add(u),
  39571. r = r.sub(d)
  39572. }
  39573. return o
  39574. }
  39575. ,
  39576. b.div = b.divide,
  39577. b.modulo = function(e) {
  39578. return t(e) || (e = a(e)),
  39579. this.sub(this.div(e).mul(e))
  39580. }
  39581. ,
  39582. b.mod = b.modulo,
  39583. b.not = function() {
  39584. return r(~this.low, ~this.high, this.unsigned)
  39585. }
  39586. ,
  39587. b.and = function(e) {
  39588. return t(e) || (e = a(e)),
  39589. r(this.low & e.low, this.high & e.high, this.unsigned)
  39590. }
  39591. ,
  39592. b.or = function(e) {
  39593. return t(e) || (e = a(e)),
  39594. r(this.low | e.low, this.high | e.high, this.unsigned)
  39595. }
  39596. ,
  39597. b.xor = function(e) {
  39598. return t(e) || (e = a(e)),
  39599. r(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  39600. }
  39601. ,
  39602. b.shiftLeft = function(e) {
  39603. return t(e) && (e = e.toInt()),
  39604. 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)
  39605. }
  39606. ,
  39607. b.shl = b.shiftLeft,
  39608. b.shiftRight = function(e) {
  39609. return t(e) && (e = e.toInt()),
  39610. 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)
  39611. }
  39612. ,
  39613. b.shr = b.shiftRight,
  39614. b.shiftRightUnsigned = function(e) {
  39615. if (t(e) && (e = e.toInt()),
  39616. e &= 63,
  39617. 0 === e)
  39618. return this;
  39619. var i = this.high;
  39620. if (e < 32) {
  39621. var n = this.low;
  39622. return r(n >>> e | i << 32 - e, i >>> e, this.unsigned)
  39623. }
  39624. return 32 === e ? r(i, 0, this.unsigned) : r(i >>> e - 32, 0, this.unsigned)
  39625. }
  39626. ,
  39627. b.shru = b.shiftRightUnsigned,
  39628. b.toSigned = function() {
  39629. return this.unsigned ? r(this.low, this.high, !1) : this
  39630. }
  39631. ,
  39632. b.toUnsigned = function() {
  39633. return this.unsigned ? this : r(this.low, this.high, !0)
  39634. }
  39635. ,
  39636. b.toBytes = function(e) {
  39637. return e ? this.toBytesLE() : this.toBytesBE()
  39638. }
  39639. ,
  39640. b.toBytesLE = function() {
  39641. var e = this.high
  39642. , t = this.low;
  39643. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  39644. }
  39645. ,
  39646. b.toBytesBE = function() {
  39647. var e = this.high
  39648. , t = this.low;
  39649. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  39650. }
  39651. ,
  39652. e
  39653. })
  39654. }
  39655. , {}],
  39656. 217: [function(e, t, i) {
  39657. var n = {
  39658. REVISION: "75"
  39659. };
  39660. "function" == typeof define && define.amd ? define("three", n) : "undefined" != typeof i && "undefined" != typeof t && (t.exports = n),
  39661. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  39662. void 0 === Math.sign && (Math.sign = function(e) {
  39663. return e < 0 ? -1 : e > 0 ? 1 : +e
  39664. }
  39665. ),
  39666. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  39667. get: function() {
  39668. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  39669. }
  39670. }),
  39671. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  39672. writable: !0,
  39673. configurable: !0,
  39674. value: function(e) {
  39675. "use strict";
  39676. if (void 0 === e || null === e)
  39677. throw new TypeError("Cannot convert first argument to object");
  39678. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  39679. var r = arguments[i];
  39680. if (void 0 !== r && null !== r) {
  39681. r = Object(r);
  39682. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  39683. var l = o[a]
  39684. , c = Object.getOwnPropertyDescriptor(r, l);
  39685. void 0 !== c && c.enumerable && (t[l] = r[l])
  39686. }
  39687. }
  39688. }
  39689. return t
  39690. }
  39691. }),
  39692. n.MOUSE = {
  39693. LEFT: 0,
  39694. MIDDLE: 1,
  39695. RIGHT: 2
  39696. },
  39697. n.CullFaceNone = 0,
  39698. n.CullFaceBack = 1,
  39699. n.CullFaceFront = 2,
  39700. n.CullFaceFrontBack = 3,
  39701. n.FrontFaceDirectionCW = 0,
  39702. n.FrontFaceDirectionCCW = 1,
  39703. n.BasicShadowMap = 0,
  39704. n.PCFShadowMap = 1,
  39705. n.PCFSoftShadowMap = 2,
  39706. n.FrontSide = 0,
  39707. n.BackSide = 1,
  39708. n.DoubleSide = 2,
  39709. n.FlatShading = 1,
  39710. n.SmoothShading = 2,
  39711. n.NoColors = 0,
  39712. n.FaceColors = 1,
  39713. n.VertexColors = 2,
  39714. n.NoBlending = 0,
  39715. n.NormalBlending = 1,
  39716. n.AdditiveBlending = 2,
  39717. n.SubtractiveBlending = 3,
  39718. n.MultiplyBlending = 4,
  39719. n.CustomBlending = 5,
  39720. n.AddEquation = 100,
  39721. n.SubtractEquation = 101,
  39722. n.ReverseSubtractEquation = 102,
  39723. n.MinEquation = 103,
  39724. n.MaxEquation = 104,
  39725. n.ZeroFactor = 200,
  39726. n.OneFactor = 201,
  39727. n.SrcColorFactor = 202,
  39728. n.OneMinusSrcColorFactor = 203,
  39729. n.SrcAlphaFactor = 204,
  39730. n.OneMinusSrcAlphaFactor = 205,
  39731. n.DstAlphaFactor = 206,
  39732. n.OneMinusDstAlphaFactor = 207,
  39733. n.DstColorFactor = 208,
  39734. n.OneMinusDstColorFactor = 209,
  39735. n.SrcAlphaSaturateFactor = 210,
  39736. n.NeverDepth = 0,
  39737. n.AlwaysDepth = 1,
  39738. n.LessDepth = 2,
  39739. n.LessEqualDepth = 3,
  39740. n.EqualDepth = 4,
  39741. n.GreaterEqualDepth = 5,
  39742. n.GreaterDepth = 6,
  39743. n.NotEqualDepth = 7,
  39744. n.MultiplyOperation = 0,
  39745. n.MixOperation = 1,
  39746. n.AddOperation = 2,
  39747. n.NoToneMapping = 0,
  39748. n.LinearToneMapping = 1,
  39749. n.ReinhardToneMapping = 2,
  39750. n.Uncharted2ToneMapping = 3,
  39751. n.CineonToneMapping = 4,
  39752. n.UVMapping = 300,
  39753. n.CubeReflectionMapping = 301,
  39754. n.CubeRefractionMapping = 302,
  39755. n.EquirectangularReflectionMapping = 303,
  39756. n.EquirectangularRefractionMapping = 304,
  39757. n.SphericalReflectionMapping = 305,
  39758. n.CubeUVReflectionMapping = 306,
  39759. n.CubeUVRefractionMapping = 307,
  39760. n.RepeatWrapping = 1e3,
  39761. n.ClampToEdgeWrapping = 1001,
  39762. n.MirroredRepeatWrapping = 1002,
  39763. n.NearestFilter = 1003,
  39764. n.NearestMipMapNearestFilter = 1004,
  39765. n.NearestMipMapLinearFilter = 1005,
  39766. n.LinearFilter = 1006,
  39767. n.LinearMipMapNearestFilter = 1007,
  39768. n.LinearMipMapLinearFilter = 1008,
  39769. n.UnsignedByteType = 1009,
  39770. n.ByteType = 1010,
  39771. n.ShortType = 1011,
  39772. n.UnsignedShortType = 1012,
  39773. n.IntType = 1013,
  39774. n.UnsignedIntType = 1014,
  39775. n.FloatType = 1015,
  39776. n.HalfFloatType = 1025,
  39777. n.UnsignedShort4444Type = 1016,
  39778. n.UnsignedShort5551Type = 1017,
  39779. n.UnsignedShort565Type = 1018,
  39780. n.AlphaFormat = 1019,
  39781. n.RGBFormat = 1020,
  39782. n.RGBAFormat = 1021,
  39783. n.LuminanceFormat = 1022,
  39784. n.LuminanceAlphaFormat = 1023,
  39785. n.RGBEFormat = n.RGBAFormat,
  39786. n.RGB_S3TC_DXT1_Format = 2001,
  39787. n.RGBA_S3TC_DXT1_Format = 2002,
  39788. n.RGBA_S3TC_DXT3_Format = 2003,
  39789. n.RGBA_S3TC_DXT5_Format = 2004,
  39790. n.RGB_PVRTC_4BPPV1_Format = 2100,
  39791. n.RGB_PVRTC_2BPPV1_Format = 2101,
  39792. n.RGBA_PVRTC_4BPPV1_Format = 2102,
  39793. n.RGBA_PVRTC_2BPPV1_Format = 2103,
  39794. n.RGB_ETC1_Format = 2151,
  39795. n.LoopOnce = 2200,
  39796. n.LoopRepeat = 2201,
  39797. n.LoopPingPong = 2202,
  39798. n.InterpolateDiscrete = 2300,
  39799. n.InterpolateLinear = 2301,
  39800. n.InterpolateSmooth = 2302,
  39801. n.ZeroCurvatureEnding = 2400,
  39802. n.ZeroSlopeEnding = 2401,
  39803. n.WrapAroundEnding = 2402,
  39804. n.TrianglesDrawMode = 0,
  39805. n.TriangleStripDrawMode = 1,
  39806. n.TriangleFanDrawMode = 2,
  39807. n.LinearEncoding = 3e3,
  39808. n.sRGBEncoding = 3001,
  39809. n.GammaEncoding = 3007,
  39810. n.RGBEEncoding = 3002,
  39811. n.LogLuvEncoding = 3003,
  39812. n.RGBM7Encoding = 3004,
  39813. n.RGBM16Encoding = 3005,
  39814. n.RGBDEncoding = 3006,
  39815. n.Color = function(e) {
  39816. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  39817. }
  39818. ,
  39819. n.Color.prototype = {
  39820. constructor: n.Color,
  39821. r: 1,
  39822. g: 1,
  39823. b: 1,
  39824. set: function(e) {
  39825. return e instanceof n.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  39826. this
  39827. },
  39828. setScalar: function(e) {
  39829. this.r = e,
  39830. this.g = e,
  39831. this.b = e
  39832. },
  39833. setHex: function(e) {
  39834. return e = Math.floor(e),
  39835. this.r = (e >> 16 & 255) / 255,
  39836. this.g = (e >> 8 & 255) / 255,
  39837. this.b = (255 & e) / 255,
  39838. this
  39839. },
  39840. setRGB: function(e, t, i) {
  39841. return this.r = e,
  39842. this.g = t,
  39843. this.b = i,
  39844. this
  39845. },
  39846. setHSL: function() {
  39847. function e(e, t, i) {
  39848. return i < 0 && (i += 1),
  39849. i > 1 && (i -= 1),
  39850. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  39851. }
  39852. return function(t, i, r) {
  39853. if (t = n.Math.euclideanModulo(t, 1),
  39854. i = n.Math.clamp(i, 0, 1),
  39855. r = n.Math.clamp(r, 0, 1),
  39856. 0 === i)
  39857. this.r = this.g = this.b = r;
  39858. else {
  39859. var o = r <= .5 ? r * (1 + i) : r + i - r * i
  39860. , a = 2 * r - o;
  39861. this.r = e(a, o, t + 1 / 3),
  39862. this.g = e(a, o, t),
  39863. this.b = e(a, o, t - 1 / 3)
  39864. }
  39865. return this
  39866. }
  39867. }(),
  39868. setStyle: function(e) {
  39869. function t(t) {
  39870. void 0 !== t && parseFloat(t) < 1 && console.warn("THREE.Color: Alpha component of " + e + " will be ignored.")
  39871. }
  39872. var i;
  39873. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)) {
  39874. var r, o = i[1], a = i[2];
  39875. switch (o) {
  39876. case "rgb":
  39877. case "rgba":
  39878. if (r = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  39879. return this.r = Math.min(255, parseInt(r[1], 10)) / 255,
  39880. this.g = Math.min(255, parseInt(r[2], 10)) / 255,
  39881. this.b = Math.min(255, parseInt(r[3], 10)) / 255,
  39882. t(r[5]),
  39883. this;
  39884. if (r = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  39885. return this.r = Math.min(100, parseInt(r[1], 10)) / 100,
  39886. this.g = Math.min(100, parseInt(r[2], 10)) / 100,
  39887. this.b = Math.min(100, parseInt(r[3], 10)) / 100,
  39888. t(r[5]),
  39889. this;
  39890. break;
  39891. case "hsl":
  39892. case "hsla":
  39893. if (r = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)) {
  39894. var s = parseFloat(r[1]) / 360
  39895. , l = parseInt(r[2], 10) / 100
  39896. , c = parseInt(r[3], 10) / 100;
  39897. return t(r[5]),
  39898. this.setHSL(s, l, c)
  39899. }
  39900. }
  39901. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(e)) {
  39902. var h = i[1]
  39903. , u = h.length;
  39904. if (3 === u)
  39905. return this.r = parseInt(h.charAt(0) + h.charAt(0), 16) / 255,
  39906. this.g = parseInt(h.charAt(1) + h.charAt(1), 16) / 255,
  39907. this.b = parseInt(h.charAt(2) + h.charAt(2), 16) / 255,
  39908. this;
  39909. if (6 === u)
  39910. return this.r = parseInt(h.charAt(0) + h.charAt(1), 16) / 255,
  39911. this.g = parseInt(h.charAt(2) + h.charAt(3), 16) / 255,
  39912. this.b = parseInt(h.charAt(4) + h.charAt(5), 16) / 255,
  39913. this
  39914. }
  39915. if (e && e.length > 0) {
  39916. var h = n.ColorKeywords[e];
  39917. void 0 !== h ? this.setHex(h) : console.warn("THREE.Color: Unknown color " + e)
  39918. }
  39919. return this
  39920. },
  39921. clone: function() {
  39922. return new this.constructor(this.r,this.g,this.b)
  39923. },
  39924. copy: function(e) {
  39925. return this.r = e.r,
  39926. this.g = e.g,
  39927. this.b = e.b,
  39928. this
  39929. },
  39930. copyGammaToLinear: function(e, t) {
  39931. return void 0 === t && (t = 2),
  39932. this.r = Math.pow(e.r, t),
  39933. this.g = Math.pow(e.g, t),
  39934. this.b = Math.pow(e.b, t),
  39935. this
  39936. },
  39937. copyLinearToGamma: function(e, t) {
  39938. void 0 === t && (t = 2);
  39939. var i = t > 0 ? 1 / t : 1;
  39940. return this.r = Math.pow(e.r, i),
  39941. this.g = Math.pow(e.g, i),
  39942. this.b = Math.pow(e.b, i),
  39943. this
  39944. },
  39945. convertGammaToLinear: function() {
  39946. var e = this.r
  39947. , t = this.g
  39948. , i = this.b;
  39949. return this.r = e * e,
  39950. this.g = t * t,
  39951. this.b = i * i,
  39952. this
  39953. },
  39954. convertLinearToGamma: function() {
  39955. return this.r = Math.sqrt(this.r),
  39956. this.g = Math.sqrt(this.g),
  39957. this.b = Math.sqrt(this.b),
  39958. this
  39959. },
  39960. getHex: function() {
  39961. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  39962. },
  39963. getHexString: function() {
  39964. return ("000000" + this.getHex().toString(16)).slice(-6)
  39965. },
  39966. getHSL: function(e) {
  39967. var t, i, n = e || {
  39968. h: 0,
  39969. s: 0,
  39970. l: 0
  39971. }, 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;
  39972. if (l === s)
  39973. t = 0,
  39974. i = 0;
  39975. else {
  39976. var h = s - l;
  39977. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  39978. s) {
  39979. case r:
  39980. t = (o - a) / h + (o < a ? 6 : 0);
  39981. break;
  39982. case o:
  39983. t = (a - r) / h + 2;
  39984. break;
  39985. case a:
  39986. t = (r - o) / h + 4
  39987. }
  39988. t /= 6
  39989. }
  39990. return n.h = t,
  39991. n.s = i,
  39992. n.l = c,
  39993. n
  39994. },
  39995. getStyle: function() {
  39996. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  39997. },
  39998. offsetHSL: function(e, t, i) {
  39999. var n = this.getHSL();
  40000. return n.h += e,
  40001. n.s += t,
  40002. n.l += i,
  40003. this.setHSL(n.h, n.s, n.l),
  40004. this
  40005. },
  40006. add: function(e) {
  40007. return this.r += e.r,
  40008. this.g += e.g,
  40009. this.b += e.b,
  40010. this
  40011. },
  40012. addColors: function(e, t) {
  40013. return this.r = e.r + t.r,
  40014. this.g = e.g + t.g,
  40015. this.b = e.b + t.b,
  40016. this
  40017. },
  40018. addScalar: function(e) {
  40019. return this.r += e,
  40020. this.g += e,
  40021. this.b += e,
  40022. this
  40023. },
  40024. multiply: function(e) {
  40025. return this.r *= e.r,
  40026. this.g *= e.g,
  40027. this.b *= e.b,
  40028. this
  40029. },
  40030. multiplyScalar: function(e) {
  40031. return this.r *= e,
  40032. this.g *= e,
  40033. this.b *= e,
  40034. this
  40035. },
  40036. lerp: function(e, t) {
  40037. return this.r += (e.r - this.r) * t,
  40038. this.g += (e.g - this.g) * t,
  40039. this.b += (e.b - this.b) * t,
  40040. this
  40041. },
  40042. equals: function(e) {
  40043. return e.r === this.r && e.g === this.g && e.b === this.b
  40044. },
  40045. fromArray: function(e, t) {
  40046. return void 0 === t && (t = 0),
  40047. this.r = e[t],
  40048. this.g = e[t + 1],
  40049. this.b = e[t + 2],
  40050. this
  40051. },
  40052. toArray: function(e, t) {
  40053. return void 0 === e && (e = []),
  40054. void 0 === t && (t = 0),
  40055. e[t] = this.r,
  40056. e[t + 1] = this.g,
  40057. e[t + 2] = this.b,
  40058. e
  40059. }
  40060. },
  40061. n.ColorKeywords = {
  40062. aliceblue: 15792383,
  40063. antiquewhite: 16444375,
  40064. aqua: 65535,
  40065. aquamarine: 8388564,
  40066. azure: 15794175,
  40067. beige: 16119260,
  40068. bisque: 16770244,
  40069. black: 0,
  40070. blanchedalmond: 16772045,
  40071. blue: 255,
  40072. blueviolet: 9055202,
  40073. brown: 10824234,
  40074. burlywood: 14596231,
  40075. cadetblue: 6266528,
  40076. chartreuse: 8388352,
  40077. chocolate: 13789470,
  40078. coral: 16744272,
  40079. cornflowerblue: 6591981,
  40080. cornsilk: 16775388,
  40081. crimson: 14423100,
  40082. cyan: 65535,
  40083. darkblue: 139,
  40084. darkcyan: 35723,
  40085. darkgoldenrod: 12092939,
  40086. darkgray: 11119017,
  40087. darkgreen: 25600,
  40088. darkgrey: 11119017,
  40089. darkkhaki: 12433259,
  40090. darkmagenta: 9109643,
  40091. darkolivegreen: 5597999,
  40092. darkorange: 16747520,
  40093. darkorchid: 10040012,
  40094. darkred: 9109504,
  40095. darksalmon: 15308410,
  40096. darkseagreen: 9419919,
  40097. darkslateblue: 4734347,
  40098. darkslategray: 3100495,
  40099. darkslategrey: 3100495,
  40100. darkturquoise: 52945,
  40101. darkviolet: 9699539,
  40102. deeppink: 16716947,
  40103. deepskyblue: 49151,
  40104. dimgray: 6908265,
  40105. dimgrey: 6908265,
  40106. dodgerblue: 2003199,
  40107. firebrick: 11674146,
  40108. floralwhite: 16775920,
  40109. forestgreen: 2263842,
  40110. fuchsia: 16711935,
  40111. gainsboro: 14474460,
  40112. ghostwhite: 16316671,
  40113. gold: 16766720,
  40114. goldenrod: 14329120,
  40115. gray: 8421504,
  40116. green: 32768,
  40117. greenyellow: 11403055,
  40118. grey: 8421504,
  40119. honeydew: 15794160,
  40120. hotpink: 16738740,
  40121. indianred: 13458524,
  40122. indigo: 4915330,
  40123. ivory: 16777200,
  40124. khaki: 15787660,
  40125. lavender: 15132410,
  40126. lavenderblush: 16773365,
  40127. lawngreen: 8190976,
  40128. lemonchiffon: 16775885,
  40129. lightblue: 11393254,
  40130. lightcoral: 15761536,
  40131. lightcyan: 14745599,
  40132. lightgoldenrodyellow: 16448210,
  40133. lightgray: 13882323,
  40134. lightgreen: 9498256,
  40135. lightgrey: 13882323,
  40136. lightpink: 16758465,
  40137. lightsalmon: 16752762,
  40138. lightseagreen: 2142890,
  40139. lightskyblue: 8900346,
  40140. lightslategray: 7833753,
  40141. lightslategrey: 7833753,
  40142. lightsteelblue: 11584734,
  40143. lightyellow: 16777184,
  40144. lime: 65280,
  40145. limegreen: 3329330,
  40146. linen: 16445670,
  40147. magenta: 16711935,
  40148. maroon: 8388608,
  40149. mediumaquamarine: 6737322,
  40150. mediumblue: 205,
  40151. mediumorchid: 12211667,
  40152. mediumpurple: 9662683,
  40153. mediumseagreen: 3978097,
  40154. mediumslateblue: 8087790,
  40155. mediumspringgreen: 64154,
  40156. mediumturquoise: 4772300,
  40157. mediumvioletred: 13047173,
  40158. midnightblue: 1644912,
  40159. mintcream: 16121850,
  40160. mistyrose: 16770273,
  40161. moccasin: 16770229,
  40162. navajowhite: 16768685,
  40163. navy: 128,
  40164. oldlace: 16643558,
  40165. olive: 8421376,
  40166. olivedrab: 7048739,
  40167. orange: 16753920,
  40168. orangered: 16729344,
  40169. orchid: 14315734,
  40170. palegoldenrod: 15657130,
  40171. palegreen: 10025880,
  40172. paleturquoise: 11529966,
  40173. palevioletred: 14381203,
  40174. papayawhip: 16773077,
  40175. peachpuff: 16767673,
  40176. peru: 13468991,
  40177. pink: 16761035,
  40178. plum: 14524637,
  40179. powderblue: 11591910,
  40180. purple: 8388736,
  40181. red: 16711680,
  40182. rosybrown: 12357519,
  40183. royalblue: 4286945,
  40184. saddlebrown: 9127187,
  40185. salmon: 16416882,
  40186. sandybrown: 16032864,
  40187. seagreen: 3050327,
  40188. seashell: 16774638,
  40189. sienna: 10506797,
  40190. silver: 12632256,
  40191. skyblue: 8900331,
  40192. slateblue: 6970061,
  40193. slategray: 7372944,
  40194. slategrey: 7372944,
  40195. snow: 16775930,
  40196. springgreen: 65407,
  40197. steelblue: 4620980,
  40198. tan: 13808780,
  40199. teal: 32896,
  40200. thistle: 14204888,
  40201. tomato: 16737095,
  40202. turquoise: 4251856,
  40203. violet: 15631086,
  40204. wheat: 16113331,
  40205. white: 16777215,
  40206. whitesmoke: 16119285,
  40207. yellow: 16776960,
  40208. yellowgreen: 10145074
  40209. },
  40210. n.Quaternion = function(e, t, i, n) {
  40211. this._x = e || 0,
  40212. this._y = t || 0,
  40213. this._z = i || 0,
  40214. this._w = void 0 !== n ? n : 1
  40215. }
  40216. ,
  40217. n.Quaternion.prototype = {
  40218. constructor: n.Quaternion,
  40219. get x() {
  40220. return this._x
  40221. },
  40222. set x(e) {
  40223. this._x = e,
  40224. this.onChangeCallback()
  40225. },
  40226. get y() {
  40227. return this._y
  40228. },
  40229. set y(e) {
  40230. this._y = e,
  40231. this.onChangeCallback()
  40232. },
  40233. get z() {
  40234. return this._z
  40235. },
  40236. set z(e) {
  40237. this._z = e,
  40238. this.onChangeCallback()
  40239. },
  40240. get w() {
  40241. return this._w
  40242. },
  40243. set w(e) {
  40244. this._w = e,
  40245. this.onChangeCallback()
  40246. },
  40247. set: function(e, t, i, n) {
  40248. return this._x = e,
  40249. this._y = t,
  40250. this._z = i,
  40251. this._w = n,
  40252. this.onChangeCallback(),
  40253. this
  40254. },
  40255. clone: function() {
  40256. return new this.constructor(this._x,this._y,this._z,this._w)
  40257. },
  40258. copy: function(e) {
  40259. return this._x = e.x,
  40260. this._y = e.y,
  40261. this._z = e.z,
  40262. this._w = e.w,
  40263. this.onChangeCallback(),
  40264. this
  40265. },
  40266. setFromEuler: function(e, t) {
  40267. if (e instanceof n.Euler == !1)
  40268. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  40269. var i = Math.cos(e._x / 2)
  40270. , r = Math.cos(e._y / 2)
  40271. , o = Math.cos(e._z / 2)
  40272. , a = Math.sin(e._x / 2)
  40273. , s = Math.sin(e._y / 2)
  40274. , l = Math.sin(e._z / 2)
  40275. , c = e.order;
  40276. return "XYZ" === c ? (this._x = a * r * o + i * s * l,
  40277. this._y = i * s * o - a * r * l,
  40278. this._z = i * r * l + a * s * o,
  40279. this._w = i * r * o - a * s * l) : "YXZ" === c ? (this._x = a * r * o + i * s * l,
  40280. this._y = i * s * o - a * r * l,
  40281. this._z = i * r * l - a * s * o,
  40282. this._w = i * r * o + a * s * l) : "ZXY" === c ? (this._x = a * r * o - i * s * l,
  40283. this._y = i * s * o + a * r * l,
  40284. this._z = i * r * l + a * s * o,
  40285. this._w = i * r * o - a * s * l) : "ZYX" === c ? (this._x = a * r * o - i * s * l,
  40286. this._y = i * s * o + a * r * l,
  40287. this._z = i * r * l - a * s * o,
  40288. this._w = i * r * o + a * s * l) : "YZX" === c ? (this._x = a * r * o + i * s * l,
  40289. this._y = i * s * o + a * r * l,
  40290. this._z = i * r * l - a * s * o,
  40291. this._w = i * r * o - a * s * l) : "XZY" === c && (this._x = a * r * o - i * s * l,
  40292. this._y = i * s * o - a * r * l,
  40293. this._z = i * r * l + a * s * o,
  40294. this._w = i * r * o + a * s * l),
  40295. t !== !1 && this.onChangeCallback(),
  40296. this
  40297. },
  40298. setFromAxisAngle: function(e, t) {
  40299. var i = t / 2
  40300. , n = Math.sin(i);
  40301. return this._x = e.x * n,
  40302. this._y = e.y * n,
  40303. this._z = e.z * n,
  40304. this._w = Math.cos(i),
  40305. this.onChangeCallback(),
  40306. this
  40307. },
  40308. setFromRotationMatrix: function(e) {
  40309. 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;
  40310. return d > 0 ? (t = .5 / Math.sqrt(d + 1),
  40311. this._w = .25 / t,
  40312. this._x = (h - l) * t,
  40313. this._y = (o - c) * t,
  40314. this._z = (a - r) * t) : n > s && n > u ? (t = 2 * Math.sqrt(1 + n - s - u),
  40315. this._w = (h - l) / t,
  40316. this._x = .25 * t,
  40317. this._y = (r + a) / t,
  40318. this._z = (o + c) / t) : s > u ? (t = 2 * Math.sqrt(1 + s - n - u),
  40319. this._w = (o - c) / t,
  40320. this._x = (r + a) / t,
  40321. this._y = .25 * t,
  40322. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  40323. this._w = (a - r) / t,
  40324. this._x = (o + c) / t,
  40325. this._y = (l + h) / t,
  40326. this._z = .25 * t),
  40327. this.onChangeCallback(),
  40328. this
  40329. },
  40330. setFromUnitVectors: function() {
  40331. var e, t, i = 1e-6;
  40332. return function(r, o) {
  40333. return void 0 === e && (e = new n.Vector3),
  40334. t = r.dot(o) + 1,
  40335. t < i ? (t = 0,
  40336. 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),
  40337. this._x = e.x,
  40338. this._y = e.y,
  40339. this._z = e.z,
  40340. this._w = t,
  40341. this.normalize(),
  40342. this
  40343. }
  40344. }(),
  40345. inverse: function() {
  40346. return this.conjugate().normalize(),
  40347. this
  40348. },
  40349. conjugate: function() {
  40350. return this._x *= -1,
  40351. this._y *= -1,
  40352. this._z *= -1,
  40353. this.onChangeCallback(),
  40354. this
  40355. },
  40356. dot: function(e) {
  40357. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  40358. },
  40359. lengthSq: function() {
  40360. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  40361. },
  40362. length: function() {
  40363. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  40364. },
  40365. normalize: function() {
  40366. var e = this.length();
  40367. return 0 === e ? (this._x = 0,
  40368. this._y = 0,
  40369. this._z = 0,
  40370. this._w = 1) : (e = 1 / e,
  40371. this._x = this._x * e,
  40372. this._y = this._y * e,
  40373. this._z = this._z * e,
  40374. this._w = this._w * e),
  40375. this.onChangeCallback(),
  40376. this
  40377. },
  40378. multiply: function(e, t) {
  40379. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  40380. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  40381. },
  40382. multiplyQuaternions: function(e, t) {
  40383. var i = e._x
  40384. , n = e._y
  40385. , r = e._z
  40386. , o = e._w
  40387. , a = t._x
  40388. , s = t._y
  40389. , l = t._z
  40390. , c = t._w;
  40391. return this._x = i * c + o * a + n * l - r * s,
  40392. this._y = n * c + o * s + r * a - i * l,
  40393. this._z = r * c + o * l + i * s - n * a,
  40394. this._w = o * c - i * a - n * s - r * l,
  40395. this.onChangeCallback(),
  40396. this
  40397. },
  40398. slerp: function(e, t) {
  40399. if (0 === t)
  40400. return this;
  40401. if (1 === t)
  40402. return this.copy(e);
  40403. var i = this._x
  40404. , n = this._y
  40405. , r = this._z
  40406. , o = this._w
  40407. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  40408. if (a < 0 ? (this._w = -e._w,
  40409. this._x = -e._x,
  40410. this._y = -e._y,
  40411. this._z = -e._z,
  40412. a = -a) : this.copy(e),
  40413. a >= 1)
  40414. return this._w = o,
  40415. this._x = i,
  40416. this._y = n,
  40417. this._z = r,
  40418. this;
  40419. var s = Math.sqrt(1 - a * a);
  40420. if (Math.abs(s) < .001)
  40421. return this._w = .5 * (o + this._w),
  40422. this._x = .5 * (i + this._x),
  40423. this._y = .5 * (n + this._y),
  40424. this._z = .5 * (r + this._z),
  40425. this;
  40426. var l = Math.atan2(s, a)
  40427. , c = Math.sin((1 - t) * l) / s
  40428. , h = Math.sin(t * l) / s;
  40429. return this._w = o * c + this._w * h,
  40430. this._x = i * c + this._x * h,
  40431. this._y = n * c + this._y * h,
  40432. this._z = r * c + this._z * h,
  40433. this.onChangeCallback(),
  40434. this
  40435. },
  40436. equals: function(e) {
  40437. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  40438. },
  40439. fromArray: function(e, t) {
  40440. return void 0 === t && (t = 0),
  40441. this._x = e[t],
  40442. this._y = e[t + 1],
  40443. this._z = e[t + 2],
  40444. this._w = e[t + 3],
  40445. this.onChangeCallback(),
  40446. this
  40447. },
  40448. toArray: function(e, t) {
  40449. return void 0 === e && (e = []),
  40450. void 0 === t && (t = 0),
  40451. e[t] = this._x,
  40452. e[t + 1] = this._y,
  40453. e[t + 2] = this._z,
  40454. e[t + 3] = this._w,
  40455. e
  40456. },
  40457. onChange: function(e) {
  40458. return this.onChangeCallback = e,
  40459. this
  40460. },
  40461. onChangeCallback: function() {}
  40462. },
  40463. Object.assign(n.Quaternion, {
  40464. slerp: function(e, t, i, n) {
  40465. return i.copy(e).slerp(t, n)
  40466. },
  40467. slerpFlat: function(e, t, i, n, r, o, a) {
  40468. var s = i[n + 0]
  40469. , l = i[n + 1]
  40470. , c = i[n + 2]
  40471. , h = i[n + 3]
  40472. , u = r[o + 0]
  40473. , d = r[o + 1]
  40474. , p = r[o + 2]
  40475. , f = r[o + 3];
  40476. if (h !== f || s !== u || l !== d || c !== p) {
  40477. var g = 1 - a
  40478. , m = s * u + l * d + c * p + h * f
  40479. , v = m >= 0 ? 1 : -1
  40480. , A = 1 - m * m;
  40481. if (A > Number.EPSILON) {
  40482. var y = Math.sqrt(A)
  40483. , C = Math.atan2(y, m * v);
  40484. g = Math.sin(g * C) / y,
  40485. a = Math.sin(a * C) / y
  40486. }
  40487. var I = a * v;
  40488. if (s = s * g + u * I,
  40489. l = l * g + d * I,
  40490. c = c * g + p * I,
  40491. h = h * g + f * I,
  40492. g === 1 - a) {
  40493. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  40494. s *= E,
  40495. l *= E,
  40496. c *= E,
  40497. h *= E
  40498. }
  40499. }
  40500. e[t] = s,
  40501. e[t + 1] = l,
  40502. e[t + 2] = c,
  40503. e[t + 3] = h
  40504. }
  40505. }),
  40506. n.Vector2 = function(e, t) {
  40507. this.x = e || 0,
  40508. this.y = t || 0
  40509. }
  40510. ,
  40511. n.Vector2.prototype = {
  40512. constructor: n.Vector2,
  40513. get width() {
  40514. return this.x
  40515. },
  40516. set width(e) {
  40517. this.x = e
  40518. },
  40519. get height() {
  40520. return this.y
  40521. },
  40522. set height(e) {
  40523. this.y = e
  40524. },
  40525. set: function(e, t) {
  40526. return this.x = e,
  40527. this.y = t,
  40528. this
  40529. },
  40530. setScalar: function(e) {
  40531. return this.x = e,
  40532. this.y = e,
  40533. this
  40534. },
  40535. setX: function(e) {
  40536. return this.x = e,
  40537. this
  40538. },
  40539. setY: function(e) {
  40540. return this.y = e,
  40541. this
  40542. },
  40543. setComponent: function(e, t) {
  40544. switch (e) {
  40545. case 0:
  40546. this.x = t;
  40547. break;
  40548. case 1:
  40549. this.y = t;
  40550. break;
  40551. default:
  40552. throw new Error("index is out of range: " + e)
  40553. }
  40554. },
  40555. getComponent: function(e) {
  40556. switch (e) {
  40557. case 0:
  40558. return this.x;
  40559. case 1:
  40560. return this.y;
  40561. default:
  40562. throw new Error("index is out of range: " + e)
  40563. }
  40564. },
  40565. clone: function() {
  40566. return new this.constructor(this.x,this.y)
  40567. },
  40568. copy: function(e) {
  40569. return this.x = e.x,
  40570. this.y = e.y,
  40571. this
  40572. },
  40573. add: function(e, t) {
  40574. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  40575. this.addVectors(e, t)) : (this.x += e.x,
  40576. this.y += e.y,
  40577. this)
  40578. },
  40579. addScalar: function(e) {
  40580. return this.x += e,
  40581. this.y += e,
  40582. this
  40583. },
  40584. addVectors: function(e, t) {
  40585. return this.x = e.x + t.x,
  40586. this.y = e.y + t.y,
  40587. this
  40588. },
  40589. addScaledVector: function(e, t) {
  40590. return this.x += e.x * t,
  40591. this.y += e.y * t,
  40592. this
  40593. },
  40594. sub: function(e, t) {
  40595. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  40596. this.subVectors(e, t)) : (this.x -= e.x,
  40597. this.y -= e.y,
  40598. this)
  40599. },
  40600. subScalar: function(e) {
  40601. return this.x -= e,
  40602. this.y -= e,
  40603. this
  40604. },
  40605. subVectors: function(e, t) {
  40606. return this.x = e.x - t.x,
  40607. this.y = e.y - t.y,
  40608. this
  40609. },
  40610. multiply: function(e) {
  40611. return this.x *= e.x,
  40612. this.y *= e.y,
  40613. this
  40614. },
  40615. multiplyScalar: function(e) {
  40616. return isFinite(e) ? (this.x *= e,
  40617. this.y *= e) : (this.x = 0,
  40618. this.y = 0),
  40619. this
  40620. },
  40621. divide: function(e) {
  40622. return this.x /= e.x,
  40623. this.y /= e.y,
  40624. this
  40625. },
  40626. divideScalar: function(e) {
  40627. return this.multiplyScalar(1 / e)
  40628. },
  40629. min: function(e) {
  40630. return this.x = Math.min(this.x, e.x),
  40631. this.y = Math.min(this.y, e.y),
  40632. this
  40633. },
  40634. max: function(e) {
  40635. return this.x = Math.max(this.x, e.x),
  40636. this.y = Math.max(this.y, e.y),
  40637. this
  40638. },
  40639. clamp: function(e, t) {
  40640. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  40641. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  40642. this
  40643. },
  40644. clampScalar: function() {
  40645. var e, t;
  40646. return function(i, r) {
  40647. return void 0 === e && (e = new n.Vector2,
  40648. t = new n.Vector2),
  40649. e.set(i, i),
  40650. t.set(r, r),
  40651. this.clamp(e, t)
  40652. }
  40653. }(),
  40654. clampLength: function(e, t) {
  40655. var i = this.length();
  40656. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  40657. this
  40658. },
  40659. floor: function() {
  40660. return this.x = Math.floor(this.x),
  40661. this.y = Math.floor(this.y),
  40662. this
  40663. },
  40664. ceil: function() {
  40665. return this.x = Math.ceil(this.x),
  40666. this.y = Math.ceil(this.y),
  40667. this
  40668. },
  40669. round: function() {
  40670. return this.x = Math.round(this.x),
  40671. this.y = Math.round(this.y),
  40672. this
  40673. },
  40674. roundToZero: function() {
  40675. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  40676. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  40677. this
  40678. },
  40679. negate: function() {
  40680. return this.x = -this.x,
  40681. this.y = -this.y,
  40682. this
  40683. },
  40684. dot: function(e) {
  40685. return this.x * e.x + this.y * e.y
  40686. },
  40687. lengthSq: function() {
  40688. return this.x * this.x + this.y * this.y
  40689. },
  40690. length: function() {
  40691. return Math.sqrt(this.x * this.x + this.y * this.y)
  40692. },
  40693. lengthManhattan: function() {
  40694. return Math.abs(this.x) + Math.abs(this.y)
  40695. },
  40696. normalize: function() {
  40697. return this.divideScalar(this.length())
  40698. },
  40699. angle: function() {
  40700. var e = Math.atan2(this.y, this.x);
  40701. return e < 0 && (e += 2 * Math.PI),
  40702. e
  40703. },
  40704. distanceTo: function(e) {
  40705. return Math.sqrt(this.distanceToSquared(e))
  40706. },
  40707. distanceToSquared: function(e) {
  40708. var t = this.x - e.x
  40709. , i = this.y - e.y;
  40710. return t * t + i * i
  40711. },
  40712. setLength: function(e) {
  40713. return this.multiplyScalar(e / this.length())
  40714. },
  40715. lerp: function(e, t) {
  40716. return this.x += (e.x - this.x) * t,
  40717. this.y += (e.y - this.y) * t,
  40718. this
  40719. },
  40720. lerpVectors: function(e, t, i) {
  40721. return this.subVectors(t, e).multiplyScalar(i).add(e),
  40722. this
  40723. },
  40724. equals: function(e) {
  40725. return e.x === this.x && e.y === this.y
  40726. },
  40727. fromArray: function(e, t) {
  40728. return void 0 === t && (t = 0),
  40729. this.x = e[t],
  40730. this.y = e[t + 1],
  40731. this
  40732. },
  40733. toArray: function(e, t) {
  40734. return void 0 === e && (e = []),
  40735. void 0 === t && (t = 0),
  40736. e[t] = this.x,
  40737. e[t + 1] = this.y,
  40738. e
  40739. },
  40740. fromAttribute: function(e, t, i) {
  40741. return void 0 === i && (i = 0),
  40742. t = t * e.itemSize + i,
  40743. this.x = e.array[t],
  40744. this.y = e.array[t + 1],
  40745. this
  40746. },
  40747. rotateAround: function(e, t) {
  40748. var i = Math.cos(t)
  40749. , n = Math.sin(t)
  40750. , r = this.x - e.x
  40751. , o = this.y - e.y;
  40752. return this.x = r * i - o * n + e.x,
  40753. this.y = r * n + o * i + e.y,
  40754. this
  40755. }
  40756. },
  40757. n.Vector3 = function(e, t, i) {
  40758. this.x = e || 0,
  40759. this.y = t || 0,
  40760. this.z = i || 0
  40761. }
  40762. ,
  40763. n.Vector3.prototype = {
  40764. constructor: n.Vector3,
  40765. set: function(e, t, i) {
  40766. return this.x = e,
  40767. this.y = t,
  40768. this.z = i,
  40769. this
  40770. },
  40771. setScalar: function(e) {
  40772. return this.x = e,
  40773. this.y = e,
  40774. this.z = e,
  40775. this
  40776. },
  40777. setX: function(e) {
  40778. return this.x = e,
  40779. this
  40780. },
  40781. setY: function(e) {
  40782. return this.y = e,
  40783. this
  40784. },
  40785. setZ: function(e) {
  40786. return this.z = e,
  40787. this
  40788. },
  40789. setComponent: function(e, t) {
  40790. switch (e) {
  40791. case 0:
  40792. this.x = t;
  40793. break;
  40794. case 1:
  40795. this.y = t;
  40796. break;
  40797. case 2:
  40798. this.z = t;
  40799. break;
  40800. default:
  40801. throw new Error("index is out of range: " + e)
  40802. }
  40803. },
  40804. getComponent: function(e) {
  40805. switch (e) {
  40806. case 0:
  40807. return this.x;
  40808. case 1:
  40809. return this.y;
  40810. case 2:
  40811. return this.z;
  40812. default:
  40813. throw new Error("index is out of range: " + e)
  40814. }
  40815. },
  40816. clone: function() {
  40817. return new this.constructor(this.x,this.y,this.z)
  40818. },
  40819. copy: function(e) {
  40820. return this.x = e.x,
  40821. this.y = e.y,
  40822. this.z = e.z,
  40823. this
  40824. },
  40825. add: function(e, t) {
  40826. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  40827. this.addVectors(e, t)) : (this.x += e.x,
  40828. this.y += e.y,
  40829. this.z += e.z,
  40830. this)
  40831. },
  40832. addScalar: function(e) {
  40833. return this.x += e,
  40834. this.y += e,
  40835. this.z += e,
  40836. this
  40837. },
  40838. addVectors: function(e, t) {
  40839. return this.x = e.x + t.x,
  40840. this.y = e.y + t.y,
  40841. this.z = e.z + t.z,
  40842. this
  40843. },
  40844. addScaledVector: function(e, t) {
  40845. return this.x += e.x * t,
  40846. this.y += e.y * t,
  40847. this.z += e.z * t,
  40848. this
  40849. },
  40850. sub: function(e, t) {
  40851. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  40852. this.subVectors(e, t)) : (this.x -= e.x,
  40853. this.y -= e.y,
  40854. this.z -= e.z,
  40855. this)
  40856. },
  40857. subScalar: function(e) {
  40858. return this.x -= e,
  40859. this.y -= e,
  40860. this.z -= e,
  40861. this
  40862. },
  40863. subVectors: function(e, t) {
  40864. return this.x = e.x - t.x,
  40865. this.y = e.y - t.y,
  40866. this.z = e.z - t.z,
  40867. this
  40868. },
  40869. multiply: function(e, t) {
  40870. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  40871. this.multiplyVectors(e, t)) : (this.x *= e.x,
  40872. this.y *= e.y,
  40873. this.z *= e.z,
  40874. this)
  40875. },
  40876. multiplyScalar: function(e) {
  40877. return isFinite(e) ? (this.x *= e,
  40878. this.y *= e,
  40879. this.z *= e) : (this.x = 0,
  40880. this.y = 0,
  40881. this.z = 0),
  40882. this
  40883. },
  40884. multiplyVectors: function(e, t) {
  40885. return this.x = e.x * t.x,
  40886. this.y = e.y * t.y,
  40887. this.z = e.z * t.z,
  40888. this
  40889. },
  40890. applyEuler: function() {
  40891. var e;
  40892. return function(t) {
  40893. return t instanceof n.Euler == !1 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  40894. void 0 === e && (e = new n.Quaternion),
  40895. this.applyQuaternion(e.setFromEuler(t)),
  40896. this
  40897. }
  40898. }(),
  40899. applyAxisAngle: function() {
  40900. var e;
  40901. return function(t, i) {
  40902. return void 0 === e && (e = new n.Quaternion),
  40903. this.applyQuaternion(e.setFromAxisAngle(t, i)),
  40904. this
  40905. }
  40906. }(),
  40907. applyMatrix3: function(e) {
  40908. var t = this.x
  40909. , i = this.y
  40910. , n = this.z
  40911. , r = e.elements;
  40912. return this.x = r[0] * t + r[3] * i + r[6] * n,
  40913. this.y = r[1] * t + r[4] * i + r[7] * n,
  40914. this.z = r[2] * t + r[5] * i + r[8] * n,
  40915. this
  40916. },
  40917. applyMatrix4: function(e) {
  40918. var t = this.x
  40919. , i = this.y
  40920. , n = this.z
  40921. , r = e.elements;
  40922. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  40923. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  40924. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  40925. this
  40926. },
  40927. applyProjection: function(e) {
  40928. var t = this.x
  40929. , i = this.y
  40930. , n = this.z
  40931. , r = e.elements
  40932. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  40933. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  40934. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  40935. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  40936. this
  40937. },
  40938. applyQuaternion: function(e) {
  40939. var t = this.x
  40940. , i = this.y
  40941. , n = this.z
  40942. , r = e.x
  40943. , o = e.y
  40944. , a = e.z
  40945. , s = e.w
  40946. , l = s * t + o * n - a * i
  40947. , c = s * i + a * t - r * n
  40948. , h = s * n + r * i - o * t
  40949. , u = -r * t - o * i - a * n;
  40950. return this.x = l * s + u * -r + c * -a - h * -o,
  40951. this.y = c * s + u * -o + h * -r - l * -a,
  40952. this.z = h * s + u * -a + l * -o - c * -r,
  40953. this
  40954. },
  40955. project: function() {
  40956. var e;
  40957. return function(t) {
  40958. return void 0 === e && (e = new n.Matrix4),
  40959. e.multiplyMatrices(t.projectionMatrix, e.getInverse(t.matrixWorld)),
  40960. this.applyProjection(e)
  40961. }
  40962. }(),
  40963. unproject: function() {
  40964. var e;
  40965. return function(t) {
  40966. return void 0 === e && (e = new n.Matrix4),
  40967. e.multiplyMatrices(t.matrixWorld, e.getInverse(t.projectionMatrix)),
  40968. this.applyProjection(e)
  40969. }
  40970. }(),
  40971. transformDirection: function(e) {
  40972. var t = this.x
  40973. , i = this.y
  40974. , n = this.z
  40975. , r = e.elements;
  40976. return this.x = r[0] * t + r[4] * i + r[8] * n,
  40977. this.y = r[1] * t + r[5] * i + r[9] * n,
  40978. this.z = r[2] * t + r[6] * i + r[10] * n,
  40979. this.normalize(),
  40980. this
  40981. },
  40982. divide: function(e) {
  40983. return this.x /= e.x,
  40984. this.y /= e.y,
  40985. this.z /= e.z,
  40986. this
  40987. },
  40988. divideScalar: function(e) {
  40989. return this.multiplyScalar(1 / e)
  40990. },
  40991. min: function(e) {
  40992. return this.x = Math.min(this.x, e.x),
  40993. this.y = Math.min(this.y, e.y),
  40994. this.z = Math.min(this.z, e.z),
  40995. this
  40996. },
  40997. max: function(e) {
  40998. return this.x = Math.max(this.x, e.x),
  40999. this.y = Math.max(this.y, e.y),
  41000. this.z = Math.max(this.z, e.z),
  41001. this
  41002. },
  41003. clamp: function(e, t) {
  41004. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  41005. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  41006. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  41007. this
  41008. },
  41009. clampScalar: function() {
  41010. var e, t;
  41011. return function(i, r) {
  41012. return void 0 === e && (e = new n.Vector3,
  41013. t = new n.Vector3),
  41014. e.set(i, i, i),
  41015. t.set(r, r, r),
  41016. this.clamp(e, t)
  41017. }
  41018. }(),
  41019. clampLength: function(e, t) {
  41020. var i = this.length();
  41021. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  41022. this
  41023. },
  41024. floor: function() {
  41025. return this.x = Math.floor(this.x),
  41026. this.y = Math.floor(this.y),
  41027. this.z = Math.floor(this.z),
  41028. this
  41029. },
  41030. ceil: function() {
  41031. return this.x = Math.ceil(this.x),
  41032. this.y = Math.ceil(this.y),
  41033. this.z = Math.ceil(this.z),
  41034. this
  41035. },
  41036. round: function() {
  41037. return this.x = Math.round(this.x),
  41038. this.y = Math.round(this.y),
  41039. this.z = Math.round(this.z),
  41040. this
  41041. },
  41042. roundToZero: function() {
  41043. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  41044. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  41045. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  41046. this
  41047. },
  41048. negate: function() {
  41049. return this.x = -this.x,
  41050. this.y = -this.y,
  41051. this.z = -this.z,
  41052. this
  41053. },
  41054. dot: function(e) {
  41055. return this.x * e.x + this.y * e.y + this.z * e.z
  41056. },
  41057. lengthSq: function() {
  41058. return this.x * this.x + this.y * this.y + this.z * this.z
  41059. },
  41060. length: function() {
  41061. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  41062. },
  41063. lengthManhattan: function() {
  41064. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  41065. },
  41066. normalize: function() {
  41067. return this.divideScalar(this.length())
  41068. },
  41069. setLength: function(e) {
  41070. return this.multiplyScalar(e / this.length())
  41071. },
  41072. lerp: function(e, t) {
  41073. return this.x += (e.x - this.x) * t,
  41074. this.y += (e.y - this.y) * t,
  41075. this.z += (e.z - this.z) * t,
  41076. this
  41077. },
  41078. lerpVectors: function(e, t, i) {
  41079. return this.subVectors(t, e).multiplyScalar(i).add(e),
  41080. this
  41081. },
  41082. cross: function(e, t) {
  41083. if (void 0 !== t)
  41084. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  41085. this.crossVectors(e, t);
  41086. var i = this.x
  41087. , n = this.y
  41088. , r = this.z;
  41089. return this.x = n * e.z - r * e.y,
  41090. this.y = r * e.x - i * e.z,
  41091. this.z = i * e.y - n * e.x,
  41092. this
  41093. },
  41094. crossVectors: function(e, t) {
  41095. var i = e.x
  41096. , n = e.y
  41097. , r = e.z
  41098. , o = t.x
  41099. , a = t.y
  41100. , s = t.z;
  41101. return this.x = n * s - r * a,
  41102. this.y = r * o - i * s,
  41103. this.z = i * a - n * o,
  41104. this
  41105. },
  41106. projectOnVector: function() {
  41107. var e, t;
  41108. return function(i) {
  41109. return void 0 === e && (e = new n.Vector3),
  41110. e.copy(i).normalize(),
  41111. t = this.dot(e),
  41112. this.copy(e).multiplyScalar(t)
  41113. }
  41114. }(),
  41115. projectOnPlane: function() {
  41116. var e;
  41117. return function(t) {
  41118. return void 0 === e && (e = new n.Vector3),
  41119. e.copy(this).projectOnVector(t),
  41120. this.sub(e)
  41121. }
  41122. }(),
  41123. reflect: function() {
  41124. var e;
  41125. return function(t) {
  41126. return void 0 === e && (e = new n.Vector3),
  41127. this.sub(e.copy(t).multiplyScalar(2 * this.dot(t)))
  41128. }
  41129. }(),
  41130. angleTo: function(e) {
  41131. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  41132. return Math.acos(n.Math.clamp(t, -1, 1))
  41133. },
  41134. distanceTo: function(e) {
  41135. return Math.sqrt(this.distanceToSquared(e))
  41136. },
  41137. distanceToSquared: function(e) {
  41138. var t = this.x - e.x
  41139. , i = this.y - e.y
  41140. , n = this.z - e.z;
  41141. return t * t + i * i + n * n
  41142. },
  41143. setFromSpherical: function(e) {
  41144. var t = Math.sin(e.phi) * e.radius;
  41145. return this.x = t * Math.sin(e.theta),
  41146. this.y = Math.cos(e.phi) * e.radius,
  41147. this.z = t * Math.cos(e.theta),
  41148. this
  41149. },
  41150. setFromMatrixPosition: function(e) {
  41151. return this.setFromMatrixColumn(e, 3)
  41152. },
  41153. setFromMatrixScale: function(e) {
  41154. var t = this.setFromMatrixColumn(e, 0).length()
  41155. , i = this.setFromMatrixColumn(e, 1).length()
  41156. , n = this.setFromMatrixColumn(e, 2).length();
  41157. return this.x = t,
  41158. this.y = i,
  41159. this.z = n,
  41160. this
  41161. },
  41162. setFromMatrixColumn: function(e, t) {
  41163. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  41164. e = arguments[1],
  41165. t = arguments[0]),
  41166. this.fromArray(e.elements, 4 * t)
  41167. },
  41168. equals: function(e) {
  41169. return e.x === this.x && e.y === this.y && e.z === this.z
  41170. },
  41171. fromArray: function(e, t) {
  41172. return void 0 === t && (t = 0),
  41173. this.x = e[t],
  41174. this.y = e[t + 1],
  41175. this.z = e[t + 2],
  41176. this
  41177. },
  41178. toArray: function(e, t) {
  41179. return void 0 === e && (e = []),
  41180. void 0 === t && (t = 0),
  41181. e[t] = this.x,
  41182. e[t + 1] = this.y,
  41183. e[t + 2] = this.z,
  41184. e
  41185. },
  41186. fromAttribute: function(e, t, i) {
  41187. return void 0 === i && (i = 0),
  41188. t = t * e.itemSize + i,
  41189. this.x = e.array[t],
  41190. this.y = e.array[t + 1],
  41191. this.z = e.array[t + 2],
  41192. this
  41193. }
  41194. },
  41195. n.Vector4 = function(e, t, i, n) {
  41196. this.x = e || 0,
  41197. this.y = t || 0,
  41198. this.z = i || 0,
  41199. this.w = void 0 !== n ? n : 1
  41200. }
  41201. ,
  41202. n.Vector4.prototype = {
  41203. constructor: n.Vector4,
  41204. set: function(e, t, i, n) {
  41205. return this.x = e,
  41206. this.y = t,
  41207. this.z = i,
  41208. this.w = n,
  41209. this
  41210. },
  41211. setScalar: function(e) {
  41212. return this.x = e,
  41213. this.y = e,
  41214. this.z = e,
  41215. this.w = e,
  41216. this
  41217. },
  41218. setX: function(e) {
  41219. return this.x = e,
  41220. this
  41221. },
  41222. setY: function(e) {
  41223. return this.y = e,
  41224. this
  41225. },
  41226. setZ: function(e) {
  41227. return this.z = e,
  41228. this
  41229. },
  41230. setW: function(e) {
  41231. return this.w = e,
  41232. this
  41233. },
  41234. setComponent: function(e, t) {
  41235. switch (e) {
  41236. case 0:
  41237. this.x = t;
  41238. break;
  41239. case 1:
  41240. this.y = t;
  41241. break;
  41242. case 2:
  41243. this.z = t;
  41244. break;
  41245. case 3:
  41246. this.w = t;
  41247. break;
  41248. default:
  41249. throw new Error("index is out of range: " + e)
  41250. }
  41251. },
  41252. getComponent: function(e) {
  41253. switch (e) {
  41254. case 0:
  41255. return this.x;
  41256. case 1:
  41257. return this.y;
  41258. case 2:
  41259. return this.z;
  41260. case 3:
  41261. return this.w;
  41262. default:
  41263. throw new Error("index is out of range: " + e)
  41264. }
  41265. },
  41266. clone: function() {
  41267. return new this.constructor(this.x,this.y,this.z,this.w)
  41268. },
  41269. copy: function(e) {
  41270. return this.x = e.x,
  41271. this.y = e.y,
  41272. this.z = e.z,
  41273. this.w = void 0 !== e.w ? e.w : 1,
  41274. this
  41275. },
  41276. add: function(e, t) {
  41277. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  41278. this.addVectors(e, t)) : (this.x += e.x,
  41279. this.y += e.y,
  41280. this.z += e.z,
  41281. this.w += e.w,
  41282. this)
  41283. },
  41284. addScalar: function(e) {
  41285. return this.x += e,
  41286. this.y += e,
  41287. this.z += e,
  41288. this.w += e,
  41289. this
  41290. },
  41291. addVectors: function(e, t) {
  41292. return this.x = e.x + t.x,
  41293. this.y = e.y + t.y,
  41294. this.z = e.z + t.z,
  41295. this.w = e.w + t.w,
  41296. this
  41297. },
  41298. addScaledVector: function(e, t) {
  41299. return this.x += e.x * t,
  41300. this.y += e.y * t,
  41301. this.z += e.z * t,
  41302. this.w += e.w * t,
  41303. this
  41304. },
  41305. sub: function(e, t) {
  41306. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  41307. this.subVectors(e, t)) : (this.x -= e.x,
  41308. this.y -= e.y,
  41309. this.z -= e.z,
  41310. this.w -= e.w,
  41311. this)
  41312. },
  41313. subScalar: function(e) {
  41314. return this.x -= e,
  41315. this.y -= e,
  41316. this.z -= e,
  41317. this.w -= e,
  41318. this
  41319. },
  41320. subVectors: function(e, t) {
  41321. return this.x = e.x - t.x,
  41322. this.y = e.y - t.y,
  41323. this.z = e.z - t.z,
  41324. this.w = e.w - t.w,
  41325. this
  41326. },
  41327. multiplyScalar: function(e) {
  41328. return isFinite(e) ? (this.x *= e,
  41329. this.y *= e,
  41330. this.z *= e,
  41331. this.w *= e) : (this.x = 0,
  41332. this.y = 0,
  41333. this.z = 0,
  41334. this.w = 0),
  41335. this
  41336. },
  41337. applyMatrix4: function(e) {
  41338. var t = this.x
  41339. , i = this.y
  41340. , n = this.z
  41341. , r = this.w
  41342. , o = e.elements;
  41343. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  41344. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  41345. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  41346. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  41347. this
  41348. },
  41349. divideScalar: function(e) {
  41350. return this.multiplyScalar(1 / e)
  41351. },
  41352. setAxisAngleFromQuaternion: function(e) {
  41353. this.w = 2 * Math.acos(e.w);
  41354. var t = Math.sqrt(1 - e.w * e.w);
  41355. return t < 1e-4 ? (this.x = 1,
  41356. this.y = 0,
  41357. this.z = 0) : (this.x = e.x / t,
  41358. this.y = e.y / t,
  41359. this.z = e.z / t),
  41360. this
  41361. },
  41362. setAxisAngleFromRotationMatrix: function(e) {
  41363. 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];
  41364. if (Math.abs(c - u) < o && Math.abs(h - f) < o && Math.abs(p - g) < o) {
  41365. if (Math.abs(c + u) < a && Math.abs(h + f) < a && Math.abs(p + g) < a && Math.abs(l + d + m - 3) < a)
  41366. return this.set(1, 0, 0, 0),
  41367. this;
  41368. t = Math.PI;
  41369. var v = (l + 1) / 2
  41370. , A = (d + 1) / 2
  41371. , y = (m + 1) / 2
  41372. , C = (c + u) / 4
  41373. , I = (h + f) / 4
  41374. , E = (p + g) / 4;
  41375. return v > A && v > y ? v < o ? (i = 0,
  41376. n = .707106781,
  41377. r = .707106781) : (i = Math.sqrt(v),
  41378. n = C / i,
  41379. r = I / i) : A > y ? A < o ? (i = .707106781,
  41380. n = 0,
  41381. r = .707106781) : (n = Math.sqrt(A),
  41382. i = C / n,
  41383. r = E / n) : y < o ? (i = .707106781,
  41384. n = .707106781,
  41385. r = 0) : (r = Math.sqrt(y),
  41386. i = I / r,
  41387. n = E / r),
  41388. this.set(i, n, r, t),
  41389. this
  41390. }
  41391. var b = Math.sqrt((g - p) * (g - p) + (h - f) * (h - f) + (u - c) * (u - c));
  41392. return Math.abs(b) < .001 && (b = 1),
  41393. this.x = (g - p) / b,
  41394. this.y = (h - f) / b,
  41395. this.z = (u - c) / b,
  41396. this.w = Math.acos((l + d + m - 1) / 2),
  41397. this
  41398. },
  41399. min: function(e) {
  41400. return this.x = Math.min(this.x, e.x),
  41401. this.y = Math.min(this.y, e.y),
  41402. this.z = Math.min(this.z, e.z),
  41403. this.w = Math.min(this.w, e.w),
  41404. this
  41405. },
  41406. max: function(e) {
  41407. return this.x = Math.max(this.x, e.x),
  41408. this.y = Math.max(this.y, e.y),
  41409. this.z = Math.max(this.z, e.z),
  41410. this.w = Math.max(this.w, e.w),
  41411. this
  41412. },
  41413. clamp: function(e, t) {
  41414. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  41415. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  41416. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  41417. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  41418. this
  41419. },
  41420. clampScalar: function() {
  41421. var e, t;
  41422. return function(i, r) {
  41423. return void 0 === e && (e = new n.Vector4,
  41424. t = new n.Vector4),
  41425. e.set(i, i, i, i),
  41426. t.set(r, r, r, r),
  41427. this.clamp(e, t)
  41428. }
  41429. }(),
  41430. floor: function() {
  41431. return this.x = Math.floor(this.x),
  41432. this.y = Math.floor(this.y),
  41433. this.z = Math.floor(this.z),
  41434. this.w = Math.floor(this.w),
  41435. this
  41436. },
  41437. ceil: function() {
  41438. return this.x = Math.ceil(this.x),
  41439. this.y = Math.ceil(this.y),
  41440. this.z = Math.ceil(this.z),
  41441. this.w = Math.ceil(this.w),
  41442. this
  41443. },
  41444. round: function() {
  41445. return this.x = Math.round(this.x),
  41446. this.y = Math.round(this.y),
  41447. this.z = Math.round(this.z),
  41448. this.w = Math.round(this.w),
  41449. this
  41450. },
  41451. roundToZero: function() {
  41452. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  41453. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  41454. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  41455. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  41456. this
  41457. },
  41458. negate: function() {
  41459. return this.x = -this.x,
  41460. this.y = -this.y,
  41461. this.z = -this.z,
  41462. this.w = -this.w,
  41463. this
  41464. },
  41465. dot: function(e) {
  41466. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  41467. },
  41468. lengthSq: function() {
  41469. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  41470. },
  41471. length: function() {
  41472. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  41473. },
  41474. lengthManhattan: function() {
  41475. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  41476. },
  41477. normalize: function() {
  41478. return this.divideScalar(this.length())
  41479. },
  41480. setLength: function(e) {
  41481. return this.multiplyScalar(e / this.length())
  41482. },
  41483. lerp: function(e, t) {
  41484. return this.x += (e.x - this.x) * t,
  41485. this.y += (e.y - this.y) * t,
  41486. this.z += (e.z - this.z) * t,
  41487. this.w += (e.w - this.w) * t,
  41488. this
  41489. },
  41490. lerpVectors: function(e, t, i) {
  41491. return this.subVectors(t, e).multiplyScalar(i).add(e),
  41492. this
  41493. },
  41494. equals: function(e) {
  41495. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  41496. },
  41497. fromArray: function(e, t) {
  41498. return void 0 === t && (t = 0),
  41499. this.x = e[t],
  41500. this.y = e[t + 1],
  41501. this.z = e[t + 2],
  41502. this.w = e[t + 3],
  41503. this
  41504. },
  41505. toArray: function(e, t) {
  41506. return void 0 === e && (e = []),
  41507. void 0 === t && (t = 0),
  41508. e[t] = this.x,
  41509. e[t + 1] = this.y,
  41510. e[t + 2] = this.z,
  41511. e[t + 3] = this.w,
  41512. e
  41513. },
  41514. fromAttribute: function(e, t, i) {
  41515. return void 0 === i && (i = 0),
  41516. t = t * e.itemSize + i,
  41517. this.x = e.array[t],
  41518. this.y = e.array[t + 1],
  41519. this.z = e.array[t + 2],
  41520. this.w = e.array[t + 3],
  41521. this
  41522. }
  41523. },
  41524. n.Euler = function(e, t, i, r) {
  41525. this._x = e || 0,
  41526. this._y = t || 0,
  41527. this._z = i || 0,
  41528. this._order = r || n.Euler.DefaultOrder
  41529. }
  41530. ,
  41531. n.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  41532. n.Euler.DefaultOrder = "XYZ",
  41533. n.Euler.prototype = {
  41534. constructor: n.Euler,
  41535. get x() {
  41536. return this._x
  41537. },
  41538. set x(e) {
  41539. this._x = e,
  41540. this.onChangeCallback()
  41541. },
  41542. get y() {
  41543. return this._y
  41544. },
  41545. set y(e) {
  41546. this._y = e,
  41547. this.onChangeCallback()
  41548. },
  41549. get z() {
  41550. return this._z
  41551. },
  41552. set z(e) {
  41553. this._z = e,
  41554. this.onChangeCallback()
  41555. },
  41556. get order() {
  41557. return this._order
  41558. },
  41559. set order(e) {
  41560. this._order = e,
  41561. this.onChangeCallback()
  41562. },
  41563. set: function(e, t, i, n) {
  41564. return this._x = e,
  41565. this._y = t,
  41566. this._z = i,
  41567. this._order = n || this._order,
  41568. this.onChangeCallback(),
  41569. this
  41570. },
  41571. clone: function() {
  41572. return new this.constructor(this._x,this._y,this._z,this._order)
  41573. },
  41574. copy: function(e) {
  41575. return this._x = e._x,
  41576. this._y = e._y,
  41577. this._z = e._z,
  41578. this._order = e._order,
  41579. this.onChangeCallback(),
  41580. this
  41581. },
  41582. setFromRotationMatrix: function(e, t, i) {
  41583. var r = n.Math.clamp
  41584. , o = e.elements
  41585. , a = o[0]
  41586. , s = o[4]
  41587. , l = o[8]
  41588. , c = o[1]
  41589. , h = o[5]
  41590. , u = o[9]
  41591. , d = o[2]
  41592. , p = o[6]
  41593. , f = o[10];
  41594. return t = t || this._order,
  41595. "XYZ" === t ? (this._y = Math.asin(r(l, -1, 1)),
  41596. Math.abs(l) < .99999 ? (this._x = Math.atan2(-u, f),
  41597. this._z = Math.atan2(-s, a)) : (this._x = Math.atan2(p, h),
  41598. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-r(u, -1, 1)),
  41599. Math.abs(u) < .99999 ? (this._y = Math.atan2(l, f),
  41600. this._z = Math.atan2(c, h)) : (this._y = Math.atan2(-d, a),
  41601. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(r(p, -1, 1)),
  41602. Math.abs(p) < .99999 ? (this._y = Math.atan2(-d, f),
  41603. this._z = Math.atan2(-s, h)) : (this._y = 0,
  41604. this._z = Math.atan2(c, a))) : "ZYX" === t ? (this._y = Math.asin(-r(d, -1, 1)),
  41605. Math.abs(d) < .99999 ? (this._x = Math.atan2(p, f),
  41606. this._z = Math.atan2(c, a)) : (this._x = 0,
  41607. this._z = Math.atan2(-s, h))) : "YZX" === t ? (this._z = Math.asin(r(c, -1, 1)),
  41608. Math.abs(c) < .99999 ? (this._x = Math.atan2(-u, h),
  41609. this._y = Math.atan2(-d, a)) : (this._x = 0,
  41610. this._y = Math.atan2(l, f))) : "XZY" === t ? (this._z = Math.asin(-r(s, -1, 1)),
  41611. Math.abs(s) < .99999 ? (this._x = Math.atan2(p, h),
  41612. this._y = Math.atan2(l, a)) : (this._x = Math.atan2(-u, f),
  41613. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  41614. this._order = t,
  41615. i !== !1 && this.onChangeCallback(),
  41616. this
  41617. },
  41618. setFromQuaternion: function() {
  41619. var e;
  41620. return function(t, i, r) {
  41621. return void 0 === e && (e = new n.Matrix4),
  41622. e.makeRotationFromQuaternion(t),
  41623. this.setFromRotationMatrix(e, i, r),
  41624. this
  41625. }
  41626. }(),
  41627. setFromVector3: function(e, t) {
  41628. return this.set(e.x, e.y, e.z, t || this._order)
  41629. },
  41630. reorder: function() {
  41631. var e = new n.Quaternion;
  41632. return function(t) {
  41633. e.setFromEuler(this),
  41634. this.setFromQuaternion(e, t)
  41635. }
  41636. }(),
  41637. equals: function(e) {
  41638. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  41639. },
  41640. fromArray: function(e) {
  41641. return this._x = e[0],
  41642. this._y = e[1],
  41643. this._z = e[2],
  41644. void 0 !== e[3] && (this._order = e[3]),
  41645. this.onChangeCallback(),
  41646. this
  41647. },
  41648. toArray: function(e, t) {
  41649. return void 0 === e && (e = []),
  41650. void 0 === t && (t = 0),
  41651. e[t] = this._x,
  41652. e[t + 1] = this._y,
  41653. e[t + 2] = this._z,
  41654. e[t + 3] = this._order,
  41655. e
  41656. },
  41657. toVector3: function(e) {
  41658. return e ? e.set(this._x, this._y, this._z) : new n.Vector3(this._x,this._y,this._z)
  41659. },
  41660. onChange: function(e) {
  41661. return this.onChangeCallback = e,
  41662. this
  41663. },
  41664. onChangeCallback: function() {}
  41665. },
  41666. n.Line3 = function(e, t) {
  41667. this.start = void 0 !== e ? e : new n.Vector3,
  41668. this.end = void 0 !== t ? t : new n.Vector3
  41669. }
  41670. ,
  41671. n.Line3.prototype = {
  41672. constructor: n.Line3,
  41673. set: function(e, t) {
  41674. return this.start.copy(e),
  41675. this.end.copy(t),
  41676. this
  41677. },
  41678. clone: function() {
  41679. return (new this.constructor).copy(this)
  41680. },
  41681. copy: function(e) {
  41682. return this.start.copy(e.start),
  41683. this.end.copy(e.end),
  41684. this
  41685. },
  41686. center: function(e) {
  41687. var t = e || new n.Vector3;
  41688. return t.addVectors(this.start, this.end).multiplyScalar(.5)
  41689. },
  41690. delta: function(e) {
  41691. var t = e || new n.Vector3;
  41692. return t.subVectors(this.end, this.start)
  41693. },
  41694. distanceSq: function() {
  41695. return this.start.distanceToSquared(this.end)
  41696. },
  41697. distance: function() {
  41698. return this.start.distanceTo(this.end)
  41699. },
  41700. at: function(e, t) {
  41701. var i = t || new n.Vector3;
  41702. return this.delta(i).multiplyScalar(e).add(this.start)
  41703. },
  41704. closestPointToPointParameter: function() {
  41705. var e = new n.Vector3
  41706. , t = new n.Vector3;
  41707. return function(i, r) {
  41708. e.subVectors(i, this.start),
  41709. t.subVectors(this.end, this.start);
  41710. var o = t.dot(t)
  41711. , a = t.dot(e)
  41712. , s = a / o;
  41713. return r && (s = n.Math.clamp(s, 0, 1)),
  41714. s
  41715. }
  41716. }(),
  41717. closestPointToPoint: function(e, t, i) {
  41718. var r = this.closestPointToPointParameter(e, t)
  41719. , o = i || new n.Vector3;
  41720. return this.delta(o).multiplyScalar(r).add(this.start)
  41721. },
  41722. applyMatrix4: function(e) {
  41723. return this.start.applyMatrix4(e),
  41724. this.end.applyMatrix4(e),
  41725. this
  41726. },
  41727. equals: function(e) {
  41728. return e.start.equals(this.start) && e.end.equals(this.end)
  41729. }
  41730. },
  41731. n.Box2 = function(e, t) {
  41732. this.min = void 0 !== e ? e : new n.Vector2(+(1 / 0),+(1 / 0)),
  41733. this.max = void 0 !== t ? t : new n.Vector2(-(1 / 0),-(1 / 0))
  41734. }
  41735. ,
  41736. n.Box2.prototype = {
  41737. constructor: n.Box2,
  41738. set: function(e, t) {
  41739. return this.min.copy(e),
  41740. this.max.copy(t),
  41741. this
  41742. },
  41743. setFromPoints: function(e) {
  41744. this.makeEmpty();
  41745. for (var t = 0, i = e.length; t < i; t++)
  41746. this.expandByPoint(e[t]);
  41747. return this
  41748. },
  41749. setFromCenterAndSize: function() {
  41750. var e = new n.Vector2;
  41751. return function(t, i) {
  41752. var n = e.copy(i).multiplyScalar(.5);
  41753. return this.min.copy(t).sub(n),
  41754. this.max.copy(t).add(n),
  41755. this
  41756. }
  41757. }(),
  41758. clone: function() {
  41759. return (new this.constructor).copy(this)
  41760. },
  41761. copy: function(e) {
  41762. return this.min.copy(e.min),
  41763. this.max.copy(e.max),
  41764. this
  41765. },
  41766. makeEmpty: function() {
  41767. return this.min.x = this.min.y = +(1 / 0),
  41768. this.max.x = this.max.y = -(1 / 0),
  41769. this
  41770. },
  41771. isEmpty: function() {
  41772. return this.max.x < this.min.x || this.max.y < this.min.y
  41773. },
  41774. center: function(e) {
  41775. var t = e || new n.Vector2;
  41776. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  41777. },
  41778. size: function(e) {
  41779. var t = e || new n.Vector2;
  41780. return t.subVectors(this.max, this.min)
  41781. },
  41782. expandByPoint: function(e) {
  41783. return this.min.min(e),
  41784. this.max.max(e),
  41785. this
  41786. },
  41787. expandByVector: function(e) {
  41788. return this.min.sub(e),
  41789. this.max.add(e),
  41790. this
  41791. },
  41792. expandByScalar: function(e) {
  41793. return this.min.addScalar(-e),
  41794. this.max.addScalar(e),
  41795. this
  41796. },
  41797. containsPoint: function(e) {
  41798. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  41799. },
  41800. containsBox: function(e) {
  41801. 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
  41802. },
  41803. getParameter: function(e, t) {
  41804. var i = t || new n.Vector2;
  41805. 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))
  41806. },
  41807. intersectsBox: function(e) {
  41808. 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)
  41809. },
  41810. clampPoint: function(e, t) {
  41811. var i = t || new n.Vector2;
  41812. return i.copy(e).clamp(this.min, this.max)
  41813. },
  41814. distanceToPoint: function() {
  41815. var e = new n.Vector2;
  41816. return function(t) {
  41817. var i = e.copy(t).clamp(this.min, this.max);
  41818. return i.sub(t).length()
  41819. }
  41820. }(),
  41821. intersect: function(e) {
  41822. return this.min.max(e.min),
  41823. this.max.min(e.max),
  41824. this
  41825. },
  41826. union: function(e) {
  41827. return this.min.min(e.min),
  41828. this.max.max(e.max),
  41829. this
  41830. },
  41831. translate: function(e) {
  41832. return this.min.add(e),
  41833. this.max.add(e),
  41834. this
  41835. },
  41836. equals: function(e) {
  41837. return e.min.equals(this.min) && e.max.equals(this.max)
  41838. }
  41839. },
  41840. n.Box3 = function(e, t) {
  41841. this.min = void 0 !== e ? e : new n.Vector3(+(1 / 0),+(1 / 0),+(1 / 0)),
  41842. this.max = void 0 !== t ? t : new n.Vector3(-(1 / 0),-(1 / 0),-(1 / 0))
  41843. }
  41844. ,
  41845. n.Box3.prototype = {
  41846. constructor: n.Box3,
  41847. set: function(e, t) {
  41848. return this.min.copy(e),
  41849. this.max.copy(t),
  41850. this
  41851. },
  41852. setFromArray: function(e) {
  41853. this.makeEmpty();
  41854. 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) {
  41855. var c = e[s]
  41856. , h = e[s + 1]
  41857. , u = e[s + 2];
  41858. c < t && (t = c),
  41859. h < i && (i = h),
  41860. u < n && (n = u),
  41861. c > r && (r = c),
  41862. h > o && (o = h),
  41863. u > a && (a = u)
  41864. }
  41865. this.min.set(t, i, n),
  41866. this.max.set(r, o, a)
  41867. },
  41868. setFromPoints: function(e) {
  41869. this.makeEmpty();
  41870. for (var t = 0, i = e.length; t < i; t++)
  41871. this.expandByPoint(e[t]);
  41872. return this
  41873. },
  41874. setFromCenterAndSize: function() {
  41875. var e = new n.Vector3;
  41876. return function(t, i) {
  41877. var n = e.copy(i).multiplyScalar(.5);
  41878. return this.min.copy(t).sub(n),
  41879. this.max.copy(t).add(n),
  41880. this
  41881. }
  41882. }(),
  41883. setFromObject: function() {
  41884. var e;
  41885. return function(t) {
  41886. void 0 === e && (e = new n.Box3);
  41887. var i = this;
  41888. return this.makeEmpty(),
  41889. t.updateMatrixWorld(!0),
  41890. t.traverse(function(t) {
  41891. var n = t.geometry;
  41892. void 0 !== n && (null === n.boundingBox && n.computeBoundingBox(),
  41893. n.boundingBox.isEmpty() === !1 && (e.copy(n.boundingBox),
  41894. e.applyMatrix4(t.matrixWorld),
  41895. i.union(e)))
  41896. }),
  41897. this
  41898. }
  41899. }(),
  41900. clone: function() {
  41901. return (new this.constructor).copy(this)
  41902. },
  41903. copy: function(e) {
  41904. return this.min.copy(e.min),
  41905. this.max.copy(e.max),
  41906. this
  41907. },
  41908. makeEmpty: function() {
  41909. return this.min.x = this.min.y = this.min.z = +(1 / 0),
  41910. this.max.x = this.max.y = this.max.z = -(1 / 0),
  41911. this
  41912. },
  41913. isEmpty: function() {
  41914. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  41915. },
  41916. center: function(e) {
  41917. var t = e || new n.Vector3;
  41918. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  41919. },
  41920. size: function(e) {
  41921. var t = e || new n.Vector3;
  41922. return t.subVectors(this.max, this.min)
  41923. },
  41924. expandByPoint: function(e) {
  41925. return this.min.min(e),
  41926. this.max.max(e),
  41927. this
  41928. },
  41929. expandByVector: function(e) {
  41930. return this.min.sub(e),
  41931. this.max.add(e),
  41932. this
  41933. },
  41934. expandByScalar: function(e) {
  41935. return this.min.addScalar(-e),
  41936. this.max.addScalar(e),
  41937. this
  41938. },
  41939. containsPoint: function(e) {
  41940. 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)
  41941. },
  41942. containsBox: function(e) {
  41943. 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
  41944. },
  41945. getParameter: function(e, t) {
  41946. var i = t || new n.Vector3;
  41947. 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))
  41948. },
  41949. intersectsBox: function(e) {
  41950. 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)
  41951. },
  41952. intersectsSphere: function() {
  41953. var e;
  41954. return function(t) {
  41955. return void 0 === e && (e = new n.Vector3),
  41956. this.clampPoint(t.center, e),
  41957. e.distanceToSquared(t.center) <= t.radius * t.radius
  41958. }
  41959. }(),
  41960. intersectsPlane: function(e) {
  41961. var t, i;
  41962. return e.normal.x > 0 ? (t = e.normal.x * this.min.x,
  41963. i = e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  41964. i = e.normal.x * this.min.x),
  41965. e.normal.y > 0 ? (t += e.normal.y * this.min.y,
  41966. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  41967. i += e.normal.y * this.min.y),
  41968. e.normal.z > 0 ? (t += e.normal.z * this.min.z,
  41969. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  41970. i += e.normal.z * this.min.z),
  41971. t <= e.constant && i >= e.constant
  41972. },
  41973. clampPoint: function(e, t) {
  41974. var i = t || new n.Vector3;
  41975. return i.copy(e).clamp(this.min, this.max)
  41976. },
  41977. distanceToPoint: function() {
  41978. var e = new n.Vector3;
  41979. return function(t) {
  41980. var i = e.copy(t).clamp(this.min, this.max);
  41981. return i.sub(t).length()
  41982. }
  41983. }(),
  41984. getBoundingSphere: function() {
  41985. var e = new n.Vector3;
  41986. return function(t) {
  41987. var i = t || new n.Sphere;
  41988. return i.center = this.center(),
  41989. i.radius = .5 * this.size(e).length(),
  41990. i
  41991. }
  41992. }(),
  41993. intersect: function(e) {
  41994. return this.min.max(e.min),
  41995. this.max.min(e.max),
  41996. this
  41997. },
  41998. union: function(e) {
  41999. return this.min.min(e.min),
  42000. this.max.max(e.max),
  42001. this
  42002. },
  42003. applyMatrix4: function() {
  42004. 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];
  42005. return function(t) {
  42006. return e[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(t),
  42007. e[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(t),
  42008. e[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(t),
  42009. e[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(t),
  42010. e[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(t),
  42011. e[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(t),
  42012. e[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(t),
  42013. e[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(t),
  42014. this.makeEmpty(),
  42015. this.setFromPoints(e),
  42016. this
  42017. }
  42018. }(),
  42019. translate: function(e) {
  42020. return this.min.add(e),
  42021. this.max.add(e),
  42022. this
  42023. },
  42024. equals: function(e) {
  42025. return e.min.equals(this.min) && e.max.equals(this.max)
  42026. }
  42027. },
  42028. n.Matrix3 = function() {
  42029. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  42030. arguments.length > 0 && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  42031. }
  42032. ,
  42033. n.Matrix3.prototype = {
  42034. constructor: n.Matrix3,
  42035. set: function(e, t, i, n, r, o, a, s, l) {
  42036. var c = this.elements;
  42037. return c[0] = e,
  42038. c[1] = n,
  42039. c[2] = a,
  42040. c[3] = t,
  42041. c[4] = r,
  42042. c[5] = s,
  42043. c[6] = i,
  42044. c[7] = o,
  42045. c[8] = l,
  42046. this
  42047. },
  42048. identity: function() {
  42049. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  42050. this
  42051. },
  42052. clone: function() {
  42053. return (new this.constructor).fromArray(this.elements)
  42054. },
  42055. copy: function(e) {
  42056. var t = e.elements;
  42057. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  42058. this
  42059. },
  42060. setFromMatrix4: function(e) {
  42061. var t = e.elements;
  42062. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  42063. this
  42064. },
  42065. applyToVector3Array: function() {
  42066. var e;
  42067. return function(t, i, r) {
  42068. void 0 === e && (e = new n.Vector3),
  42069. void 0 === i && (i = 0),
  42070. void 0 === r && (r = t.length);
  42071. for (var o = 0, a = i; o < r; o += 3,
  42072. a += 3)
  42073. e.fromArray(t, a),
  42074. e.applyMatrix3(this),
  42075. e.toArray(t, a);
  42076. return t
  42077. }
  42078. }(),
  42079. applyToBuffer: function() {
  42080. var e;
  42081. return function(t, i, r) {
  42082. void 0 === e && (e = new n.Vector3),
  42083. void 0 === i && (i = 0),
  42084. void 0 === r && (r = t.length / t.itemSize);
  42085. for (var o = 0, a = i; o < r; o++,
  42086. a++)
  42087. e.x = t.getX(a),
  42088. e.y = t.getY(a),
  42089. e.z = t.getZ(a),
  42090. e.applyMatrix3(this),
  42091. t.setXYZ(e.x, e.y, e.z);
  42092. return t
  42093. }
  42094. }(),
  42095. multiplyScalar: function(e) {
  42096. var t = this.elements;
  42097. return t[0] *= e,
  42098. t[3] *= e,
  42099. t[6] *= e,
  42100. t[1] *= e,
  42101. t[4] *= e,
  42102. t[7] *= e,
  42103. t[2] *= e,
  42104. t[5] *= e,
  42105. t[8] *= e,
  42106. this
  42107. },
  42108. determinant: function() {
  42109. var e = this.elements
  42110. , t = e[0]
  42111. , i = e[1]
  42112. , n = e[2]
  42113. , r = e[3]
  42114. , o = e[4]
  42115. , a = e[5]
  42116. , s = e[6]
  42117. , l = e[7]
  42118. , c = e[8];
  42119. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  42120. },
  42121. getInverse: function(e, t) {
  42122. e instanceof n.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  42123. var i = e.elements
  42124. , r = this.elements
  42125. , o = i[0]
  42126. , a = i[1]
  42127. , s = i[2]
  42128. , l = i[3]
  42129. , c = i[4]
  42130. , h = i[5]
  42131. , u = i[6]
  42132. , d = i[7]
  42133. , p = i[8]
  42134. , f = p * c - h * d
  42135. , g = h * u - p * l
  42136. , m = d * l - c * u
  42137. , v = o * f + a * g + s * m;
  42138. if (0 === v) {
  42139. var A = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  42140. if (t)
  42141. throw new Error(A);
  42142. return console.warn(A),
  42143. this.identity()
  42144. }
  42145. return r[0] = f,
  42146. r[1] = s * d - p * a,
  42147. r[2] = h * a - s * c,
  42148. r[3] = g,
  42149. r[4] = p * o - s * u,
  42150. r[5] = s * l - h * o,
  42151. r[6] = m,
  42152. r[7] = a * u - d * o,
  42153. r[8] = c * o - a * l,
  42154. this.multiplyScalar(1 / v)
  42155. },
  42156. transpose: function() {
  42157. var e, t = this.elements;
  42158. return e = t[1],
  42159. t[1] = t[3],
  42160. t[3] = e,
  42161. e = t[2],
  42162. t[2] = t[6],
  42163. t[6] = e,
  42164. e = t[5],
  42165. t[5] = t[7],
  42166. t[7] = e,
  42167. this
  42168. },
  42169. flattenToArrayOffset: function(e, t) {
  42170. var i = this.elements;
  42171. return e[t] = i[0],
  42172. e[t + 1] = i[1],
  42173. e[t + 2] = i[2],
  42174. e[t + 3] = i[3],
  42175. e[t + 4] = i[4],
  42176. e[t + 5] = i[5],
  42177. e[t + 6] = i[6],
  42178. e[t + 7] = i[7],
  42179. e[t + 8] = i[8],
  42180. e
  42181. },
  42182. getNormalMatrix: function(e) {
  42183. return this.setFromMatrix4(e).getInverse(this).transpose()
  42184. },
  42185. transposeIntoArray: function(e) {
  42186. var t = this.elements;
  42187. return e[0] = t[0],
  42188. e[1] = t[3],
  42189. e[2] = t[6],
  42190. e[3] = t[1],
  42191. e[4] = t[4],
  42192. e[5] = t[7],
  42193. e[6] = t[2],
  42194. e[7] = t[5],
  42195. e[8] = t[8],
  42196. this
  42197. },
  42198. fromArray: function(e) {
  42199. return this.elements.set(e),
  42200. this
  42201. },
  42202. toArray: function() {
  42203. var e = this.elements;
  42204. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  42205. }
  42206. },
  42207. n.Matrix4 = function() {
  42208. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  42209. arguments.length > 0 && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  42210. }
  42211. ,
  42212. n.Matrix4.prototype = {
  42213. constructor: n.Matrix4,
  42214. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  42215. var m = this.elements;
  42216. return m[0] = e,
  42217. m[4] = t,
  42218. m[8] = i,
  42219. m[12] = n,
  42220. m[1] = r,
  42221. m[5] = o,
  42222. m[9] = a,
  42223. m[13] = s,
  42224. m[2] = l,
  42225. m[6] = c,
  42226. m[10] = h,
  42227. m[14] = u,
  42228. m[3] = d,
  42229. m[7] = p,
  42230. m[11] = f,
  42231. m[15] = g,
  42232. this
  42233. },
  42234. identity: function() {
  42235. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  42236. this
  42237. },
  42238. clone: function() {
  42239. return (new n.Matrix4).fromArray(this.elements)
  42240. },
  42241. copy: function(e) {
  42242. return this.elements.set(e.elements),
  42243. this
  42244. },
  42245. copyPosition: function(e) {
  42246. var t = this.elements
  42247. , i = e.elements;
  42248. return t[12] = i[12],
  42249. t[13] = i[13],
  42250. t[14] = i[14],
  42251. this
  42252. },
  42253. extractBasis: function(e, t, i) {
  42254. return e.setFromMatrixColumn(this, 0),
  42255. t.setFromMatrixColumn(this, 1),
  42256. i.setFromMatrixColumn(this, 2),
  42257. this
  42258. },
  42259. makeBasis: function(e, t, i) {
  42260. 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),
  42261. this
  42262. },
  42263. extractRotation: function() {
  42264. var e;
  42265. return function(t) {
  42266. void 0 === e && (e = new n.Vector3);
  42267. var i = this.elements
  42268. , r = t.elements
  42269. , o = 1 / e.setFromMatrixColumn(t, 0).length()
  42270. , a = 1 / e.setFromMatrixColumn(t, 1).length()
  42271. , s = 1 / e.setFromMatrixColumn(t, 2).length();
  42272. return i[0] = r[0] * o,
  42273. i[1] = r[1] * o,
  42274. i[2] = r[2] * o,
  42275. i[4] = r[4] * a,
  42276. i[5] = r[5] * a,
  42277. i[6] = r[6] * a,
  42278. i[8] = r[8] * s,
  42279. i[9] = r[9] * s,
  42280. i[10] = r[10] * s,
  42281. this
  42282. }
  42283. }(),
  42284. makeRotationFromEuler: function(e) {
  42285. e instanceof n.Euler == !1 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  42286. var t = this.elements
  42287. , i = e.x
  42288. , r = e.y
  42289. , o = e.z
  42290. , a = Math.cos(i)
  42291. , s = Math.sin(i)
  42292. , l = Math.cos(r)
  42293. , c = Math.sin(r)
  42294. , h = Math.cos(o)
  42295. , u = Math.sin(o);
  42296. if ("XYZ" === e.order) {
  42297. var d = a * h
  42298. , p = a * u
  42299. , f = s * h
  42300. , g = s * u;
  42301. t[0] = l * h,
  42302. t[4] = -l * u,
  42303. t[8] = c,
  42304. t[1] = p + f * c,
  42305. t[5] = d - g * c,
  42306. t[9] = -s * l,
  42307. t[2] = g - d * c,
  42308. t[6] = f + p * c,
  42309. t[10] = a * l
  42310. } else if ("YXZ" === e.order) {
  42311. var m = l * h
  42312. , v = l * u
  42313. , A = c * h
  42314. , y = c * u;
  42315. t[0] = m + y * s,
  42316. t[4] = A * s - v,
  42317. t[8] = a * c,
  42318. t[1] = a * u,
  42319. t[5] = a * h,
  42320. t[9] = -s,
  42321. t[2] = v * s - A,
  42322. t[6] = y + m * s,
  42323. t[10] = a * l
  42324. } else if ("ZXY" === e.order) {
  42325. var m = l * h
  42326. , v = l * u
  42327. , A = c * h
  42328. , y = c * u;
  42329. t[0] = m - y * s,
  42330. t[4] = -a * u,
  42331. t[8] = A + v * s,
  42332. t[1] = v + A * s,
  42333. t[5] = a * h,
  42334. t[9] = y - m * s,
  42335. t[2] = -a * c,
  42336. t[6] = s,
  42337. t[10] = a * l
  42338. } else if ("ZYX" === e.order) {
  42339. var d = a * h
  42340. , p = a * u
  42341. , f = s * h
  42342. , g = s * u;
  42343. t[0] = l * h,
  42344. t[4] = f * c - p,
  42345. t[8] = d * c + g,
  42346. t[1] = l * u,
  42347. t[5] = g * c + d,
  42348. t[9] = p * c - f,
  42349. t[2] = -c,
  42350. t[6] = s * l,
  42351. t[10] = a * l
  42352. } else if ("YZX" === e.order) {
  42353. var C = a * l
  42354. , I = a * c
  42355. , E = s * l
  42356. , b = s * c;
  42357. t[0] = l * h,
  42358. t[4] = b - C * u,
  42359. t[8] = E * u + I,
  42360. t[1] = u,
  42361. t[5] = a * h,
  42362. t[9] = -s * h,
  42363. t[2] = -c * h,
  42364. t[6] = I * u + E,
  42365. t[10] = C - b * u
  42366. } else if ("XZY" === e.order) {
  42367. var C = a * l
  42368. , I = a * c
  42369. , E = s * l
  42370. , b = s * c;
  42371. t[0] = l * h,
  42372. t[4] = -u,
  42373. t[8] = c * h,
  42374. t[1] = C * u + b,
  42375. t[5] = a * h,
  42376. t[9] = I * u - E,
  42377. t[2] = E * u - I,
  42378. t[6] = s * h,
  42379. t[10] = b * u + C
  42380. }
  42381. return t[3] = 0,
  42382. t[7] = 0,
  42383. t[11] = 0,
  42384. t[12] = 0,
  42385. t[13] = 0,
  42386. t[14] = 0,
  42387. t[15] = 1,
  42388. this
  42389. },
  42390. makeRotationFromQuaternion: function(e) {
  42391. var t = this.elements
  42392. , i = e.x
  42393. , n = e.y
  42394. , r = e.z
  42395. , o = e.w
  42396. , a = i + i
  42397. , s = n + n
  42398. , l = r + r
  42399. , c = i * a
  42400. , h = i * s
  42401. , u = i * l
  42402. , d = n * s
  42403. , p = n * l
  42404. , f = r * l
  42405. , g = o * a
  42406. , m = o * s
  42407. , v = o * l;
  42408. return t[0] = 1 - (d + f),
  42409. t[4] = h - v,
  42410. t[8] = u + m,
  42411. t[1] = h + v,
  42412. t[5] = 1 - (c + f),
  42413. t[9] = p - g,
  42414. t[2] = u - m,
  42415. t[6] = p + g,
  42416. t[10] = 1 - (c + d),
  42417. t[3] = 0,
  42418. t[7] = 0,
  42419. t[11] = 0,
  42420. t[12] = 0,
  42421. t[13] = 0,
  42422. t[14] = 0,
  42423. t[15] = 1,
  42424. this
  42425. },
  42426. lookAt: function() {
  42427. var e, t, i;
  42428. return function(r, o, a) {
  42429. void 0 === e && (e = new n.Vector3),
  42430. void 0 === t && (t = new n.Vector3),
  42431. void 0 === i && (i = new n.Vector3);
  42432. var s = this.elements;
  42433. return i.subVectors(r, o).normalize(),
  42434. 0 === i.lengthSq() && (i.z = 1),
  42435. e.crossVectors(a, i).normalize(),
  42436. 0 === e.lengthSq() && (i.x += 1e-4,
  42437. e.crossVectors(a, i).normalize()),
  42438. t.crossVectors(i, e),
  42439. s[0] = e.x,
  42440. s[4] = t.x,
  42441. s[8] = i.x,
  42442. s[1] = e.y,
  42443. s[5] = t.y,
  42444. s[9] = i.y,
  42445. s[2] = e.z,
  42446. s[6] = t.z,
  42447. s[10] = i.z,
  42448. this
  42449. }
  42450. }(),
  42451. multiply: function(e, t) {
  42452. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  42453. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  42454. },
  42455. multiplyMatrices: function(e, t) {
  42456. var i = e.elements
  42457. , n = t.elements
  42458. , r = this.elements
  42459. , o = i[0]
  42460. , a = i[4]
  42461. , s = i[8]
  42462. , l = i[12]
  42463. , c = i[1]
  42464. , h = i[5]
  42465. , u = i[9]
  42466. , d = i[13]
  42467. , p = i[2]
  42468. , f = i[6]
  42469. , g = i[10]
  42470. , m = i[14]
  42471. , v = i[3]
  42472. , A = i[7]
  42473. , y = i[11]
  42474. , C = i[15]
  42475. , I = n[0]
  42476. , E = n[4]
  42477. , b = n[8]
  42478. , w = n[12]
  42479. , _ = n[1]
  42480. , T = n[5]
  42481. , x = n[9]
  42482. , S = n[13]
  42483. , M = n[2]
  42484. , R = n[6]
  42485. , P = n[10]
  42486. , O = n[14]
  42487. , L = n[3]
  42488. , D = n[7]
  42489. , N = n[11]
  42490. , B = n[15];
  42491. return r[0] = o * I + a * _ + s * M + l * L,
  42492. r[4] = o * E + a * T + s * R + l * D,
  42493. r[8] = o * b + a * x + s * P + l * N,
  42494. r[12] = o * w + a * S + s * O + l * B,
  42495. r[1] = c * I + h * _ + u * M + d * L,
  42496. r[5] = c * E + h * T + u * R + d * D,
  42497. r[9] = c * b + h * x + u * P + d * N,
  42498. r[13] = c * w + h * S + u * O + d * B,
  42499. r[2] = p * I + f * _ + g * M + m * L,
  42500. r[6] = p * E + f * T + g * R + m * D,
  42501. r[10] = p * b + f * x + g * P + m * N,
  42502. r[14] = p * w + f * S + g * O + m * B,
  42503. r[3] = v * I + A * _ + y * M + C * L,
  42504. r[7] = v * E + A * T + y * R + C * D,
  42505. r[11] = v * b + A * x + y * P + C * N,
  42506. r[15] = v * w + A * S + y * O + C * B,
  42507. this
  42508. },
  42509. multiplyToArray: function(e, t, i) {
  42510. var n = this.elements;
  42511. return this.multiplyMatrices(e, t),
  42512. i[0] = n[0],
  42513. i[1] = n[1],
  42514. i[2] = n[2],
  42515. i[3] = n[3],
  42516. i[4] = n[4],
  42517. i[5] = n[5],
  42518. i[6] = n[6],
  42519. i[7] = n[7],
  42520. i[8] = n[8],
  42521. i[9] = n[9],
  42522. i[10] = n[10],
  42523. i[11] = n[11],
  42524. i[12] = n[12],
  42525. i[13] = n[13],
  42526. i[14] = n[14],
  42527. i[15] = n[15],
  42528. this
  42529. },
  42530. multiplyScalar: function(e) {
  42531. var t = this.elements;
  42532. return t[0] *= e,
  42533. t[4] *= e,
  42534. t[8] *= e,
  42535. t[12] *= e,
  42536. t[1] *= e,
  42537. t[5] *= e,
  42538. t[9] *= e,
  42539. t[13] *= e,
  42540. t[2] *= e,
  42541. t[6] *= e,
  42542. t[10] *= e,
  42543. t[14] *= e,
  42544. t[3] *= e,
  42545. t[7] *= e,
  42546. t[11] *= e,
  42547. t[15] *= e,
  42548. this
  42549. },
  42550. applyToVector3Array: function() {
  42551. var e;
  42552. return function(t, i, r) {
  42553. void 0 === e && (e = new n.Vector3),
  42554. void 0 === i && (i = 0),
  42555. void 0 === r && (r = t.length);
  42556. for (var o = 0, a = i; o < r; o += 3,
  42557. a += 3)
  42558. e.fromArray(t, a),
  42559. e.applyMatrix4(this),
  42560. e.toArray(t, a);
  42561. return t
  42562. }
  42563. }(),
  42564. applyToBuffer: function() {
  42565. var e;
  42566. return function(t, i, r) {
  42567. void 0 === e && (e = new n.Vector3),
  42568. void 0 === i && (i = 0),
  42569. void 0 === r && (r = t.length / t.itemSize);
  42570. for (var o = 0, a = i; o < r; o++,
  42571. a++)
  42572. e.x = t.getX(a),
  42573. e.y = t.getY(a),
  42574. e.z = t.getZ(a),
  42575. e.applyMatrix4(this),
  42576. t.setXYZ(e.x, e.y, e.z);
  42577. return t
  42578. }
  42579. }(),
  42580. determinant: function() {
  42581. var e = this.elements
  42582. , t = e[0]
  42583. , i = e[4]
  42584. , n = e[8]
  42585. , r = e[12]
  42586. , o = e[1]
  42587. , a = e[5]
  42588. , s = e[9]
  42589. , l = e[13]
  42590. , c = e[2]
  42591. , h = e[6]
  42592. , u = e[10]
  42593. , d = e[14]
  42594. , p = e[3]
  42595. , f = e[7]
  42596. , g = e[11]
  42597. , m = e[15];
  42598. 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)
  42599. },
  42600. transpose: function() {
  42601. var e, t = this.elements;
  42602. return e = t[1],
  42603. t[1] = t[4],
  42604. t[4] = e,
  42605. e = t[2],
  42606. t[2] = t[8],
  42607. t[8] = e,
  42608. e = t[6],
  42609. t[6] = t[9],
  42610. t[9] = e,
  42611. e = t[3],
  42612. t[3] = t[12],
  42613. t[12] = e,
  42614. e = t[7],
  42615. t[7] = t[13],
  42616. t[13] = e,
  42617. e = t[11],
  42618. t[11] = t[14],
  42619. t[14] = e,
  42620. this
  42621. },
  42622. flattenToArrayOffset: function(e, t) {
  42623. var i = this.elements;
  42624. return e[t] = i[0],
  42625. e[t + 1] = i[1],
  42626. e[t + 2] = i[2],
  42627. e[t + 3] = i[3],
  42628. e[t + 4] = i[4],
  42629. e[t + 5] = i[5],
  42630. e[t + 6] = i[6],
  42631. e[t + 7] = i[7],
  42632. e[t + 8] = i[8],
  42633. e[t + 9] = i[9],
  42634. e[t + 10] = i[10],
  42635. e[t + 11] = i[11],
  42636. e[t + 12] = i[12],
  42637. e[t + 13] = i[13],
  42638. e[t + 14] = i[14],
  42639. e[t + 15] = i[15],
  42640. e
  42641. },
  42642. getPosition: function() {
  42643. var e;
  42644. return function() {
  42645. return void 0 === e && (e = new n.Vector3),
  42646. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  42647. e.setFromMatrixColumn(this, 3)
  42648. }
  42649. }(),
  42650. setPosition: function(e) {
  42651. var t = this.elements;
  42652. return t[12] = e.x,
  42653. t[13] = e.y,
  42654. t[14] = e.z,
  42655. this
  42656. },
  42657. getInverse: function(e, t) {
  42658. var i = this.elements
  42659. , n = e.elements
  42660. , r = n[0]
  42661. , o = n[1]
  42662. , a = n[2]
  42663. , s = n[3]
  42664. , l = n[4]
  42665. , c = n[5]
  42666. , h = n[6]
  42667. , u = n[7]
  42668. , d = n[8]
  42669. , p = n[9]
  42670. , f = n[10]
  42671. , g = n[11]
  42672. , m = n[12]
  42673. , v = n[13]
  42674. , A = n[14]
  42675. , y = n[15]
  42676. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  42677. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  42678. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  42679. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  42680. , w = r * C + o * I + a * E + s * b;
  42681. if (0 === w) {
  42682. var _ = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  42683. if (t)
  42684. throw new Error(_);
  42685. return console.warn(_),
  42686. this.identity()
  42687. }
  42688. return i[0] = C,
  42689. i[1] = v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y,
  42690. i[2] = c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y,
  42691. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  42692. i[4] = I,
  42693. i[5] = d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y,
  42694. i[6] = m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y,
  42695. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  42696. i[8] = E,
  42697. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y,
  42698. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y,
  42699. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  42700. i[12] = b,
  42701. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A,
  42702. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A,
  42703. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  42704. this.multiplyScalar(1 / w)
  42705. },
  42706. scale: function(e) {
  42707. var t = this.elements
  42708. , i = e.x
  42709. , n = e.y
  42710. , r = e.z;
  42711. return t[0] *= i,
  42712. t[4] *= n,
  42713. t[8] *= r,
  42714. t[1] *= i,
  42715. t[5] *= n,
  42716. t[9] *= r,
  42717. t[2] *= i,
  42718. t[6] *= n,
  42719. t[10] *= r,
  42720. t[3] *= i,
  42721. t[7] *= n,
  42722. t[11] *= r,
  42723. this
  42724. },
  42725. getMaxScaleOnAxis: function() {
  42726. var e = this.elements
  42727. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  42728. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  42729. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  42730. return Math.sqrt(Math.max(t, i, n))
  42731. },
  42732. makeTranslation: function(e, t, i) {
  42733. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  42734. this
  42735. },
  42736. makeRotationX: function(e) {
  42737. var t = Math.cos(e)
  42738. , i = Math.sin(e);
  42739. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  42740. this
  42741. },
  42742. makeRotationY: function(e) {
  42743. var t = Math.cos(e)
  42744. , i = Math.sin(e);
  42745. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  42746. this
  42747. },
  42748. makeRotationZ: function(e) {
  42749. var t = Math.cos(e)
  42750. , i = Math.sin(e);
  42751. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  42752. this
  42753. },
  42754. makeRotationAxis: function(e, t) {
  42755. var i = Math.cos(t)
  42756. , n = Math.sin(t)
  42757. , r = 1 - i
  42758. , o = e.x
  42759. , a = e.y
  42760. , s = e.z
  42761. , l = r * o
  42762. , c = r * a;
  42763. 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),
  42764. this
  42765. },
  42766. makeScale: function(e, t, i) {
  42767. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  42768. this
  42769. },
  42770. compose: function(e, t, i) {
  42771. return this.makeRotationFromQuaternion(t),
  42772. this.scale(i),
  42773. this.setPosition(e),
  42774. this
  42775. },
  42776. decompose: function() {
  42777. var e, t;
  42778. return function(i, r, o) {
  42779. void 0 === e && (e = new n.Vector3),
  42780. void 0 === t && (t = new n.Matrix4);
  42781. var a = this.elements
  42782. , s = e.set(a[0], a[1], a[2]).length()
  42783. , l = e.set(a[4], a[5], a[6]).length()
  42784. , c = e.set(a[8], a[9], a[10]).length()
  42785. , h = this.determinant();
  42786. h < 0 && (s = -s),
  42787. i.x = a[12],
  42788. i.y = a[13],
  42789. i.z = a[14],
  42790. t.elements.set(this.elements);
  42791. var u = 1 / s
  42792. , d = 1 / l
  42793. , p = 1 / c;
  42794. return t.elements[0] *= u,
  42795. t.elements[1] *= u,
  42796. t.elements[2] *= u,
  42797. t.elements[4] *= d,
  42798. t.elements[5] *= d,
  42799. t.elements[6] *= d,
  42800. t.elements[8] *= p,
  42801. t.elements[9] *= p,
  42802. t.elements[10] *= p,
  42803. r.setFromRotationMatrix(t),
  42804. o.x = s,
  42805. o.y = l,
  42806. o.z = c,
  42807. this
  42808. }
  42809. }(),
  42810. makeFrustum: function(e, t, i, n, r, o) {
  42811. var a = this.elements
  42812. , s = 2 * r / (t - e)
  42813. , l = 2 * r / (n - i)
  42814. , c = (t + e) / (t - e)
  42815. , h = (n + i) / (n - i)
  42816. , u = -(o + r) / (o - r)
  42817. , d = -2 * o * r / (o - r);
  42818. return a[0] = s,
  42819. a[4] = 0,
  42820. a[8] = c,
  42821. a[12] = 0,
  42822. a[1] = 0,
  42823. a[5] = l,
  42824. a[9] = h,
  42825. a[13] = 0,
  42826. a[2] = 0,
  42827. a[6] = 0,
  42828. a[10] = u,
  42829. a[14] = d,
  42830. a[3] = 0,
  42831. a[7] = 0,
  42832. a[11] = -1,
  42833. a[15] = 0,
  42834. this
  42835. },
  42836. makePerspective: function(e, t, i, r) {
  42837. var o = i * Math.tan(n.Math.degToRad(.5 * e))
  42838. , a = -o
  42839. , s = a * t
  42840. , l = o * t;
  42841. return this.makeFrustum(s, l, a, o, i, r)
  42842. },
  42843. makeOrthographic: function(e, t, i, n, r, o) {
  42844. var a = this.elements
  42845. , s = 1 / (t - e)
  42846. , l = 1 / (i - n)
  42847. , c = 1 / (o - r)
  42848. , h = (t + e) * s
  42849. , u = (i + n) * l
  42850. , d = (o + r) * c;
  42851. return a[0] = 2 * s,
  42852. a[4] = 0,
  42853. a[8] = 0,
  42854. a[12] = -h,
  42855. a[1] = 0,
  42856. a[5] = 2 * l,
  42857. a[9] = 0,
  42858. a[13] = -u,
  42859. a[2] = 0,
  42860. a[6] = 0,
  42861. a[10] = -2 * c,
  42862. a[14] = -d,
  42863. a[3] = 0,
  42864. a[7] = 0,
  42865. a[11] = 0,
  42866. a[15] = 1,
  42867. this
  42868. },
  42869. equals: function(e) {
  42870. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  42871. if (t[n] !== i[n])
  42872. return !1;
  42873. return !0
  42874. },
  42875. fromArray: function(e) {
  42876. return this.elements.set(e),
  42877. this
  42878. },
  42879. toArray: function() {
  42880. var e = this.elements;
  42881. 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]]
  42882. }
  42883. },
  42884. n.Ray = function(e, t) {
  42885. this.origin = void 0 !== e ? e : new n.Vector3,
  42886. this.direction = void 0 !== t ? t : new n.Vector3
  42887. }
  42888. ,
  42889. n.Ray.prototype = {
  42890. constructor: n.Ray,
  42891. set: function(e, t) {
  42892. return this.origin.copy(e),
  42893. this.direction.copy(t),
  42894. this
  42895. },
  42896. clone: function() {
  42897. return (new this.constructor).copy(this)
  42898. },
  42899. copy: function(e) {
  42900. return this.origin.copy(e.origin),
  42901. this.direction.copy(e.direction),
  42902. this
  42903. },
  42904. at: function(e, t) {
  42905. var i = t || new n.Vector3;
  42906. return i.copy(this.direction).multiplyScalar(e).add(this.origin)
  42907. },
  42908. lookAt: function(e) {
  42909. this.direction.copy(e).sub(this.origin).normalize()
  42910. },
  42911. recast: function() {
  42912. var e = new n.Vector3;
  42913. return function(t) {
  42914. return this.origin.copy(this.at(t, e)),
  42915. this
  42916. }
  42917. }(),
  42918. closestPointToPoint: function(e, t) {
  42919. var i = t || new n.Vector3;
  42920. i.subVectors(e, this.origin);
  42921. var r = i.dot(this.direction);
  42922. return r < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(r).add(this.origin)
  42923. },
  42924. distanceToPoint: function(e) {
  42925. return Math.sqrt(this.distanceSqToPoint(e))
  42926. },
  42927. distanceSqToPoint: function() {
  42928. var e = new n.Vector3;
  42929. return function(t) {
  42930. var i = e.subVectors(t, this.origin).dot(this.direction);
  42931. return i < 0 ? this.origin.distanceToSquared(t) : (e.copy(this.direction).multiplyScalar(i).add(this.origin),
  42932. e.distanceToSquared(t))
  42933. }
  42934. }(),
  42935. distanceSqToSegment: function() {
  42936. var e = new n.Vector3
  42937. , t = new n.Vector3
  42938. , i = new n.Vector3;
  42939. return function(n, r, o, a) {
  42940. e.copy(n).add(r).multiplyScalar(.5),
  42941. t.copy(r).sub(n).normalize(),
  42942. i.copy(this.origin).sub(e);
  42943. 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);
  42944. if (m > 0)
  42945. if (s = d * f - p,
  42946. l = d * p - f,
  42947. h = u * m,
  42948. s >= 0)
  42949. if (l >= -h)
  42950. if (l <= h) {
  42951. var v = 1 / m;
  42952. s *= v,
  42953. l *= v,
  42954. c = s * (s + d * l + 2 * p) + l * (d * s + l + 2 * f) + g
  42955. } else
  42956. l = u,
  42957. s = Math.max(0, -(d * l + p)),
  42958. c = -s * s + l * (l + 2 * f) + g;
  42959. else
  42960. l = -u,
  42961. s = Math.max(0, -(d * l + p)),
  42962. c = -s * s + l * (l + 2 * f) + g;
  42963. else
  42964. l <= -h ? (s = Math.max(0, -(-d * u + p)),
  42965. l = s > 0 ? -u : Math.min(Math.max(-u, -f), u),
  42966. c = -s * s + l * (l + 2 * f) + g) : l <= h ? (s = 0,
  42967. l = Math.min(Math.max(-u, -f), u),
  42968. c = l * (l + 2 * f) + g) : (s = Math.max(0, -(d * u + p)),
  42969. l = s > 0 ? u : Math.min(Math.max(-u, -f), u),
  42970. c = -s * s + l * (l + 2 * f) + g);
  42971. else
  42972. l = d > 0 ? -u : u,
  42973. s = Math.max(0, -(d * l + p)),
  42974. c = -s * s + l * (l + 2 * f) + g;
  42975. return o && o.copy(this.direction).multiplyScalar(s).add(this.origin),
  42976. a && a.copy(t).multiplyScalar(l).add(e),
  42977. c
  42978. }
  42979. }(),
  42980. intersectSphere: function() {
  42981. var e = new n.Vector3;
  42982. return function(t, i) {
  42983. e.subVectors(t.center, this.origin);
  42984. var n = e.dot(this.direction)
  42985. , r = e.dot(e) - n * n
  42986. , o = t.radius * t.radius;
  42987. if (r > o)
  42988. return null;
  42989. var a = Math.sqrt(o - r)
  42990. , s = n - a
  42991. , l = n + a;
  42992. return s < 0 && l < 0 ? null : s < 0 ? this.at(l, i) : this.at(s, i)
  42993. }
  42994. }(),
  42995. intersectsSphere: function(e) {
  42996. return this.distanceToPoint(e.center) <= e.radius
  42997. },
  42998. distanceToPlane: function(e) {
  42999. var t = e.normal.dot(this.direction);
  43000. if (0 === t)
  43001. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  43002. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  43003. return i >= 0 ? i : null
  43004. },
  43005. intersectPlane: function(e, t) {
  43006. var i = this.distanceToPlane(e);
  43007. return null === i ? null : this.at(i, t)
  43008. },
  43009. intersectsPlane: function(e) {
  43010. var t = e.distanceToPoint(this.origin);
  43011. if (0 === t)
  43012. return !0;
  43013. var i = e.normal.dot(this.direction);
  43014. return i * t < 0
  43015. },
  43016. intersectBox: function(e, t) {
  43017. 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;
  43018. return l >= 0 ? (i = (e.min.x - u.x) * l,
  43019. n = (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  43020. n = (e.min.x - u.x) * l),
  43021. c >= 0 ? (r = (e.min.y - u.y) * c,
  43022. o = (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  43023. o = (e.min.y - u.y) * c),
  43024. i > o || r > n ? null : ((r > i || i !== i) && (i = r),
  43025. (o < n || n !== n) && (n = o),
  43026. h >= 0 ? (a = (e.min.z - u.z) * h,
  43027. s = (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  43028. s = (e.min.z - u.z) * h),
  43029. i > s || a > n ? null : ((a > i || i !== i) && (i = a),
  43030. (s < n || n !== n) && (n = s),
  43031. n < 0 ? null : this.at(i >= 0 ? i : n, t)))
  43032. },
  43033. intersectsBox: function() {
  43034. var e = new n.Vector3;
  43035. return function(t) {
  43036. return null !== this.intersectBox(t, e)
  43037. }
  43038. }(),
  43039. intersectTriangle: function() {
  43040. var e = new n.Vector3
  43041. , t = new n.Vector3
  43042. , i = new n.Vector3
  43043. , r = new n.Vector3;
  43044. return function(n, o, a, s, l) {
  43045. t.subVectors(o, n),
  43046. i.subVectors(a, n),
  43047. r.crossVectors(t, i);
  43048. var c, h = this.direction.dot(r);
  43049. if (h > 0) {
  43050. if (s)
  43051. return null;
  43052. c = 1
  43053. } else {
  43054. if (!(h < 0))
  43055. return null;
  43056. c = -1,
  43057. h = -h
  43058. }
  43059. e.subVectors(this.origin, n);
  43060. var u = c * this.direction.dot(i.crossVectors(e, i));
  43061. if (u < 0)
  43062. return null;
  43063. var d = c * this.direction.dot(t.cross(e));
  43064. if (d < 0)
  43065. return null;
  43066. if (u + d > h)
  43067. return null;
  43068. var p = -c * e.dot(r);
  43069. return p < 0 ? null : this.at(p / h, l)
  43070. }
  43071. }(),
  43072. applyMatrix4: function(e) {
  43073. return this.direction.add(this.origin).applyMatrix4(e),
  43074. this.origin.applyMatrix4(e),
  43075. this.direction.sub(this.origin),
  43076. this.direction.normalize(),
  43077. this
  43078. },
  43079. equals: function(e) {
  43080. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  43081. }
  43082. },
  43083. n.Sphere = function(e, t) {
  43084. this.center = void 0 !== e ? e : new n.Vector3,
  43085. this.radius = void 0 !== t ? t : 0
  43086. }
  43087. ,
  43088. n.Sphere.prototype = {
  43089. constructor: n.Sphere,
  43090. set: function(e, t) {
  43091. return this.center.copy(e),
  43092. this.radius = t,
  43093. this
  43094. },
  43095. setFromPoints: function() {
  43096. var e = new n.Box3;
  43097. return function(t, i) {
  43098. var n = this.center;
  43099. void 0 !== i ? n.copy(i) : e.setFromPoints(t).center(n);
  43100. for (var r = 0, o = 0, a = t.length; o < a; o++)
  43101. r = Math.max(r, n.distanceToSquared(t[o]));
  43102. return this.radius = Math.sqrt(r),
  43103. this
  43104. }
  43105. }(),
  43106. clone: function() {
  43107. return (new this.constructor).copy(this)
  43108. },
  43109. copy: function(e) {
  43110. return this.center.copy(e.center),
  43111. this.radius = e.radius,
  43112. this
  43113. },
  43114. empty: function() {
  43115. return this.radius <= 0
  43116. },
  43117. containsPoint: function(e) {
  43118. return e.distanceToSquared(this.center) <= this.radius * this.radius
  43119. },
  43120. distanceToPoint: function(e) {
  43121. return e.distanceTo(this.center) - this.radius
  43122. },
  43123. intersectsSphere: function(e) {
  43124. var t = this.radius + e.radius;
  43125. return e.center.distanceToSquared(this.center) <= t * t
  43126. },
  43127. intersectsBox: function(e) {
  43128. return e.intersectsSphere(this)
  43129. },
  43130. intersectsPlane: function(e) {
  43131. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  43132. },
  43133. clampPoint: function(e, t) {
  43134. var i = this.center.distanceToSquared(e)
  43135. , r = t || new n.Vector3;
  43136. return r.copy(e),
  43137. i > this.radius * this.radius && (r.sub(this.center).normalize(),
  43138. r.multiplyScalar(this.radius).add(this.center)),
  43139. r
  43140. },
  43141. getBoundingBox: function(e) {
  43142. var t = e || new n.Box3;
  43143. return t.set(this.center, this.center),
  43144. t.expandByScalar(this.radius),
  43145. t
  43146. },
  43147. applyMatrix4: function(e) {
  43148. return this.center.applyMatrix4(e),
  43149. this.radius = this.radius * e.getMaxScaleOnAxis(),
  43150. this
  43151. },
  43152. translate: function(e) {
  43153. return this.center.add(e),
  43154. this
  43155. },
  43156. equals: function(e) {
  43157. return e.center.equals(this.center) && e.radius === this.radius
  43158. }
  43159. },
  43160. n.Frustum = function(e, t, i, r, o, a) {
  43161. 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]
  43162. }
  43163. ,
  43164. n.Frustum.prototype = {
  43165. constructor: n.Frustum,
  43166. set: function(e, t, i, n, r, o) {
  43167. var a = this.planes;
  43168. return a[0].copy(e),
  43169. a[1].copy(t),
  43170. a[2].copy(i),
  43171. a[3].copy(n),
  43172. a[4].copy(r),
  43173. a[5].copy(o),
  43174. this
  43175. },
  43176. clone: function() {
  43177. return (new this.constructor).copy(this)
  43178. },
  43179. copy: function(e) {
  43180. for (var t = this.planes, i = 0; i < 6; i++)
  43181. t[i].copy(e.planes[i]);
  43182. return this
  43183. },
  43184. setFromMatrix: function(e) {
  43185. var t = this.planes
  43186. , i = e.elements
  43187. , n = i[0]
  43188. , r = i[1]
  43189. , o = i[2]
  43190. , a = i[3]
  43191. , s = i[4]
  43192. , l = i[5]
  43193. , c = i[6]
  43194. , h = i[7]
  43195. , u = i[8]
  43196. , d = i[9]
  43197. , p = i[10]
  43198. , f = i[11]
  43199. , g = i[12]
  43200. , m = i[13]
  43201. , v = i[14]
  43202. , A = i[15];
  43203. return t[0].setComponents(a - n, h - s, f - u, A - g).normalize(),
  43204. t[1].setComponents(a + n, h + s, f + u, A + g).normalize(),
  43205. t[2].setComponents(a + r, h + l, f + d, A + m).normalize(),
  43206. t[3].setComponents(a - r, h - l, f - d, A - m).normalize(),
  43207. t[4].setComponents(a - o, h - c, f - p, A - v).normalize(),
  43208. t[5].setComponents(a + o, h + c, f + p, A + v).normalize(),
  43209. this
  43210. },
  43211. intersectsObject: function() {
  43212. var e = new n.Sphere;
  43213. return function(t) {
  43214. var i = t.geometry;
  43215. return null === i.boundingSphere && i.computeBoundingSphere(),
  43216. e.copy(i.boundingSphere),
  43217. e.applyMatrix4(t.matrixWorld),
  43218. this.intersectsSphere(e)
  43219. }
  43220. }(),
  43221. intersectsSphere: function(e) {
  43222. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  43223. var o = t[r].distanceToPoint(i);
  43224. if (o < n)
  43225. return !1
  43226. }
  43227. return !0
  43228. },
  43229. intersectsBox: function() {
  43230. var e = new n.Vector3
  43231. , t = new n.Vector3;
  43232. return function(i) {
  43233. for (var n = this.planes, r = 0; r < 6; r++) {
  43234. var o = n[r];
  43235. e.x = o.normal.x > 0 ? i.min.x : i.max.x,
  43236. t.x = o.normal.x > 0 ? i.max.x : i.min.x,
  43237. e.y = o.normal.y > 0 ? i.min.y : i.max.y,
  43238. t.y = o.normal.y > 0 ? i.max.y : i.min.y,
  43239. e.z = o.normal.z > 0 ? i.min.z : i.max.z,
  43240. t.z = o.normal.z > 0 ? i.max.z : i.min.z;
  43241. var a = o.distanceToPoint(e)
  43242. , s = o.distanceToPoint(t);
  43243. if (a < 0 && s < 0)
  43244. return !1
  43245. }
  43246. return !0
  43247. }
  43248. }(),
  43249. containsPoint: function(e) {
  43250. for (var t = this.planes, i = 0; i < 6; i++)
  43251. if (t[i].distanceToPoint(e) < 0)
  43252. return !1;
  43253. return !0
  43254. }
  43255. },
  43256. n.Plane = function(e, t) {
  43257. this.normal = void 0 !== e ? e : new n.Vector3(1,0,0),
  43258. this.constant = void 0 !== t ? t : 0
  43259. }
  43260. ,
  43261. n.Plane.prototype = {
  43262. constructor: n.Plane,
  43263. set: function(e, t) {
  43264. return this.normal.copy(e),
  43265. this.constant = t,
  43266. this
  43267. },
  43268. setComponents: function(e, t, i, n) {
  43269. return this.normal.set(e, t, i),
  43270. this.constant = n,
  43271. this
  43272. },
  43273. setFromNormalAndCoplanarPoint: function(e, t) {
  43274. return this.normal.copy(e),
  43275. this.constant = -t.dot(this.normal),
  43276. this
  43277. },
  43278. setFromCoplanarPoints: function() {
  43279. var e = new n.Vector3
  43280. , t = new n.Vector3;
  43281. return function(i, n, r) {
  43282. var o = e.subVectors(r, n).cross(t.subVectors(i, n)).normalize();
  43283. return this.setFromNormalAndCoplanarPoint(o, i),
  43284. this
  43285. }
  43286. }(),
  43287. clone: function() {
  43288. return (new this.constructor).copy(this)
  43289. },
  43290. copy: function(e) {
  43291. return this.normal.copy(e.normal),
  43292. this.constant = e.constant,
  43293. this
  43294. },
  43295. normalize: function() {
  43296. var e = 1 / this.normal.length();
  43297. return this.normal.multiplyScalar(e),
  43298. this.constant *= e,
  43299. this
  43300. },
  43301. negate: function() {
  43302. return this.constant *= -1,
  43303. this.normal.negate(),
  43304. this
  43305. },
  43306. distanceToPoint: function(e) {
  43307. return this.normal.dot(e) + this.constant
  43308. },
  43309. distanceToSphere: function(e) {
  43310. return this.distanceToPoint(e.center) - e.radius
  43311. },
  43312. projectPoint: function(e, t) {
  43313. return this.orthoPoint(e, t).sub(e).negate()
  43314. },
  43315. orthoPoint: function(e, t) {
  43316. var i = this.distanceToPoint(e)
  43317. , r = t || new n.Vector3;
  43318. return r.copy(this.normal).multiplyScalar(i)
  43319. },
  43320. intersectLine: function() {
  43321. var e = new n.Vector3;
  43322. return function(t, i) {
  43323. var r = i || new n.Vector3
  43324. , o = t.delta(e)
  43325. , a = this.normal.dot(o);
  43326. if (0 !== a) {
  43327. var s = -(t.start.dot(this.normal) + this.constant) / a;
  43328. if (!(s < 0 || s > 1))
  43329. return r.copy(o).multiplyScalar(s).add(t.start)
  43330. } else if (0 === this.distanceToPoint(t.start))
  43331. return r.copy(t.start)
  43332. }
  43333. }(),
  43334. intersectsLine: function(e) {
  43335. var t = this.distanceToPoint(e.start)
  43336. , i = this.distanceToPoint(e.end);
  43337. return t < 0 && i > 0 || i < 0 && t > 0
  43338. },
  43339. intersectsBox: function(e) {
  43340. return e.intersectsPlane(this)
  43341. },
  43342. intersectsSphere: function(e) {
  43343. return e.intersectsPlane(this)
  43344. },
  43345. coplanarPoint: function(e) {
  43346. var t = e || new n.Vector3;
  43347. return t.copy(this.normal).multiplyScalar(-this.constant)
  43348. },
  43349. applyMatrix4: function() {
  43350. var e = new n.Vector3
  43351. , t = new n.Vector3
  43352. , i = new n.Matrix3;
  43353. return function(n, r) {
  43354. var o = r || i.getNormalMatrix(n)
  43355. , a = e.copy(this.normal).applyMatrix3(o)
  43356. , s = this.coplanarPoint(t);
  43357. return s.applyMatrix4(n),
  43358. this.setFromNormalAndCoplanarPoint(a, s),
  43359. this
  43360. }
  43361. }(),
  43362. translate: function(e) {
  43363. return this.constant = this.constant - e.dot(this.normal),
  43364. this
  43365. },
  43366. equals: function(e) {
  43367. return e.normal.equals(this.normal) && e.constant === this.constant
  43368. }
  43369. },
  43370. n.Spherical = function(e, t, i) {
  43371. return this.radius = void 0 !== e ? e : 1,
  43372. this.phi = void 0 !== t ? t : 0,
  43373. this.theta = void 0 !== i ? i : 0,
  43374. this
  43375. }
  43376. ,
  43377. n.Spherical.prototype = {
  43378. constructor: n.Spherical,
  43379. set: function(e, t, i) {
  43380. this.radius = e,
  43381. this.phi = t,
  43382. this.theta = i
  43383. },
  43384. clone: function() {
  43385. return (new this.constructor).copy(this)
  43386. },
  43387. copy: function(e) {
  43388. return this.radius.copy(e.radius),
  43389. this.phi.copy(e.phi),
  43390. this.theta.copy(e.theta),
  43391. this
  43392. },
  43393. makeSafe: function() {
  43394. var e = 1e-6;
  43395. this.phi = Math.max(e, Math.min(Math.PI - e, this.phi))
  43396. },
  43397. setFromVector3: function(e) {
  43398. return this.radius = e.length(),
  43399. 0 === this.radius ? (this.theta = 0,
  43400. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  43401. this.phi = Math.acos(n.Math.clamp(e.y / this.radius, -1, 1))),
  43402. this
  43403. }
  43404. },
  43405. n.Math = {
  43406. generateUUID: function() {
  43407. var e, t = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), i = new Array(36), n = 0;
  43408. return function() {
  43409. for (var r = 0; r < 36; r++)
  43410. 8 === r || 13 === r || 18 === r || 23 === r ? i[r] = "-" : 14 === r ? i[r] = "4" : (n <= 2 && (n = 33554432 + 16777216 * Math.random() | 0),
  43411. e = 15 & n,
  43412. n >>= 4,
  43413. i[r] = t[19 === r ? 3 & e | 8 : e]);
  43414. return i.join("")
  43415. }
  43416. }(),
  43417. clamp: function(e, t, i) {
  43418. return Math.max(t, Math.min(i, e))
  43419. },
  43420. euclideanModulo: function(e, t) {
  43421. return (e % t + t) % t
  43422. },
  43423. mapLinear: function(e, t, i, n, r) {
  43424. return n + (e - t) * (r - n) / (i - t)
  43425. },
  43426. smoothstep: function(e, t, i) {
  43427. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  43428. e * e * (3 - 2 * e))
  43429. },
  43430. smootherstep: function(e, t, i) {
  43431. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  43432. e * e * e * (e * (6 * e - 15) + 10))
  43433. },
  43434. random16: function() {
  43435. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  43436. Math.random()
  43437. },
  43438. randInt: function(e, t) {
  43439. return e + Math.floor(Math.random() * (t - e + 1))
  43440. },
  43441. randFloat: function(e, t) {
  43442. return e + Math.random() * (t - e)
  43443. },
  43444. randFloatSpread: function(e) {
  43445. return e * (.5 - Math.random())
  43446. },
  43447. degToRad: function() {
  43448. var e = Math.PI / 180;
  43449. return function(t) {
  43450. return t * e
  43451. }
  43452. }(),
  43453. radToDeg: function() {
  43454. var e = 180 / Math.PI;
  43455. return function(t) {
  43456. return t * e
  43457. }
  43458. }(),
  43459. isPowerOfTwo: function(e) {
  43460. return 0 === (e & e - 1) && 0 !== e
  43461. },
  43462. nearestPowerOfTwo: function(e) {
  43463. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  43464. },
  43465. nextPowerOfTwo: function(e) {
  43466. return e--,
  43467. e |= e >> 1,
  43468. e |= e >> 2,
  43469. e |= e >> 4,
  43470. e |= e >> 8,
  43471. e |= e >> 16,
  43472. e++,
  43473. e
  43474. }
  43475. },
  43476. n.Spline = function(e) {
  43477. function t(e, t, i, n, r, o, a) {
  43478. var s = .5 * (i - e)
  43479. , l = .5 * (n - t);
  43480. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  43481. }
  43482. this.points = e;
  43483. var i, r, o, a, s, l, c, h, u, d = [], p = {
  43484. x: 0,
  43485. y: 0,
  43486. z: 0
  43487. };
  43488. this.initFromArray = function(e) {
  43489. this.points = [];
  43490. for (var t = 0; t < e.length; t++)
  43491. this.points[t] = {
  43492. x: e[t][0],
  43493. y: e[t][1],
  43494. z: e[t][2]
  43495. }
  43496. }
  43497. ,
  43498. this.getPoint = function(e) {
  43499. return i = (this.points.length - 1) * e,
  43500. r = Math.floor(i),
  43501. o = i - r,
  43502. d[0] = 0 === r ? r : r - 1,
  43503. d[1] = r,
  43504. d[2] = r > this.points.length - 2 ? this.points.length - 1 : r + 1,
  43505. d[3] = r > this.points.length - 3 ? this.points.length - 1 : r + 2,
  43506. l = this.points[d[0]],
  43507. c = this.points[d[1]],
  43508. h = this.points[d[2]],
  43509. u = this.points[d[3]],
  43510. a = o * o,
  43511. s = o * a,
  43512. p.x = t(l.x, c.x, h.x, u.x, o, a, s),
  43513. p.y = t(l.y, c.y, h.y, u.y, o, a, s),
  43514. p.z = t(l.z, c.z, h.z, u.z, o, a, s),
  43515. p
  43516. }
  43517. ,
  43518. this.getControlPointsArray = function() {
  43519. var e, t, i = this.points.length, n = [];
  43520. for (e = 0; e < i; e++)
  43521. t = this.points[e],
  43522. n[e] = [t.x, t.y, t.z];
  43523. return n
  43524. }
  43525. ,
  43526. this.getLength = function(e) {
  43527. var t, i, r, o, a = 0, s = 0, l = 0, c = new n.Vector3, h = new n.Vector3, u = [], d = 0;
  43528. for (u[0] = 0,
  43529. e || (e = 100),
  43530. r = this.points.length * e,
  43531. c.copy(this.points[0]),
  43532. t = 1; t < r; t++)
  43533. i = t / r,
  43534. o = this.getPoint(i),
  43535. h.copy(o),
  43536. d += h.distanceTo(c),
  43537. c.copy(o),
  43538. a = (this.points.length - 1) * i,
  43539. s = Math.floor(a),
  43540. s !== l && (u[s] = d,
  43541. l = s);
  43542. return u[u.length] = d,
  43543. {
  43544. chunks: u,
  43545. total: d
  43546. }
  43547. }
  43548. ,
  43549. this.reparametrizeByArcLength = function(e) {
  43550. var t, i, r, o, a, s, l, c, h = [], u = new n.Vector3, d = this.getLength();
  43551. for (h.push(u.copy(this.points[0]).clone()),
  43552. t = 1; t < this.points.length; t++) {
  43553. for (s = d.chunks[t] - d.chunks[t - 1],
  43554. l = Math.ceil(e * s / d.total),
  43555. o = (t - 1) / (this.points.length - 1),
  43556. a = t / (this.points.length - 1),
  43557. i = 1; i < l - 1; i++)
  43558. r = o + i * (1 / l) * (a - o),
  43559. c = this.getPoint(r),
  43560. h.push(u.copy(c).clone());
  43561. h.push(u.copy(this.points[t]).clone())
  43562. }
  43563. this.points = h
  43564. }
  43565. }
  43566. ,
  43567. n.Triangle = function(e, t, i) {
  43568. this.a = void 0 !== e ? e : new n.Vector3,
  43569. this.b = void 0 !== t ? t : new n.Vector3,
  43570. this.c = void 0 !== i ? i : new n.Vector3
  43571. }
  43572. ,
  43573. n.Triangle.normal = function() {
  43574. var e = new n.Vector3;
  43575. return function(t, i, r, o) {
  43576. var a = o || new n.Vector3;
  43577. a.subVectors(r, i),
  43578. e.subVectors(t, i),
  43579. a.cross(e);
  43580. var s = a.lengthSq();
  43581. return s > 0 ? a.multiplyScalar(1 / Math.sqrt(s)) : a.set(0, 0, 0)
  43582. }
  43583. }(),
  43584. n.Triangle.barycoordFromPoint = function() {
  43585. var e = new n.Vector3
  43586. , t = new n.Vector3
  43587. , i = new n.Vector3;
  43588. return function(r, o, a, s, l) {
  43589. e.subVectors(s, o),
  43590. t.subVectors(a, o),
  43591. i.subVectors(r, o);
  43592. var c = e.dot(e)
  43593. , h = e.dot(t)
  43594. , u = e.dot(i)
  43595. , d = t.dot(t)
  43596. , p = t.dot(i)
  43597. , f = c * d - h * h
  43598. , g = l || new n.Vector3;
  43599. if (0 === f)
  43600. return g.set(-2, -1, -1);
  43601. var m = 1 / f
  43602. , v = (d * u - h * p) * m
  43603. , A = (c * p - h * u) * m;
  43604. return g.set(1 - v - A, A, v)
  43605. }
  43606. }(),
  43607. n.Triangle.containsPoint = function() {
  43608. var e = new n.Vector3;
  43609. return function(t, i, r, o) {
  43610. var a = n.Triangle.barycoordFromPoint(t, i, r, o, e);
  43611. return a.x >= 0 && a.y >= 0 && a.x + a.y <= 1
  43612. }
  43613. }(),
  43614. n.Triangle.prototype = {
  43615. constructor: n.Triangle,
  43616. set: function(e, t, i) {
  43617. return this.a.copy(e),
  43618. this.b.copy(t),
  43619. this.c.copy(i),
  43620. this
  43621. },
  43622. setFromPointsAndIndices: function(e, t, i, n) {
  43623. return this.a.copy(e[t]),
  43624. this.b.copy(e[i]),
  43625. this.c.copy(e[n]),
  43626. this
  43627. },
  43628. clone: function() {
  43629. return (new this.constructor).copy(this)
  43630. },
  43631. copy: function(e) {
  43632. return this.a.copy(e.a),
  43633. this.b.copy(e.b),
  43634. this.c.copy(e.c),
  43635. this
  43636. },
  43637. area: function() {
  43638. var e = new n.Vector3
  43639. , t = new n.Vector3;
  43640. return function() {
  43641. return e.subVectors(this.c, this.b),
  43642. t.subVectors(this.a, this.b),
  43643. .5 * e.cross(t).length()
  43644. }
  43645. }(),
  43646. midpoint: function(e) {
  43647. var t = e || new n.Vector3;
  43648. return t.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  43649. },
  43650. normal: function(e) {
  43651. return n.Triangle.normal(this.a, this.b, this.c, e)
  43652. },
  43653. plane: function(e) {
  43654. var t = e || new n.Plane;
  43655. return t.setFromCoplanarPoints(this.a, this.b, this.c)
  43656. },
  43657. barycoordFromPoint: function(e, t) {
  43658. return n.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  43659. },
  43660. containsPoint: function(e) {
  43661. return n.Triangle.containsPoint(e, this.a, this.b, this.c)
  43662. },
  43663. equals: function(e) {
  43664. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  43665. }
  43666. },
  43667. n.Interpolant = function(e, t, i, n) {
  43668. this.parameterPositions = e,
  43669. this._cachedIndex = 0,
  43670. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  43671. this.sampleValues = t,
  43672. this.valueSize = i
  43673. }
  43674. ,
  43675. n.Interpolant.prototype = {
  43676. constructor: n.Interpolant,
  43677. evaluate: function(e) {
  43678. var t = this.parameterPositions
  43679. , i = this._cachedIndex
  43680. , n = t[i]
  43681. , r = t[i - 1];
  43682. e: {
  43683. t: {
  43684. var o;
  43685. i: {
  43686. n: if (!(e < n)) {
  43687. for (var a = i + 2; ; ) {
  43688. if (void 0 === n) {
  43689. if (e < r)
  43690. break n;
  43691. return i = t.length,
  43692. this._cachedIndex = i,
  43693. this.afterEnd_(i - 1, e, r)
  43694. }
  43695. if (i === a)
  43696. break;
  43697. if (r = n,
  43698. n = t[++i],
  43699. e < n)
  43700. break t
  43701. }
  43702. o = t.length;
  43703. break i
  43704. }
  43705. {
  43706. if (e >= r)
  43707. break e;
  43708. var s = t[1];
  43709. e < s && (i = 2,
  43710. r = s);
  43711. for (var a = i - 2; ; ) {
  43712. if (void 0 === r)
  43713. return this._cachedIndex = 0,
  43714. this.beforeStart_(0, e, n);
  43715. if (i === a)
  43716. break;
  43717. if (n = r,
  43718. r = t[--i - 1],
  43719. e >= r)
  43720. break t
  43721. }
  43722. o = i,
  43723. i = 0
  43724. }
  43725. }
  43726. for (; i < o; ) {
  43727. var l = i + o >>> 1;
  43728. e < t[l] ? o = l : i = l + 1
  43729. }
  43730. if (n = t[i],
  43731. r = t[i - 1],
  43732. void 0 === r)
  43733. return this._cachedIndex = 0,
  43734. this.beforeStart_(0, e, n);
  43735. if (void 0 === n)
  43736. return i = t.length,
  43737. this._cachedIndex = i,
  43738. this.afterEnd_(i - 1, r, e)
  43739. }
  43740. this._cachedIndex = i,
  43741. this.intervalChanged_(i, r, n)
  43742. }
  43743. return this.interpolate_(i, r, e, n)
  43744. },
  43745. settings: null,
  43746. DefaultSettings_: {},
  43747. getSettings_: function() {
  43748. return this.settings || this.DefaultSettings_
  43749. },
  43750. copySampleValue_: function(e) {
  43751. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  43752. t[o] = i[r + o];
  43753. return t
  43754. },
  43755. interpolate_: function(e, t, i, n) {
  43756. throw new Error("call to abstract method")
  43757. },
  43758. intervalChanged_: function(e, t, i) {}
  43759. },
  43760. Object.assign(n.Interpolant.prototype, {
  43761. beforeStart_: n.Interpolant.prototype.copySampleValue_,
  43762. afterEnd_: n.Interpolant.prototype.copySampleValue_
  43763. }),
  43764. n.CubicInterpolant = function(e, t, i, r) {
  43765. n.Interpolant.call(this, e, t, i, r),
  43766. this._weightPrev = -0,
  43767. this._offsetPrev = -0,
  43768. this._weightNext = -0,
  43769. this._offsetNext = -0
  43770. }
  43771. ,
  43772. n.CubicInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43773. constructor: n.CubicInterpolant,
  43774. DefaultSettings_: {
  43775. endingStart: n.ZeroCurvatureEnding,
  43776. endingEnd: n.ZeroCurvatureEnding
  43777. },
  43778. intervalChanged_: function(e, t, i) {
  43779. var r = this.parameterPositions
  43780. , o = e - 2
  43781. , a = e + 1
  43782. , s = r[o]
  43783. , l = r[a];
  43784. if (void 0 === s)
  43785. switch (this.getSettings_().endingStart) {
  43786. case n.ZeroSlopeEnding:
  43787. o = e,
  43788. s = 2 * t - i;
  43789. break;
  43790. case n.WrapAroundEnding:
  43791. o = r.length - 2,
  43792. s = t + r[o] - r[o + 1];
  43793. break;
  43794. default:
  43795. o = e,
  43796. s = i
  43797. }
  43798. if (void 0 === l)
  43799. switch (this.getSettings_().endingEnd) {
  43800. case n.ZeroSlopeEnding:
  43801. a = e,
  43802. l = 2 * i - t;
  43803. break;
  43804. case n.WrapAroundEnding:
  43805. a = 1,
  43806. l = i + r[1] - r[0];
  43807. break;
  43808. default:
  43809. a = e - 1,
  43810. l = t
  43811. }
  43812. var c = .5 * (i - t)
  43813. , h = this.valueSize;
  43814. this._weightPrev = c / (t - s),
  43815. this._weightNext = c / (l - i),
  43816. this._offsetPrev = o * h,
  43817. this._offsetNext = a * h
  43818. },
  43819. interpolate_: function(e, t, i, n) {
  43820. 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)
  43821. r[C] = m * o[c + C] + v * o[l + C] + A * o[s + C] + y * o[h + C];
  43822. return r
  43823. }
  43824. }),
  43825. n.DiscreteInterpolant = function(e, t, i, r) {
  43826. n.Interpolant.call(this, e, t, i, r)
  43827. }
  43828. ,
  43829. n.DiscreteInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43830. constructor: n.DiscreteInterpolant,
  43831. interpolate_: function(e, t, i, n) {
  43832. return this.copySampleValue_(e - 1)
  43833. }
  43834. }),
  43835. n.LinearInterpolant = function(e, t, i, r) {
  43836. n.Interpolant.call(this, e, t, i, r)
  43837. }
  43838. ,
  43839. n.LinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43840. constructor: n.LinearInterpolant,
  43841. interpolate_: function(e, t, i, n) {
  43842. 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)
  43843. r[u] = o[l + u] * h + o[s + u] * c;
  43844. return r
  43845. }
  43846. }),
  43847. n.QuaternionLinearInterpolant = function(e, t, i, r) {
  43848. n.Interpolant.call(this, e, t, i, r)
  43849. }
  43850. ,
  43851. n.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43852. constructor: n.QuaternionLinearInterpolant,
  43853. interpolate_: function(e, t, i, r) {
  43854. 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)
  43855. n.Quaternion.slerpFlat(o, 0, a, l - s, a, l, c);
  43856. return o
  43857. }
  43858. }),
  43859. n.Clock = function(e) {
  43860. this.autoStart = void 0 === e || e,
  43861. this.startTime = 0,
  43862. this.oldTime = 0,
  43863. this.elapsedTime = 0,
  43864. this.running = !1
  43865. }
  43866. ,
  43867. n.Clock.prototype = {
  43868. constructor: n.Clock,
  43869. start: function() {
  43870. this.startTime = performance.now(),
  43871. this.oldTime = this.startTime,
  43872. this.running = !0
  43873. },
  43874. stop: function() {
  43875. this.getElapsedTime(),
  43876. this.running = !1
  43877. },
  43878. getElapsedTime: function() {
  43879. return this.getDelta(),
  43880. this.elapsedTime
  43881. },
  43882. getDelta: function() {
  43883. var e = 0;
  43884. if (this.autoStart && !this.running && this.start(),
  43885. this.running) {
  43886. var t = performance.now();
  43887. e = .001 * (t - this.oldTime),
  43888. this.oldTime = t,
  43889. this.elapsedTime += e
  43890. }
  43891. return e
  43892. }
  43893. },
  43894. n.EventDispatcher = function() {}
  43895. ,
  43896. n.EventDispatcher.prototype = {
  43897. constructor: n.EventDispatcher,
  43898. apply: function(e) {
  43899. e.addEventListener = n.EventDispatcher.prototype.addEventListener,
  43900. e.hasEventListener = n.EventDispatcher.prototype.hasEventListener,
  43901. e.removeEventListener = n.EventDispatcher.prototype.removeEventListener,
  43902. e.dispatchEvent = n.EventDispatcher.prototype.dispatchEvent
  43903. },
  43904. addEventListener: function(e, t) {
  43905. void 0 === this._listeners && (this._listeners = {});
  43906. var i = this._listeners;
  43907. void 0 === i[e] && (i[e] = []),
  43908. i[e].indexOf(t) === -1 && i[e].push(t)
  43909. },
  43910. hasEventListener: function(e, t) {
  43911. if (void 0 === this._listeners)
  43912. return !1;
  43913. var i = this._listeners;
  43914. return void 0 !== i[e] && i[e].indexOf(t) !== -1
  43915. },
  43916. removeEventListener: function(e, t) {
  43917. if (void 0 !== this._listeners) {
  43918. var i = this._listeners
  43919. , n = i[e];
  43920. if (void 0 !== n) {
  43921. var r = n.indexOf(t);
  43922. r !== -1 && n.splice(r, 1)
  43923. }
  43924. }
  43925. },
  43926. dispatchEvent: function(e) {
  43927. if (void 0 !== this._listeners) {
  43928. var t = this._listeners
  43929. , i = t[e.type];
  43930. if (void 0 !== i) {
  43931. e.target = this;
  43932. for (var n = [], r = i.length, o = 0; o < r; o++)
  43933. n[o] = i[o];
  43934. for (var o = 0; o < r; o++)
  43935. n[o].call(this, e)
  43936. }
  43937. }
  43938. }
  43939. },
  43940. n.Layers = function() {
  43941. this.mask = 1
  43942. }
  43943. ,
  43944. n.Layers.prototype = {
  43945. constructor: n.Layers,
  43946. set: function(e) {
  43947. this.mask = 1 << e
  43948. },
  43949. enable: function(e) {
  43950. this.mask |= 1 << e
  43951. },
  43952. toggle: function(e) {
  43953. this.mask ^= 1 << e
  43954. },
  43955. disable: function(e) {
  43956. this.mask &= ~(1 << e)
  43957. },
  43958. test: function(e) {
  43959. return 0 !== (this.mask & e.mask)
  43960. }
  43961. },
  43962. function(e) {
  43963. function t(e, t) {
  43964. return e.distance - t.distance
  43965. }
  43966. function i(e, t, n, r) {
  43967. if (e.visible !== !1 && (e.raycast(t, n),
  43968. r === !0))
  43969. for (var o = e.children, a = 0, s = o.length; a < s; a++)
  43970. i(o[a], t, n, !0)
  43971. }
  43972. e.Raycaster = function(t, i, n, r) {
  43973. this.ray = new e.Ray(t,i),
  43974. this.near = n || 0,
  43975. this.far = r || 1 / 0,
  43976. this.params = {
  43977. Mesh: {},
  43978. Line: {},
  43979. LOD: {},
  43980. Points: {
  43981. threshold: 1
  43982. },
  43983. Sprite: {}
  43984. },
  43985. Object.defineProperties(this.params, {
  43986. PointCloud: {
  43987. get: function() {
  43988. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  43989. this.Points
  43990. }
  43991. }
  43992. })
  43993. }
  43994. ,
  43995. e.Raycaster.prototype = {
  43996. constructor: e.Raycaster,
  43997. linePrecision: 1,
  43998. set: function(e, t) {
  43999. this.ray.set(e, t)
  44000. },
  44001. setFromCamera: function(t, i) {
  44002. i instanceof e.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(i.matrixWorld),
  44003. 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),
  44004. this.ray.direction.set(0, 0, -1).transformDirection(i.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  44005. },
  44006. intersectObject: function(e, n) {
  44007. var r = [];
  44008. return i(e, this, r, n),
  44009. r.sort(t),
  44010. r
  44011. },
  44012. intersectObjects: function(e, n) {
  44013. var r = [];
  44014. if (Array.isArray(e) === !1)
  44015. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  44016. r;
  44017. for (var o = 0, a = e.length; o < a; o++)
  44018. i(e[o], this, r, n);
  44019. return r.sort(t),
  44020. r
  44021. }
  44022. }
  44023. }(n),
  44024. n.Object3D = function() {
  44025. function e() {
  44026. o.setFromEuler(r, !1)
  44027. }
  44028. function t() {
  44029. r.setFromQuaternion(o, void 0, !1)
  44030. }
  44031. Object.defineProperty(this, "id", {
  44032. value: n.Object3DIdCount++
  44033. }),
  44034. this.uuid = n.Math.generateUUID(),
  44035. this.name = "",
  44036. this.type = "Object3D",
  44037. this.parent = null,
  44038. this.children = [],
  44039. this.up = n.Object3D.DefaultUp.clone();
  44040. var i = new n.Vector3
  44041. , r = new n.Euler
  44042. , o = new n.Quaternion
  44043. , a = new n.Vector3(1,1,1);
  44044. r.onChange(e),
  44045. o.onChange(t),
  44046. Object.defineProperties(this, {
  44047. position: {
  44048. enumerable: !0,
  44049. value: i
  44050. },
  44051. rotation: {
  44052. enumerable: !0,
  44053. value: r
  44054. },
  44055. quaternion: {
  44056. enumerable: !0,
  44057. value: o
  44058. },
  44059. scale: {
  44060. enumerable: !0,
  44061. value: a
  44062. },
  44063. modelViewMatrix: {
  44064. value: new n.Matrix4
  44065. },
  44066. normalMatrix: {
  44067. value: new n.Matrix3
  44068. }
  44069. }),
  44070. this.rotationAutoUpdate = !0,
  44071. this.matrix = new n.Matrix4,
  44072. this.matrixWorld = new n.Matrix4,
  44073. this.matrixAutoUpdate = n.Object3D.DefaultMatrixAutoUpdate,
  44074. this.matrixWorldNeedsUpdate = !1,
  44075. this.layers = new n.Layers,
  44076. this.visible = !0,
  44077. this.castShadow = !1,
  44078. this.receiveShadow = !1,
  44079. this.frustumCulled = !0,
  44080. this.renderOrder = 0,
  44081. this.userData = {}
  44082. }
  44083. ,
  44084. n.Object3D.DefaultUp = new n.Vector3(0,1,0),
  44085. n.Object3D.DefaultMatrixAutoUpdate = !0,
  44086. n.Object3D.prototype = {
  44087. constructor: n.Object3D,
  44088. applyMatrix: function(e) {
  44089. this.matrix.multiplyMatrices(e, this.matrix),
  44090. this.matrix.decompose(this.position, this.quaternion, this.scale)
  44091. },
  44092. setRotationFromAxisAngle: function(e, t) {
  44093. this.quaternion.setFromAxisAngle(e, t)
  44094. },
  44095. setRotationFromEuler: function(e) {
  44096. this.quaternion.setFromEuler(e, !0)
  44097. },
  44098. setRotationFromMatrix: function(e) {
  44099. this.quaternion.setFromRotationMatrix(e)
  44100. },
  44101. setRotationFromQuaternion: function(e) {
  44102. this.quaternion.copy(e)
  44103. },
  44104. rotateOnAxis: function() {
  44105. var e = new n.Quaternion;
  44106. return function(t, i) {
  44107. return e.setFromAxisAngle(t, i),
  44108. this.quaternion.multiply(e),
  44109. this
  44110. }
  44111. }(),
  44112. rotateX: function() {
  44113. var e = new n.Vector3(1,0,0);
  44114. return function(t) {
  44115. return this.rotateOnAxis(e, t)
  44116. }
  44117. }(),
  44118. rotateY: function() {
  44119. var e = new n.Vector3(0,1,0);
  44120. return function(t) {
  44121. return this.rotateOnAxis(e, t)
  44122. }
  44123. }(),
  44124. rotateZ: function() {
  44125. var e = new n.Vector3(0,0,1);
  44126. return function(t) {
  44127. return this.rotateOnAxis(e, t)
  44128. }
  44129. }(),
  44130. translateOnAxis: function() {
  44131. var e = new n.Vector3;
  44132. return function(t, i) {
  44133. return e.copy(t).applyQuaternion(this.quaternion),
  44134. this.position.add(e.multiplyScalar(i)),
  44135. this
  44136. }
  44137. }(),
  44138. translateX: function() {
  44139. var e = new n.Vector3(1,0,0);
  44140. return function(t) {
  44141. return this.translateOnAxis(e, t)
  44142. }
  44143. }(),
  44144. translateY: function() {
  44145. var e = new n.Vector3(0,1,0);
  44146. return function(t) {
  44147. return this.translateOnAxis(e, t)
  44148. }
  44149. }(),
  44150. translateZ: function() {
  44151. var e = new n.Vector3(0,0,1);
  44152. return function(t) {
  44153. return this.translateOnAxis(e, t)
  44154. }
  44155. }(),
  44156. localToWorld: function(e) {
  44157. return e.applyMatrix4(this.matrixWorld)
  44158. },
  44159. worldToLocal: function() {
  44160. var e = new n.Matrix4;
  44161. return function(t) {
  44162. return t.applyMatrix4(e.getInverse(this.matrixWorld))
  44163. }
  44164. }(),
  44165. lookAt: function() {
  44166. var e = new n.Matrix4;
  44167. return function(t) {
  44168. e.lookAt(t, this.position, this.up),
  44169. this.quaternion.setFromRotationMatrix(e)
  44170. }
  44171. }(),
  44172. add: function(e) {
  44173. if (arguments.length > 1) {
  44174. for (var t = 0; t < arguments.length; t++)
  44175. this.add(arguments[t]);
  44176. return this
  44177. }
  44178. return e === this ? (console.error("THREE.Object3D.add: object can't be added as a child of itself.", e),
  44179. this) : (e instanceof n.Object3D ? (null !== e.parent && e.parent.remove(e),
  44180. e.parent = this,
  44181. e.dispatchEvent({
  44182. type: "added"
  44183. }),
  44184. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  44185. this)
  44186. },
  44187. remove: function(e) {
  44188. if (arguments.length > 1)
  44189. for (var t = 0; t < arguments.length; t++)
  44190. this.remove(arguments[t]);
  44191. var i = this.children.indexOf(e);
  44192. i !== -1 && (e.parent = null,
  44193. e.dispatchEvent({
  44194. type: "removed"
  44195. }),
  44196. this.children.splice(i, 1))
  44197. },
  44198. getObjectById: function(e) {
  44199. return this.getObjectByProperty("id", e)
  44200. },
  44201. getObjectByName: function(e) {
  44202. return this.getObjectByProperty("name", e)
  44203. },
  44204. getObjectByProperty: function(e, t) {
  44205. if (this[e] === t)
  44206. return this;
  44207. for (var i = 0, n = this.children.length; i < n; i++) {
  44208. var r = this.children[i]
  44209. , o = r.getObjectByProperty(e, t);
  44210. if (void 0 !== o)
  44211. return o
  44212. }
  44213. },
  44214. getWorldPosition: function(e) {
  44215. var t = e || new n.Vector3;
  44216. return this.updateMatrixWorld(!0),
  44217. t.setFromMatrixPosition(this.matrixWorld)
  44218. },
  44219. getWorldQuaternion: function() {
  44220. var e = new n.Vector3
  44221. , t = new n.Vector3;
  44222. return function(i) {
  44223. var r = i || new n.Quaternion;
  44224. return this.updateMatrixWorld(!0),
  44225. this.matrixWorld.decompose(e, r, t),
  44226. r
  44227. }
  44228. }(),
  44229. getWorldRotation: function() {
  44230. var e = new n.Quaternion;
  44231. return function(t) {
  44232. var i = t || new n.Euler;
  44233. return this.getWorldQuaternion(e),
  44234. i.setFromQuaternion(e, this.rotation.order, !1)
  44235. }
  44236. }(),
  44237. getWorldScale: function() {
  44238. var e = new n.Vector3
  44239. , t = new n.Quaternion;
  44240. return function(i) {
  44241. var r = i || new n.Vector3;
  44242. return this.updateMatrixWorld(!0),
  44243. this.matrixWorld.decompose(e, t, r),
  44244. r
  44245. }
  44246. }(),
  44247. getWorldDirection: function() {
  44248. var e = new n.Quaternion;
  44249. return function(t) {
  44250. var i = t || new n.Vector3;
  44251. return this.getWorldQuaternion(e),
  44252. i.set(0, 0, 1).applyQuaternion(e)
  44253. }
  44254. }(),
  44255. raycast: function() {},
  44256. traverse: function(e) {
  44257. e(this);
  44258. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  44259. t[i].traverse(e)
  44260. },
  44261. traverseVisible: function(e) {
  44262. if (this.visible !== !1) {
  44263. e(this);
  44264. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  44265. t[i].traverseVisible(e)
  44266. }
  44267. },
  44268. traverseAncestors: function(e) {
  44269. var t = this.parent;
  44270. null !== t && (e(t),
  44271. t.traverseAncestors(e))
  44272. },
  44273. updateMatrix: function() {
  44274. this.matrix.compose(this.position, this.quaternion, this.scale),
  44275. this.matrixWorldNeedsUpdate = !0
  44276. },
  44277. updateMatrixWorld: function(e) {
  44278. this.matrixAutoUpdate === !0 && this.updateMatrix(),
  44279. this.matrixWorldNeedsUpdate !== !0 && e !== !0 || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  44280. this.matrixWorldNeedsUpdate = !1,
  44281. e = !0);
  44282. for (var t = 0, i = this.children.length; t < i; t++)
  44283. this.children[t].updateMatrixWorld(e)
  44284. },
  44285. toJSON: function(e) {
  44286. function t(e) {
  44287. var t = [];
  44288. for (var i in e) {
  44289. var n = e[i];
  44290. delete n.metadata,
  44291. t.push(n)
  44292. }
  44293. return t
  44294. }
  44295. var i = void 0 === e
  44296. , n = {};
  44297. i && (e = {
  44298. geometries: {},
  44299. materials: {},
  44300. textures: {},
  44301. images: {}
  44302. },
  44303. n.metadata = {
  44304. version: 4.4,
  44305. type: "Object",
  44306. generator: "Object3D.toJSON"
  44307. });
  44308. var r = {};
  44309. if (r.uuid = this.uuid,
  44310. r.type = this.type,
  44311. "" !== this.name && (r.name = this.name),
  44312. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  44313. this.castShadow === !0 && (r.castShadow = !0),
  44314. this.receiveShadow === !0 && (r.receiveShadow = !0),
  44315. this.visible === !1 && (r.visible = !1),
  44316. r.matrix = this.matrix.toArray(),
  44317. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  44318. r.geometry = this.geometry.uuid),
  44319. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  44320. r.material = this.material.uuid),
  44321. this.children.length > 0) {
  44322. r.children = [];
  44323. for (var o = 0; o < this.children.length; o++)
  44324. r.children.push(this.children[o].toJSON(e).object)
  44325. }
  44326. if (i) {
  44327. var a = t(e.geometries)
  44328. , s = t(e.materials)
  44329. , l = t(e.textures)
  44330. , c = t(e.images);
  44331. a.length > 0 && (n.geometries = a),
  44332. s.length > 0 && (n.materials = s),
  44333. l.length > 0 && (n.textures = l),
  44334. c.length > 0 && (n.images = c)
  44335. }
  44336. return n.object = r,
  44337. n
  44338. },
  44339. clone: function(e) {
  44340. return (new this.constructor).copy(this, e)
  44341. },
  44342. copy: function(e, t) {
  44343. if (void 0 === t && (t = !0),
  44344. this.name = e.name,
  44345. this.up.copy(e.up),
  44346. this.position.copy(e.position),
  44347. this.quaternion.copy(e.quaternion),
  44348. this.scale.copy(e.scale),
  44349. this.rotationAutoUpdate = e.rotationAutoUpdate,
  44350. this.matrix.copy(e.matrix),
  44351. this.matrixWorld.copy(e.matrixWorld),
  44352. this.matrixAutoUpdate = e.matrixAutoUpdate,
  44353. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  44354. this.visible = e.visible,
  44355. this.castShadow = e.castShadow,
  44356. this.receiveShadow = e.receiveShadow,
  44357. this.frustumCulled = e.frustumCulled,
  44358. this.renderOrder = e.renderOrder,
  44359. this.userData = JSON.parse(JSON.stringify(e.userData)),
  44360. t === !0)
  44361. for (var i = 0; i < e.children.length; i++) {
  44362. var n = e.children[i];
  44363. this.add(n.clone())
  44364. }
  44365. return this
  44366. }
  44367. },
  44368. n.EventDispatcher.prototype.apply(n.Object3D.prototype),
  44369. n.Object3DIdCount = 0,
  44370. n.Face3 = function(e, t, i, r, o, a) {
  44371. this.a = e,
  44372. this.b = t,
  44373. this.c = i,
  44374. this.normal = r instanceof n.Vector3 ? r : new n.Vector3,
  44375. this.vertexNormals = Array.isArray(r) ? r : [],
  44376. this.color = o instanceof n.Color ? o : new n.Color,
  44377. this.vertexColors = Array.isArray(o) ? o : [],
  44378. this.materialIndex = void 0 !== a ? a : 0
  44379. }
  44380. ,
  44381. n.Face3.prototype = {
  44382. constructor: n.Face3,
  44383. clone: function() {
  44384. return (new this.constructor).copy(this)
  44385. },
  44386. copy: function(e) {
  44387. this.a = e.a,
  44388. this.b = e.b,
  44389. this.c = e.c,
  44390. this.normal.copy(e.normal),
  44391. this.color.copy(e.color),
  44392. this.materialIndex = e.materialIndex;
  44393. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  44394. this.vertexNormals[t] = e.vertexNormals[t].clone();
  44395. for (var t = 0, i = e.vertexColors.length; t < i; t++)
  44396. this.vertexColors[t] = e.vertexColors[t].clone();
  44397. return this
  44398. }
  44399. },
  44400. n.BufferAttribute = function(e, t) {
  44401. this.uuid = n.Math.generateUUID(),
  44402. this.array = e,
  44403. this.itemSize = t,
  44404. this.dynamic = !1,
  44405. this.updateRange = {
  44406. offset: 0,
  44407. count: -1
  44408. },
  44409. this.version = 0
  44410. }
  44411. ,
  44412. n.BufferAttribute.prototype = {
  44413. constructor: n.BufferAttribute,
  44414. get count() {
  44415. return this.array.length / this.itemSize
  44416. },
  44417. set needsUpdate(e) {
  44418. e === !0 && this.version++
  44419. },
  44420. setDynamic: function(e) {
  44421. return this.dynamic = e,
  44422. this
  44423. },
  44424. copy: function(e) {
  44425. return this.array = new e.array.constructor(e.array),
  44426. this.itemSize = e.itemSize,
  44427. this.dynamic = e.dynamic,
  44428. this
  44429. },
  44430. copyAt: function(e, t, i) {
  44431. e *= this.itemSize,
  44432. i *= t.itemSize;
  44433. for (var n = 0, r = this.itemSize; n < r; n++)
  44434. this.array[e + n] = t.array[i + n];
  44435. return this
  44436. },
  44437. copyArray: function(e) {
  44438. return this.array.set(e),
  44439. this
  44440. },
  44441. copyColorsArray: function(e) {
  44442. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  44443. var a = e[r];
  44444. void 0 === a && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", r),
  44445. a = new n.Color),
  44446. t[i++] = a.r,
  44447. t[i++] = a.g,
  44448. t[i++] = a.b
  44449. }
  44450. return this
  44451. },
  44452. copyIndicesArray: function(e) {
  44453. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  44454. var o = e[n];
  44455. t[i++] = o.a,
  44456. t[i++] = o.b,
  44457. t[i++] = o.c
  44458. }
  44459. return this
  44460. },
  44461. copyVector2sArray: function(e) {
  44462. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  44463. var a = e[r];
  44464. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", r),
  44465. a = new n.Vector2),
  44466. t[i++] = a.x,
  44467. t[i++] = a.y
  44468. }
  44469. return this
  44470. },
  44471. copyVector3sArray: function(e) {
  44472. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  44473. var a = e[r];
  44474. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", r),
  44475. a = new n.Vector3),
  44476. t[i++] = a.x,
  44477. t[i++] = a.y,
  44478. t[i++] = a.z
  44479. }
  44480. return this
  44481. },
  44482. copyVector4sArray: function(e) {
  44483. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  44484. var a = e[r];
  44485. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", r),
  44486. a = new n.Vector4),
  44487. t[i++] = a.x,
  44488. t[i++] = a.y,
  44489. t[i++] = a.z,
  44490. t[i++] = a.w
  44491. }
  44492. return this
  44493. },
  44494. set: function(e, t) {
  44495. return void 0 === t && (t = 0),
  44496. this.array.set(e, t),
  44497. this
  44498. },
  44499. getX: function(e) {
  44500. return this.array[e * this.itemSize]
  44501. },
  44502. setX: function(e, t) {
  44503. return this.array[e * this.itemSize] = t,
  44504. this
  44505. },
  44506. getY: function(e) {
  44507. return this.array[e * this.itemSize + 1]
  44508. },
  44509. setY: function(e, t) {
  44510. return this.array[e * this.itemSize + 1] = t,
  44511. this
  44512. },
  44513. getZ: function(e) {
  44514. return this.array[e * this.itemSize + 2]
  44515. },
  44516. setZ: function(e, t) {
  44517. return this.array[e * this.itemSize + 2] = t,
  44518. this
  44519. },
  44520. getW: function(e) {
  44521. return this.array[e * this.itemSize + 3]
  44522. },
  44523. setW: function(e, t) {
  44524. return this.array[e * this.itemSize + 3] = t,
  44525. this
  44526. },
  44527. setXY: function(e, t, i) {
  44528. return e *= this.itemSize,
  44529. this.array[e + 0] = t,
  44530. this.array[e + 1] = i,
  44531. this
  44532. },
  44533. setXYZ: function(e, t, i, n) {
  44534. return e *= this.itemSize,
  44535. this.array[e + 0] = t,
  44536. this.array[e + 1] = i,
  44537. this.array[e + 2] = n,
  44538. this
  44539. },
  44540. setXYZW: function(e, t, i, n, r) {
  44541. return e *= this.itemSize,
  44542. this.array[e + 0] = t,
  44543. this.array[e + 1] = i,
  44544. this.array[e + 2] = n,
  44545. this.array[e + 3] = r,
  44546. this
  44547. },
  44548. clone: function() {
  44549. return (new this.constructor).copy(this)
  44550. }
  44551. },
  44552. n.Int8Attribute = function(e, t) {
  44553. return new n.BufferAttribute(new Int8Array(e),t)
  44554. }
  44555. ,
  44556. n.Uint8Attribute = function(e, t) {
  44557. return new n.BufferAttribute(new Uint8Array(e),t)
  44558. }
  44559. ,
  44560. n.Uint8ClampedAttribute = function(e, t) {
  44561. return new n.BufferAttribute(new Uint8ClampedArray(e),t)
  44562. }
  44563. ,
  44564. n.Int16Attribute = function(e, t) {
  44565. return new n.BufferAttribute(new Int16Array(e),t)
  44566. }
  44567. ,
  44568. n.Uint16Attribute = function(e, t) {
  44569. return new n.BufferAttribute(new Uint16Array(e),t)
  44570. }
  44571. ;
  44572. n.Int32Attribute = function(e, t) {
  44573. return new n.BufferAttribute(new Int32Array(e),t)
  44574. }
  44575. ;
  44576. n.Uint32Attribute = function(e, t) {
  44577. return new n.BufferAttribute(new Uint32Array(e),t)
  44578. }
  44579. ,
  44580. n.Float32Attribute = function(e, t) {
  44581. return new n.BufferAttribute(new Float32Array(e),t)
  44582. }
  44583. ,
  44584. n.Float64Attribute = function(e, t) {
  44585. return new n.BufferAttribute(new Float64Array(e),t)
  44586. }
  44587. ,
  44588. n.DynamicBufferAttribute = function(e, t) {
  44589. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  44590. new n.BufferAttribute(e,t).setDynamic(!0)
  44591. }
  44592. ,
  44593. n.InstancedBufferAttribute = function(e, t, i) {
  44594. n.BufferAttribute.call(this, e, t),
  44595. this.meshPerAttribute = i || 1
  44596. }
  44597. ,
  44598. n.InstancedBufferAttribute.prototype = Object.create(n.BufferAttribute.prototype),
  44599. n.InstancedBufferAttribute.prototype.constructor = n.InstancedBufferAttribute,
  44600. n.InstancedBufferAttribute.prototype.copy = function(e) {
  44601. return n.BufferAttribute.prototype.copy.call(this, e),
  44602. this.meshPerAttribute = e.meshPerAttribute,
  44603. this
  44604. }
  44605. ,
  44606. n.InterleavedBuffer = function(e, t) {
  44607. this.uuid = n.Math.generateUUID(),
  44608. this.array = e,
  44609. this.stride = t,
  44610. this.dynamic = !1,
  44611. this.updateRange = {
  44612. offset: 0,
  44613. count: -1
  44614. },
  44615. this.version = 0
  44616. }
  44617. ,
  44618. n.InterleavedBuffer.prototype = {
  44619. constructor: n.InterleavedBuffer,
  44620. get length() {
  44621. return this.array.length
  44622. },
  44623. get count() {
  44624. return this.array.length / this.stride
  44625. },
  44626. set needsUpdate(e) {
  44627. e === !0 && this.version++
  44628. },
  44629. setDynamic: function(e) {
  44630. return this.dynamic = e,
  44631. this
  44632. },
  44633. copy: function(e) {
  44634. return this.array = new e.array.constructor(e.array),
  44635. this.stride = e.stride,
  44636. this.dynamic = e.dynamic,
  44637. this
  44638. },
  44639. copyAt: function(e, t, i) {
  44640. e *= this.stride,
  44641. i *= t.stride;
  44642. for (var n = 0, r = this.stride; n < r; n++)
  44643. this.array[e + n] = t.array[i + n];
  44644. return this
  44645. },
  44646. set: function(e, t) {
  44647. return void 0 === t && (t = 0),
  44648. this.array.set(e, t),
  44649. this
  44650. },
  44651. clone: function() {
  44652. return (new this.constructor).copy(this)
  44653. }
  44654. },
  44655. n.InstancedInterleavedBuffer = function(e, t, i) {
  44656. n.InterleavedBuffer.call(this, e, t),
  44657. this.meshPerAttribute = i || 1
  44658. }
  44659. ,
  44660. n.InstancedInterleavedBuffer.prototype = Object.create(n.InterleavedBuffer.prototype),
  44661. n.InstancedInterleavedBuffer.prototype.constructor = n.InstancedInterleavedBuffer,
  44662. n.InstancedInterleavedBuffer.prototype.copy = function(e) {
  44663. return n.InterleavedBuffer.prototype.copy.call(this, e),
  44664. this.meshPerAttribute = e.meshPerAttribute,
  44665. this
  44666. }
  44667. ,
  44668. n.InterleavedBufferAttribute = function(e, t, i) {
  44669. this.uuid = n.Math.generateUUID(),
  44670. this.data = e,
  44671. this.itemSize = t,
  44672. this.offset = i
  44673. }
  44674. ,
  44675. n.InterleavedBufferAttribute.prototype = {
  44676. constructor: n.InterleavedBufferAttribute,
  44677. get length() {
  44678. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  44679. this.array.length
  44680. },
  44681. get count() {
  44682. return this.data.count
  44683. },
  44684. setX: function(e, t) {
  44685. return this.data.array[e * this.data.stride + this.offset] = t,
  44686. this
  44687. },
  44688. setY: function(e, t) {
  44689. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  44690. this
  44691. },
  44692. setZ: function(e, t) {
  44693. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  44694. this
  44695. },
  44696. setW: function(e, t) {
  44697. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  44698. this
  44699. },
  44700. getX: function(e) {
  44701. return this.data.array[e * this.data.stride + this.offset]
  44702. },
  44703. getY: function(e) {
  44704. return this.data.array[e * this.data.stride + this.offset + 1]
  44705. },
  44706. getZ: function(e) {
  44707. return this.data.array[e * this.data.stride + this.offset + 2]
  44708. },
  44709. getW: function(e) {
  44710. return this.data.array[e * this.data.stride + this.offset + 3]
  44711. },
  44712. setXY: function(e, t, i) {
  44713. return e = e * this.data.stride + this.offset,
  44714. this.data.array[e + 0] = t,
  44715. this.data.array[e + 1] = i,
  44716. this
  44717. },
  44718. setXYZ: function(e, t, i, n) {
  44719. return e = e * this.data.stride + this.offset,
  44720. this.data.array[e + 0] = t,
  44721. this.data.array[e + 1] = i,
  44722. this.data.array[e + 2] = n,
  44723. this
  44724. },
  44725. setXYZW: function(e, t, i, n, r) {
  44726. return e = e * this.data.stride + this.offset,
  44727. this.data.array[e + 0] = t,
  44728. this.data.array[e + 1] = i,
  44729. this.data.array[e + 2] = n,
  44730. this.data.array[e + 3] = r,
  44731. this
  44732. }
  44733. },
  44734. n.Geometry = function() {
  44735. Object.defineProperty(this, "id", {
  44736. value: n.GeometryIdCount++
  44737. }),
  44738. this.uuid = n.Math.generateUUID(),
  44739. this.name = "",
  44740. this.type = "Geometry",
  44741. this.vertices = [],
  44742. this.colors = [],
  44743. this.faces = [],
  44744. this.faceVertexUvs = [[]],
  44745. this.morphTargets = [],
  44746. this.morphNormals = [],
  44747. this.skinWeights = [],
  44748. this.skinIndices = [],
  44749. this.lineDistances = [],
  44750. this.boundingBox = null,
  44751. this.boundingSphere = null,
  44752. this.verticesNeedUpdate = !1,
  44753. this.elementsNeedUpdate = !1,
  44754. this.uvsNeedUpdate = !1,
  44755. this.normalsNeedUpdate = !1,
  44756. this.colorsNeedUpdate = !1,
  44757. this.lineDistancesNeedUpdate = !1,
  44758. this.groupsNeedUpdate = !1
  44759. }
  44760. ,
  44761. n.Geometry.prototype = {
  44762. constructor: n.Geometry,
  44763. applyMatrix: function(e) {
  44764. for (var t = (new n.Matrix3).getNormalMatrix(e), i = 0, r = this.vertices.length; i < r; i++) {
  44765. var o = this.vertices[i];
  44766. o.applyMatrix4(e)
  44767. }
  44768. for (var i = 0, r = this.faces.length; i < r; i++) {
  44769. var a = this.faces[i];
  44770. a.normal.applyMatrix3(t).normalize();
  44771. for (var s = 0, l = a.vertexNormals.length; s < l; s++)
  44772. a.vertexNormals[s].applyMatrix3(t).normalize()
  44773. }
  44774. return null !== this.boundingBox && this.computeBoundingBox(),
  44775. null !== this.boundingSphere && this.computeBoundingSphere(),
  44776. this.verticesNeedUpdate = !0,
  44777. this.normalsNeedUpdate = !0,
  44778. this
  44779. },
  44780. rotateX: function() {
  44781. var e;
  44782. return function(t) {
  44783. return void 0 === e && (e = new n.Matrix4),
  44784. e.makeRotationX(t),
  44785. this.applyMatrix(e),
  44786. this
  44787. }
  44788. }(),
  44789. rotateY: function() {
  44790. var e;
  44791. return function(t) {
  44792. return void 0 === e && (e = new n.Matrix4),
  44793. e.makeRotationY(t),
  44794. this.applyMatrix(e),
  44795. this
  44796. }
  44797. }(),
  44798. rotateZ: function() {
  44799. var e;
  44800. return function(t) {
  44801. return void 0 === e && (e = new n.Matrix4),
  44802. e.makeRotationZ(t),
  44803. this.applyMatrix(e),
  44804. this
  44805. }
  44806. }(),
  44807. translate: function() {
  44808. var e;
  44809. return function(t, i, r) {
  44810. return void 0 === e && (e = new n.Matrix4),
  44811. e.makeTranslation(t, i, r),
  44812. this.applyMatrix(e),
  44813. this
  44814. }
  44815. }(),
  44816. scale: function() {
  44817. var e;
  44818. return function(t, i, r) {
  44819. return void 0 === e && (e = new n.Matrix4),
  44820. e.makeScale(t, i, r),
  44821. this.applyMatrix(e),
  44822. this
  44823. }
  44824. }(),
  44825. lookAt: function() {
  44826. var e;
  44827. return function(t) {
  44828. void 0 === e && (e = new n.Object3D),
  44829. e.lookAt(t),
  44830. e.updateMatrix(),
  44831. this.applyMatrix(e.matrix)
  44832. }
  44833. }(),
  44834. fromBufferGeometry: function(e) {
  44835. function t(e, t, r, o) {
  44836. var a = void 0 !== s ? [u[e].clone(), u[t].clone(), u[r].clone()] : []
  44837. , f = void 0 !== l ? [i.colors[e].clone(), i.colors[t].clone(), i.colors[r].clone()] : []
  44838. , g = new n.Face3(e,t,r,a,f,o);
  44839. i.faces.push(g),
  44840. void 0 !== c && i.faceVertexUvs[0].push([d[e].clone(), d[t].clone(), d[r].clone()]),
  44841. void 0 !== h && i.faceVertexUvs[1].push([p[e].clone(), p[t].clone(), p[r].clone()])
  44842. }
  44843. var i = this
  44844. , r = null !== e.index ? e.index.array : void 0
  44845. , o = e.attributes
  44846. , a = o.position.array
  44847. , s = void 0 !== o.normal ? o.normal.array : void 0
  44848. , l = void 0 !== o.color ? o.color.array : void 0
  44849. , c = void 0 !== o.uv ? o.uv.array : void 0
  44850. , h = void 0 !== o.uv2 ? o.uv2.array : void 0;
  44851. void 0 !== h && (this.faceVertexUvs[1] = []);
  44852. for (var u = [], d = [], p = [], f = 0, g = 0; f < a.length; f += 3,
  44853. g += 2)
  44854. i.vertices.push(new n.Vector3(a[f],a[f + 1],a[f + 2])),
  44855. void 0 !== s && u.push(new n.Vector3(s[f],s[f + 1],s[f + 2])),
  44856. void 0 !== l && i.colors.push(new n.Color(l[f],l[f + 1],l[f + 2])),
  44857. void 0 !== c && d.push(new n.Vector2(c[g],c[g + 1])),
  44858. void 0 !== h && p.push(new n.Vector2(h[g],h[g + 1]));
  44859. if (void 0 !== r) {
  44860. var m = e.groups;
  44861. if (m.length > 0)
  44862. for (var f = 0; f < m.length; f++)
  44863. for (var v = m[f], A = v.start, y = v.count, g = A, C = A + y; g < C; g += 3)
  44864. t(r[g], r[g + 1], r[g + 2], v.materialIndex);
  44865. else
  44866. for (var f = 0; f < r.length; f += 3)
  44867. t(r[f], r[f + 1], r[f + 2])
  44868. } else
  44869. for (var f = 0; f < a.length / 3; f += 3)
  44870. t(f, f + 1, f + 2);
  44871. return this.computeFaceNormals(),
  44872. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  44873. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  44874. this
  44875. },
  44876. center: function() {
  44877. this.computeBoundingBox();
  44878. var e = this.boundingBox.center().negate();
  44879. return this.translate(e.x, e.y, e.z),
  44880. e
  44881. },
  44882. normalize: function() {
  44883. this.computeBoundingSphere();
  44884. var e = this.boundingSphere.center
  44885. , t = this.boundingSphere.radius
  44886. , i = 0 === t ? 1 : 1 / t
  44887. , r = new n.Matrix4;
  44888. 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),
  44889. this.applyMatrix(r),
  44890. this
  44891. },
  44892. computeFaceNormals: function() {
  44893. for (var e = new n.Vector3, t = new n.Vector3, i = 0, r = this.faces.length; i < r; i++) {
  44894. var o = this.faces[i]
  44895. , a = this.vertices[o.a]
  44896. , s = this.vertices[o.b]
  44897. , l = this.vertices[o.c];
  44898. e.subVectors(l, s),
  44899. t.subVectors(a, s),
  44900. e.cross(t),
  44901. e.normalize(),
  44902. o.normal.copy(e)
  44903. }
  44904. },
  44905. computeVertexNormals: function(e) {
  44906. void 0 === e && (e = !0);
  44907. var t, i, r, o, a, s;
  44908. for (s = new Array(this.vertices.length),
  44909. t = 0,
  44910. i = this.vertices.length; t < i; t++)
  44911. s[t] = new n.Vector3;
  44912. if (e) {
  44913. var l, c, h, u = new n.Vector3, d = new n.Vector3;
  44914. for (r = 0,
  44915. o = this.faces.length; r < o; r++)
  44916. a = this.faces[r],
  44917. l = this.vertices[a.a],
  44918. c = this.vertices[a.b],
  44919. h = this.vertices[a.c],
  44920. u.subVectors(h, c),
  44921. d.subVectors(l, c),
  44922. u.cross(d),
  44923. s[a.a].add(u),
  44924. s[a.b].add(u),
  44925. s[a.c].add(u)
  44926. } else
  44927. for (r = 0,
  44928. o = this.faces.length; r < o; r++)
  44929. a = this.faces[r],
  44930. s[a.a].add(a.normal),
  44931. s[a.b].add(a.normal),
  44932. s[a.c].add(a.normal);
  44933. for (t = 0,
  44934. i = this.vertices.length; t < i; t++)
  44935. s[t].normalize();
  44936. for (r = 0,
  44937. o = this.faces.length; r < o; r++) {
  44938. a = this.faces[r];
  44939. var p = a.vertexNormals;
  44940. 3 === p.length ? (p[0].copy(s[a.a]),
  44941. p[1].copy(s[a.b]),
  44942. p[2].copy(s[a.c])) : (p[0] = s[a.a].clone(),
  44943. p[1] = s[a.b].clone(),
  44944. p[2] = s[a.c].clone())
  44945. }
  44946. this.faces.length > 0 && (this.normalsNeedUpdate = !0)
  44947. },
  44948. computeMorphNormals: function() {
  44949. var e, t, i, r, o;
  44950. for (i = 0,
  44951. r = this.faces.length; i < r; i++)
  44952. for (o = this.faces[i],
  44953. o.__originalFaceNormal ? o.__originalFaceNormal.copy(o.normal) : o.__originalFaceNormal = o.normal.clone(),
  44954. o.__originalVertexNormals || (o.__originalVertexNormals = []),
  44955. e = 0,
  44956. t = o.vertexNormals.length; e < t; e++)
  44957. o.__originalVertexNormals[e] ? o.__originalVertexNormals[e].copy(o.vertexNormals[e]) : o.__originalVertexNormals[e] = o.vertexNormals[e].clone();
  44958. var a = new n.Geometry;
  44959. for (a.faces = this.faces,
  44960. e = 0,
  44961. t = this.morphTargets.length; e < t; e++) {
  44962. if (!this.morphNormals[e]) {
  44963. this.morphNormals[e] = {},
  44964. this.morphNormals[e].faceNormals = [],
  44965. this.morphNormals[e].vertexNormals = [];
  44966. var s, l, c = this.morphNormals[e].faceNormals, h = this.morphNormals[e].vertexNormals;
  44967. for (i = 0,
  44968. r = this.faces.length; i < r; i++)
  44969. s = new n.Vector3,
  44970. l = {
  44971. a: new n.Vector3,
  44972. b: new n.Vector3,
  44973. c: new n.Vector3
  44974. },
  44975. c.push(s),
  44976. h.push(l)
  44977. }
  44978. var u = this.morphNormals[e];
  44979. a.vertices = this.morphTargets[e].vertices,
  44980. a.computeFaceNormals(),
  44981. a.computeVertexNormals();
  44982. var s, l;
  44983. for (i = 0,
  44984. r = this.faces.length; i < r; i++)
  44985. o = this.faces[i],
  44986. s = u.faceNormals[i],
  44987. l = u.vertexNormals[i],
  44988. s.copy(o.normal),
  44989. l.a.copy(o.vertexNormals[0]),
  44990. l.b.copy(o.vertexNormals[1]),
  44991. l.c.copy(o.vertexNormals[2])
  44992. }
  44993. for (i = 0,
  44994. r = this.faces.length; i < r; i++)
  44995. o = this.faces[i],
  44996. o.normal = o.__originalFaceNormal,
  44997. o.vertexNormals = o.__originalVertexNormals
  44998. },
  44999. computeTangents: function() {
  45000. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  45001. },
  45002. computeLineDistances: function() {
  45003. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  45004. i > 0 && (e += t[i].distanceTo(t[i - 1])),
  45005. this.lineDistances[i] = e
  45006. },
  45007. computeBoundingBox: function() {
  45008. null === this.boundingBox && (this.boundingBox = new n.Box3),
  45009. this.boundingBox.setFromPoints(this.vertices)
  45010. },
  45011. computeBoundingSphere: function() {
  45012. null === this.boundingSphere && (this.boundingSphere = new n.Sphere),
  45013. this.boundingSphere.setFromPoints(this.vertices)
  45014. },
  45015. merge: function(e, t, i) {
  45016. if (e instanceof n.Geometry == !1)
  45017. return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e);
  45018. 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];
  45019. void 0 === i && (i = 0),
  45020. void 0 !== t && (r = (new n.Matrix3).getNormalMatrix(t));
  45021. for (var d = 0, p = s.length; d < p; d++) {
  45022. var f = s[d]
  45023. , g = f.clone();
  45024. void 0 !== t && g.applyMatrix4(t),
  45025. a.push(g)
  45026. }
  45027. for (d = 0,
  45028. p = c.length; d < p; d++) {
  45029. var m, v, A, y = c[d], C = y.vertexNormals, I = y.vertexColors;
  45030. m = new n.Face3(y.a + o,y.b + o,y.c + o),
  45031. m.normal.copy(y.normal),
  45032. void 0 !== r && m.normal.applyMatrix3(r).normalize();
  45033. for (var E = 0, b = C.length; E < b; E++)
  45034. v = C[E].clone(),
  45035. void 0 !== r && v.applyMatrix3(r).normalize(),
  45036. m.vertexNormals.push(v);
  45037. m.color.copy(y.color);
  45038. for (var E = 0, b = I.length; E < b; E++)
  45039. A = I[E],
  45040. m.vertexColors.push(A.clone());
  45041. m.materialIndex = y.materialIndex + i,
  45042. l.push(m)
  45043. }
  45044. for (d = 0,
  45045. p = u.length; d < p; d++) {
  45046. var w = u[d]
  45047. , _ = [];
  45048. if (void 0 !== w) {
  45049. for (var E = 0, b = w.length; E < b; E++)
  45050. _.push(w[E].clone());
  45051. h.push(_)
  45052. }
  45053. }
  45054. },
  45055. mergeMesh: function(e) {
  45056. return e instanceof n.Mesh == !1 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  45057. void this.merge(e.geometry, e.matrix))
  45058. },
  45059. mergeVertices: function() {
  45060. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = 4, d = Math.pow(10, u);
  45061. for (i = 0,
  45062. n = this.vertices.length; i < n; i++)
  45063. e = this.vertices[i],
  45064. t = Math.round(e.x * d) + "_" + Math.round(e.y * d) + "_" + Math.round(e.z * d),
  45065. void 0 === l[t] ? (l[t] = i,
  45066. c.push(this.vertices[i]),
  45067. h[i] = c.length - 1) : h[i] = h[l[t]];
  45068. var p = [];
  45069. for (i = 0,
  45070. n = this.faces.length; i < n; i++) {
  45071. r = this.faces[i],
  45072. r.a = h[r.a],
  45073. r.b = h[r.b],
  45074. r.c = h[r.c],
  45075. o = [r.a, r.b, r.c];
  45076. for (var f = -1, g = 0; g < 3; g++)
  45077. if (o[g] === o[(g + 1) % 3]) {
  45078. f = g,
  45079. p.push(i);
  45080. break
  45081. }
  45082. }
  45083. for (i = p.length - 1; i >= 0; i--) {
  45084. var m = p[i];
  45085. for (this.faces.splice(m, 1),
  45086. a = 0,
  45087. s = this.faceVertexUvs.length; a < s; a++)
  45088. this.faceVertexUvs[a].splice(m, 1)
  45089. }
  45090. var v = this.vertices.length - c.length;
  45091. return this.vertices = c,
  45092. v
  45093. },
  45094. sortFacesByMaterialIndex: function() {
  45095. function e(e, t) {
  45096. return e.materialIndex - t.materialIndex
  45097. }
  45098. for (var t = this.faces, i = t.length, n = 0; n < i; n++)
  45099. t[n]._id = n;
  45100. t.sort(e);
  45101. var r, o, a = this.faceVertexUvs[0], s = this.faceVertexUvs[1];
  45102. a && a.length === i && (r = []),
  45103. s && s.length === i && (o = []);
  45104. for (var n = 0; n < i; n++) {
  45105. var l = t[n]._id;
  45106. r && r.push(a[l]),
  45107. o && o.push(s[l])
  45108. }
  45109. r && (this.faceVertexUvs[0] = r),
  45110. o && (this.faceVertexUvs[1] = o)
  45111. },
  45112. toJSON: function() {
  45113. function e(e, t, i) {
  45114. return i ? e | 1 << t : e & ~(1 << t)
  45115. }
  45116. function t(e) {
  45117. var t = e.x.toString() + e.y.toString() + e.z.toString();
  45118. return void 0 !== d[t] ? d[t] : (d[t] = u.length / 3,
  45119. u.push(e.x, e.y, e.z),
  45120. d[t])
  45121. }
  45122. function i(e) {
  45123. var t = e.r.toString() + e.g.toString() + e.b.toString();
  45124. return void 0 !== f[t] ? f[t] : (f[t] = p.length,
  45125. p.push(e.getHex()),
  45126. f[t])
  45127. }
  45128. function n(e) {
  45129. var t = e.x.toString() + e.y.toString();
  45130. return void 0 !== m[t] ? m[t] : (m[t] = g.length / 2,
  45131. g.push(e.x, e.y),
  45132. m[t])
  45133. }
  45134. var r = {
  45135. metadata: {
  45136. version: 4.4,
  45137. type: "Geometry",
  45138. generator: "Geometry.toJSON"
  45139. }
  45140. };
  45141. if (r.uuid = this.uuid,
  45142. r.type = this.type,
  45143. "" !== this.name && (r.name = this.name),
  45144. void 0 !== this.parameters) {
  45145. var o = this.parameters;
  45146. for (var a in o)
  45147. void 0 !== o[a] && (r[a] = o[a]);
  45148. return r
  45149. }
  45150. for (var s = [], l = 0; l < this.vertices.length; l++) {
  45151. var c = this.vertices[l];
  45152. s.push(c.x, c.y, c.z)
  45153. }
  45154. for (var h = [], u = [], d = {}, p = [], f = {}, g = [], m = {}, l = 0; l < this.faces.length; l++) {
  45155. var v = this.faces[l]
  45156. , A = !0
  45157. , y = !1
  45158. , C = void 0 !== this.faceVertexUvs[0][l]
  45159. , I = v.normal.length() > 0
  45160. , E = v.vertexNormals.length > 0
  45161. , b = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  45162. , w = v.vertexColors.length > 0
  45163. , _ = 0;
  45164. if (_ = e(_, 0, 0),
  45165. _ = e(_, 1, A),
  45166. _ = e(_, 2, y),
  45167. _ = e(_, 3, C),
  45168. _ = e(_, 4, I),
  45169. _ = e(_, 5, E),
  45170. _ = e(_, 6, b),
  45171. _ = e(_, 7, w),
  45172. h.push(_),
  45173. h.push(v.a, v.b, v.c),
  45174. h.push(v.materialIndex),
  45175. C) {
  45176. var T = this.faceVertexUvs[0][l];
  45177. h.push(n(T[0]), n(T[1]), n(T[2]))
  45178. }
  45179. if (I && h.push(t(v.normal)),
  45180. E) {
  45181. var x = v.vertexNormals;
  45182. h.push(t(x[0]), t(x[1]), t(x[2]))
  45183. }
  45184. if (b && h.push(i(v.color)),
  45185. w) {
  45186. var S = v.vertexColors;
  45187. h.push(i(S[0]), i(S[1]), i(S[2]))
  45188. }
  45189. }
  45190. return r.data = {},
  45191. r.data.vertices = s,
  45192. r.data.normals = u,
  45193. p.length > 0 && (r.data.colors = p),
  45194. g.length > 0 && (r.data.uvs = [g]),
  45195. r.data.faces = h,
  45196. r
  45197. },
  45198. clone: function() {
  45199. return (new n.Geometry).copy(this)
  45200. },
  45201. copy: function(e) {
  45202. this.vertices = [],
  45203. this.faces = [],
  45204. this.faceVertexUvs = [[]];
  45205. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  45206. this.vertices.push(t[i].clone());
  45207. for (var r = e.faces, i = 0, n = r.length; i < n; i++)
  45208. this.faces.push(r[i].clone());
  45209. for (var i = 0, n = e.faceVertexUvs.length; i < n; i++) {
  45210. var o = e.faceVertexUvs[i];
  45211. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  45212. for (var a = 0, s = o.length; a < s; a++) {
  45213. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  45214. var d = l[h];
  45215. c.push(d.clone())
  45216. }
  45217. this.faceVertexUvs[i].push(c)
  45218. }
  45219. }
  45220. return this
  45221. },
  45222. dispose: function() {
  45223. this.dispatchEvent({
  45224. type: "dispose"
  45225. })
  45226. }
  45227. },
  45228. n.EventDispatcher.prototype.apply(n.Geometry.prototype),
  45229. n.GeometryIdCount = 0,
  45230. n.DirectGeometry = function() {
  45231. Object.defineProperty(this, "id", {
  45232. value: n.GeometryIdCount++
  45233. }),
  45234. this.uuid = n.Math.generateUUID(),
  45235. this.name = "",
  45236. this.type = "DirectGeometry",
  45237. this.indices = [],
  45238. this.vertices = [],
  45239. this.normals = [],
  45240. this.colors = [],
  45241. this.uvs = [],
  45242. this.uvs2 = [],
  45243. this.groups = [],
  45244. this.morphTargets = {},
  45245. this.skinWeights = [],
  45246. this.skinIndices = [],
  45247. this.boundingBox = null,
  45248. this.boundingSphere = null,
  45249. this.verticesNeedUpdate = !1,
  45250. this.normalsNeedUpdate = !1,
  45251. this.colorsNeedUpdate = !1,
  45252. this.uvsNeedUpdate = !1,
  45253. this.groupsNeedUpdate = !1
  45254. }
  45255. ,
  45256. n.DirectGeometry.prototype = {
  45257. constructor: n.DirectGeometry,
  45258. computeBoundingBox: n.Geometry.prototype.computeBoundingBox,
  45259. computeBoundingSphere: n.Geometry.prototype.computeBoundingSphere,
  45260. computeFaceNormals: function() {
  45261. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  45262. },
  45263. computeVertexNormals: function() {
  45264. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  45265. },
  45266. computeGroups: function(e) {
  45267. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  45268. var a = r[o];
  45269. a.materialIndex !== i && (i = a.materialIndex,
  45270. void 0 !== t && (t.count = 3 * o - t.start,
  45271. n.push(t)),
  45272. t = {
  45273. start: 3 * o,
  45274. materialIndex: i
  45275. })
  45276. }
  45277. void 0 !== t && (t.count = 3 * o - t.start,
  45278. n.push(t)),
  45279. this.groups = n
  45280. },
  45281. fromGeometry: function(e) {
  45282. 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;
  45283. if (c > 0) {
  45284. t = [];
  45285. for (var h = 0; h < c; h++)
  45286. t[h] = [];
  45287. this.morphTargets.position = t
  45288. }
  45289. var u, d = e.morphNormals, p = d.length;
  45290. if (p > 0) {
  45291. u = [];
  45292. for (var h = 0; h < p; h++)
  45293. u[h] = [];
  45294. this.morphTargets.normal = u
  45295. }
  45296. for (var f = e.skinIndices, g = e.skinWeights, m = f.length === r.length, v = g.length === r.length, h = 0; h < i.length; h++) {
  45297. var A = i[h];
  45298. this.vertices.push(r[A.a], r[A.b], r[A.c]);
  45299. var y = A.vertexNormals;
  45300. if (3 === y.length)
  45301. this.normals.push(y[0], y[1], y[2]);
  45302. else {
  45303. var C = A.normal;
  45304. this.normals.push(C, C, C)
  45305. }
  45306. var I = A.vertexColors;
  45307. if (3 === I.length)
  45308. this.colors.push(I[0], I[1], I[2]);
  45309. else {
  45310. var E = A.color;
  45311. this.colors.push(E, E, E)
  45312. }
  45313. if (a === !0) {
  45314. var b = o[0][h];
  45315. void 0 !== b ? this.uvs.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", h),
  45316. this.uvs.push(new n.Vector2, new n.Vector2, new n.Vector2))
  45317. }
  45318. if (s === !0) {
  45319. var b = o[1][h];
  45320. void 0 !== b ? this.uvs2.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", h),
  45321. this.uvs2.push(new n.Vector2, new n.Vector2, new n.Vector2))
  45322. }
  45323. for (var w = 0; w < c; w++) {
  45324. var _ = l[w].vertices;
  45325. t[w].push(_[A.a], _[A.b], _[A.c])
  45326. }
  45327. for (var w = 0; w < p; w++) {
  45328. var T = d[w].vertexNormals[h];
  45329. u[w].push(T.a, T.b, T.c)
  45330. }
  45331. m && this.skinIndices.push(f[A.a], f[A.b], f[A.c]),
  45332. v && this.skinWeights.push(g[A.a], g[A.b], g[A.c])
  45333. }
  45334. return this.computeGroups(e),
  45335. this.verticesNeedUpdate = e.verticesNeedUpdate,
  45336. this.normalsNeedUpdate = e.normalsNeedUpdate,
  45337. this.colorsNeedUpdate = e.colorsNeedUpdate,
  45338. this.uvsNeedUpdate = e.uvsNeedUpdate,
  45339. this.groupsNeedUpdate = e.groupsNeedUpdate,
  45340. this
  45341. },
  45342. dispose: function() {
  45343. this.dispatchEvent({
  45344. type: "dispose"
  45345. })
  45346. }
  45347. },
  45348. n.EventDispatcher.prototype.apply(n.DirectGeometry.prototype),
  45349. n.BufferGeometry = function() {
  45350. Object.defineProperty(this, "id", {
  45351. value: n.GeometryIdCount++
  45352. }),
  45353. this.uuid = n.Math.generateUUID(),
  45354. this.name = "",
  45355. this.type = "BufferGeometry",
  45356. this.index = null,
  45357. this.attributes = {},
  45358. this.morphAttributes = {},
  45359. this.groups = [],
  45360. this.boundingBox = null,
  45361. this.boundingSphere = null,
  45362. this.drawRange = {
  45363. start: 0,
  45364. count: 1 / 0
  45365. }
  45366. }
  45367. ,
  45368. n.BufferGeometry.prototype = {
  45369. constructor: n.BufferGeometry,
  45370. getIndex: function() {
  45371. return this.index
  45372. },
  45373. setIndex: function(e) {
  45374. this.index = e
  45375. },
  45376. addAttribute: function(e, t) {
  45377. return t instanceof n.BufferAttribute == !1 && t instanceof n.InterleavedBufferAttribute == !1 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  45378. void this.addAttribute(e, new n.BufferAttribute(arguments[1],arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  45379. void this.setIndex(t)) : (this.attributes[e] = t,
  45380. this)
  45381. },
  45382. getAttribute: function(e) {
  45383. return this.attributes[e]
  45384. },
  45385. removeAttribute: function(e) {
  45386. return delete this.attributes[e],
  45387. this
  45388. },
  45389. addGroup: function(e, t, i) {
  45390. this.groups.push({
  45391. start: e,
  45392. count: t,
  45393. materialIndex: void 0 !== i ? i : 0
  45394. })
  45395. },
  45396. clearGroups: function() {
  45397. this.groups = []
  45398. },
  45399. setDrawRange: function(e, t) {
  45400. this.drawRange.start = e,
  45401. this.drawRange.count = t
  45402. },
  45403. applyMatrix: function(e) {
  45404. var t = this.attributes.position;
  45405. void 0 !== t && (e.applyToVector3Array(t.array),
  45406. t.needsUpdate = !0);
  45407. var i = this.attributes.normal;
  45408. if (void 0 !== i) {
  45409. var r = (new n.Matrix3).getNormalMatrix(e);
  45410. r.applyToVector3Array(i.array),
  45411. i.needsUpdate = !0
  45412. }
  45413. return null !== this.boundingBox && this.computeBoundingBox(),
  45414. null !== this.boundingSphere && this.computeBoundingSphere(),
  45415. this
  45416. },
  45417. rotateX: function() {
  45418. var e;
  45419. return function(t) {
  45420. return void 0 === e && (e = new n.Matrix4),
  45421. e.makeRotationX(t),
  45422. this.applyMatrix(e),
  45423. this
  45424. }
  45425. }(),
  45426. rotateY: function() {
  45427. var e;
  45428. return function(t) {
  45429. return void 0 === e && (e = new n.Matrix4),
  45430. e.makeRotationY(t),
  45431. this.applyMatrix(e),
  45432. this
  45433. }
  45434. }(),
  45435. rotateZ: function() {
  45436. var e;
  45437. return function(t) {
  45438. return void 0 === e && (e = new n.Matrix4),
  45439. e.makeRotationZ(t),
  45440. this.applyMatrix(e),
  45441. this
  45442. }
  45443. }(),
  45444. translate: function() {
  45445. var e;
  45446. return function(t, i, r) {
  45447. return void 0 === e && (e = new n.Matrix4),
  45448. e.makeTranslation(t, i, r),
  45449. this.applyMatrix(e),
  45450. this
  45451. }
  45452. }(),
  45453. scale: function() {
  45454. var e;
  45455. return function(t, i, r) {
  45456. return void 0 === e && (e = new n.Matrix4),
  45457. e.makeScale(t, i, r),
  45458. this.applyMatrix(e),
  45459. this
  45460. }
  45461. }(),
  45462. lookAt: function() {
  45463. var e;
  45464. return function(t) {
  45465. void 0 === e && (e = new n.Object3D),
  45466. e.lookAt(t),
  45467. e.updateMatrix(),
  45468. this.applyMatrix(e.matrix)
  45469. }
  45470. }(),
  45471. center: function() {
  45472. this.computeBoundingBox();
  45473. var e = this.boundingBox.center().negate();
  45474. return this.translate(e.x, e.y, e.z),
  45475. e
  45476. },
  45477. setFromObject: function(e) {
  45478. var t = e.geometry;
  45479. if (e instanceof n.Points || e instanceof n.Line) {
  45480. var i = new n.Float32Attribute(3 * t.vertices.length,3)
  45481. , r = new n.Float32Attribute(3 * t.colors.length,3);
  45482. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  45483. this.addAttribute("color", r.copyColorsArray(t.colors)),
  45484. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  45485. var o = new n.Float32Attribute(t.lineDistances.length,1);
  45486. this.addAttribute("lineDistance", o.copyArray(t.lineDistances))
  45487. }
  45488. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  45489. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  45490. } else
  45491. e instanceof n.Mesh && t instanceof n.Geometry && this.fromGeometry(t);
  45492. return this
  45493. },
  45494. updateFromObject: function(e) {
  45495. var t = e.geometry;
  45496. if (e instanceof n.Mesh) {
  45497. var i = t.__directGeometry;
  45498. if (void 0 === i)
  45499. return this.fromGeometry(t);
  45500. i.verticesNeedUpdate = t.verticesNeedUpdate,
  45501. i.normalsNeedUpdate = t.normalsNeedUpdate,
  45502. i.colorsNeedUpdate = t.colorsNeedUpdate,
  45503. i.uvsNeedUpdate = t.uvsNeedUpdate,
  45504. i.groupsNeedUpdate = t.groupsNeedUpdate,
  45505. t.verticesNeedUpdate = !1,
  45506. t.normalsNeedUpdate = !1,
  45507. t.colorsNeedUpdate = !1,
  45508. t.uvsNeedUpdate = !1,
  45509. t.groupsNeedUpdate = !1,
  45510. t = i
  45511. }
  45512. if (t.verticesNeedUpdate === !0) {
  45513. var r = this.attributes.position;
  45514. void 0 !== r && (r.copyVector3sArray(t.vertices),
  45515. r.needsUpdate = !0),
  45516. t.verticesNeedUpdate = !1
  45517. }
  45518. if (t.normalsNeedUpdate === !0) {
  45519. var r = this.attributes.normal;
  45520. void 0 !== r && (r.copyVector3sArray(t.normals),
  45521. r.needsUpdate = !0),
  45522. t.normalsNeedUpdate = !1
  45523. }
  45524. if (t.colorsNeedUpdate === !0) {
  45525. var r = this.attributes.color;
  45526. void 0 !== r && (r.copyColorsArray(t.colors),
  45527. r.needsUpdate = !0),
  45528. t.colorsNeedUpdate = !1
  45529. }
  45530. if (t.uvsNeedUpdate) {
  45531. var r = this.attributes.uv;
  45532. void 0 !== r && (r.copyVector2sArray(t.uvs),
  45533. r.needsUpdate = !0),
  45534. t.uvsNeedUpdate = !1
  45535. }
  45536. if (t.lineDistancesNeedUpdate) {
  45537. var r = this.attributes.lineDistance;
  45538. void 0 !== r && (r.copyArray(t.lineDistances),
  45539. r.needsUpdate = !0),
  45540. t.lineDistancesNeedUpdate = !1
  45541. }
  45542. return t.groupsNeedUpdate && (t.computeGroups(e.geometry),
  45543. this.groups = t.groups,
  45544. t.groupsNeedUpdate = !1),
  45545. this
  45546. },
  45547. fromGeometry: function(e) {
  45548. return e.__directGeometry = (new n.DirectGeometry).fromGeometry(e),
  45549. this.fromDirectGeometry(e.__directGeometry)
  45550. },
  45551. fromDirectGeometry: function(e) {
  45552. var t = new Float32Array(3 * e.vertices.length);
  45553. if (this.addAttribute("position", new n.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  45554. e.normals.length > 0) {
  45555. var i = new Float32Array(3 * e.normals.length);
  45556. this.addAttribute("normal", new n.BufferAttribute(i,3).copyVector3sArray(e.normals))
  45557. }
  45558. if (e.colors.length > 0) {
  45559. var r = new Float32Array(3 * e.colors.length);
  45560. this.addAttribute("color", new n.BufferAttribute(r,3).copyColorsArray(e.colors))
  45561. }
  45562. if (e.uvs.length > 0) {
  45563. var o = new Float32Array(2 * e.uvs.length);
  45564. this.addAttribute("uv", new n.BufferAttribute(o,2).copyVector2sArray(e.uvs))
  45565. }
  45566. if (e.uvs2.length > 0) {
  45567. var a = new Float32Array(2 * e.uvs2.length);
  45568. this.addAttribute("uv2", new n.BufferAttribute(a,2).copyVector2sArray(e.uvs2))
  45569. }
  45570. if (e.indices.length > 0) {
  45571. var s = e.vertices.length > 65535 ? Uint32Array : Uint16Array
  45572. , l = new s(3 * e.indices.length);
  45573. this.setIndex(new n.BufferAttribute(l,1).copyIndicesArray(e.indices))
  45574. }
  45575. this.groups = e.groups;
  45576. for (var c in e.morphTargets) {
  45577. for (var h = [], u = e.morphTargets[c], d = 0, p = u.length; d < p; d++) {
  45578. var f = u[d]
  45579. , g = new n.Float32Attribute(3 * f.length,3);
  45580. h.push(g.copyVector3sArray(f))
  45581. }
  45582. this.morphAttributes[c] = h
  45583. }
  45584. if (e.skinIndices.length > 0) {
  45585. var m = new n.Float32Attribute(4 * e.skinIndices.length,4);
  45586. this.addAttribute("skinIndex", m.copyVector4sArray(e.skinIndices))
  45587. }
  45588. if (e.skinWeights.length > 0) {
  45589. var v = new n.Float32Attribute(4 * e.skinWeights.length,4);
  45590. this.addAttribute("skinWeight", v.copyVector4sArray(e.skinWeights))
  45591. }
  45592. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  45593. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  45594. this
  45595. },
  45596. computeBoundingBox: function() {
  45597. new n.Vector3;
  45598. return function() {
  45599. null === this.boundingBox && (this.boundingBox = new n.Box3);
  45600. var e = this.attributes.position.array;
  45601. e && this.boundingBox.setFromArray(e),
  45602. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  45603. this.boundingBox.max.set(0, 0, 0)),
  45604. (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)
  45605. }
  45606. }(),
  45607. computeBoundingSphere: function() {
  45608. var e = new n.Box3
  45609. , t = new n.Vector3;
  45610. return function() {
  45611. null === this.boundingSphere && (this.boundingSphere = new n.Sphere);
  45612. var i = this.attributes.position.array;
  45613. if (i) {
  45614. var r = this.boundingSphere.center;
  45615. e.setFromArray(i),
  45616. e.center(r);
  45617. for (var o = 0, a = 0, s = i.length; a < s; a += 3)
  45618. t.fromArray(i, a),
  45619. o = Math.max(o, r.distanceToSquared(t));
  45620. this.boundingSphere.radius = Math.sqrt(o),
  45621. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  45622. }
  45623. }
  45624. }(),
  45625. computeFaceNormals: function() {},
  45626. computeVertexNormals: function() {
  45627. var e = this.index
  45628. , t = this.attributes
  45629. , i = this.groups;
  45630. if (t.position) {
  45631. var r = t.position.array;
  45632. if (void 0 === t.normal)
  45633. this.addAttribute("normal", new n.BufferAttribute(new Float32Array(r.length),3));
  45634. else
  45635. for (var o = t.normal.array, a = 0, s = o.length; a < s; a++)
  45636. o[a] = 0;
  45637. 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;
  45638. if (e) {
  45639. var v = e.array;
  45640. 0 === i.length && this.addGroup(0, v.length);
  45641. for (var A = 0, y = i.length; A < y; ++A)
  45642. for (var C = i[A], I = C.start, E = C.count, a = I, s = I + E; a < s; a += 3)
  45643. l = 3 * v[a + 0],
  45644. c = 3 * v[a + 1],
  45645. h = 3 * v[a + 2],
  45646. d.fromArray(r, l),
  45647. p.fromArray(r, c),
  45648. f.fromArray(r, h),
  45649. g.subVectors(f, p),
  45650. m.subVectors(d, p),
  45651. g.cross(m),
  45652. u[l] += g.x,
  45653. u[l + 1] += g.y,
  45654. u[l + 2] += g.z,
  45655. u[c] += g.x,
  45656. u[c + 1] += g.y,
  45657. u[c + 2] += g.z,
  45658. u[h] += g.x,
  45659. u[h + 1] += g.y,
  45660. u[h + 2] += g.z
  45661. } else
  45662. for (var a = 0, s = r.length; a < s; a += 9)
  45663. d.fromArray(r, a),
  45664. p.fromArray(r, a + 3),
  45665. f.fromArray(r, a + 6),
  45666. g.subVectors(f, p),
  45667. m.subVectors(d, p),
  45668. g.cross(m),
  45669. u[a] = g.x,
  45670. u[a + 1] = g.y,
  45671. u[a + 2] = g.z,
  45672. u[a + 3] = g.x,
  45673. u[a + 4] = g.y,
  45674. u[a + 5] = g.z,
  45675. u[a + 6] = g.x,
  45676. u[a + 7] = g.y,
  45677. u[a + 8] = g.z;
  45678. this.normalizeNormals(),
  45679. t.normal.needsUpdate = !0
  45680. }
  45681. },
  45682. merge: function(e, t) {
  45683. if (e instanceof n.BufferGeometry == !1)
  45684. return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e);
  45685. void 0 === t && (t = 0);
  45686. var i = this.attributes;
  45687. for (var r in i)
  45688. if (void 0 !== e.attributes[r])
  45689. 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++,
  45690. u++)
  45691. a[u] = l[h];
  45692. return this
  45693. },
  45694. normalizeNormals: function() {
  45695. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  45696. e = r[o],
  45697. t = r[o + 1],
  45698. i = r[o + 2],
  45699. n = 1 / Math.sqrt(e * e + t * t + i * i),
  45700. r[o] *= n,
  45701. r[o + 1] *= n,
  45702. r[o + 2] *= n
  45703. },
  45704. toNonIndexed: function() {
  45705. if (null === this.index)
  45706. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  45707. this;
  45708. var e = new n.BufferGeometry
  45709. , t = this.index.array
  45710. , i = this.attributes;
  45711. for (var r in i) {
  45712. 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++) {
  45713. c = t[u] * s;
  45714. for (var p = 0; p < s; p++)
  45715. l[h++] = a[c++]
  45716. }
  45717. e.addAttribute(r, new n.BufferAttribute(l,s))
  45718. }
  45719. return e
  45720. },
  45721. toJSON: function() {
  45722. var e = {
  45723. metadata: {
  45724. version: 4.4,
  45725. type: "BufferGeometry",
  45726. generator: "BufferGeometry.toJSON"
  45727. }
  45728. };
  45729. if (e.uuid = this.uuid,
  45730. e.type = this.type,
  45731. "" !== this.name && (e.name = this.name),
  45732. void 0 !== this.parameters) {
  45733. var t = this.parameters;
  45734. for (var i in t)
  45735. void 0 !== t[i] && (e[i] = t[i]);
  45736. return e
  45737. }
  45738. e.data = {
  45739. attributes: {}
  45740. };
  45741. var n = this.index;
  45742. if (null !== n) {
  45743. var r = Array.prototype.slice.call(n.array);
  45744. e.data.index = {
  45745. type: n.array.constructor.name,
  45746. array: r
  45747. }
  45748. }
  45749. var o = this.attributes;
  45750. for (var i in o) {
  45751. var a = o[i]
  45752. , r = Array.prototype.slice.call(a.array);
  45753. e.data.attributes[i] = {
  45754. itemSize: a.itemSize,
  45755. type: a.array.constructor.name,
  45756. array: r
  45757. }
  45758. }
  45759. var s = this.groups;
  45760. s.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(s)));
  45761. var l = this.boundingSphere;
  45762. return null !== l && (e.data.boundingSphere = {
  45763. center: l.center.toArray(),
  45764. radius: l.radius
  45765. }),
  45766. e
  45767. },
  45768. clone: function() {
  45769. return (new n.BufferGeometry).copy(this)
  45770. },
  45771. copy: function(e) {
  45772. var t = e.index;
  45773. null !== t && this.setIndex(t.clone());
  45774. var i = e.attributes;
  45775. for (var n in i) {
  45776. var r = i[n];
  45777. this.addAttribute(n, r.clone())
  45778. }
  45779. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  45780. var l = o[a];
  45781. this.addGroup(l.start, l.count)
  45782. }
  45783. return this
  45784. },
  45785. dispose: function() {
  45786. this.dispatchEvent({
  45787. type: "dispose"
  45788. })
  45789. }
  45790. },
  45791. n.EventDispatcher.prototype.apply(n.BufferGeometry.prototype),
  45792. n.BufferGeometry.MaxIndex = 65535,
  45793. n.InstancedBufferGeometry = function() {
  45794. n.BufferGeometry.call(this),
  45795. this.type = "InstancedBufferGeometry",
  45796. this.maxInstancedCount = void 0
  45797. }
  45798. ,
  45799. n.InstancedBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  45800. n.InstancedBufferGeometry.prototype.constructor = n.InstancedBufferGeometry,
  45801. n.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  45802. this.groups.push({
  45803. start: e,
  45804. count: t,
  45805. instances: i
  45806. })
  45807. }
  45808. ,
  45809. n.InstancedBufferGeometry.prototype.copy = function(e) {
  45810. var t = e.index;
  45811. null !== t && this.setIndex(t.clone());
  45812. var i = e.attributes;
  45813. for (var n in i) {
  45814. var r = i[n];
  45815. this.addAttribute(n, r.clone())
  45816. }
  45817. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  45818. var l = o[a];
  45819. this.addGroup(l.start, l.count, l.instances)
  45820. }
  45821. return this
  45822. }
  45823. ,
  45824. n.EventDispatcher.prototype.apply(n.InstancedBufferGeometry.prototype),
  45825. n.Uniform = function(e, t) {
  45826. this.type = e,
  45827. this.value = t,
  45828. this.dynamic = !1
  45829. }
  45830. ,
  45831. n.Uniform.prototype = {
  45832. constructor: n.Uniform,
  45833. onUpdate: function(e) {
  45834. return this.dynamic = !0,
  45835. this.onUpdateCallback = e,
  45836. this
  45837. }
  45838. },
  45839. n.AnimationClip = function(e, t, i) {
  45840. this.name = e || n.Math.generateUUID(),
  45841. this.tracks = i,
  45842. this.duration = void 0 !== t ? t : -1,
  45843. this.duration < 0 && this.resetDuration(),
  45844. this.trim(),
  45845. this.optimize()
  45846. }
  45847. ,
  45848. n.AnimationClip.prototype = {
  45849. constructor: n.AnimationClip,
  45850. resetDuration: function() {
  45851. for (var e = this.tracks, t = 0, i = 0, n = e.length; i !== n; ++i) {
  45852. var r = this.tracks[i];
  45853. t = Math.max(t, r.times[r.times.length - 1])
  45854. }
  45855. this.duration = t
  45856. },
  45857. trim: function() {
  45858. for (var e = 0; e < this.tracks.length; e++)
  45859. this.tracks[e].trim(0, this.duration);
  45860. return this
  45861. },
  45862. optimize: function() {
  45863. for (var e = 0; e < this.tracks.length; e++)
  45864. this.tracks[e].optimize();
  45865. return this
  45866. }
  45867. },
  45868. Object.assign(n.AnimationClip, {
  45869. parse: function(e) {
  45870. for (var t = [], i = e.tracks, r = 1 / (e.fps || 1), o = 0, a = i.length; o !== a; ++o)
  45871. t.push(n.KeyframeTrack.parse(i[o]).scale(r));
  45872. return new n.AnimationClip(e.name,e.duration,t)
  45873. },
  45874. toJSON: function(e) {
  45875. for (var t = [], i = e.tracks, r = {
  45876. name: e.name,
  45877. duration: e.duration,
  45878. tracks: t
  45879. }, o = 0, a = i.length; o !== a; ++o)
  45880. t.push(n.KeyframeTrack.toJSON(i[o]));
  45881. return r
  45882. },
  45883. CreateFromMorphTargetSequence: function(e, t, i) {
  45884. for (var r = t.length, o = [], a = 0; a < r; a++) {
  45885. var s = []
  45886. , l = [];
  45887. s.push((a + r - 1) % r, a, (a + 1) % r),
  45888. l.push(0, 1, 0);
  45889. var c = n.AnimationUtils.getKeyframeOrder(s);
  45890. s = n.AnimationUtils.sortedArray(s, 1, c),
  45891. l = n.AnimationUtils.sortedArray(l, 1, c),
  45892. 0 === s[0] && (s.push(r),
  45893. l.push(l[0])),
  45894. o.push(new n.NumberKeyframeTrack(".morphTargetInfluences[" + t[a].name + "]",s,l).scale(1 / i))
  45895. }
  45896. return new n.AnimationClip(e,-1,o)
  45897. },
  45898. findByName: function(e, t) {
  45899. for (var i = 0; i < e.length; i++)
  45900. if (e[i].name === t)
  45901. return e[i];
  45902. return null
  45903. },
  45904. CreateClipsFromMorphTargetSequences: function(e, t) {
  45905. for (var i = {}, r = /^([\w-]*?)([\d]+)$/, o = 0, a = e.length; o < a; o++) {
  45906. var s = e[o]
  45907. , l = s.name.match(r);
  45908. if (l && l.length > 1) {
  45909. var c = l[1]
  45910. , h = i[c];
  45911. h || (i[c] = h = []),
  45912. h.push(s)
  45913. }
  45914. }
  45915. var u = [];
  45916. for (var c in i)
  45917. u.push(n.AnimationClip.CreateFromMorphTargetSequence(c, i[c], t));
  45918. return u
  45919. },
  45920. parseAnimation: function(e, t, i) {
  45921. if (!e)
  45922. return console.error(" no animation in JSONLoader data"),
  45923. null;
  45924. for (var r = function(e, t, i, r, o) {
  45925. if (0 !== i.length) {
  45926. var a = []
  45927. , s = [];
  45928. n.AnimationUtils.flattenJSON(i, a, s, r),
  45929. 0 !== a.length && o.push(new e(t,a,s))
  45930. }
  45931. }, o = [], a = e.name || "default", s = e.length || -1, l = e.fps || 30, c = e.hierarchy || [], h = 0; h < c.length; h++) {
  45932. var u = c[h].keys;
  45933. if (u && 0 != u.length)
  45934. if (u[0].morphTargets) {
  45935. for (var d = {}, p = 0; p < u.length; p++)
  45936. if (u[p].morphTargets)
  45937. for (var f = 0; f < u[p].morphTargets.length; f++)
  45938. d[u[p].morphTargets[f]] = -1;
  45939. for (var g in d) {
  45940. for (var m = [], v = [], f = 0; f !== u[p].morphTargets.length; ++f) {
  45941. var A = u[p];
  45942. m.push(A.time),
  45943. v.push(A.morphTarget === g ? 1 : 0)
  45944. }
  45945. o.push(new n.NumberKeyframeTrack(".morphTargetInfluence[" + g + "]",m,v))
  45946. }
  45947. s = d.length * (l || 1)
  45948. } else {
  45949. var y = ".bones[" + t[h].name + "]";
  45950. r(n.VectorKeyframeTrack, y + ".position", u, "pos", o),
  45951. r(n.QuaternionKeyframeTrack, y + ".quaternion", u, "rot", o),
  45952. r(n.VectorKeyframeTrack, y + ".scale", u, "scl", o)
  45953. }
  45954. }
  45955. if (0 === o.length)
  45956. return null;
  45957. var C = new n.AnimationClip(a,s,o);
  45958. return C
  45959. }
  45960. }),
  45961. n.AnimationMixer = function(e) {
  45962. this._root = e,
  45963. this._initMemoryManager(),
  45964. this._accuIndex = 0,
  45965. this.time = 0,
  45966. this.timeScale = 1
  45967. }
  45968. ,
  45969. n.AnimationMixer.prototype = {
  45970. constructor: n.AnimationMixer,
  45971. clipAction: function(e, t) {
  45972. 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];
  45973. if (void 0 !== l) {
  45974. var c = l.actionByRoot[o];
  45975. if (void 0 !== c)
  45976. return c;
  45977. if (i = l.knownActions[0],
  45978. s = i._clip,
  45979. e !== a && e !== s)
  45980. throw new Error("Different clips with the same name detected!")
  45981. }
  45982. if (null === s)
  45983. return null;
  45984. var h = new n.AnimationMixer._Action(this,s,t);
  45985. return this._bindAction(h, i),
  45986. this._addInactiveAction(h, a, o),
  45987. h
  45988. },
  45989. existingAction: function(e, t) {
  45990. var i = t || this._root
  45991. , n = i.uuid
  45992. , r = "string" == typeof e ? e : e.name
  45993. , o = this._actionsByClip[r];
  45994. return void 0 !== o ? o.actionByRoot[n] || null : null
  45995. },
  45996. stopAllAction: function() {
  45997. var e = this._actions
  45998. , t = this._nActiveActions
  45999. , i = this._bindings
  46000. , n = this._nActiveBindings;
  46001. this._nActiveActions = 0,
  46002. this._nActiveBindings = 0;
  46003. for (var r = 0; r !== t; ++r)
  46004. e[r].reset();
  46005. for (var r = 0; r !== n; ++r)
  46006. i[r].useCount = 0;
  46007. return this
  46008. },
  46009. update: function(e) {
  46010. e *= this.timeScale;
  46011. 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) {
  46012. var s = t[a];
  46013. s.enabled && s._update(n, e, r, o)
  46014. }
  46015. for (var l = this._bindings, c = this._nActiveBindings, a = 0; a !== c; ++a)
  46016. l[a].apply(o);
  46017. return this
  46018. },
  46019. getRoot: function() {
  46020. return this._root
  46021. },
  46022. uncacheClip: function(e) {
  46023. var t = this._actions
  46024. , i = e.name
  46025. , n = this._actionsByClip
  46026. , r = n[i];
  46027. if (void 0 !== r) {
  46028. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  46029. var l = o[a];
  46030. this._deactivateAction(l);
  46031. var c = l._cacheIndex
  46032. , h = t[t.length - 1];
  46033. l._cacheIndex = null,
  46034. l._byClipCacheIndex = null,
  46035. h._cacheIndex = c,
  46036. t[c] = h,
  46037. t.pop(),
  46038. this._removeInactiveBindingsForAction(l)
  46039. }
  46040. delete n[i]
  46041. }
  46042. },
  46043. uncacheRoot: function(e) {
  46044. var t = e.uuid
  46045. , i = this._actionsByClip;
  46046. for (var n in i) {
  46047. var r = i[n].actionByRoot
  46048. , o = r[t];
  46049. void 0 !== o && (this._deactivateAction(o),
  46050. this._removeInactiveAction(o))
  46051. }
  46052. var a = this._bindingsByRootAndName
  46053. , s = a[t];
  46054. if (void 0 !== s)
  46055. for (var l in s) {
  46056. var c = s[l];
  46057. c.restoreOriginalState(),
  46058. this._removeInactiveBinding(c)
  46059. }
  46060. },
  46061. uncacheAction: function(e, t) {
  46062. var i = this.existingAction(e, t);
  46063. null !== i && (this._deactivateAction(i),
  46064. this._removeInactiveAction(i))
  46065. }
  46066. },
  46067. n.EventDispatcher.prototype.apply(n.AnimationMixer.prototype),
  46068. n.AnimationMixer._Action = function(e, t, i) {
  46069. this._mixer = e,
  46070. this._clip = t,
  46071. this._localRoot = i || null;
  46072. for (var r = t.tracks, o = r.length, a = new Array(o), s = {
  46073. endingStart: n.ZeroCurvatureEnding,
  46074. endingEnd: n.ZeroCurvatureEnding
  46075. }, l = 0; l !== o; ++l) {
  46076. var c = r[l].createInterpolant(null);
  46077. a[l] = c,
  46078. c.settings = s
  46079. }
  46080. this._interpolantSettings = s,
  46081. this._interpolants = a,
  46082. this._propertyBindings = new Array(o),
  46083. this._cacheIndex = null,
  46084. this._byClipCacheIndex = null,
  46085. this._timeScaleInterpolant = null,
  46086. this._weightInterpolant = null,
  46087. this.loop = n.LoopRepeat,
  46088. this._loopCount = -1,
  46089. this._startTime = null,
  46090. this.time = 0,
  46091. this.timeScale = 1,
  46092. this._effectiveTimeScale = 1,
  46093. this.weight = 1,
  46094. this._effectiveWeight = 1,
  46095. this.repetitions = 1 / 0,
  46096. this.paused = !1,
  46097. this.enabled = !0,
  46098. this.clampWhenFinished = !1,
  46099. this.zeroSlopeAtStart = !0,
  46100. this.zeroSlopeAtEnd = !0
  46101. }
  46102. ,
  46103. n.AnimationMixer._Action.prototype = {
  46104. constructor: n.AnimationMixer._Action,
  46105. play: function() {
  46106. return this._mixer._activateAction(this),
  46107. this
  46108. },
  46109. stop: function() {
  46110. return this._mixer._deactivateAction(this),
  46111. this.reset()
  46112. },
  46113. reset: function() {
  46114. return this.paused = !1,
  46115. this.enabled = !0,
  46116. this.time = 0,
  46117. this._loopCount = -1,
  46118. this._startTime = null,
  46119. this.stopFading().stopWarping()
  46120. },
  46121. isRunning: function() {
  46122. this._startTime;
  46123. return this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  46124. },
  46125. isScheduled: function() {
  46126. return this._mixer._isActiveAction(this)
  46127. },
  46128. startAt: function(e) {
  46129. return this._startTime = e,
  46130. this
  46131. },
  46132. setLoop: function(e, t) {
  46133. return this.loop = e,
  46134. this.repetitions = t,
  46135. this
  46136. },
  46137. setEffectiveWeight: function(e) {
  46138. return this.weight = e,
  46139. this._effectiveWeight = this.enabled ? e : 0,
  46140. this.stopFading()
  46141. },
  46142. getEffectiveWeight: function() {
  46143. return this._effectiveWeight
  46144. },
  46145. fadeIn: function(e) {
  46146. return this._scheduleFading(e, 0, 1)
  46147. },
  46148. fadeOut: function(e) {
  46149. return this._scheduleFading(e, 1, 0)
  46150. },
  46151. crossFadeFrom: function(e, t, i) {
  46152. this._mixer;
  46153. if (e.fadeOut(t),
  46154. this.fadeIn(t),
  46155. i) {
  46156. var n = this._clip.duration
  46157. , r = e._clip.duration
  46158. , o = r / n
  46159. , a = n / r;
  46160. e.warp(1, o, t),
  46161. this.warp(a, 1, t)
  46162. }
  46163. return this
  46164. },
  46165. crossFadeTo: function(e, t, i) {
  46166. return e.crossFadeFrom(this, t, i)
  46167. },
  46168. stopFading: function() {
  46169. var e = this._weightInterpolant;
  46170. return null !== e && (this._weightInterpolant = null,
  46171. this._mixer._takeBackControlInterpolant(e)),
  46172. this
  46173. },
  46174. setEffectiveTimeScale: function(e) {
  46175. return this.timeScale = e,
  46176. this._effectiveTimeScale = this.paused ? 0 : e,
  46177. this.stopWarping()
  46178. },
  46179. getEffectiveTimeScale: function() {
  46180. return this._effectiveTimeScale
  46181. },
  46182. setDuration: function(e) {
  46183. return this.timeScale = this._clip.duration / e,
  46184. this.stopWarping()
  46185. },
  46186. syncWith: function(e) {
  46187. return this.time = e.time,
  46188. this.timeScale = e.timeScale,
  46189. this.stopWarping()
  46190. },
  46191. halt: function(e) {
  46192. return this.warp(this._currentTimeScale, 0, e)
  46193. },
  46194. warp: function(e, t, i) {
  46195. var n = this._mixer
  46196. , r = n.time
  46197. , o = this._timeScaleInterpolant
  46198. , a = this.timeScale;
  46199. null === o && (o = n._lendControlInterpolant(),
  46200. this._timeScaleInterpolant = o);
  46201. var s = o.parameterPositions
  46202. , l = o.sampleValues;
  46203. return s[0] = r,
  46204. s[1] = r + i,
  46205. l[0] = e / a,
  46206. l[1] = t / a,
  46207. this
  46208. },
  46209. stopWarping: function() {
  46210. var e = this._timeScaleInterpolant;
  46211. return null !== e && (this._timeScaleInterpolant = null,
  46212. this._mixer._takeBackControlInterpolant(e)),
  46213. this
  46214. },
  46215. getMixer: function() {
  46216. return this._mixer
  46217. },
  46218. getClip: function() {
  46219. return this._clip
  46220. },
  46221. getRoot: function() {
  46222. return this._localRoot || this._mixer._root
  46223. },
  46224. _update: function(e, t, i, n) {
  46225. var r = this._startTime;
  46226. if (null !== r) {
  46227. var o = (e - r) * i;
  46228. if (o < 0 || 0 === i)
  46229. return;
  46230. this._startTime = null,
  46231. t = i * o
  46232. }
  46233. t *= this._updateTimeScale(e);
  46234. var a = this._updateTime(t)
  46235. , s = this._updateWeight(e);
  46236. if (s > 0)
  46237. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  46238. l[h].evaluate(a),
  46239. c[h].accumulate(n, s)
  46240. },
  46241. _updateWeight: function(e) {
  46242. var t = 0;
  46243. if (this.enabled) {
  46244. t = this.weight;
  46245. var i = this._weightInterpolant;
  46246. if (null !== i) {
  46247. var n = i.evaluate(e)[0];
  46248. t *= n,
  46249. e > i.parameterPositions[1] && (this.stopFading(),
  46250. 0 === n && (this.enabled = !1))
  46251. }
  46252. }
  46253. return this._effectiveWeight = t,
  46254. t
  46255. },
  46256. _updateTimeScale: function(e) {
  46257. var t = 0;
  46258. if (!this.paused) {
  46259. t = this.timeScale;
  46260. var i = this._timeScaleInterpolant;
  46261. if (null !== i) {
  46262. var n = i.evaluate(e)[0];
  46263. t *= n,
  46264. e > i.parameterPositions[1] && (this.stopWarping(),
  46265. 0 === t ? this.pause = !0 : this.timeScale = t)
  46266. }
  46267. }
  46268. return this._effectiveTimeScale = t,
  46269. t
  46270. },
  46271. _updateTime: function(e) {
  46272. var t = this.time + e;
  46273. if (0 === e)
  46274. return t;
  46275. var i = this._clip.duration
  46276. , r = this.loop
  46277. , o = this._loopCount
  46278. , a = !1;
  46279. switch (r) {
  46280. case n.LoopOnce:
  46281. if (o === -1 && (this.loopCount = 0,
  46282. this._setEndings(!0, !0, !1)),
  46283. t >= i)
  46284. t = i;
  46285. else {
  46286. if (!(t < 0))
  46287. break;
  46288. t = 0
  46289. }
  46290. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  46291. this._mixer.dispatchEvent({
  46292. type: "finished",
  46293. action: this,
  46294. direction: e < 0 ? -1 : 1
  46295. });
  46296. break;
  46297. case n.LoopPingPong:
  46298. a = !0;
  46299. case n.LoopRepeat:
  46300. if (o === -1 && (e > 0 ? (o = 0,
  46301. this._setEndings(!0, 0 === this.repetitions, a)) : this._setEndings(0 === this.repetitions, !0, a)),
  46302. t >= i || t < 0) {
  46303. var s = Math.floor(t / i);
  46304. t -= i * s,
  46305. o += Math.abs(s);
  46306. var l = this.repetitions - o;
  46307. if (l < 0) {
  46308. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  46309. t = e > 0 ? i : 0,
  46310. this._mixer.dispatchEvent({
  46311. type: "finished",
  46312. action: this,
  46313. direction: e > 0 ? 1 : -1
  46314. });
  46315. break
  46316. }
  46317. if (0 === l) {
  46318. var c = e < 0;
  46319. this._setEndings(c, !c, a)
  46320. } else
  46321. this._setEndings(!1, !1, a);
  46322. this._loopCount = o,
  46323. this._mixer.dispatchEvent({
  46324. type: "loop",
  46325. action: this,
  46326. loopDelta: s
  46327. })
  46328. }
  46329. if (r === n.LoopPingPong && 1 === (1 & o))
  46330. return this.time = t,
  46331. i - t
  46332. }
  46333. return this.time = t,
  46334. t
  46335. },
  46336. _setEndings: function(e, t, i) {
  46337. var r = this._interpolantSettings;
  46338. i ? (r.endingStart = n.ZeroSlopeEnding,
  46339. r.endingEnd = n.ZeroSlopeEnding) : (e ? r.endingStart = this.zeroSlopeAtStart ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingStart = n.WrapAroundEnding,
  46340. t ? r.endingEnd = this.zeroSlopeAtEnd ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingEnd = n.WrapAroundEnding)
  46341. },
  46342. _scheduleFading: function(e, t, i) {
  46343. var n = this._mixer
  46344. , r = n.time
  46345. , o = this._weightInterpolant;
  46346. null === o && (o = n._lendControlInterpolant(),
  46347. this._weightInterpolant = o);
  46348. var a = o.parameterPositions
  46349. , s = o.sampleValues;
  46350. return a[0] = r,
  46351. s[0] = t,
  46352. a[1] = r + e,
  46353. s[1] = i,
  46354. this
  46355. }
  46356. },
  46357. Object.assign(n.AnimationMixer.prototype, {
  46358. _bindAction: function(e, t) {
  46359. var i = e._localRoot || this._root
  46360. , r = e._clip.tracks
  46361. , o = r.length
  46362. , a = e._propertyBindings
  46363. , s = e._interpolants
  46364. , l = i.uuid
  46365. , c = this._bindingsByRootAndName
  46366. , h = c[l];
  46367. void 0 === h && (h = {},
  46368. c[l] = h);
  46369. for (var u = 0; u !== o; ++u) {
  46370. var d = r[u]
  46371. , p = d.name
  46372. , f = h[p];
  46373. if (void 0 !== f)
  46374. a[u] = f;
  46375. else {
  46376. if (f = a[u],
  46377. void 0 !== f) {
  46378. null === f._cacheIndex && (++f.referenceCount,
  46379. this._addInactiveBinding(f, l, p));
  46380. continue
  46381. }
  46382. var g = t && t._propertyBindings[u].binding.parsedPath;
  46383. f = new n.PropertyMixer(n.PropertyBinding.create(i, p, g),d.ValueTypeName,d.getValueSize()),
  46384. ++f.referenceCount,
  46385. this._addInactiveBinding(f, l, p),
  46386. a[u] = f
  46387. }
  46388. s[u].resultBuffer = f.buffer
  46389. }
  46390. },
  46391. _activateAction: function(e) {
  46392. if (!this._isActiveAction(e)) {
  46393. if (null === e._cacheIndex) {
  46394. var t = (e._localRoot || this._root).uuid
  46395. , i = e._clip.name
  46396. , n = this._actionsByClip[i];
  46397. this._bindAction(e, n && n.knownActions[0]),
  46398. this._addInactiveAction(e, i, t)
  46399. }
  46400. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  46401. var s = r[o];
  46402. 0 === s.useCount++ && (this._lendBinding(s),
  46403. s.saveOriginalState())
  46404. }
  46405. this._lendAction(e)
  46406. }
  46407. },
  46408. _deactivateAction: function(e) {
  46409. if (this._isActiveAction(e)) {
  46410. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  46411. var r = t[i];
  46412. 0 === --r.useCount && (r.restoreOriginalState(),
  46413. this._takeBackBinding(r))
  46414. }
  46415. this._takeBackAction(e)
  46416. }
  46417. },
  46418. _initMemoryManager: function() {
  46419. this._actions = [],
  46420. this._nActiveActions = 0,
  46421. this._actionsByClip = {},
  46422. this._bindings = [],
  46423. this._nActiveBindings = 0,
  46424. this._bindingsByRootAndName = {},
  46425. this._controlInterpolants = [],
  46426. this._nActiveControlInterpolants = 0;
  46427. var e = this;
  46428. this.stats = {
  46429. actions: {
  46430. get total() {
  46431. return e._actions.length
  46432. },
  46433. get inUse() {
  46434. return e._nActiveActions
  46435. }
  46436. },
  46437. bindings: {
  46438. get total() {
  46439. return e._bindings.length
  46440. },
  46441. get inUse() {
  46442. return e._nActiveBindings
  46443. }
  46444. },
  46445. controlInterpolants: {
  46446. get total() {
  46447. return e._controlInterpolants.length
  46448. },
  46449. get inUse() {
  46450. return e._nActiveControlInterpolants
  46451. }
  46452. }
  46453. }
  46454. },
  46455. _isActiveAction: function(e) {
  46456. var t = e._cacheIndex;
  46457. return null !== t && t < this._nActiveActions
  46458. },
  46459. _addInactiveAction: function(e, t, i) {
  46460. var n = this._actions
  46461. , r = this._actionsByClip
  46462. , o = r[t];
  46463. if (void 0 === o)
  46464. o = {
  46465. knownActions: [e],
  46466. actionByRoot: {}
  46467. },
  46468. e._byClipCacheIndex = 0,
  46469. r[t] = o;
  46470. else {
  46471. var a = o.knownActions;
  46472. e._byClipCacheIndex = a.length,
  46473. a.push(e)
  46474. }
  46475. e._cacheIndex = n.length,
  46476. n.push(e),
  46477. o.actionByRoot[i] = e
  46478. },
  46479. _removeInactiveAction: function(e) {
  46480. var t = this._actions
  46481. , i = t[t.length - 1]
  46482. , n = e._cacheIndex;
  46483. i._cacheIndex = n,
  46484. t[n] = i,
  46485. t.pop(),
  46486. e._cacheIndex = null;
  46487. var r = e._clip.name
  46488. , o = this._actionsByClip
  46489. , a = o[r]
  46490. , s = a.knownActions
  46491. , l = s[s.length - 1]
  46492. , c = e._byClipCacheIndex;
  46493. l._byClipCacheIndex = c,
  46494. s[c] = l,
  46495. s.pop(),
  46496. e._byClipCacheIndex = null;
  46497. var h = a.actionByRoot
  46498. , u = (t._localRoot || this._root).uuid;
  46499. delete h[u],
  46500. 0 === s.length && delete o[r],
  46501. this._removeInactiveBindingsForAction(e)
  46502. },
  46503. _removeInactiveBindingsForAction: function(e) {
  46504. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  46505. var r = t[i];
  46506. 0 === --r.referenceCount && this._removeInactiveBinding(r)
  46507. }
  46508. },
  46509. _lendAction: function(e) {
  46510. var t = this._actions
  46511. , i = e._cacheIndex
  46512. , n = this._nActiveActions++
  46513. , r = t[n];
  46514. e._cacheIndex = n,
  46515. t[n] = e,
  46516. r._cacheIndex = i,
  46517. t[i] = r
  46518. },
  46519. _takeBackAction: function(e) {
  46520. var t = this._actions
  46521. , i = e._cacheIndex
  46522. , n = --this._nActiveActions
  46523. , r = t[n];
  46524. e._cacheIndex = n,
  46525. t[n] = e,
  46526. r._cacheIndex = i,
  46527. t[i] = r
  46528. },
  46529. _addInactiveBinding: function(e, t, i) {
  46530. var n = this._bindingsByRootAndName
  46531. , r = n[t]
  46532. , o = this._bindings;
  46533. void 0 === r && (r = {},
  46534. n[t] = r),
  46535. r[i] = e,
  46536. e._cacheIndex = o.length,
  46537. o.push(e)
  46538. },
  46539. _removeInactiveBinding: function(e) {
  46540. var t = this._bindings
  46541. , i = e.binding
  46542. , n = i.rootNode.uuid
  46543. , r = i.path
  46544. , o = this._bindingsByRootAndName
  46545. , a = o[n]
  46546. , s = t[t.length - 1]
  46547. , l = e._cacheIndex;
  46548. s._cacheIndex = l,
  46549. t[l] = s,
  46550. t.pop(),
  46551. delete a[r];
  46552. e: {
  46553. for (var c in a)
  46554. break e;
  46555. delete o[n]
  46556. }
  46557. },
  46558. _lendBinding: function(e) {
  46559. var t = this._bindings
  46560. , i = e._cacheIndex
  46561. , n = this._nActiveBindings++
  46562. , r = t[n];
  46563. e._cacheIndex = n,
  46564. t[n] = e,
  46565. r._cacheIndex = i,
  46566. t[i] = r
  46567. },
  46568. _takeBackBinding: function(e) {
  46569. var t = this._bindings
  46570. , i = e._cacheIndex
  46571. , n = --this._nActiveBindings
  46572. , r = t[n];
  46573. e._cacheIndex = n,
  46574. t[n] = e,
  46575. r._cacheIndex = i,
  46576. t[i] = r
  46577. },
  46578. _lendControlInterpolant: function() {
  46579. var e = this._controlInterpolants
  46580. , t = this._nActiveControlInterpolants++
  46581. , i = e[t];
  46582. return void 0 === i && (i = new n.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),
  46583. i.__cacheIndex = t,
  46584. e[t] = i),
  46585. i
  46586. },
  46587. _takeBackControlInterpolant: function(e) {
  46588. var t = this._controlInterpolants
  46589. , i = e.__cacheIndex
  46590. , n = --this._nActiveControlInterpolants
  46591. , r = t[n];
  46592. e.__cacheIndex = n,
  46593. t[n] = e,
  46594. r.__cacheIndex = i,
  46595. t[i] = r
  46596. },
  46597. _controlInterpolantsResultBuffer: new Float32Array(1)
  46598. }),
  46599. n.AnimationObjectGroup = function(e) {
  46600. this.uuid = n.Math.generateUUID(),
  46601. this._objects = Array.prototype.slice.call(arguments),
  46602. this.nCachedObjects_ = 0;
  46603. var t = {};
  46604. this._indicesByUUID = t;
  46605. for (var i = 0, r = arguments.length; i !== r; ++i)
  46606. t[arguments[i].uuid] = i;
  46607. this._paths = [],
  46608. this._parsedPaths = [],
  46609. this._bindings = [],
  46610. this._bindingsIndicesByPath = {};
  46611. var o = this;
  46612. this.stats = {
  46613. objects: {
  46614. get total() {
  46615. return o._objects.length
  46616. },
  46617. get inUse() {
  46618. return this.total - o.nCachedObjects_
  46619. }
  46620. },
  46621. get bindingsPerObject() {
  46622. return o._bindings.length
  46623. }
  46624. }
  46625. }
  46626. ,
  46627. n.AnimationObjectGroup.prototype = {
  46628. constructor: n.AnimationObjectGroup,
  46629. add: function(e) {
  46630. 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) {
  46631. var d = arguments[h]
  46632. , p = d.uuid
  46633. , f = o[p];
  46634. if (void 0 === f) {
  46635. f = i++,
  46636. o[p] = f,
  46637. t.push(d);
  46638. for (var g = 0, m = c; g !== m; ++g)
  46639. l[g].push(new n.PropertyBinding(d,a[g],s[g]))
  46640. } else if (f < r) {
  46641. var v = t[f]
  46642. , A = --r
  46643. , y = t[A];
  46644. o[y.uuid] = f,
  46645. t[f] = y,
  46646. o[p] = A,
  46647. t[A] = d;
  46648. for (var g = 0, m = c; g !== m; ++g) {
  46649. var C = l[g]
  46650. , I = C[A]
  46651. , E = C[f];
  46652. C[f] = I,
  46653. void 0 === E && (E = new n.PropertyBinding(d,a[g],s[g])),
  46654. C[A] = E
  46655. }
  46656. } else
  46657. t[f] !== v && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  46658. }
  46659. this.nCachedObjects_ = r
  46660. },
  46661. remove: function(e) {
  46662. for (var t = this._objects, i = (t.length,
  46663. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  46664. var l = arguments[a]
  46665. , c = l.uuid
  46666. , h = n[c];
  46667. if (void 0 !== h && h >= i) {
  46668. var u = i++
  46669. , d = t[u];
  46670. n[d.uuid] = h,
  46671. t[h] = d,
  46672. n[c] = u,
  46673. t[u] = l;
  46674. for (var p = 0, f = o; p !== f; ++p) {
  46675. var g = r[p]
  46676. , m = g[u]
  46677. , v = g[h];
  46678. g[h] = m,
  46679. g[u] = v
  46680. }
  46681. }
  46682. }
  46683. this.nCachedObjects_ = i
  46684. },
  46685. uncache: function(e) {
  46686. 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) {
  46687. var c = arguments[s]
  46688. , h = c.uuid
  46689. , u = r[h];
  46690. if (void 0 !== u)
  46691. if (delete r[h],
  46692. u < n) {
  46693. var d = --n
  46694. , p = t[d]
  46695. , f = --i
  46696. , g = t[f];
  46697. r[p.uuid] = u,
  46698. t[u] = p,
  46699. r[g.uuid] = d,
  46700. t[d] = g,
  46701. t.pop();
  46702. for (var m = 0, v = a; m !== v; ++m) {
  46703. var A = o[m]
  46704. , y = A[d]
  46705. , C = A[f];
  46706. A[u] = y,
  46707. A[d] = C,
  46708. A.pop()
  46709. }
  46710. } else {
  46711. var f = --i
  46712. , g = t[f];
  46713. r[g.uuid] = u,
  46714. t[u] = g,
  46715. t.pop();
  46716. for (var m = 0, v = a; m !== v; ++m) {
  46717. var A = o[m];
  46718. A[u] = A[f],
  46719. A.pop()
  46720. }
  46721. }
  46722. }
  46723. this.nCachedObjects_ = n
  46724. },
  46725. subscribe_: function(e, t) {
  46726. var i = this._bindingsIndicesByPath
  46727. , r = i[e]
  46728. , o = this._bindings;
  46729. if (void 0 !== r)
  46730. return o[r];
  46731. var a = this._paths
  46732. , s = this._parsedPaths
  46733. , l = this._objects
  46734. , c = l.length
  46735. , h = this.nCachedObjects_
  46736. , u = new Array(c);
  46737. r = o.length,
  46738. i[e] = r,
  46739. a.push(e),
  46740. s.push(t),
  46741. o.push(u);
  46742. for (var d = h, p = l.length; d !== p; ++d) {
  46743. var f = l[d];
  46744. u[d] = new n.PropertyBinding(f,e,t)
  46745. }
  46746. return u
  46747. },
  46748. unsubscribe_: function(e) {
  46749. var t = this._bindingsIndicesByPath
  46750. , i = t[e];
  46751. if (void 0 !== i) {
  46752. var n = this._paths
  46753. , r = this._parsedPaths
  46754. , o = this._bindings
  46755. , a = o.length - 1
  46756. , s = o[a]
  46757. , l = e[a];
  46758. t[l] = i,
  46759. o[i] = s,
  46760. o.pop(),
  46761. r[i] = r[a],
  46762. r.pop(),
  46763. n[i] = n[a],
  46764. n.pop()
  46765. }
  46766. }
  46767. },
  46768. n.AnimationUtils = {
  46769. arraySlice: function(e, t, i) {
  46770. return n.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  46771. },
  46772. convertArray: function(e, t, i) {
  46773. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  46774. },
  46775. isTypedArray: function(e) {
  46776. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  46777. },
  46778. getKeyframeOrder: function(e) {
  46779. function t(t, i) {
  46780. return e[t] - e[i]
  46781. }
  46782. for (var i = e.length, n = new Array(i), r = 0; r !== i; ++r)
  46783. n[r] = r;
  46784. return n.sort(t),
  46785. n
  46786. },
  46787. sortedArray: function(e, t, i) {
  46788. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  46789. for (var s = i[o] * t, l = 0; l !== t; ++l)
  46790. r[a++] = e[s + l];
  46791. return r
  46792. },
  46793. flattenJSON: function(e, t, i, n) {
  46794. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  46795. o = e[r++];
  46796. if (void 0 !== o) {
  46797. var a = o[n];
  46798. if (void 0 !== a)
  46799. if (Array.isArray(a)) {
  46800. do
  46801. a = o[n],
  46802. void 0 !== a && (t.push(o.time),
  46803. i.push.apply(i, a)),
  46804. o = e[r++];
  46805. while (void 0 !== o)
  46806. } else if (void 0 !== a.toArray) {
  46807. do
  46808. a = o[n],
  46809. void 0 !== a && (t.push(o.time),
  46810. a.toArray(i, i.length)),
  46811. o = e[r++];
  46812. while (void 0 !== o)
  46813. } else
  46814. do
  46815. a = o[n],
  46816. void 0 !== a && (t.push(o.time),
  46817. i.push(a)),
  46818. o = e[r++];
  46819. while (void 0 !== o)
  46820. }
  46821. }
  46822. },
  46823. n.KeyframeTrack = function(e, t, i, r) {
  46824. if (void 0 === e)
  46825. throw new Error("track name is undefined");
  46826. if (void 0 === t || 0 === t.length)
  46827. throw new Error("no keyframes in track named " + e);
  46828. this.name = e,
  46829. this.times = n.AnimationUtils.convertArray(t, this.TimeBufferType),
  46830. this.values = n.AnimationUtils.convertArray(i, this.ValueBufferType),
  46831. this.setInterpolation(r || this.DefaultInterpolation),
  46832. this.validate(),
  46833. this.optimize()
  46834. }
  46835. ,
  46836. n.KeyframeTrack.prototype = {
  46837. constructor: n.KeyframeTrack,
  46838. TimeBufferType: Float32Array,
  46839. ValueBufferType: Float32Array,
  46840. DefaultInterpolation: n.InterpolateLinear,
  46841. InterpolantFactoryMethodDiscrete: function(e) {
  46842. return new n.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  46843. },
  46844. InterpolantFactoryMethodLinear: function(e) {
  46845. return new n.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  46846. },
  46847. InterpolantFactoryMethodSmooth: function(e) {
  46848. return new n.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  46849. },
  46850. setInterpolation: function(e) {
  46851. var t = void 0;
  46852. switch (e) {
  46853. case n.InterpolateDiscrete:
  46854. t = this.InterpolantFactoryMethodDiscrete;
  46855. break;
  46856. case n.InterpolateLinear:
  46857. t = this.InterpolantFactoryMethodLinear;
  46858. break;
  46859. case n.InterpolateSmooth:
  46860. t = this.InterpolantFactoryMethodSmooth
  46861. }
  46862. if (void 0 === t) {
  46863. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  46864. if (void 0 === this.createInterpolant) {
  46865. if (e === this.DefaultInterpolation)
  46866. throw new Error(i);
  46867. this.setInterpolation(this.DefaultInterpolation)
  46868. }
  46869. return void console.warn(i)
  46870. }
  46871. this.createInterpolant = t
  46872. },
  46873. getInterpolation: function() {
  46874. switch (this.createInterpolant) {
  46875. case this.InterpolantFactoryMethodDiscrete:
  46876. return n.InterpolateDiscrete;
  46877. case this.InterpolantFactoryMethodLinear:
  46878. return n.InterpolateLinear;
  46879. case this.InterpolantFactoryMethodSmooth:
  46880. return n.InterpolateSmooth
  46881. }
  46882. },
  46883. getValueSize: function() {
  46884. return this.values.length / this.times.length
  46885. },
  46886. shift: function(e) {
  46887. if (0 !== e)
  46888. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  46889. t[i] += e;
  46890. return this
  46891. },
  46892. scale: function(e) {
  46893. if (1 !== e)
  46894. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  46895. t[i] *= e;
  46896. return this
  46897. },
  46898. trim: function(e, t) {
  46899. for (var i = this.times, r = i.length, o = 0, a = r - 1; o !== r && i[o] < e; )
  46900. ++o;
  46901. for (; a !== -1 && i[a] > t; )
  46902. --a;
  46903. if (++a,
  46904. 0 !== o || a !== r) {
  46905. o >= a && (a = Math.max(a, 1),
  46906. o = a - 1);
  46907. var s = this.getValueSize();
  46908. this.times = n.AnimationUtils.arraySlice(i, o, a),
  46909. this.values = n.AnimationUtils.arraySlice(this.values, o * s, a * s)
  46910. }
  46911. return this
  46912. },
  46913. validate: function() {
  46914. var e = !0
  46915. , t = this.getValueSize();
  46916. t - Math.floor(t) !== 0 && (console.error("invalid value size in track", this),
  46917. e = !1);
  46918. var i = this.times
  46919. , r = this.values
  46920. , o = i.length;
  46921. 0 === o && (console.error("track is empty", this),
  46922. e = !1);
  46923. for (var a = null, s = 0; s !== o; s++) {
  46924. var l = i[s];
  46925. if ("number" == typeof l && isNaN(l)) {
  46926. console.error("time is not a valid number", this, s, l),
  46927. e = !1;
  46928. break
  46929. }
  46930. if (null !== a && a > l) {
  46931. console.error("out of order keys", this, s, l, a),
  46932. e = !1;
  46933. break
  46934. }
  46935. a = l
  46936. }
  46937. if (void 0 !== r && n.AnimationUtils.isTypedArray(r))
  46938. for (var s = 0, c = r.length; s !== c; ++s) {
  46939. var h = r[s];
  46940. if (isNaN(h)) {
  46941. console.error("value is not a valid number", this, s, h),
  46942. e = !1;
  46943. break
  46944. }
  46945. }
  46946. return e
  46947. },
  46948. optimize: function() {
  46949. for (var e = this.times, t = this.values, i = this.getValueSize(), r = 1, o = 1, a = e.length - 1; o <= a; ++o) {
  46950. var s = !1
  46951. , l = e[o]
  46952. , c = e[o + 1];
  46953. if (l !== c && (1 !== o || l !== l[0]))
  46954. for (var h = o * i, u = h - i, d = h + i, p = 0; p !== i; ++p) {
  46955. var f = t[h + p];
  46956. if (f !== t[u + p] || f !== t[d + p]) {
  46957. s = !0;
  46958. break
  46959. }
  46960. }
  46961. if (s) {
  46962. if (o !== r) {
  46963. e[r] = e[o];
  46964. for (var g = o * i, m = r * i, p = 0; p !== i; ++p)
  46965. t[m + p] = t[g + p]
  46966. }
  46967. ++r
  46968. }
  46969. }
  46970. return r !== e.length && (this.times = n.AnimationUtils.arraySlice(e, 0, r),
  46971. this.values = n.AnimationUtils.arraySlice(t, 0, r * i)),
  46972. this
  46973. }
  46974. },
  46975. Object.assign(n.KeyframeTrack, {
  46976. parse: function(e) {
  46977. if (void 0 === e.type)
  46978. throw new Error("track type undefined, can not parse");
  46979. var t = n.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  46980. if (void 0 === e.times) {
  46981. console.warn("legacy JSON format detected, converting");
  46982. var i = []
  46983. , r = [];
  46984. n.AnimationUtils.flattenJSON(e.keys, i, r, "value"),
  46985. e.times = i,
  46986. e.values = r
  46987. }
  46988. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  46989. },
  46990. toJSON: function(e) {
  46991. var t, i = e.constructor;
  46992. if (void 0 !== i.toJSON)
  46993. t = i.toJSON(e);
  46994. else {
  46995. t = {
  46996. name: e.name,
  46997. times: n.AnimationUtils.convertArray(e.times, Array),
  46998. values: n.AnimationUtils.convertArray(e.values, Array)
  46999. };
  47000. var r = e.getInterpolation();
  47001. r !== e.DefaultInterpolation && (t.interpolation = r)
  47002. }
  47003. return t.type = e.ValueTypeName,
  47004. t
  47005. },
  47006. _getTrackTypeForValueTypeName: function(e) {
  47007. switch (e.toLowerCase()) {
  47008. case "scalar":
  47009. case "double":
  47010. case "float":
  47011. case "number":
  47012. case "integer":
  47013. return n.NumberKeyframeTrack;
  47014. case "vector":
  47015. case "vector2":
  47016. case "vector3":
  47017. case "vector4":
  47018. return n.VectorKeyframeTrack;
  47019. case "color":
  47020. return n.ColorKeyframeTrack;
  47021. case "quaternion":
  47022. return n.QuaternionKeyframeTrack;
  47023. case "bool":
  47024. case "boolean":
  47025. return n.BooleanKeyframeTrack;
  47026. case "string":
  47027. return n.StringKeyframeTrack
  47028. }
  47029. throw new Error("Unsupported typeName: " + e)
  47030. }
  47031. }),
  47032. n.PropertyBinding = function(e, t, i) {
  47033. this.path = t,
  47034. this.parsedPath = i || n.PropertyBinding.parseTrackName(t),
  47035. this.node = n.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  47036. this.rootNode = e
  47037. }
  47038. ,
  47039. n.PropertyBinding.prototype = {
  47040. constructor: n.PropertyBinding,
  47041. getValue: function(e, t) {
  47042. this.bind(),
  47043. this.getValue(e, t)
  47044. },
  47045. setValue: function(e, t) {
  47046. this.bind(),
  47047. this.setValue(e, t)
  47048. },
  47049. bind: function() {
  47050. var e = this.node
  47051. , t = this.parsedPath
  47052. , i = t.objectName
  47053. , r = t.propertyName
  47054. , o = t.propertyIndex;
  47055. if (e || (e = n.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  47056. this.node = e),
  47057. this.getValue = this._getValue_unavailable,
  47058. this.setValue = this._setValue_unavailable,
  47059. !e)
  47060. return void console.error(" trying to update node for track: " + this.path + " but it wasn't found.");
  47061. if (i) {
  47062. var a = t.objectIndex;
  47063. switch (i) {
  47064. case "materials":
  47065. if (!e.material)
  47066. return void console.error(" can not bind to material as node does not have a material", this);
  47067. if (!e.material.materials)
  47068. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  47069. e = e.material.materials;
  47070. break;
  47071. case "bones":
  47072. if (!e.skeleton)
  47073. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  47074. e = e.skeleton.bones;
  47075. for (var s = 0; s < e.length; s++)
  47076. if (e[s].name === a) {
  47077. a = s;
  47078. break
  47079. }
  47080. break;
  47081. default:
  47082. if (void 0 === e[i])
  47083. return void console.error(" can not bind to objectName of node, undefined", this);
  47084. e = e[i]
  47085. }
  47086. if (void 0 !== a) {
  47087. if (void 0 === e[a])
  47088. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  47089. e = e[a]
  47090. }
  47091. }
  47092. var l = e[r];
  47093. if (!l) {
  47094. var c = t.nodeName;
  47095. return void console.error(" trying to update property for track: " + c + "." + r + " but it wasn't found.", e)
  47096. }
  47097. var h = this.Versioning.None;
  47098. void 0 !== e.needsUpdate ? (h = this.Versioning.NeedsUpdate,
  47099. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (h = this.Versioning.MatrixWorldNeedsUpdate,
  47100. this.targetObject = e);
  47101. var u = this.BindingType.Direct;
  47102. if (void 0 !== o) {
  47103. if ("morphTargetInfluences" === r) {
  47104. if (!e.geometry)
  47105. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  47106. if (!e.geometry.morphTargets)
  47107. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  47108. for (var s = 0; s < this.node.geometry.morphTargets.length; s++)
  47109. if (e.geometry.morphTargets[s].name === o) {
  47110. o = s;
  47111. break
  47112. }
  47113. }
  47114. u = this.BindingType.ArrayElement,
  47115. this.resolvedProperty = l,
  47116. this.propertyIndex = o
  47117. } else
  47118. void 0 !== l.fromArray && void 0 !== l.toArray ? (u = this.BindingType.HasFromToArray,
  47119. this.resolvedProperty = l) : void 0 !== l.length ? (u = this.BindingType.EntireArray,
  47120. this.resolvedProperty = l) : this.propertyName = r;
  47121. this.getValue = this.GetterByBindingType[u],
  47122. this.setValue = this.SetterByBindingTypeAndVersioning[u][h]
  47123. },
  47124. unbind: function() {
  47125. this.node = null,
  47126. this.getValue = this._getValue_unbound,
  47127. this.setValue = this._setValue_unbound
  47128. }
  47129. },
  47130. Object.assign(n.PropertyBinding.prototype, {
  47131. _getValue_unavailable: function() {},
  47132. _setValue_unavailable: function() {},
  47133. _getValue_unbound: n.PropertyBinding.prototype.getValue,
  47134. _setValue_unbound: n.PropertyBinding.prototype.setValue,
  47135. BindingType: {
  47136. Direct: 0,
  47137. EntireArray: 1,
  47138. ArrayElement: 2,
  47139. HasFromToArray: 3
  47140. },
  47141. Versioning: {
  47142. None: 0,
  47143. NeedsUpdate: 1,
  47144. MatrixWorldNeedsUpdate: 2
  47145. },
  47146. GetterByBindingType: [function(e, t) {
  47147. e[t] = this.node[this.propertyName]
  47148. }
  47149. , function(e, t) {
  47150. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  47151. e[t++] = i[n]
  47152. }
  47153. , function(e, t) {
  47154. e[t] = this.resolvedProperty[this.propertyIndex]
  47155. }
  47156. , function(e, t) {
  47157. this.resolvedProperty.toArray(e, t)
  47158. }
  47159. ],
  47160. SetterByBindingTypeAndVersioning: [[function(e, t) {
  47161. this.node[this.propertyName] = e[t]
  47162. }
  47163. , function(e, t) {
  47164. this.node[this.propertyName] = e[t],
  47165. this.targetObject.needsUpdate = !0
  47166. }
  47167. , function(e, t) {
  47168. this.node[this.propertyName] = e[t],
  47169. this.targetObject.matrixWorldNeedsUpdate = !0
  47170. }
  47171. ], [function(e, t) {
  47172. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  47173. i[n] = e[t++]
  47174. }
  47175. , function(e, t) {
  47176. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  47177. i[n] = e[t++];
  47178. this.targetObject.needsUpdate = !0
  47179. }
  47180. , function(e, t) {
  47181. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  47182. i[n] = e[t++];
  47183. this.targetObject.matrixWorldNeedsUpdate = !0
  47184. }
  47185. ], [function(e, t) {
  47186. this.resolvedProperty[this.propertyIndex] = e[t]
  47187. }
  47188. , function(e, t) {
  47189. this.resolvedProperty[this.propertyIndex] = e[t],
  47190. this.targetObject.needsUpdate = !0
  47191. }
  47192. , function(e, t) {
  47193. this.resolvedProperty[this.propertyIndex] = e[t],
  47194. this.targetObject.matrixWorldNeedsUpdate = !0
  47195. }
  47196. ], [function(e, t) {
  47197. this.resolvedProperty.fromArray(e, t)
  47198. }
  47199. , function(e, t) {
  47200. this.resolvedProperty.fromArray(e, t),
  47201. this.targetObject.needsUpdate = !0
  47202. }
  47203. , function(e, t) {
  47204. this.resolvedProperty.fromArray(e, t),
  47205. this.targetObject.matrixWorldNeedsUpdate = !0
  47206. }
  47207. ]]
  47208. }),
  47209. n.PropertyBinding.Composite = function(e, t, i) {
  47210. var r = i || n.PropertyBinding.parseTrackName(t);
  47211. this._targetGroup = e,
  47212. this._bindings = e.subscribe_(t, r)
  47213. }
  47214. ,
  47215. n.PropertyBinding.Composite.prototype = {
  47216. constructor: n.PropertyBinding.Composite,
  47217. getValue: function(e, t) {
  47218. this.bind();
  47219. var i = this._targetGroup.nCachedObjects_
  47220. , n = this._bindings[i];
  47221. void 0 !== n && n.getValue(e, t)
  47222. },
  47223. setValue: function(e, t) {
  47224. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  47225. i[n].setValue(e, t)
  47226. },
  47227. bind: function() {
  47228. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  47229. e[t].bind()
  47230. },
  47231. unbind: function() {
  47232. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  47233. e[t].unbind()
  47234. }
  47235. },
  47236. n.PropertyBinding.create = function(e, t, i) {
  47237. return e instanceof n.AnimationObjectGroup ? new n.PropertyBinding.Composite(e,t,i) : new n.PropertyBinding(e,t,i)
  47238. }
  47239. ,
  47240. n.PropertyBinding.parseTrackName = function(e) {
  47241. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  47242. , i = t.exec(e);
  47243. if (!i)
  47244. throw new Error("cannot parse trackName at all: " + e);
  47245. i.index === t.lastIndex && t.lastIndex++;
  47246. var n = {
  47247. nodeName: i[3],
  47248. objectName: i[5],
  47249. objectIndex: i[7],
  47250. propertyName: i[9],
  47251. propertyIndex: i[11]
  47252. };
  47253. if (null === n.propertyName || 0 === n.propertyName.length)
  47254. throw new Error("can not parse propertyName from trackName: " + e);
  47255. return n
  47256. }
  47257. ,
  47258. n.PropertyBinding.findNode = function(e, t) {
  47259. if (!t || "" === t || "root" === t || "." === t || t === -1 || t === e.name || t === e.uuid)
  47260. return e;
  47261. if (e.skeleton) {
  47262. var i = function(e) {
  47263. for (var i = 0; i < e.bones.length; i++) {
  47264. var n = e.bones[i];
  47265. if (n.name === t)
  47266. return n
  47267. }
  47268. return null
  47269. }
  47270. , n = i(e.skeleton);
  47271. if (n)
  47272. return n
  47273. }
  47274. if (e.children) {
  47275. var r = function(e) {
  47276. for (var i = 0; i < e.length; i++) {
  47277. var n = e[i];
  47278. if (n.name === t || n.uuid === t)
  47279. return n;
  47280. var o = r(n.children);
  47281. if (o)
  47282. return o
  47283. }
  47284. return null
  47285. }
  47286. , o = r(e.children);
  47287. if (o)
  47288. return o
  47289. }
  47290. return null
  47291. }
  47292. ,
  47293. n.PropertyMixer = function(e, t, i) {
  47294. this.binding = e,
  47295. this.valueSize = i;
  47296. var n, r = Float64Array;
  47297. switch (t) {
  47298. case "quaternion":
  47299. n = this._slerp;
  47300. break;
  47301. case "string":
  47302. case "bool":
  47303. r = Array,
  47304. n = this._select;
  47305. break;
  47306. default:
  47307. n = this._lerp
  47308. }
  47309. this.buffer = new r(4 * i),
  47310. this._mixBufferRegion = n,
  47311. this.cumulativeWeight = 0,
  47312. this.useCount = 0,
  47313. this.referenceCount = 0
  47314. }
  47315. ,
  47316. n.PropertyMixer.prototype = {
  47317. constructor: n.PropertyMixer,
  47318. accumulate: function(e, t) {
  47319. var i = this.buffer
  47320. , n = this.valueSize
  47321. , r = e * n + n
  47322. , o = this.cumulativeWeight;
  47323. if (0 === o) {
  47324. for (var a = 0; a !== n; ++a)
  47325. i[r + a] = i[a];
  47326. o = t
  47327. } else {
  47328. o += t;
  47329. var s = t / o;
  47330. this._mixBufferRegion(i, r, 0, s, n)
  47331. }
  47332. this.cumulativeWeight = o
  47333. },
  47334. apply: function(e) {
  47335. var t = this.valueSize
  47336. , i = this.buffer
  47337. , n = e * t + t
  47338. , r = this.cumulativeWeight
  47339. , o = this.binding;
  47340. if (this.cumulativeWeight = 0,
  47341. r < 1) {
  47342. var a = 3 * t;
  47343. this._mixBufferRegion(i, n, a, 1 - r, t)
  47344. }
  47345. for (var s = t, l = t + t; s !== l; ++s)
  47346. if (i[s] !== i[s + t]) {
  47347. o.setValue(i, n);
  47348. break
  47349. }
  47350. },
  47351. saveOriginalState: function() {
  47352. var e = this.binding
  47353. , t = this.buffer
  47354. , i = this.valueSize
  47355. , n = 3 * i;
  47356. e.getValue(t, n);
  47357. for (var r = i, o = n; r !== o; ++r)
  47358. t[r] = t[n + r % i];
  47359. this.cumulativeWeight = 0
  47360. },
  47361. restoreOriginalState: function() {
  47362. var e = 3 * this.valueSize;
  47363. this.binding.setValue(this.buffer, e)
  47364. },
  47365. _select: function(e, t, i, n, r) {
  47366. if (n >= .5)
  47367. for (var o = 0; o !== r; ++o)
  47368. e[t + o] = e[i + o]
  47369. },
  47370. _slerp: function(e, t, i, r, o) {
  47371. n.Quaternion.slerpFlat(e, t, e, t, e, i, r)
  47372. },
  47373. _lerp: function(e, t, i, n, r) {
  47374. for (var o = 1 - n, a = 0; a !== r; ++a) {
  47375. var s = t + a;
  47376. e[s] = e[s] * o + e[i + a] * n
  47377. }
  47378. }
  47379. },
  47380. n.BooleanKeyframeTrack = function(e, t, i) {
  47381. n.KeyframeTrack.call(this, e, t, i)
  47382. }
  47383. ,
  47384. n.BooleanKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47385. constructor: n.BooleanKeyframeTrack,
  47386. ValueTypeName: "bool",
  47387. ValueBufferType: Array,
  47388. DefaultInterpolation: n.IntepolateDiscrete,
  47389. InterpolantFactoryMethodLinear: void 0,
  47390. InterpolantFactoryMethodSmooth: void 0
  47391. }),
  47392. n.NumberKeyframeTrack = function(e, t, i, r) {
  47393. n.KeyframeTrack.call(this, e, t, i, r)
  47394. }
  47395. ,
  47396. n.NumberKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47397. constructor: n.NumberKeyframeTrack,
  47398. ValueTypeName: "number"
  47399. }),
  47400. n.QuaternionKeyframeTrack = function(e, t, i, r) {
  47401. n.KeyframeTrack.call(this, e, t, i, r)
  47402. }
  47403. ,
  47404. n.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47405. constructor: n.QuaternionKeyframeTrack,
  47406. ValueTypeName: "quaternion",
  47407. DefaultInterpolation: n.InterpolateLinear,
  47408. InterpolantFactoryMethodLinear: function(e) {
  47409. return new n.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  47410. },
  47411. InterpolantFactoryMethodSmooth: void 0
  47412. }),
  47413. n.StringKeyframeTrack = function(e, t, i, r) {
  47414. n.KeyframeTrack.call(this, e, t, i, r)
  47415. }
  47416. ,
  47417. n.StringKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47418. constructor: n.StringKeyframeTrack,
  47419. ValueTypeName: "string",
  47420. ValueBufferType: Array,
  47421. DefaultInterpolation: n.IntepolateDiscrete,
  47422. InterpolantFactoryMethodLinear: void 0,
  47423. InterpolantFactoryMethodSmooth: void 0
  47424. }),
  47425. n.VectorKeyframeTrack = function(e, t, i, r) {
  47426. n.KeyframeTrack.call(this, e, t, i, r)
  47427. }
  47428. ,
  47429. n.VectorKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47430. constructor: n.VectorKeyframeTrack,
  47431. ValueTypeName: "vector"
  47432. }),
  47433. n.Audio = function(e) {
  47434. n.Object3D.call(this),
  47435. this.type = "Audio",
  47436. this.context = e.context,
  47437. this.source = this.context.createBufferSource(),
  47438. this.source.onended = this.onEnded.bind(this),
  47439. this.gain = this.context.createGain(),
  47440. this.gain.connect(e.getInput()),
  47441. this.autoplay = !1,
  47442. this.startTime = 0,
  47443. this.playbackRate = 1,
  47444. this.isPlaying = !1,
  47445. this.hasPlaybackControl = !0,
  47446. this.sourceType = "empty",
  47447. this.filter = null
  47448. }
  47449. ,
  47450. n.Audio.prototype = Object.create(n.Object3D.prototype),
  47451. n.Audio.prototype.constructor = n.Audio,
  47452. n.Audio.prototype.getOutput = function() {
  47453. return this.gain
  47454. }
  47455. ,
  47456. n.Audio.prototype.load = function(e) {
  47457. var t = new n.AudioBuffer(this.context);
  47458. return t.load(e),
  47459. this.setBuffer(t),
  47460. this
  47461. }
  47462. ,
  47463. n.Audio.prototype.setNodeSource = function(e) {
  47464. return this.hasPlaybackControl = !1,
  47465. this.sourceType = "audioNode",
  47466. this.source = e,
  47467. this.connect(),
  47468. this
  47469. }
  47470. ,
  47471. n.Audio.prototype.setBuffer = function(e) {
  47472. var t = this;
  47473. return e.onReady(function(e) {
  47474. t.source.buffer = e,
  47475. t.sourceType = "buffer",
  47476. t.autoplay && t.play()
  47477. }),
  47478. this
  47479. }
  47480. ,
  47481. n.Audio.prototype.play = function() {
  47482. if (this.isPlaying === !0)
  47483. return void console.warn("THREE.Audio: Audio is already playing.");
  47484. if (this.hasPlaybackControl === !1)
  47485. return void console.warn("THREE.Audio: this Audio has no playback control.");
  47486. var e = this.context.createBufferSource();
  47487. e.buffer = this.source.buffer,
  47488. e.loop = this.source.loop,
  47489. e.onended = this.source.onended,
  47490. e.start(0, this.startTime),
  47491. e.playbackRate.value = this.playbackRate,
  47492. this.isPlaying = !0,
  47493. this.source = e,
  47494. this.connect()
  47495. }
  47496. ,
  47497. n.Audio.prototype.pause = function() {
  47498. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  47499. void (this.startTime = this.context.currentTime))
  47500. }
  47501. ,
  47502. n.Audio.prototype.stop = function() {
  47503. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  47504. void (this.startTime = 0))
  47505. }
  47506. ,
  47507. n.Audio.prototype.connect = function() {
  47508. null !== this.filter ? (this.source.connect(this.filter),
  47509. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  47510. }
  47511. ,
  47512. n.Audio.prototype.disconnect = function() {
  47513. null !== this.filter ? (this.source.disconnect(this.filter),
  47514. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  47515. }
  47516. ,
  47517. n.Audio.prototype.getFilter = function() {
  47518. return this.filter
  47519. }
  47520. ,
  47521. n.Audio.prototype.setFilter = function(e) {
  47522. void 0 === e && (e = null),
  47523. this.isPlaying === !0 ? (this.disconnect(),
  47524. this.filter = e,
  47525. this.connect()) : this.filter = e
  47526. }
  47527. ,
  47528. n.Audio.prototype.setPlaybackRate = function(e) {
  47529. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  47530. void (this.isPlaying === !0 && (this.source.playbackRate.value = this.playbackRate)))
  47531. }
  47532. ,
  47533. n.Audio.prototype.getPlaybackRate = function() {
  47534. return this.playbackRate
  47535. }
  47536. ,
  47537. n.Audio.prototype.onEnded = function() {
  47538. this.isPlaying = !1
  47539. }
  47540. ,
  47541. n.Audio.prototype.setLoop = function(e) {
  47542. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  47543. }
  47544. ,
  47545. n.Audio.prototype.getLoop = function() {
  47546. return this.hasPlaybackControl === !1 ? (console.warn("THREE.Audio: this Audio has no playback control."),
  47547. !1) : this.source.loop
  47548. }
  47549. ,
  47550. n.Audio.prototype.setVolume = function(e) {
  47551. this.gain.gain.value = e
  47552. }
  47553. ,
  47554. n.Audio.prototype.getVolume = function() {
  47555. return this.gain.gain.value
  47556. }
  47557. ,
  47558. n.AudioAnalyser = function(e, t) {
  47559. this.analyser = e.context.createAnalyser(),
  47560. this.analyser.fftSize = void 0 !== t ? t : 2048,
  47561. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  47562. e.getOutput().connect(this.analyser)
  47563. }
  47564. ,
  47565. n.AudioAnalyser.prototype = {
  47566. constructor: n.AudioAnalyser,
  47567. getData: function() {
  47568. return this.analyser.getByteFrequencyData(this.data),
  47569. this.data
  47570. }
  47571. },
  47572. n.AudioBuffer = function(e) {
  47573. this.context = e,
  47574. this.ready = !1,
  47575. this.readyCallbacks = []
  47576. }
  47577. ,
  47578. n.AudioBuffer.prototype.load = function(e) {
  47579. var t = this
  47580. , i = new XMLHttpRequest;
  47581. return i.open("GET", e, !0),
  47582. i.responseType = "arraybuffer",
  47583. i.onload = function(e) {
  47584. t.context.decodeAudioData(this.response, function(e) {
  47585. t.buffer = e,
  47586. t.ready = !0;
  47587. for (var i = 0; i < t.readyCallbacks.length; i++)
  47588. t.readyCallbacks[i](t.buffer);
  47589. t.readyCallbacks = []
  47590. })
  47591. }
  47592. ,
  47593. i.send(),
  47594. this
  47595. }
  47596. ,
  47597. n.AudioBuffer.prototype.onReady = function(e) {
  47598. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  47599. }
  47600. ,
  47601. n.PositionalAudio = function(e) {
  47602. n.Audio.call(this, e),
  47603. this.panner = this.context.createPanner(),
  47604. this.panner.connect(this.gain)
  47605. }
  47606. ,
  47607. n.PositionalAudio.prototype = Object.create(n.Audio.prototype),
  47608. n.PositionalAudio.prototype.constructor = n.PositionalAudio,
  47609. n.PositionalAudio.prototype.getOutput = function() {
  47610. return this.panner
  47611. }
  47612. ,
  47613. n.PositionalAudio.prototype.setRefDistance = function(e) {
  47614. this.panner.refDistance = e
  47615. }
  47616. ,
  47617. n.PositionalAudio.prototype.getRefDistance = function() {
  47618. return this.panner.refDistance
  47619. }
  47620. ,
  47621. n.PositionalAudio.prototype.setRolloffFactor = function(e) {
  47622. this.panner.rolloffFactor = e
  47623. }
  47624. ,
  47625. n.PositionalAudio.prototype.getRolloffFactor = function() {
  47626. return this.panner.rolloffFactor
  47627. }
  47628. ,
  47629. n.PositionalAudio.prototype.setDistanceModel = function(e) {
  47630. this.panner.distanceModel = e
  47631. }
  47632. ,
  47633. n.PositionalAudio.prototype.getDistanceModel = function() {
  47634. return this.panner.distanceModel
  47635. }
  47636. ,
  47637. n.PositionalAudio.prototype.setMaxDistance = function(e) {
  47638. this.panner.maxDistance = e
  47639. }
  47640. ,
  47641. n.PositionalAudio.prototype.getMaxDistance = function() {
  47642. return this.panner.maxDistance
  47643. }
  47644. ,
  47645. n.PositionalAudio.prototype.updateMatrixWorld = function() {
  47646. var e = new n.Vector3;
  47647. return function(t) {
  47648. n.Object3D.prototype.updateMatrixWorld.call(this, t),
  47649. e.setFromMatrixPosition(this.matrixWorld),
  47650. this.panner.setPosition(e.x, e.y, e.z)
  47651. }
  47652. }(),
  47653. n.AudioListener = function() {
  47654. n.Object3D.call(this),
  47655. this.type = "AudioListener",
  47656. this.context = new (window.AudioContext || window.webkitAudioContext),
  47657. this.gain = this.context.createGain(),
  47658. this.gain.connect(this.context.destination),
  47659. this.filter = null
  47660. }
  47661. ,
  47662. n.AudioListener.prototype = Object.create(n.Object3D.prototype),
  47663. n.AudioListener.prototype.constructor = n.AudioListener,
  47664. n.AudioListener.prototype.getInput = function() {
  47665. return this.gain
  47666. }
  47667. ,
  47668. n.AudioListener.prototype.removeFilter = function() {
  47669. null !== this.filter && (this.gain.disconnect(this.filter),
  47670. this.filter.disconnect(this.context.destination),
  47671. this.gain.connect(this.context.destination),
  47672. this.filter = null)
  47673. }
  47674. ,
  47675. n.AudioListener.prototype.setFilter = function(e) {
  47676. null !== this.filter ? (this.gain.disconnect(this.filter),
  47677. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  47678. this.filter = e,
  47679. this.gain.connect(this.filter),
  47680. this.filter.connect(this.context.destination)
  47681. }
  47682. ,
  47683. n.AudioListener.prototype.getFilter = function() {
  47684. return this.filter
  47685. }
  47686. ,
  47687. n.AudioListener.prototype.setMasterVolume = function(e) {
  47688. this.gain.gain.value = e
  47689. }
  47690. ,
  47691. n.AudioListener.prototype.getMasterVolume = function() {
  47692. return this.gain.gain.value
  47693. }
  47694. ,
  47695. n.AudioListener.prototype.updateMatrixWorld = function() {
  47696. var e = new n.Vector3
  47697. , t = new n.Quaternion
  47698. , i = new n.Vector3
  47699. , r = new n.Vector3;
  47700. return function(o) {
  47701. n.Object3D.prototype.updateMatrixWorld.call(this, o);
  47702. var a = this.context.listener
  47703. , s = this.up;
  47704. this.matrixWorld.decompose(e, t, i),
  47705. r.set(0, 0, -1).applyQuaternion(t),
  47706. a.setPosition(e.x, e.y, e.z),
  47707. a.setOrientation(r.x, r.y, r.z, s.x, s.y, s.z)
  47708. }
  47709. }(),
  47710. n.Camera = function() {
  47711. n.Object3D.call(this),
  47712. this.type = "Camera",
  47713. this.matrixWorldInverse = new n.Matrix4,
  47714. this.projectionMatrix = new n.Matrix4
  47715. }
  47716. ,
  47717. n.Camera.prototype = Object.create(n.Object3D.prototype),
  47718. n.Camera.prototype.constructor = n.Camera,
  47719. n.Camera.prototype.getWorldDirection = function() {
  47720. var e = new n.Quaternion;
  47721. return function(t) {
  47722. var i = t || new n.Vector3;
  47723. return this.getWorldQuaternion(e),
  47724. i.set(0, 0, -1).applyQuaternion(e)
  47725. }
  47726. }(),
  47727. n.Camera.prototype.lookAt = function() {
  47728. var e = new n.Matrix4;
  47729. return function(t) {
  47730. e.lookAt(this.position, t, this.up),
  47731. this.quaternion.setFromRotationMatrix(e)
  47732. }
  47733. }(),
  47734. n.Camera.prototype.clone = function() {
  47735. return (new this.constructor).copy(this)
  47736. }
  47737. ,
  47738. n.Camera.prototype.copy = function(e) {
  47739. return n.Object3D.prototype.copy.call(this, e),
  47740. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  47741. this.projectionMatrix.copy(e.projectionMatrix),
  47742. this
  47743. }
  47744. ,
  47745. n.CubeCamera = function(e, t, i) {
  47746. n.Object3D.call(this),
  47747. this.type = "CubeCamera";
  47748. var r = 90
  47749. , o = 1
  47750. , a = new n.PerspectiveCamera(r,o,e,t);
  47751. a.up.set(0, -1, 0),
  47752. a.lookAt(new n.Vector3(1,0,0)),
  47753. this.add(a);
  47754. var s = new n.PerspectiveCamera(r,o,e,t);
  47755. s.up.set(0, -1, 0),
  47756. s.lookAt(new n.Vector3(-1,0,0)),
  47757. this.add(s);
  47758. var l = new n.PerspectiveCamera(r,o,e,t);
  47759. l.up.set(0, 0, 1),
  47760. l.lookAt(new n.Vector3(0,1,0)),
  47761. this.add(l);
  47762. var c = new n.PerspectiveCamera(r,o,e,t);
  47763. c.up.set(0, 0, -1),
  47764. c.lookAt(new n.Vector3(0,-1,0)),
  47765. this.add(c);
  47766. var h = new n.PerspectiveCamera(r,o,e,t);
  47767. h.up.set(0, -1, 0),
  47768. h.lookAt(new n.Vector3(0,0,1)),
  47769. this.add(h);
  47770. var u = new n.PerspectiveCamera(r,o,e,t);
  47771. u.up.set(0, -1, 0),
  47772. u.lookAt(new n.Vector3(0,0,-1)),
  47773. this.add(u);
  47774. var d = {
  47775. format: n.RGBFormat,
  47776. magFilter: n.LinearFilter,
  47777. minFilter: n.LinearFilter
  47778. };
  47779. this.renderTarget = new n.WebGLRenderTargetCube(i,i,d),
  47780. this.updateCubeMap = function(e, t) {
  47781. null === this.parent && this.updateMatrixWorld();
  47782. var i = this.renderTarget
  47783. , n = i.texture.generateMipmaps;
  47784. i.texture.generateMipmaps = !1,
  47785. i.activeCubeFace = 0,
  47786. e.render(t, a, i),
  47787. i.activeCubeFace = 1,
  47788. e.render(t, s, i),
  47789. i.activeCubeFace = 2,
  47790. e.render(t, l, i),
  47791. i.activeCubeFace = 3,
  47792. e.render(t, c, i),
  47793. i.activeCubeFace = 4,
  47794. e.render(t, h, i),
  47795. i.texture.generateMipmaps = n,
  47796. i.activeCubeFace = 5,
  47797. e.render(t, u, i),
  47798. e.setRenderTarget(null)
  47799. }
  47800. }
  47801. ,
  47802. n.CubeCamera.prototype = Object.create(n.Object3D.prototype),
  47803. n.CubeCamera.prototype.constructor = n.CubeCamera,
  47804. n.OrthographicCamera = function(e, t, i, r, o, a) {
  47805. n.Camera.call(this),
  47806. this.type = "OrthographicCamera",
  47807. this.zoom = 1,
  47808. this.left = e,
  47809. this.right = t,
  47810. this.top = i,
  47811. this.bottom = r,
  47812. this.near = void 0 !== o ? o : .1,
  47813. this.far = void 0 !== a ? a : 2e3,
  47814. this.updateProjectionMatrix()
  47815. }
  47816. ,
  47817. n.OrthographicCamera.prototype = Object.create(n.Camera.prototype),
  47818. n.OrthographicCamera.prototype.constructor = n.OrthographicCamera,
  47819. n.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  47820. var e = (this.right - this.left) / (2 * this.zoom)
  47821. , t = (this.top - this.bottom) / (2 * this.zoom)
  47822. , i = (this.right + this.left) / 2
  47823. , n = (this.top + this.bottom) / 2;
  47824. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  47825. }
  47826. ,
  47827. n.OrthographicCamera.prototype.copy = function(e) {
  47828. return n.Camera.prototype.copy.call(this, e),
  47829. this.left = e.left,
  47830. this.right = e.right,
  47831. this.top = e.top,
  47832. this.bottom = e.bottom,
  47833. this.near = e.near,
  47834. this.far = e.far,
  47835. this.zoom = e.zoom,
  47836. this
  47837. }
  47838. ,
  47839. n.OrthographicCamera.prototype.toJSON = function(e) {
  47840. var t = n.Object3D.prototype.toJSON.call(this, e);
  47841. return t.object.zoom = this.zoom,
  47842. t.object.left = this.left,
  47843. t.object.right = this.right,
  47844. t.object.top = this.top,
  47845. t.object.bottom = this.bottom,
  47846. t.object.near = this.near,
  47847. t.object.far = this.far,
  47848. t
  47849. }
  47850. ,
  47851. n.PerspectiveCamera = function(e, t, i, r) {
  47852. n.Camera.call(this),
  47853. this.type = "PerspectiveCamera",
  47854. this.focalLength = 10,
  47855. this.zoom = 1,
  47856. this.fov = void 0 !== e ? e : 50,
  47857. this.aspect = void 0 !== t ? t : 1,
  47858. this.near = void 0 !== i ? i : .1,
  47859. this.far = void 0 !== r ? r : 2e3,
  47860. this.updateProjectionMatrix()
  47861. }
  47862. ,
  47863. n.PerspectiveCamera.prototype = Object.create(n.Camera.prototype),
  47864. n.PerspectiveCamera.prototype.constructor = n.PerspectiveCamera,
  47865. n.PerspectiveCamera.prototype.setLens = function(e, t) {
  47866. void 0 === t && (t = 24),
  47867. this.fov = 2 * n.Math.radToDeg(Math.atan(t / (2 * e))),
  47868. this.updateProjectionMatrix()
  47869. }
  47870. ,
  47871. n.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  47872. this.fullWidth = e,
  47873. this.fullHeight = t,
  47874. this.x = i,
  47875. this.y = n,
  47876. this.width = r,
  47877. this.height = o,
  47878. this.updateProjectionMatrix()
  47879. }
  47880. ,
  47881. n.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  47882. var e = n.Math.radToDeg(2 * Math.atan(Math.tan(.5 * n.Math.degToRad(this.fov)) / this.zoom));
  47883. if (this.fullWidth) {
  47884. var t = this.fullWidth / this.fullHeight
  47885. , i = Math.tan(n.Math.degToRad(.5 * e)) * this.near
  47886. , r = -i
  47887. , o = t * r
  47888. , a = t * i
  47889. , s = Math.abs(a - o)
  47890. , l = Math.abs(i - r);
  47891. 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)
  47892. } else
  47893. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  47894. }
  47895. ,
  47896. n.PerspectiveCamera.prototype.copy = function(e) {
  47897. return n.Camera.prototype.copy.call(this, e),
  47898. this.focalLength = e.focalLength,
  47899. this.zoom = e.zoom,
  47900. this.fov = e.fov,
  47901. this.aspect = e.aspect,
  47902. this.near = e.near,
  47903. this.far = e.far,
  47904. this
  47905. }
  47906. ,
  47907. n.PerspectiveCamera.prototype.toJSON = function(e) {
  47908. var t = n.Object3D.prototype.toJSON.call(this, e);
  47909. return t.object.focalLength = this.focalLength,
  47910. t.object.zoom = this.zoom,
  47911. t.object.fov = this.fov,
  47912. t.object.aspect = this.aspect,
  47913. t.object.near = this.near,
  47914. t.object.far = this.far,
  47915. t
  47916. }
  47917. ,
  47918. n.StereoCamera = function() {
  47919. this.type = "StereoCamera",
  47920. this.aspect = 1,
  47921. this.cameraL = new n.PerspectiveCamera,
  47922. this.cameraL.layers.enable(1),
  47923. this.cameraL.matrixAutoUpdate = !1,
  47924. this.cameraR = new n.PerspectiveCamera,
  47925. this.cameraR.layers.enable(2),
  47926. this.cameraR.matrixAutoUpdate = !1
  47927. }
  47928. ,
  47929. n.StereoCamera.prototype = {
  47930. constructor: n.StereoCamera,
  47931. update: function() {
  47932. var e, t, i, r, o, a = new n.Matrix4, s = new n.Matrix4;
  47933. return function(l) {
  47934. var c = e !== l.focalLength || t !== l.fov || i !== l.aspect * this.aspect || r !== l.near || o !== l.far;
  47935. if (c) {
  47936. e = l.focalLength,
  47937. t = l.fov,
  47938. i = l.aspect * this.aspect,
  47939. r = l.near,
  47940. o = l.far;
  47941. var h, u, d = l.projectionMatrix.clone(), p = .032, f = p * r / e, g = r * Math.tan(n.Math.degToRad(.5 * t));
  47942. s.elements[12] = -p,
  47943. a.elements[12] = p,
  47944. h = -g * i + f,
  47945. u = g * i + f,
  47946. d.elements[0] = 2 * r / (u - h),
  47947. d.elements[8] = (u + h) / (u - h),
  47948. this.cameraL.projectionMatrix.copy(d),
  47949. h = -g * i - f,
  47950. u = g * i - f,
  47951. d.elements[0] = 2 * r / (u - h),
  47952. d.elements[8] = (u + h) / (u - h),
  47953. this.cameraR.projectionMatrix.copy(d)
  47954. }
  47955. this.cameraL.matrixWorld.copy(l.matrixWorld).multiply(s),
  47956. this.cameraR.matrixWorld.copy(l.matrixWorld).multiply(a)
  47957. }
  47958. }()
  47959. },
  47960. n.Light = function(e, t) {
  47961. n.Object3D.call(this),
  47962. this.type = "Light",
  47963. this.color = new n.Color(e),
  47964. this.intensity = void 0 !== t ? t : 1,
  47965. this.receiveShadow = void 0
  47966. }
  47967. ,
  47968. n.Light.prototype = Object.create(n.Object3D.prototype),
  47969. n.Light.prototype.constructor = n.Light,
  47970. n.Light.prototype.copy = function(e) {
  47971. return n.Object3D.prototype.copy.call(this, e),
  47972. this.color.copy(e.color),
  47973. this.intensity = e.intensity,
  47974. this
  47975. }
  47976. ,
  47977. n.Light.prototype.toJSON = function(e) {
  47978. var t = n.Object3D.prototype.toJSON.call(this, e);
  47979. return t.object.color = this.color.getHex(),
  47980. t.object.intensity = this.intensity,
  47981. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  47982. void 0 !== this.distance && (t.object.distance = this.distance),
  47983. void 0 !== this.angle && (t.object.angle = this.angle),
  47984. void 0 !== this.decay && (t.object.decay = this.decay),
  47985. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  47986. t
  47987. }
  47988. ,
  47989. n.LightShadow = function(e) {
  47990. this.camera = e,
  47991. this.bias = 0,
  47992. this.radius = 1,
  47993. this.mapSize = new n.Vector2(512,512),
  47994. this.map = null,
  47995. this.matrix = new n.Matrix4
  47996. }
  47997. ,
  47998. n.LightShadow.prototype = {
  47999. constructor: n.LightShadow,
  48000. copy: function(e) {
  48001. return this.camera = e.camera.clone(),
  48002. this.bias = e.bias,
  48003. this.radius = e.radius,
  48004. this.mapSize.copy(e.mapSize),
  48005. this
  48006. },
  48007. clone: function() {
  48008. return (new this.constructor).copy(this)
  48009. }
  48010. },
  48011. n.AmbientLight = function(e, t) {
  48012. n.Light.call(this, e, t),
  48013. this.type = "AmbientLight",
  48014. this.castShadow = void 0
  48015. }
  48016. ,
  48017. n.AmbientLight.prototype = Object.create(n.Light.prototype),
  48018. n.AmbientLight.prototype.constructor = n.AmbientLight,
  48019. n.DirectionalLight = function(e, t) {
  48020. n.Light.call(this, e, t),
  48021. this.type = "DirectionalLight",
  48022. this.position.set(0, 1, 0),
  48023. this.updateMatrix(),
  48024. this.target = new n.Object3D,
  48025. this.shadow = new n.LightShadow(new n.OrthographicCamera(-5,5,5,-5,.5,500))
  48026. }
  48027. ,
  48028. n.DirectionalLight.prototype = Object.create(n.Light.prototype),
  48029. n.DirectionalLight.prototype.constructor = n.DirectionalLight,
  48030. n.DirectionalLight.prototype.copy = function(e) {
  48031. return n.Light.prototype.copy.call(this, e),
  48032. this.target = e.target.clone(),
  48033. this.shadow = e.shadow.clone(),
  48034. this
  48035. }
  48036. ,
  48037. n.HemisphereLight = function(e, t, i) {
  48038. n.Light.call(this, e, i),
  48039. this.type = "HemisphereLight",
  48040. this.castShadow = void 0,
  48041. this.position.set(0, 1, 0),
  48042. this.updateMatrix(),
  48043. this.groundColor = new n.Color(t)
  48044. }
  48045. ,
  48046. n.HemisphereLight.prototype = Object.create(n.Light.prototype),
  48047. n.HemisphereLight.prototype.constructor = n.HemisphereLight,
  48048. n.HemisphereLight.prototype.copy = function(e) {
  48049. return n.Light.prototype.copy.call(this, e),
  48050. this.groundColor.copy(e.groundColor),
  48051. this
  48052. }
  48053. ,
  48054. n.PointLight = function(e, t, i, r) {
  48055. n.Light.call(this, e, t),
  48056. this.type = "PointLight",
  48057. this.distance = void 0 !== i ? i : 0,
  48058. this.decay = void 0 !== r ? r : 1,
  48059. this.shadow = new n.LightShadow(new n.PerspectiveCamera(90,1,.5,500))
  48060. }
  48061. ,
  48062. n.PointLight.prototype = Object.create(n.Light.prototype),
  48063. n.PointLight.prototype.constructor = n.PointLight,
  48064. Object.defineProperty(n.PointLight.prototype, "power", {
  48065. get: function() {
  48066. return 4 * this.intensity * Math.PI
  48067. },
  48068. set: function(e) {
  48069. this.intensity = e / (4 * Math.PI)
  48070. }
  48071. }),
  48072. n.PointLight.prototype.copy = function(e) {
  48073. return n.Light.prototype.copy.call(this, e),
  48074. this.distance = e.distance,
  48075. this.decay = e.decay,
  48076. this.shadow = e.shadow.clone(),
  48077. this
  48078. }
  48079. ,
  48080. n.SpotLight = function(e, t, i, r, o, a) {
  48081. n.Light.call(this, e, t),
  48082. this.type = "SpotLight",
  48083. this.position.set(0, 1, 0),
  48084. this.updateMatrix(),
  48085. this.target = new n.Object3D,
  48086. this.distance = void 0 !== i ? i : 0,
  48087. this.angle = void 0 !== r ? r : Math.PI / 3,
  48088. this.penumbra = void 0 !== o ? o : 0,
  48089. this.decay = void 0 !== a ? a : 1,
  48090. this.shadow = new n.LightShadow(new n.PerspectiveCamera(50,1,.5,500))
  48091. }
  48092. ,
  48093. n.SpotLight.prototype = Object.create(n.Light.prototype),
  48094. n.SpotLight.prototype.constructor = n.SpotLight,
  48095. Object.defineProperty(n.SpotLight.prototype, "power", {
  48096. get: function() {
  48097. return this.intensity * Math.PI
  48098. },
  48099. set: function(e) {
  48100. this.intensity = e / Math.PI
  48101. }
  48102. }),
  48103. n.SpotLight.prototype.copy = function(e) {
  48104. return n.Light.prototype.copy.call(this, e),
  48105. this.distance = e.distance,
  48106. this.angle = e.angle,
  48107. this.penumbra = e.penumbra,
  48108. this.decay = e.decay,
  48109. this.target = e.target.clone(),
  48110. this.shadow = e.shadow.clone(),
  48111. this
  48112. }
  48113. ,
  48114. n.Cache = {
  48115. enabled: !1,
  48116. files: {},
  48117. add: function(e, t) {
  48118. this.enabled !== !1 && (this.files[e] = t)
  48119. },
  48120. get: function(e) {
  48121. if (this.enabled !== !1)
  48122. return this.files[e]
  48123. },
  48124. remove: function(e) {
  48125. delete this.files[e]
  48126. },
  48127. clear: function() {
  48128. this.files = {}
  48129. }
  48130. },
  48131. n.Loader = function() {
  48132. this.onLoadStart = function() {}
  48133. ,
  48134. this.onLoadProgress = function() {}
  48135. ,
  48136. this.onLoadComplete = function() {}
  48137. }
  48138. ,
  48139. n.Loader.prototype = {
  48140. constructor: n.Loader,
  48141. crossOrigin: void 0,
  48142. extractUrlBase: function(e) {
  48143. var t = e.split("/");
  48144. return 1 === t.length ? "./" : (t.pop(),
  48145. t.join("/") + "/")
  48146. },
  48147. initMaterials: function(e, t, i) {
  48148. for (var n = [], r = 0; r < e.length; ++r)
  48149. n[r] = this.createMaterial(e[r], t, i);
  48150. return n
  48151. },
  48152. createMaterial: function() {
  48153. var e, t, i;
  48154. return function(r, o, a) {
  48155. function s(e, i, r, s, c) {
  48156. var h, u = o + e, d = n.Loader.Handlers.get(u);
  48157. null !== d ? h = d.load(u) : (t.setCrossOrigin(a),
  48158. h = t.load(u)),
  48159. void 0 !== i && (h.repeat.fromArray(i),
  48160. 1 !== i[0] && (h.wrapS = n.RepeatWrapping),
  48161. 1 !== i[1] && (h.wrapT = n.RepeatWrapping)),
  48162. void 0 !== r && h.offset.fromArray(r),
  48163. void 0 !== s && ("repeat" === s[0] && (h.wrapS = n.RepeatWrapping),
  48164. "mirror" === s[0] && (h.wrapS = n.MirroredRepeatWrapping),
  48165. "repeat" === s[1] && (h.wrapT = n.RepeatWrapping),
  48166. "mirror" === s[1] && (h.wrapT = n.MirroredRepeatWrapping)),
  48167. void 0 !== c && (h.anisotropy = c);
  48168. var p = n.Math.generateUUID();
  48169. return l[p] = h,
  48170. p
  48171. }
  48172. void 0 === e && (e = new n.Color),
  48173. void 0 === t && (t = new n.TextureLoader),
  48174. void 0 === i && (i = new n.MaterialLoader);
  48175. var l = {}
  48176. , c = {
  48177. uuid: n.Math.generateUUID(),
  48178. type: "MeshLambertMaterial"
  48179. };
  48180. for (var h in r) {
  48181. var u = r[h];
  48182. switch (h) {
  48183. case "DbgColor":
  48184. case "DbgIndex":
  48185. case "opticalDensity":
  48186. case "illumination":
  48187. break;
  48188. case "DbgName":
  48189. c.name = u;
  48190. break;
  48191. case "blending":
  48192. c.blending = n[u];
  48193. break;
  48194. case "colorAmbient":
  48195. case "mapAmbient":
  48196. console.warn("THREE.Loader.createMaterial:", h, "is no longer supported.");
  48197. break;
  48198. case "colorDiffuse":
  48199. c.color = e.fromArray(u).getHex();
  48200. break;
  48201. case "colorSpecular":
  48202. c.specular = e.fromArray(u).getHex();
  48203. break;
  48204. case "colorEmissive":
  48205. c.emissive = e.fromArray(u).getHex();
  48206. break;
  48207. case "specularCoef":
  48208. c.shininess = u;
  48209. break;
  48210. case "shading":
  48211. "basic" === u.toLowerCase() && (c.type = "MeshBasicMaterial"),
  48212. "phong" === u.toLowerCase() && (c.type = "MeshPhongMaterial");
  48213. break;
  48214. case "mapDiffuse":
  48215. c.map = s(u, r.mapDiffuseRepeat, r.mapDiffuseOffset, r.mapDiffuseWrap, r.mapDiffuseAnisotropy);
  48216. break;
  48217. case "mapDiffuseRepeat":
  48218. case "mapDiffuseOffset":
  48219. case "mapDiffuseWrap":
  48220. case "mapDiffuseAnisotropy":
  48221. break;
  48222. case "mapLight":
  48223. c.lightMap = s(u, r.mapLightRepeat, r.mapLightOffset, r.mapLightWrap, r.mapLightAnisotropy);
  48224. break;
  48225. case "mapLightRepeat":
  48226. case "mapLightOffset":
  48227. case "mapLightWrap":
  48228. case "mapLightAnisotropy":
  48229. break;
  48230. case "mapAO":
  48231. c.aoMap = s(u, r.mapAORepeat, r.mapAOOffset, r.mapAOWrap, r.mapAOAnisotropy);
  48232. break;
  48233. case "mapAORepeat":
  48234. case "mapAOOffset":
  48235. case "mapAOWrap":
  48236. case "mapAOAnisotropy":
  48237. break;
  48238. case "mapBump":
  48239. c.bumpMap = s(u, r.mapBumpRepeat, r.mapBumpOffset, r.mapBumpWrap, r.mapBumpAnisotropy);
  48240. break;
  48241. case "mapBumpScale":
  48242. c.bumpScale = u;
  48243. break;
  48244. case "mapBumpRepeat":
  48245. case "mapBumpOffset":
  48246. case "mapBumpWrap":
  48247. case "mapBumpAnisotropy":
  48248. break;
  48249. case "mapNormal":
  48250. c.normalMap = s(u, r.mapNormalRepeat, r.mapNormalOffset, r.mapNormalWrap, r.mapNormalAnisotropy);
  48251. break;
  48252. case "mapNormalFactor":
  48253. c.normalScale = [u, u];
  48254. break;
  48255. case "mapNormalRepeat":
  48256. case "mapNormalOffset":
  48257. case "mapNormalWrap":
  48258. case "mapNormalAnisotropy":
  48259. break;
  48260. case "mapSpecular":
  48261. c.specularMap = s(u, r.mapSpecularRepeat, r.mapSpecularOffset, r.mapSpecularWrap, r.mapSpecularAnisotropy);
  48262. break;
  48263. case "mapSpecularRepeat":
  48264. case "mapSpecularOffset":
  48265. case "mapSpecularWrap":
  48266. case "mapSpecularAnisotropy":
  48267. break;
  48268. case "mapAlpha":
  48269. c.alphaMap = s(u, r.mapAlphaRepeat, r.mapAlphaOffset, r.mapAlphaWrap, r.mapAlphaAnisotropy);
  48270. break;
  48271. case "mapAlphaRepeat":
  48272. case "mapAlphaOffset":
  48273. case "mapAlphaWrap":
  48274. case "mapAlphaAnisotropy":
  48275. break;
  48276. case "flipSided":
  48277. c.side = n.BackSide;
  48278. break;
  48279. case "doubleSided":
  48280. c.side = n.DoubleSide;
  48281. break;
  48282. case "transparency":
  48283. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  48284. c.opacity = u;
  48285. break;
  48286. case "depthTest":
  48287. case "depthWrite":
  48288. case "colorWrite":
  48289. case "opacity":
  48290. case "reflectivity":
  48291. case "transparent":
  48292. case "visible":
  48293. case "wireframe":
  48294. c[h] = u;
  48295. break;
  48296. case "vertexColors":
  48297. u === !0 && (c.vertexColors = n.VertexColors),
  48298. "face" === u && (c.vertexColors = n.FaceColors);
  48299. break;
  48300. default:
  48301. console.error("THREE.Loader.createMaterial: Unsupported", h, u)
  48302. }
  48303. }
  48304. return "MeshBasicMaterial" === c.type && delete c.emissive,
  48305. "MeshPhongMaterial" !== c.type && delete c.specular,
  48306. c.opacity < 1 && (c.transparent = !0),
  48307. i.setTextures(l),
  48308. i.parse(c)
  48309. }
  48310. }()
  48311. },
  48312. n.Loader.Handlers = {
  48313. handlers: [],
  48314. add: function(e, t) {
  48315. this.handlers.push(e, t)
  48316. },
  48317. get: function(e) {
  48318. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  48319. var r = t[i]
  48320. , o = t[i + 1];
  48321. if (r.test(e))
  48322. return o
  48323. }
  48324. return null
  48325. }
  48326. },
  48327. n.XHRLoader = function(e) {
  48328. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48329. }
  48330. ,
  48331. n.XHRLoader.prototype = {
  48332. constructor: n.XHRLoader,
  48333. load: function(e, t, i, r) {
  48334. void 0 !== this.path && (e = this.path + e);
  48335. var o = this
  48336. , a = n.Cache.get(e);
  48337. if (void 0 !== a)
  48338. return t && setTimeout(function() {
  48339. t(a)
  48340. }, 0),
  48341. a;
  48342. var s = new XMLHttpRequest;
  48343. return s.overrideMimeType("text/plain"),
  48344. s.open("GET", e, !0),
  48345. s.addEventListener("load", function(i) {
  48346. var a = i.target.response;
  48347. n.Cache.add(e, a),
  48348. 200 === this.status ? (t && t(a),
  48349. o.manager.itemEnd(e)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  48350. t && t(a),
  48351. o.manager.itemEnd(e)) : (r && r(i),
  48352. o.manager.itemError(e))
  48353. }, !1),
  48354. void 0 !== i && s.addEventListener("progress", function(e) {
  48355. i(e)
  48356. }, !1),
  48357. s.addEventListener("error", function(t) {
  48358. r && r(t),
  48359. o.manager.itemError(e)
  48360. }, !1),
  48361. void 0 !== this.responseType && (s.responseType = this.responseType),
  48362. void 0 !== this.withCredentials && (s.withCredentials = this.withCredentials),
  48363. s.send(null),
  48364. o.manager.itemStart(e),
  48365. s
  48366. },
  48367. setPath: function(e) {
  48368. this.path = e
  48369. },
  48370. setResponseType: function(e) {
  48371. this.responseType = e
  48372. },
  48373. setWithCredentials: function(e) {
  48374. this.withCredentials = e
  48375. }
  48376. },
  48377. n.FontLoader = function(e) {
  48378. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48379. }
  48380. ,
  48381. n.FontLoader.prototype = {
  48382. constructor: n.FontLoader,
  48383. load: function(e, t, i, r) {
  48384. var o = new n.XHRLoader(this.manager);
  48385. o.load(e, function(e) {
  48386. t(new n.Font(JSON.parse(e.substring(65, e.length - 2))))
  48387. }, i, r)
  48388. }
  48389. },
  48390. n.ImageLoader = function(e) {
  48391. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48392. }
  48393. ,
  48394. n.ImageLoader.prototype = {
  48395. constructor: n.ImageLoader,
  48396. load: function(e, t, i, r) {
  48397. void 0 !== this.path && (e = this.path + e);
  48398. var o = this
  48399. , a = n.Cache.get(e);
  48400. if (void 0 !== a)
  48401. return o.manager.itemStart(e),
  48402. t ? setTimeout(function() {
  48403. t(a),
  48404. o.manager.itemEnd(e)
  48405. }, 0) : o.manager.itemEnd(e),
  48406. a;
  48407. var s = document.createElement("img");
  48408. return s.addEventListener("load", function(i) {
  48409. n.Cache.add(e, this),
  48410. t && t(this),
  48411. o.manager.itemEnd(e)
  48412. }, !1),
  48413. void 0 !== i && s.addEventListener("progress", function(e) {
  48414. i(e)
  48415. }, !1),
  48416. s.addEventListener("error", function(t) {
  48417. r && r(t),
  48418. o.manager.itemError(e)
  48419. }, !1),
  48420. void 0 !== this.crossOrigin && (s.crossOrigin = this.crossOrigin),
  48421. o.manager.itemStart(e),
  48422. s.src = e,
  48423. s
  48424. },
  48425. setCrossOrigin: function(e) {
  48426. this.crossOrigin = e
  48427. },
  48428. setPath: function(e) {
  48429. this.path = e
  48430. }
  48431. },
  48432. n.JSONLoader = function(e) {
  48433. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  48434. e = void 0),
  48435. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48436. this.withCredentials = !1
  48437. }
  48438. ,
  48439. n.JSONLoader.prototype = {
  48440. constructor: n.JSONLoader,
  48441. get statusDomElement() {
  48442. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  48443. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  48444. this._statusDomElement
  48445. },
  48446. load: function(e, t, i, r) {
  48447. var o = this
  48448. , a = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : n.Loader.prototype.extractUrlBase(e)
  48449. , s = new n.XHRLoader(this.manager);
  48450. s.setWithCredentials(this.withCredentials),
  48451. s.load(e, function(i) {
  48452. var n = JSON.parse(i)
  48453. , r = n.metadata;
  48454. if (void 0 !== r) {
  48455. var s = r.type;
  48456. if (void 0 !== s) {
  48457. if ("object" === s.toLowerCase())
  48458. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.ObjectLoader instead.");
  48459. if ("scene" === s.toLowerCase())
  48460. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.SceneLoader instead.")
  48461. }
  48462. }
  48463. var l = o.parse(n, a);
  48464. t(l.geometry, l.materials)
  48465. }, i, r)
  48466. },
  48467. setTexturePath: function(e) {
  48468. this.texturePath = e
  48469. },
  48470. parse: function(e, t) {
  48471. function i(t) {
  48472. function i(e, t) {
  48473. return e & 1 << t
  48474. }
  48475. 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;
  48476. if (void 0 !== e.uvs) {
  48477. for (r = 0; r < e.uvs.length; r++)
  48478. e.uvs[r].length && B++;
  48479. for (r = 0; r < B; r++)
  48480. s.faceVertexUvs[r] = []
  48481. }
  48482. for (l = 0,
  48483. c = L.length; l < c; )
  48484. E = new n.Vector3,
  48485. E.x = L[l++] * t,
  48486. E.y = L[l++] * t,
  48487. E.z = L[l++] * t,
  48488. s.vertices.push(E);
  48489. for (l = 0,
  48490. c = O.length; l < c; )
  48491. if (f = O[l++],
  48492. g = i(f, 0),
  48493. m = i(f, 1),
  48494. v = i(f, 3),
  48495. A = i(f, 4),
  48496. y = i(f, 5),
  48497. C = i(f, 6),
  48498. I = i(f, 7),
  48499. g) {
  48500. if (w = new n.Face3,
  48501. w.a = O[l],
  48502. w.b = O[l + 1],
  48503. w.c = O[l + 3],
  48504. _ = new n.Face3,
  48505. _.a = O[l + 1],
  48506. _.b = O[l + 2],
  48507. _.c = O[l + 3],
  48508. l += 4,
  48509. m && (p = O[l++],
  48510. w.materialIndex = p,
  48511. _.materialIndex = p),
  48512. a = s.faces.length,
  48513. v)
  48514. for (r = 0; r < B; r++)
  48515. for (S = e.uvs[r],
  48516. s.faceVertexUvs[r][a] = [],
  48517. s.faceVertexUvs[r][a + 1] = [],
  48518. o = 0; o < 4; o++)
  48519. d = O[l++],
  48520. R = S[2 * d],
  48521. P = S[2 * d + 1],
  48522. M = new n.Vector2(R,P),
  48523. 2 !== o && s.faceVertexUvs[r][a].push(M),
  48524. 0 !== o && s.faceVertexUvs[r][a + 1].push(M);
  48525. if (A && (u = 3 * O[l++],
  48526. w.normal.set(D[u++], D[u++], D[u]),
  48527. _.normal.copy(w.normal)),
  48528. y)
  48529. for (r = 0; r < 4; r++)
  48530. u = 3 * O[l++],
  48531. x = new n.Vector3(D[u++],D[u++],D[u]),
  48532. 2 !== r && w.vertexNormals.push(x),
  48533. 0 !== r && _.vertexNormals.push(x);
  48534. if (C && (h = O[l++],
  48535. T = N[h],
  48536. w.color.setHex(T),
  48537. _.color.setHex(T)),
  48538. I)
  48539. for (r = 0; r < 4; r++)
  48540. h = O[l++],
  48541. T = N[h],
  48542. 2 !== r && w.vertexColors.push(new n.Color(T)),
  48543. 0 !== r && _.vertexColors.push(new n.Color(T));
  48544. s.faces.push(w),
  48545. s.faces.push(_)
  48546. } else {
  48547. if (b = new n.Face3,
  48548. b.a = O[l++],
  48549. b.b = O[l++],
  48550. b.c = O[l++],
  48551. m && (p = O[l++],
  48552. b.materialIndex = p),
  48553. a = s.faces.length,
  48554. v)
  48555. for (r = 0; r < B; r++)
  48556. for (S = e.uvs[r],
  48557. s.faceVertexUvs[r][a] = [],
  48558. o = 0; o < 3; o++)
  48559. d = O[l++],
  48560. R = S[2 * d],
  48561. P = S[2 * d + 1],
  48562. M = new n.Vector2(R,P),
  48563. s.faceVertexUvs[r][a].push(M);
  48564. if (A && (u = 3 * O[l++],
  48565. b.normal.set(D[u++], D[u++], D[u])),
  48566. y)
  48567. for (r = 0; r < 3; r++)
  48568. u = 3 * O[l++],
  48569. x = new n.Vector3(D[u++],D[u++],D[u]),
  48570. b.vertexNormals.push(x);
  48571. if (C && (h = O[l++],
  48572. b.color.setHex(N[h])),
  48573. I)
  48574. for (r = 0; r < 3; r++)
  48575. h = O[l++],
  48576. b.vertexColors.push(new n.Color(N[h]));
  48577. s.faces.push(b)
  48578. }
  48579. }
  48580. function r() {
  48581. var t = void 0 !== e.influencesPerVertex ? e.influencesPerVertex : 2;
  48582. if (e.skinWeights)
  48583. for (var i = 0, r = e.skinWeights.length; i < r; i += t) {
  48584. var o = e.skinWeights[i]
  48585. , a = t > 1 ? e.skinWeights[i + 1] : 0
  48586. , l = t > 2 ? e.skinWeights[i + 2] : 0
  48587. , c = t > 3 ? e.skinWeights[i + 3] : 0;
  48588. s.skinWeights.push(new n.Vector4(o,a,l,c))
  48589. }
  48590. if (e.skinIndices)
  48591. for (var i = 0, r = e.skinIndices.length; i < r; i += t) {
  48592. var h = e.skinIndices[i]
  48593. , u = t > 1 ? e.skinIndices[i + 1] : 0
  48594. , d = t > 2 ? e.skinIndices[i + 2] : 0
  48595. , p = t > 3 ? e.skinIndices[i + 3] : 0;
  48596. s.skinIndices.push(new n.Vector4(h,u,d,p))
  48597. }
  48598. s.bones = e.bones,
  48599. 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.")
  48600. }
  48601. function o(t) {
  48602. if (void 0 !== e.morphTargets)
  48603. for (var i = 0, r = e.morphTargets.length; i < r; i++) {
  48604. s.morphTargets[i] = {},
  48605. s.morphTargets[i].name = e.morphTargets[i].name,
  48606. s.morphTargets[i].vertices = [];
  48607. for (var o = s.morphTargets[i].vertices, a = e.morphTargets[i].vertices, l = 0, c = a.length; l < c; l += 3) {
  48608. var h = new n.Vector3;
  48609. h.x = a[l] * t,
  48610. h.y = a[l + 1] * t,
  48611. h.z = a[l + 2] * t,
  48612. o.push(h)
  48613. }
  48614. }
  48615. if (void 0 !== e.morphColors && e.morphColors.length > 0) {
  48616. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  48617. for (var u = s.faces, d = e.morphColors[0].colors, i = 0, r = u.length; i < r; i++)
  48618. u[i].color.fromArray(d, 3 * i)
  48619. }
  48620. }
  48621. function a() {
  48622. var t = []
  48623. , i = [];
  48624. void 0 !== e.animation && i.push(e.animation),
  48625. void 0 !== e.animations && (e.animations.length ? i = i.concat(e.animations) : i.push(e.animations));
  48626. for (var r = 0; r < i.length; r++) {
  48627. var o = n.AnimationClip.parseAnimation(i[r], s.bones);
  48628. o && t.push(o)
  48629. }
  48630. if (s.morphTargets) {
  48631. var a = n.AnimationClip.CreateClipsFromMorphTargetSequences(s.morphTargets, 10);
  48632. t = t.concat(a)
  48633. }
  48634. t.length > 0 && (s.animations = t)
  48635. }
  48636. var s = new n.Geometry
  48637. , l = void 0 !== e.scale ? 1 / e.scale : 1;
  48638. if (i(l),
  48639. r(),
  48640. o(l),
  48641. a(),
  48642. s.computeFaceNormals(),
  48643. s.computeBoundingSphere(),
  48644. void 0 === e.materials || 0 === e.materials.length)
  48645. return {
  48646. geometry: s
  48647. };
  48648. var c = n.Loader.prototype.initMaterials(e.materials, t, this.crossOrigin);
  48649. return {
  48650. geometry: s,
  48651. materials: c
  48652. }
  48653. }
  48654. },
  48655. n.LoadingManager = function(e, t, i) {
  48656. var n = this
  48657. , r = !1
  48658. , o = 0
  48659. , a = 0;
  48660. this.onStart = void 0,
  48661. this.onLoad = e,
  48662. this.onProgress = t,
  48663. this.onError = i,
  48664. this.itemStart = function(e) {
  48665. a++,
  48666. r === !1 && void 0 !== n.onStart && n.onStart(e, o, a),
  48667. r = !0
  48668. }
  48669. ,
  48670. this.itemEnd = function(e) {
  48671. o++,
  48672. void 0 !== n.onProgress && n.onProgress(e, o, a),
  48673. o === a && (r = !1,
  48674. void 0 !== n.onLoad && n.onLoad())
  48675. }
  48676. ,
  48677. this.itemError = function(e) {
  48678. void 0 !== n.onError && n.onError(e)
  48679. }
  48680. }
  48681. ,
  48682. n.DefaultLoadingManager = new n.LoadingManager,
  48683. n.BufferGeometryLoader = function(e) {
  48684. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48685. }
  48686. ,
  48687. n.BufferGeometryLoader.prototype = {
  48688. constructor: n.BufferGeometryLoader,
  48689. load: function(e, t, i, r) {
  48690. var o = this
  48691. , a = new n.XHRLoader(o.manager);
  48692. a.load(e, function(e) {
  48693. t(o.parse(JSON.parse(e)))
  48694. }, i, r)
  48695. },
  48696. parse: function(e) {
  48697. var t = new n.BufferGeometry
  48698. , i = e.data.index
  48699. , r = {
  48700. Int8Array: Int8Array,
  48701. Uint8Array: Uint8Array,
  48702. Uint8ClampedArray: Uint8ClampedArray,
  48703. Int16Array: Int16Array,
  48704. Uint16Array: Uint16Array,
  48705. Int32Array: Int32Array,
  48706. Uint32Array: Uint32Array,
  48707. Float32Array: Float32Array,
  48708. Float64Array: Float64Array
  48709. };
  48710. if (void 0 !== i) {
  48711. var o = new r[i.type](i.array);
  48712. t.setIndex(new n.BufferAttribute(o,1))
  48713. }
  48714. var a = e.data.attributes;
  48715. for (var s in a) {
  48716. var l = a[s]
  48717. , o = new r[l.type](l.array);
  48718. t.addAttribute(s, new n.BufferAttribute(o,l.itemSize))
  48719. }
  48720. var c = e.data.groups || e.data.drawcalls || e.data.offsets;
  48721. if (void 0 !== c)
  48722. for (var h = 0, u = c.length; h !== u; ++h) {
  48723. var d = c[h];
  48724. t.addGroup(d.start, d.count, d.materialIndex)
  48725. }
  48726. var p = e.data.boundingSphere;
  48727. if (void 0 !== p) {
  48728. var f = new n.Vector3;
  48729. void 0 !== p.center && f.fromArray(p.center),
  48730. t.boundingSphere = new n.Sphere(f,p.radius)
  48731. }
  48732. return t
  48733. }
  48734. },
  48735. n.MaterialLoader = function(e) {
  48736. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48737. this.textures = {}
  48738. }
  48739. ,
  48740. n.MaterialLoader.prototype = {
  48741. constructor: n.MaterialLoader,
  48742. load: function(e, t, i, r) {
  48743. var o = this
  48744. , a = new n.XHRLoader(o.manager);
  48745. a.load(e, function(e) {
  48746. t(o.parse(JSON.parse(e)))
  48747. }, i, r)
  48748. },
  48749. setTextures: function(e) {
  48750. this.textures = e
  48751. },
  48752. getTexture: function(e) {
  48753. var t = this.textures;
  48754. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  48755. t[e]
  48756. },
  48757. parse: function(e) {
  48758. var t = new n[e.type];
  48759. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  48760. void 0 !== e.name && (t.name = e.name),
  48761. void 0 !== e.color && t.color.setHex(e.color),
  48762. void 0 !== e.roughness && (t.roughness = e.roughness),
  48763. void 0 !== e.metalness && (t.metalness = e.metalness),
  48764. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  48765. void 0 !== e.specular && t.specular.setHex(e.specular),
  48766. void 0 !== e.shininess && (t.shininess = e.shininess),
  48767. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  48768. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  48769. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  48770. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  48771. void 0 !== e.shading && (t.shading = e.shading),
  48772. void 0 !== e.blending && (t.blending = e.blending),
  48773. void 0 !== e.side && (t.side = e.side),
  48774. void 0 !== e.opacity && (t.opacity = e.opacity),
  48775. void 0 !== e.transparent && (t.transparent = e.transparent),
  48776. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  48777. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  48778. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  48779. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  48780. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  48781. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  48782. void 0 !== e.size && (t.size = e.size),
  48783. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  48784. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  48785. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  48786. t.transparent = !0),
  48787. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  48788. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  48789. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  48790. void 0 !== e.normalScale) {
  48791. var i = e.normalScale;
  48792. Array.isArray(i) === !1 && (i = [i, i]),
  48793. t.normalScale = (new n.Vector2).fromArray(i)
  48794. }
  48795. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  48796. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  48797. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  48798. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  48799. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  48800. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  48801. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  48802. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  48803. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  48804. t.combine = n.MultiplyOperation),
  48805. e.reflectivity && (t.reflectivity = e.reflectivity),
  48806. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  48807. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  48808. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  48809. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  48810. void 0 !== e.materials)
  48811. for (var r = 0, o = e.materials.length; r < o; r++)
  48812. t.materials.push(this.parse(e.materials[r]));
  48813. return t
  48814. }
  48815. },
  48816. n.ObjectLoader = function(e) {
  48817. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48818. this.texturePath = ""
  48819. }
  48820. ,
  48821. n.ObjectLoader.prototype = {
  48822. constructor: n.ObjectLoader,
  48823. load: function(e, t, i, r) {
  48824. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  48825. var o = this
  48826. , a = new n.XHRLoader(o.manager);
  48827. a.load(e, function(e) {
  48828. o.parse(JSON.parse(e), t)
  48829. }, i, r)
  48830. },
  48831. setTexturePath: function(e) {
  48832. this.texturePath = e
  48833. },
  48834. setCrossOrigin: function(e) {
  48835. this.crossOrigin = e
  48836. },
  48837. parse: function(e, t) {
  48838. var i = this.parseGeometries(e.geometries)
  48839. , n = this.parseImages(e.images, function() {
  48840. void 0 !== t && t(a)
  48841. })
  48842. , r = this.parseTextures(e.textures, n)
  48843. , o = this.parseMaterials(e.materials, r)
  48844. , a = this.parseObject(e.object, i, o);
  48845. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  48846. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  48847. a
  48848. },
  48849. parseGeometries: function(e) {
  48850. var t = {};
  48851. if (void 0 !== e)
  48852. for (var i = new n.JSONLoader, r = new n.BufferGeometryLoader, o = 0, a = e.length; o < a; o++) {
  48853. var s, l = e[o];
  48854. switch (l.type) {
  48855. case "PlaneGeometry":
  48856. case "PlaneBufferGeometry":
  48857. s = new n[l.type](l.width,l.height,l.widthSegments,l.heightSegments);
  48858. break;
  48859. case "BoxGeometry":
  48860. case "BoxBufferGeometry":
  48861. case "CubeGeometry":
  48862. s = new n[l.type](l.width,l.height,l.depth,l.widthSegments,l.heightSegments,l.depthSegments);
  48863. break;
  48864. case "CircleGeometry":
  48865. case "CircleBufferGeometry":
  48866. s = new n[l.type](l.radius,l.segments,l.thetaStart,l.thetaLength);
  48867. break;
  48868. case "CylinderGeometry":
  48869. case "CylinderBufferGeometry":
  48870. s = new n[l.type](l.radiusTop,l.radiusBottom,l.height,l.radialSegments,l.heightSegments,l.openEnded,l.thetaStart,l.thetaLength);
  48871. break;
  48872. case "SphereGeometry":
  48873. case "SphereBufferGeometry":
  48874. s = new n[l.type](l.radius,l.widthSegments,l.heightSegments,l.phiStart,l.phiLength,l.thetaStart,l.thetaLength);
  48875. break;
  48876. case "DodecahedronGeometry":
  48877. s = new n.DodecahedronGeometry(l.radius,l.detail);
  48878. break;
  48879. case "IcosahedronGeometry":
  48880. s = new n.IcosahedronGeometry(l.radius,l.detail);
  48881. break;
  48882. case "OctahedronGeometry":
  48883. s = new n.OctahedronGeometry(l.radius,l.detail);
  48884. break;
  48885. case "TetrahedronGeometry":
  48886. s = new n.TetrahedronGeometry(l.radius,l.detail);
  48887. break;
  48888. case "RingGeometry":
  48889. case "RingBufferGeometry":
  48890. s = new n[l.type](l.innerRadius,l.outerRadius,l.thetaSegments,l.phiSegments,l.thetaStart,l.thetaLength);
  48891. break;
  48892. case "TorusGeometry":
  48893. case "TorusBufferGeometry":
  48894. s = new n[l.type](l.radius,l.tube,l.radialSegments,l.tubularSegments,l.arc);
  48895. break;
  48896. case "TorusKnotGeometry":
  48897. case "TorusKnotBufferGeometry":
  48898. s = new n[l.type](l.radius,l.tube,l.tubularSegments,l.radialSegments,l.p,l.q);
  48899. break;
  48900. case "LatheGeometry":
  48901. s = new n.LatheGeometry(l.points,l.segments,l.phiStart,l.phiLength);
  48902. break;
  48903. case "BufferGeometry":
  48904. s = r.parse(l);
  48905. break;
  48906. case "Geometry":
  48907. s = i.parse(l.data, this.texturePath).geometry;
  48908. break;
  48909. default:
  48910. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + l.type + '"');
  48911. continue
  48912. }
  48913. s.uuid = l.uuid,
  48914. void 0 !== l.name && (s.name = l.name),
  48915. t[l.uuid] = s
  48916. }
  48917. return t
  48918. },
  48919. parseMaterials: function(e, t) {
  48920. var i = {};
  48921. if (void 0 !== e) {
  48922. var r = new n.MaterialLoader;
  48923. r.setTextures(t);
  48924. for (var o = 0, a = e.length; o < a; o++) {
  48925. var s = r.parse(e[o]);
  48926. i[s.uuid] = s
  48927. }
  48928. }
  48929. return i
  48930. },
  48931. parseAnimations: function(e) {
  48932. for (var t = [], i = 0; i < e.length; i++) {
  48933. var r = n.AnimationClip.parse(e[i]);
  48934. t.push(r)
  48935. }
  48936. return t
  48937. },
  48938. parseImages: function(e, t) {
  48939. function i(e) {
  48940. return r.manager.itemStart(e),
  48941. s.load(e, function() {
  48942. r.manager.itemEnd(e)
  48943. })
  48944. }
  48945. var r = this
  48946. , o = {};
  48947. if (void 0 !== e && e.length > 0) {
  48948. var a = new n.LoadingManager(t)
  48949. , s = new n.ImageLoader(a);
  48950. s.setCrossOrigin(this.crossOrigin);
  48951. for (var l = 0, c = e.length; l < c; l++) {
  48952. var h = e[l]
  48953. , u = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url) ? h.url : r.texturePath + h.url;
  48954. o[h.uuid] = i(u)
  48955. }
  48956. }
  48957. return o
  48958. },
  48959. parseTextures: function(e, t) {
  48960. function i(e) {
  48961. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  48962. n[e])
  48963. }
  48964. var r = {};
  48965. if (void 0 !== e)
  48966. for (var o = 0, a = e.length; o < a; o++) {
  48967. var s = e[o];
  48968. void 0 === s.image && console.warn('THREE.ObjectLoader: No "image" specified for', s.uuid),
  48969. void 0 === t[s.image] && console.warn("THREE.ObjectLoader: Undefined image", s.image);
  48970. var l = new n.Texture(t[s.image]);
  48971. l.needsUpdate = !0,
  48972. l.uuid = s.uuid,
  48973. void 0 !== s.name && (l.name = s.name),
  48974. void 0 !== s.mapping && (l.mapping = i(s.mapping)),
  48975. void 0 !== s.offset && (l.offset = new n.Vector2(s.offset[0],s.offset[1])),
  48976. void 0 !== s.repeat && (l.repeat = new n.Vector2(s.repeat[0],s.repeat[1])),
  48977. void 0 !== s.minFilter && (l.minFilter = i(s.minFilter)),
  48978. void 0 !== s.magFilter && (l.magFilter = i(s.magFilter)),
  48979. void 0 !== s.anisotropy && (l.anisotropy = s.anisotropy),
  48980. Array.isArray(s.wrap) && (l.wrapS = i(s.wrap[0]),
  48981. l.wrapT = i(s.wrap[1])),
  48982. r[s.uuid] = l
  48983. }
  48984. return r
  48985. },
  48986. parseObject: function() {
  48987. var e = new n.Matrix4;
  48988. return function(t, i, r) {
  48989. function o(e) {
  48990. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  48991. i[e]
  48992. }
  48993. function a(e) {
  48994. if (void 0 !== e)
  48995. return void 0 === r[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  48996. r[e]
  48997. }
  48998. var s;
  48999. switch (t.type) {
  49000. case "Scene":
  49001. s = new n.Scene;
  49002. break;
  49003. case "PerspectiveCamera":
  49004. s = new n.PerspectiveCamera(t.fov,t.aspect,t.near,t.far);
  49005. break;
  49006. case "OrthographicCamera":
  49007. s = new n.OrthographicCamera(t.left,t.right,t.top,t.bottom,t.near,t.far);
  49008. break;
  49009. case "AmbientLight":
  49010. s = new n.AmbientLight(t.color,t.intensity);
  49011. break;
  49012. case "DirectionalLight":
  49013. s = new n.DirectionalLight(t.color,t.intensity);
  49014. break;
  49015. case "PointLight":
  49016. s = new n.PointLight(t.color,t.intensity,t.distance,t.decay);
  49017. break;
  49018. case "SpotLight":
  49019. s = new n.SpotLight(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);
  49020. break;
  49021. case "HemisphereLight":
  49022. s = new n.HemisphereLight(t.color,t.groundColor,t.intensity);
  49023. break;
  49024. case "Mesh":
  49025. var l = o(t.geometry)
  49026. , c = a(t.material);
  49027. s = l.bones && l.bones.length > 0 ? new n.SkinnedMesh(l,c) : new n.Mesh(l,c);
  49028. break;
  49029. case "LOD":
  49030. s = new n.LOD;
  49031. break;
  49032. case "Line":
  49033. s = new n.Line(o(t.geometry),a(t.material),t.mode);
  49034. break;
  49035. case "PointCloud":
  49036. case "Points":
  49037. s = new n.Points(o(t.geometry),a(t.material));
  49038. break;
  49039. case "Sprite":
  49040. s = new n.Sprite(a(t.material));
  49041. break;
  49042. case "Group":
  49043. s = new n.Group;
  49044. break;
  49045. default:
  49046. s = new n.Object3D
  49047. }
  49048. if (s.uuid = t.uuid,
  49049. void 0 !== t.name && (s.name = t.name),
  49050. void 0 !== t.matrix ? (e.fromArray(t.matrix),
  49051. e.decompose(s.position, s.quaternion, s.scale)) : (void 0 !== t.position && s.position.fromArray(t.position),
  49052. void 0 !== t.rotation && s.rotation.fromArray(t.rotation),
  49053. void 0 !== t.scale && s.scale.fromArray(t.scale)),
  49054. void 0 !== t.castShadow && (s.castShadow = t.castShadow),
  49055. void 0 !== t.receiveShadow && (s.receiveShadow = t.receiveShadow),
  49056. void 0 !== t.visible && (s.visible = t.visible),
  49057. void 0 !== t.userData && (s.userData = t.userData),
  49058. void 0 !== t.children)
  49059. for (var h in t.children)
  49060. s.add(this.parseObject(t.children[h], i, r));
  49061. if ("LOD" === t.type)
  49062. for (var u = t.levels, d = 0; d < u.length; d++) {
  49063. var p = u[d]
  49064. , h = s.getObjectByProperty("uuid", p.object);
  49065. void 0 !== h && s.addLevel(h, p.distance)
  49066. }
  49067. return s
  49068. }
  49069. }()
  49070. },
  49071. n.TextureLoader = function(e) {
  49072. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  49073. }
  49074. ,
  49075. n.TextureLoader.prototype = {
  49076. constructor: n.TextureLoader,
  49077. load: function(e, t, i, r) {
  49078. var o = new n.Texture
  49079. , a = new n.ImageLoader(this.manager);
  49080. return a.setCrossOrigin(this.crossOrigin),
  49081. a.setPath(this.path),
  49082. a.load(e, function(e) {
  49083. o.image = e,
  49084. o.needsUpdate = !0,
  49085. void 0 !== t && t(o)
  49086. }, i, r),
  49087. o
  49088. },
  49089. setCrossOrigin: function(e) {
  49090. this.crossOrigin = e
  49091. },
  49092. setPath: function(e) {
  49093. this.path = e
  49094. }
  49095. },
  49096. n.CubeTextureLoader = function(e) {
  49097. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  49098. }
  49099. ,
  49100. n.CubeTextureLoader.prototype = {
  49101. constructor: n.CubeTextureLoader,
  49102. load: function(e, t, i, r) {
  49103. function o(i) {
  49104. s.load(e[i], function(e) {
  49105. a.images[i] = e,
  49106. l++,
  49107. 6 === l && (a.needsUpdate = !0,
  49108. t && t(a))
  49109. }, void 0, r)
  49110. }
  49111. var a = new n.CubeTexture
  49112. , s = new n.ImageLoader(this.manager);
  49113. s.setCrossOrigin(this.crossOrigin),
  49114. s.setPath(this.path);
  49115. for (var l = 0, c = 0; c < e.length; ++c)
  49116. o(c);
  49117. return a
  49118. },
  49119. setCrossOrigin: function(e) {
  49120. this.crossOrigin = e
  49121. },
  49122. setPath: function(e) {
  49123. this.path = e
  49124. }
  49125. },
  49126. n.DataTextureLoader = n.BinaryTextureLoader = function(e) {
  49127. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  49128. this._parser = null
  49129. }
  49130. ,
  49131. n.BinaryTextureLoader.prototype = {
  49132. constructor: n.BinaryTextureLoader,
  49133. load: function(e, t, i, r) {
  49134. var o = this
  49135. , a = new n.DataTexture
  49136. , s = new n.XHRLoader(this.manager);
  49137. return s.setResponseType("arraybuffer"),
  49138. s.load(e, function(e) {
  49139. var i = o._parser(e);
  49140. i && (void 0 !== i.image ? a.image = i.image : void 0 !== i.data && (a.image.width = i.width,
  49141. a.image.height = i.height,
  49142. a.image.data = i.data),
  49143. a.wrapS = void 0 !== i.wrapS ? i.wrapS : n.ClampToEdgeWrapping,
  49144. a.wrapT = void 0 !== i.wrapT ? i.wrapT : n.ClampToEdgeWrapping,
  49145. a.magFilter = void 0 !== i.magFilter ? i.magFilter : n.LinearFilter,
  49146. a.minFilter = void 0 !== i.minFilter ? i.minFilter : n.LinearMipMapLinearFilter,
  49147. a.anisotropy = void 0 !== i.anisotropy ? i.anisotropy : 1,
  49148. void 0 !== i.format && (a.format = i.format),
  49149. void 0 !== i.type && (a.type = i.type),
  49150. void 0 !== i.mipmaps && (a.mipmaps = i.mipmaps),
  49151. 1 === i.mipmapCount && (a.minFilter = n.LinearFilter),
  49152. a.needsUpdate = !0,
  49153. t && t(a, i))
  49154. }, i, r),
  49155. a
  49156. }
  49157. },
  49158. n.CompressedTextureLoader = function(e) {
  49159. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  49160. this._parser = null
  49161. }
  49162. ;
  49163. n.CompressedTextureLoader.prototype = {
  49164. constructor: n.CompressedTextureLoader,
  49165. load: function(e, t, i, r) {
  49166. function o(o) {
  49167. c.load(e[o], function(e) {
  49168. var i = a._parser(e, !0);
  49169. s[o] = {
  49170. width: i.width,
  49171. height: i.height,
  49172. format: i.format,
  49173. mipmaps: i.mipmaps
  49174. },
  49175. h += 1,
  49176. 6 === h && (1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  49177. l.format = i.format,
  49178. l.needsUpdate = !0,
  49179. t && t(l))
  49180. }, i, r)
  49181. }
  49182. var a = this
  49183. , s = []
  49184. , l = new n.CompressedTexture;
  49185. l.image = s;
  49186. var c = new n.XHRLoader(this.manager);
  49187. if (c.setPath(this.path),
  49188. c.setResponseType("arraybuffer"),
  49189. Array.isArray(e))
  49190. for (var h = 0, u = 0, d = e.length; u < d; ++u)
  49191. o(u);
  49192. else
  49193. c.load(e, function(e) {
  49194. var i = a._parser(e, !0);
  49195. if (i.isCubemap)
  49196. for (var r = i.mipmaps.length / i.mipmapCount, o = 0; o < r; o++) {
  49197. s[o] = {
  49198. mipmaps: []
  49199. };
  49200. for (var c = 0; c < i.mipmapCount; c++)
  49201. s[o].mipmaps.push(i.mipmaps[o * i.mipmapCount + c]),
  49202. s[o].format = i.format,
  49203. s[o].width = i.width,
  49204. s[o].height = i.height
  49205. }
  49206. else
  49207. l.image.width = i.width,
  49208. l.image.height = i.height,
  49209. l.mipmaps = i.mipmaps;
  49210. 1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  49211. l.format = i.format,
  49212. l.needsUpdate = !0,
  49213. t && t(l)
  49214. }, i, r);
  49215. return l
  49216. },
  49217. setPath: function(e) {
  49218. this.path = e
  49219. }
  49220. };
  49221. n.Material = function() {
  49222. Object.defineProperty(this, "id", {
  49223. value: n.MaterialIdCount++
  49224. }),
  49225. this.uuid = n.Math.generateUUID(),
  49226. this.name = "",
  49227. this.type = "Material",
  49228. this.side = n.FrontSide,
  49229. this.opacity = 1,
  49230. this.transparent = !1,
  49231. this.blending = n.NormalBlending,
  49232. this.blendSrc = n.SrcAlphaFactor,
  49233. this.blendDst = n.OneMinusSrcAlphaFactor,
  49234. this.blendEquation = n.AddEquation,
  49235. this.blendSrcAlpha = null,
  49236. this.blendDstAlpha = null,
  49237. this.blendEquationAlpha = null,
  49238. this.depthFunc = n.LessEqualDepth,
  49239. this.depthTest = !0,
  49240. this.depthWrite = !0,
  49241. this.colorWrite = !0,
  49242. this.precision = null,
  49243. this.polygonOffset = !1,
  49244. this.polygonOffsetFactor = 0,
  49245. this.polygonOffsetUnits = 0,
  49246. this.alphaTest = 0,
  49247. this.premultipliedAlpha = !1,
  49248. this.overdraw = 0,
  49249. this.visible = !0,
  49250. this._needsUpdate = !0
  49251. }
  49252. ,
  49253. n.Material.prototype = {
  49254. constructor: n.Material,
  49255. get needsUpdate() {
  49256. return this._needsUpdate
  49257. },
  49258. set needsUpdate(e) {
  49259. e === !0 && this.update(),
  49260. this._needsUpdate = e
  49261. },
  49262. setValues: function(e) {
  49263. if (void 0 !== e)
  49264. for (var t in e) {
  49265. var i = e[t];
  49266. if (void 0 !== i) {
  49267. var r = this[t];
  49268. 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.")
  49269. } else
  49270. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  49271. }
  49272. },
  49273. toJSON: function(e) {
  49274. function t(e) {
  49275. var t = [];
  49276. for (var i in e) {
  49277. var n = e[i];
  49278. delete n.metadata,
  49279. t.push(n)
  49280. }
  49281. return t
  49282. }
  49283. var i = void 0 === e;
  49284. i && (e = {
  49285. textures: {},
  49286. images: {}
  49287. });
  49288. var r = {
  49289. metadata: {
  49290. version: 4.4,
  49291. type: "Material",
  49292. generator: "Material.toJSON"
  49293. }
  49294. };
  49295. if (r.uuid = this.uuid,
  49296. r.type = this.type,
  49297. "" !== this.name && (r.name = this.name),
  49298. this.color instanceof n.Color && (r.color = this.color.getHex()),
  49299. .5 !== this.roughness && (r.roughness = this.roughness),
  49300. .5 !== this.metalness && (r.metalness = this.metalness),
  49301. this.emissive instanceof n.Color && (r.emissive = this.emissive.getHex()),
  49302. this.specular instanceof n.Color && (r.specular = this.specular.getHex()),
  49303. void 0 !== this.shininess && (r.shininess = this.shininess),
  49304. this.map instanceof n.Texture && (r.map = this.map.toJSON(e).uuid),
  49305. this.alphaMap instanceof n.Texture && (r.alphaMap = this.alphaMap.toJSON(e).uuid),
  49306. this.lightMap instanceof n.Texture && (r.lightMap = this.lightMap.toJSON(e).uuid),
  49307. this.bumpMap instanceof n.Texture && (r.bumpMap = this.bumpMap.toJSON(e).uuid,
  49308. r.bumpScale = this.bumpScale),
  49309. this.normalMap instanceof n.Texture && (r.normalMap = this.normalMap.toJSON(e).uuid,
  49310. r.normalScale = this.normalScale.toArray()),
  49311. this.displacementMap instanceof n.Texture && (r.displacementMap = this.displacementMap.toJSON(e).uuid,
  49312. r.displacementScale = this.displacementScale,
  49313. r.displacementBias = this.displacementBias),
  49314. this.roughnessMap instanceof n.Texture && (r.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  49315. this.metalnessMap instanceof n.Texture && (r.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  49316. this.emissiveMap instanceof n.Texture && (r.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  49317. this.specularMap instanceof n.Texture && (r.specularMap = this.specularMap.toJSON(e).uuid),
  49318. this.envMap instanceof n.Texture && (r.envMap = this.envMap.toJSON(e).uuid,
  49319. r.reflectivity = this.reflectivity),
  49320. void 0 !== this.size && (r.size = this.size),
  49321. void 0 !== this.sizeAttenuation && (r.sizeAttenuation = this.sizeAttenuation),
  49322. void 0 !== this.vertexColors && this.vertexColors !== n.NoColors && (r.vertexColors = this.vertexColors),
  49323. void 0 !== this.shading && this.shading !== n.SmoothShading && (r.shading = this.shading),
  49324. void 0 !== this.blending && this.blending !== n.NormalBlending && (r.blending = this.blending),
  49325. void 0 !== this.side && this.side !== n.FrontSide && (r.side = this.side),
  49326. this.opacity < 1 && (r.opacity = this.opacity),
  49327. this.transparent === !0 && (r.transparent = this.transparent),
  49328. this.alphaTest > 0 && (r.alphaTest = this.alphaTest),
  49329. this.premultipliedAlpha === !0 && (r.premultipliedAlpha = this.premultipliedAlpha),
  49330. this.wireframe === !0 && (r.wireframe = this.wireframe),
  49331. this.wireframeLinewidth > 1 && (r.wireframeLinewidth = this.wireframeLinewidth),
  49332. i) {
  49333. var o = t(e.textures)
  49334. , a = t(e.images);
  49335. o.length > 0 && (r.textures = o),
  49336. a.length > 0 && (r.images = a)
  49337. }
  49338. return r
  49339. },
  49340. clone: function() {
  49341. return (new this.constructor).copy(this)
  49342. },
  49343. copy: function(e) {
  49344. return this.name = e.name,
  49345. this.side = e.side,
  49346. this.opacity = e.opacity,
  49347. this.transparent = e.transparent,
  49348. this.blending = e.blending,
  49349. this.blendSrc = e.blendSrc,
  49350. this.blendDst = e.blendDst,
  49351. this.blendEquation = e.blendEquation,
  49352. this.blendSrcAlpha = e.blendSrcAlpha,
  49353. this.blendDstAlpha = e.blendDstAlpha,
  49354. this.blendEquationAlpha = e.blendEquationAlpha,
  49355. this.depthFunc = e.depthFunc,
  49356. this.depthTest = e.depthTest,
  49357. this.depthWrite = e.depthWrite,
  49358. this.colorWrite = e.colorWrite,
  49359. this.precision = e.precision,
  49360. this.polygonOffset = e.polygonOffset,
  49361. this.polygonOffsetFactor = e.polygonOffsetFactor,
  49362. this.polygonOffsetUnits = e.polygonOffsetUnits,
  49363. this.alphaTest = e.alphaTest,
  49364. this.premultipliedAlpha = e.premultipliedAlpha,
  49365. this.overdraw = e.overdraw,
  49366. this.visible = e.visible,
  49367. this
  49368. },
  49369. update: function() {
  49370. this.dispatchEvent({
  49371. type: "update"
  49372. })
  49373. },
  49374. dispose: function() {
  49375. this.dispatchEvent({
  49376. type: "dispose"
  49377. })
  49378. }
  49379. },
  49380. n.EventDispatcher.prototype.apply(n.Material.prototype),
  49381. n.MaterialIdCount = 0,
  49382. n.LineBasicMaterial = function(e) {
  49383. n.Material.call(this),
  49384. this.type = "LineBasicMaterial",
  49385. this.color = new n.Color(16777215),
  49386. this.linewidth = 1,
  49387. this.linecap = "round",
  49388. this.linejoin = "round",
  49389. this.blending = n.NormalBlending,
  49390. this.vertexColors = n.NoColors,
  49391. this.fog = !0,
  49392. this.setValues(e)
  49393. }
  49394. ,
  49395. n.LineBasicMaterial.prototype = Object.create(n.Material.prototype),
  49396. n.LineBasicMaterial.prototype.constructor = n.LineBasicMaterial,
  49397. n.LineBasicMaterial.prototype.copy = function(e) {
  49398. return n.Material.prototype.copy.call(this, e),
  49399. this.color.copy(e.color),
  49400. this.linewidth = e.linewidth,
  49401. this.linecap = e.linecap,
  49402. this.linejoin = e.linejoin,
  49403. this.vertexColors = e.vertexColors,
  49404. this.fog = e.fog,
  49405. this
  49406. }
  49407. ,
  49408. n.LineDashedMaterial = function(e) {
  49409. n.Material.call(this),
  49410. this.type = "LineDashedMaterial",
  49411. this.color = new n.Color(16777215),
  49412. this.linewidth = 1,
  49413. this.scale = 1,
  49414. this.dashSize = 3,
  49415. this.gapSize = 1,
  49416. this.blending = n.NormalBlending,
  49417. this.vertexColors = n.NoColors,
  49418. this.fog = !0,
  49419. this.setValues(e)
  49420. }
  49421. ,
  49422. n.LineDashedMaterial.prototype = Object.create(n.Material.prototype),
  49423. n.LineDashedMaterial.prototype.constructor = n.LineDashedMaterial,
  49424. n.LineDashedMaterial.prototype.copy = function(e) {
  49425. return n.Material.prototype.copy.call(this, e),
  49426. this.color.copy(e.color),
  49427. this.linewidth = e.linewidth,
  49428. this.scale = e.scale,
  49429. this.dashSize = e.dashSize,
  49430. this.gapSize = e.gapSize,
  49431. this.vertexColors = e.vertexColors,
  49432. this.fog = e.fog,
  49433. this
  49434. }
  49435. ,
  49436. n.MeshBasicMaterial = function(e) {
  49437. n.Material.call(this),
  49438. this.type = "MeshBasicMaterial",
  49439. this.color = new n.Color(16777215),
  49440. this.map = null,
  49441. this.aoMap = null,
  49442. this.aoMapIntensity = 1,
  49443. this.specularMap = null,
  49444. this.alphaMap = null,
  49445. this.envMap = null,
  49446. this.combine = n.MultiplyOperation,
  49447. this.reflectivity = 1,
  49448. this.refractionRatio = .98,
  49449. this.fog = !0,
  49450. this.shading = n.SmoothShading,
  49451. this.blending = n.NormalBlending,
  49452. this.wireframe = !1,
  49453. this.wireframeLinewidth = 1,
  49454. this.wireframeLinecap = "round",
  49455. this.wireframeLinejoin = "round",
  49456. this.vertexColors = n.NoColors,
  49457. this.skinning = !1,
  49458. this.morphTargets = !1,
  49459. this.setValues(e)
  49460. }
  49461. ,
  49462. n.MeshBasicMaterial.prototype = Object.create(n.Material.prototype),
  49463. n.MeshBasicMaterial.prototype.constructor = n.MeshBasicMaterial,
  49464. n.MeshBasicMaterial.prototype.copy = function(e) {
  49465. return n.Material.prototype.copy.call(this, e),
  49466. this.color.copy(e.color),
  49467. this.map = e.map,
  49468. this.aoMap = e.aoMap,
  49469. this.aoMapIntensity = e.aoMapIntensity,
  49470. this.specularMap = e.specularMap,
  49471. this.alphaMap = e.alphaMap,
  49472. this.envMap = e.envMap,
  49473. this.combine = e.combine,
  49474. this.reflectivity = e.reflectivity,
  49475. this.refractionRatio = e.refractionRatio,
  49476. this.fog = e.fog,
  49477. this.shading = e.shading,
  49478. this.wireframe = e.wireframe,
  49479. this.wireframeLinewidth = e.wireframeLinewidth,
  49480. this.wireframeLinecap = e.wireframeLinecap,
  49481. this.wireframeLinejoin = e.wireframeLinejoin,
  49482. this.vertexColors = e.vertexColors,
  49483. this.skinning = e.skinning,
  49484. this.morphTargets = e.morphTargets,
  49485. this
  49486. }
  49487. ,
  49488. n.MeshLambertMaterial = function(e) {
  49489. n.Material.call(this),
  49490. this.type = "MeshLambertMaterial",
  49491. this.color = new n.Color(16777215),
  49492. this.map = null,
  49493. this.lightMap = null,
  49494. this.lightMapIntensity = 1,
  49495. this.aoMap = null,
  49496. this.aoMapIntensity = 1,
  49497. this.emissive = new n.Color(0),
  49498. this.emissiveIntensity = 1,
  49499. this.emissiveMap = null,
  49500. this.specularMap = null,
  49501. this.alphaMap = null,
  49502. this.envMap = null,
  49503. this.combine = n.MultiplyOperation,
  49504. this.reflectivity = 1,
  49505. this.refractionRatio = .98,
  49506. this.fog = !0,
  49507. this.blending = n.NormalBlending,
  49508. this.wireframe = !1,
  49509. this.wireframeLinewidth = 1,
  49510. this.wireframeLinecap = "round",
  49511. this.wireframeLinejoin = "round",
  49512. this.vertexColors = n.NoColors,
  49513. this.skinning = !1,
  49514. this.morphTargets = !1,
  49515. this.morphNormals = !1,
  49516. this.setValues(e)
  49517. }
  49518. ,
  49519. n.MeshLambertMaterial.prototype = Object.create(n.Material.prototype),
  49520. n.MeshLambertMaterial.prototype.constructor = n.MeshLambertMaterial,
  49521. n.MeshLambertMaterial.prototype.copy = function(e) {
  49522. return n.Material.prototype.copy.call(this, e),
  49523. this.color.copy(e.color),
  49524. this.map = e.map,
  49525. this.lightMap = e.lightMap,
  49526. this.lightMapIntensity = e.lightMapIntensity,
  49527. this.aoMap = e.aoMap,
  49528. this.aoMapIntensity = e.aoMapIntensity,
  49529. this.emissive.copy(e.emissive),
  49530. this.emissiveMap = e.emissiveMap,
  49531. this.emissiveIntensity = e.emissiveIntensity,
  49532. this.specularMap = e.specularMap,
  49533. this.alphaMap = e.alphaMap,
  49534. this.envMap = e.envMap,
  49535. this.combine = e.combine,
  49536. this.reflectivity = e.reflectivity,
  49537. this.refractionRatio = e.refractionRatio,
  49538. this.fog = e.fog,
  49539. this.wireframe = e.wireframe,
  49540. this.wireframeLinewidth = e.wireframeLinewidth,
  49541. this.wireframeLinecap = e.wireframeLinecap,
  49542. this.wireframeLinejoin = e.wireframeLinejoin,
  49543. this.vertexColors = e.vertexColors,
  49544. this.skinning = e.skinning,
  49545. this.morphTargets = e.morphTargets,
  49546. this.morphNormals = e.morphNormals,
  49547. this
  49548. }
  49549. ,
  49550. n.MeshPhongMaterial = function(e) {
  49551. n.Material.call(this),
  49552. this.type = "MeshPhongMaterial",
  49553. this.color = new n.Color(16777215),
  49554. this.specular = new n.Color(1118481),
  49555. this.shininess = 30,
  49556. this.map = null,
  49557. this.lightMap = null,
  49558. this.lightMapIntensity = 1,
  49559. this.aoMap = null,
  49560. this.aoMapIntensity = 1,
  49561. this.emissive = new n.Color(0),
  49562. this.emissiveIntensity = 1,
  49563. this.emissiveMap = null,
  49564. this.bumpMap = null,
  49565. this.bumpScale = 1,
  49566. this.normalMap = null,
  49567. this.normalScale = new n.Vector2(1,1),
  49568. this.displacementMap = null,
  49569. this.displacementScale = 1,
  49570. this.displacementBias = 0,
  49571. this.specularMap = null,
  49572. this.alphaMap = null,
  49573. this.envMap = null,
  49574. this.combine = n.MultiplyOperation,
  49575. this.reflectivity = 1,
  49576. this.refractionRatio = .98,
  49577. this.fog = !0,
  49578. this.shading = n.SmoothShading,
  49579. this.blending = n.NormalBlending,
  49580. this.wireframe = !1,
  49581. this.wireframeLinewidth = 1,
  49582. this.wireframeLinecap = "round",
  49583. this.wireframeLinejoin = "round",
  49584. this.vertexColors = n.NoColors,
  49585. this.skinning = !1,
  49586. this.morphTargets = !1,
  49587. this.morphNormals = !1,
  49588. this.setValues(e)
  49589. }
  49590. ,
  49591. n.MeshPhongMaterial.prototype = Object.create(n.Material.prototype),
  49592. n.MeshPhongMaterial.prototype.constructor = n.MeshPhongMaterial,
  49593. n.MeshPhongMaterial.prototype.copy = function(e) {
  49594. return n.Material.prototype.copy.call(this, e),
  49595. this.color.copy(e.color),
  49596. this.specular.copy(e.specular),
  49597. this.shininess = e.shininess,
  49598. this.map = e.map,
  49599. this.lightMap = e.lightMap,
  49600. this.lightMapIntensity = e.lightMapIntensity,
  49601. this.aoMap = e.aoMap,
  49602. this.aoMapIntensity = e.aoMapIntensity,
  49603. this.emissive.copy(e.emissive),
  49604. this.emissiveMap = e.emissiveMap,
  49605. this.emissiveIntensity = e.emissiveIntensity,
  49606. this.bumpMap = e.bumpMap,
  49607. this.bumpScale = e.bumpScale,
  49608. this.normalMap = e.normalMap,
  49609. this.normalScale.copy(e.normalScale),
  49610. this.displacementMap = e.displacementMap,
  49611. this.displacementScale = e.displacementScale,
  49612. this.displacementBias = e.displacementBias,
  49613. this.specularMap = e.specularMap,
  49614. this.alphaMap = e.alphaMap,
  49615. this.envMap = e.envMap,
  49616. this.combine = e.combine,
  49617. this.reflectivity = e.reflectivity,
  49618. this.refractionRatio = e.refractionRatio,
  49619. this.fog = e.fog,
  49620. this.shading = e.shading,
  49621. this.wireframe = e.wireframe,
  49622. this.wireframeLinewidth = e.wireframeLinewidth,
  49623. this.wireframeLinecap = e.wireframeLinecap,
  49624. this.wireframeLinejoin = e.wireframeLinejoin,
  49625. this.vertexColors = e.vertexColors,
  49626. this.skinning = e.skinning,
  49627. this.morphTargets = e.morphTargets,
  49628. this.morphNormals = e.morphNormals,
  49629. this
  49630. }
  49631. ,
  49632. n.MeshStandardMaterial = function(e) {
  49633. n.Material.call(this),
  49634. this.type = "MeshStandardMaterial",
  49635. this.color = new n.Color(16777215),
  49636. this.roughness = .5,
  49637. this.metalness = .5,
  49638. this.map = null,
  49639. this.lightMap = null,
  49640. this.lightMapIntensity = 1,
  49641. this.aoMap = null,
  49642. this.aoMapIntensity = 1,
  49643. this.emissive = new n.Color(0),
  49644. this.emissiveIntensity = 1,
  49645. this.emissiveMap = null,
  49646. this.bumpMap = null,
  49647. this.bumpScale = 1,
  49648. this.normalMap = null,
  49649. this.normalScale = new n.Vector2(1,1),
  49650. this.displacementMap = null,
  49651. this.displacementScale = 1,
  49652. this.displacementBias = 0,
  49653. this.roughnessMap = null,
  49654. this.metalnessMap = null,
  49655. this.alphaMap = null,
  49656. this.envMap = null,
  49657. this.envMapIntensity = 1,
  49658. this.refractionRatio = .98,
  49659. this.fog = !0,
  49660. this.shading = n.SmoothShading,
  49661. this.blending = n.NormalBlending,
  49662. this.wireframe = !1,
  49663. this.wireframeLinewidth = 1,
  49664. this.wireframeLinecap = "round",
  49665. this.wireframeLinejoin = "round",
  49666. this.vertexColors = n.NoColors,
  49667. this.skinning = !1,
  49668. this.morphTargets = !1,
  49669. this.morphNormals = !1,
  49670. this.setValues(e)
  49671. }
  49672. ,
  49673. n.MeshStandardMaterial.prototype = Object.create(n.Material.prototype),
  49674. n.MeshStandardMaterial.prototype.constructor = n.MeshStandardMaterial,
  49675. n.MeshStandardMaterial.prototype.copy = function(e) {
  49676. return n.Material.prototype.copy.call(this, e),
  49677. this.color.copy(e.color),
  49678. this.roughness = e.roughness,
  49679. this.metalness = e.metalness,
  49680. this.map = e.map,
  49681. this.lightMap = e.lightMap,
  49682. this.lightMapIntensity = e.lightMapIntensity,
  49683. this.aoMap = e.aoMap,
  49684. this.aoMapIntensity = e.aoMapIntensity,
  49685. this.emissive.copy(e.emissive),
  49686. this.emissiveMap = e.emissiveMap,
  49687. this.emissiveIntensity = e.emissiveIntensity,
  49688. this.bumpMap = e.bumpMap,
  49689. this.bumpScale = e.bumpScale,
  49690. this.normalMap = e.normalMap,
  49691. this.normalScale.copy(e.normalScale),
  49692. this.displacementMap = e.displacementMap,
  49693. this.displacementScale = e.displacementScale,
  49694. this.displacementBias = e.displacementBias,
  49695. this.roughnessMap = e.roughnessMap,
  49696. this.metalnessMap = e.metalnessMap,
  49697. this.alphaMap = e.alphaMap,
  49698. this.envMap = e.envMap,
  49699. this.envMapIntensity = e.envMapIntensity,
  49700. this.refractionRatio = e.refractionRatio,
  49701. this.fog = e.fog,
  49702. this.shading = e.shading,
  49703. this.wireframe = e.wireframe,
  49704. this.wireframeLinewidth = e.wireframeLinewidth,
  49705. this.wireframeLinecap = e.wireframeLinecap,
  49706. this.wireframeLinejoin = e.wireframeLinejoin,
  49707. this.vertexColors = e.vertexColors,
  49708. this.skinning = e.skinning,
  49709. this.morphTargets = e.morphTargets,
  49710. this.morphNormals = e.morphNormals,
  49711. this
  49712. }
  49713. ,
  49714. n.MeshDepthMaterial = function(e) {
  49715. n.Material.call(this),
  49716. this.type = "MeshDepthMaterial",
  49717. this.morphTargets = !1,
  49718. this.wireframe = !1,
  49719. this.wireframeLinewidth = 1,
  49720. this.setValues(e)
  49721. }
  49722. ,
  49723. n.MeshDepthMaterial.prototype = Object.create(n.Material.prototype),
  49724. n.MeshDepthMaterial.prototype.constructor = n.MeshDepthMaterial,
  49725. n.MeshDepthMaterial.prototype.copy = function(e) {
  49726. return n.Material.prototype.copy.call(this, e),
  49727. this.wireframe = e.wireframe,
  49728. this.wireframeLinewidth = e.wireframeLinewidth,
  49729. this
  49730. }
  49731. ,
  49732. n.MeshNormalMaterial = function(e) {
  49733. n.Material.call(this, e),
  49734. this.type = "MeshNormalMaterial",
  49735. this.wireframe = !1,
  49736. this.wireframeLinewidth = 1,
  49737. this.morphTargets = !1,
  49738. this.setValues(e)
  49739. }
  49740. ,
  49741. n.MeshNormalMaterial.prototype = Object.create(n.Material.prototype),
  49742. n.MeshNormalMaterial.prototype.constructor = n.MeshNormalMaterial,
  49743. n.MeshNormalMaterial.prototype.copy = function(e) {
  49744. return n.Material.prototype.copy.call(this, e),
  49745. this.wireframe = e.wireframe,
  49746. this.wireframeLinewidth = e.wireframeLinewidth,
  49747. this
  49748. }
  49749. ,
  49750. n.MultiMaterial = function(e) {
  49751. this.uuid = n.Math.generateUUID(),
  49752. this.type = "MultiMaterial",
  49753. this.materials = e instanceof Array ? e : [],
  49754. this.visible = !0
  49755. }
  49756. ,
  49757. n.MultiMaterial.prototype = {
  49758. constructor: n.MultiMaterial,
  49759. toJSON: function(e) {
  49760. for (var t = {
  49761. metadata: {
  49762. version: 4.2,
  49763. type: "material",
  49764. generator: "MaterialExporter"
  49765. },
  49766. uuid: this.uuid,
  49767. type: this.type,
  49768. materials: []
  49769. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  49770. var o = i[n].toJSON(e);
  49771. delete o.metadata,
  49772. t.materials.push(o)
  49773. }
  49774. return t.visible = this.visible,
  49775. t
  49776. },
  49777. clone: function() {
  49778. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  49779. e.materials.push(this.materials[t].clone());
  49780. return e.visible = this.visible,
  49781. e
  49782. }
  49783. },
  49784. n.PointsMaterial = function(e) {
  49785. n.Material.call(this),
  49786. this.type = "PointsMaterial",
  49787. this.color = new n.Color(16777215),
  49788. this.map = null,
  49789. this.size = 1,
  49790. this.sizeAttenuation = !0,
  49791. this.blending = n.NormalBlending,
  49792. this.vertexColors = n.NoColors,
  49793. this.fog = !0,
  49794. this.setValues(e)
  49795. }
  49796. ,
  49797. n.PointsMaterial.prototype = Object.create(n.Material.prototype),
  49798. n.PointsMaterial.prototype.constructor = n.PointsMaterial,
  49799. n.PointsMaterial.prototype.copy = function(e) {
  49800. return n.Material.prototype.copy.call(this, e),
  49801. this.color.copy(e.color),
  49802. this.map = e.map,
  49803. this.size = e.size,
  49804. this.sizeAttenuation = e.sizeAttenuation,
  49805. this.vertexColors = e.vertexColors,
  49806. this.fog = e.fog,
  49807. this
  49808. }
  49809. ,
  49810. n.ShaderMaterial = function(e) {
  49811. n.Material.call(this),
  49812. this.type = "ShaderMaterial",
  49813. this.defines = {},
  49814. this.uniforms = {},
  49815. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  49816. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  49817. this.shading = n.SmoothShading,
  49818. this.linewidth = 1,
  49819. this.wireframe = !1,
  49820. this.wireframeLinewidth = 1,
  49821. this.fog = !1,
  49822. this.lights = !1,
  49823. this.vertexColors = n.NoColors,
  49824. this.skinning = !1,
  49825. this.morphTargets = !1,
  49826. this.morphNormals = !1,
  49827. this.extensions = {
  49828. derivatives: !1,
  49829. fragDepth: !1,
  49830. drawBuffers: !1,
  49831. shaderTextureLOD: !1
  49832. },
  49833. this.defaultAttributeValues = {
  49834. color: [1, 1, 1],
  49835. uv: [0, 0],
  49836. uv2: [0, 0]
  49837. },
  49838. this.index0AttributeName = void 0,
  49839. void 0 !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  49840. this.setValues(e))
  49841. }
  49842. ,
  49843. n.ShaderMaterial.prototype = Object.create(n.Material.prototype),
  49844. n.ShaderMaterial.prototype.constructor = n.ShaderMaterial,
  49845. n.ShaderMaterial.prototype.copy = function(e) {
  49846. return n.Material.prototype.copy.call(this, e),
  49847. this.fragmentShader = e.fragmentShader,
  49848. this.vertexShader = e.vertexShader,
  49849. this.uniforms = n.UniformsUtils.clone(e.uniforms),
  49850. this.defines = e.defines,
  49851. this.shading = e.shading,
  49852. this.wireframe = e.wireframe,
  49853. this.wireframeLinewidth = e.wireframeLinewidth,
  49854. this.fog = e.fog,
  49855. this.lights = e.lights,
  49856. this.vertexColors = e.vertexColors,
  49857. this.skinning = e.skinning,
  49858. this.morphTargets = e.morphTargets,
  49859. this.morphNormals = e.morphNormals,
  49860. this.extensions = e.extensions,
  49861. this
  49862. }
  49863. ,
  49864. n.ShaderMaterial.prototype.toJSON = function(e) {
  49865. var t = n.Material.prototype.toJSON.call(this, e);
  49866. return t.uniforms = this.uniforms,
  49867. t.vertexShader = this.vertexShader,
  49868. t.fragmentShader = this.fragmentShader,
  49869. t
  49870. }
  49871. ,
  49872. n.RawShaderMaterial = function(e) {
  49873. n.ShaderMaterial.call(this, e),
  49874. this.type = "RawShaderMaterial"
  49875. }
  49876. ,
  49877. n.RawShaderMaterial.prototype = Object.create(n.ShaderMaterial.prototype),
  49878. n.RawShaderMaterial.prototype.constructor = n.RawShaderMaterial,
  49879. n.SpriteMaterial = function(e) {
  49880. n.Material.call(this),
  49881. this.type = "SpriteMaterial",
  49882. this.color = new n.Color(16777215),
  49883. this.map = null,
  49884. this.rotation = 0,
  49885. this.fog = !1,
  49886. this.setValues(e)
  49887. }
  49888. ,
  49889. n.SpriteMaterial.prototype = Object.create(n.Material.prototype),
  49890. n.SpriteMaterial.prototype.constructor = n.SpriteMaterial,
  49891. n.SpriteMaterial.prototype.copy = function(e) {
  49892. return n.Material.prototype.copy.call(this, e),
  49893. this.color.copy(e.color),
  49894. this.map = e.map,
  49895. this.rotation = e.rotation,
  49896. this.fog = e.fog,
  49897. this
  49898. }
  49899. ,
  49900. n.Texture = function(e, t, i, r, o, a, s, l, c) {
  49901. Object.defineProperty(this, "id", {
  49902. value: n.TextureIdCount++
  49903. }),
  49904. this.uuid = n.Math.generateUUID(),
  49905. this.name = "",
  49906. this.sourceFile = "",
  49907. this.image = void 0 !== e ? e : n.Texture.DEFAULT_IMAGE,
  49908. this.mipmaps = [],
  49909. this.mapping = void 0 !== t ? t : n.Texture.DEFAULT_MAPPING,
  49910. this.wrapS = void 0 !== i ? i : n.ClampToEdgeWrapping,
  49911. this.wrapT = void 0 !== r ? r : n.ClampToEdgeWrapping,
  49912. this.magFilter = void 0 !== o ? o : n.LinearFilter,
  49913. this.minFilter = void 0 !== a ? a : n.LinearMipMapLinearFilter,
  49914. this.anisotropy = void 0 !== c ? c : 1,
  49915. this.format = void 0 !== s ? s : n.RGBAFormat,
  49916. this.type = void 0 !== l ? l : n.UnsignedByteType,
  49917. this.offset = new n.Vector2(0,0),
  49918. this.repeat = new n.Vector2(1,1),
  49919. this.generateMipmaps = !0,
  49920. this.premultiplyAlpha = !1,
  49921. this.flipY = !0,
  49922. this.unpackAlignment = 4,
  49923. this.encoding = n.LinearEncoding,
  49924. this.version = 0,
  49925. this.onUpdate = null
  49926. }
  49927. ,
  49928. n.Texture.DEFAULT_IMAGE = void 0,
  49929. n.Texture.DEFAULT_MAPPING = n.UVMapping,
  49930. n.Texture.prototype = {
  49931. constructor: n.Texture,
  49932. set needsUpdate(e) {
  49933. e === !0 && this.version++
  49934. },
  49935. clone: function() {
  49936. return (new this.constructor).copy(this)
  49937. },
  49938. copy: function(e) {
  49939. return this.image = e.image,
  49940. this.mipmaps = e.mipmaps.slice(0),
  49941. this.mapping = e.mapping,
  49942. this.wrapS = e.wrapS,
  49943. this.wrapT = e.wrapT,
  49944. this.magFilter = e.magFilter,
  49945. this.minFilter = e.minFilter,
  49946. this.anisotropy = e.anisotropy,
  49947. this.format = e.format,
  49948. this.type = e.type,
  49949. this.offset.copy(e.offset),
  49950. this.repeat.copy(e.repeat),
  49951. this.generateMipmaps = e.generateMipmaps,
  49952. this.premultiplyAlpha = e.premultiplyAlpha,
  49953. this.flipY = e.flipY,
  49954. this.unpackAlignment = e.unpackAlignment,
  49955. this.encoding = e.encoding,
  49956. this
  49957. },
  49958. toJSON: function(e) {
  49959. function t(e) {
  49960. var t;
  49961. return void 0 !== e.toDataURL ? t = e : (t = document.createElement("canvas"),
  49962. t.width = e.width,
  49963. t.height = e.height,
  49964. t.getContext("2d").drawImage(e, 0, 0, e.width, e.height)),
  49965. t.width > 2048 || t.height > 2048 ? t.toDataURL("image/jpeg", .6) : t.toDataURL("image/png")
  49966. }
  49967. if (void 0 !== e.textures[this.uuid])
  49968. return e.textures[this.uuid];
  49969. var i = {
  49970. metadata: {
  49971. version: 4.4,
  49972. type: "Texture",
  49973. generator: "Texture.toJSON"
  49974. },
  49975. uuid: this.uuid,
  49976. name: this.name,
  49977. mapping: this.mapping,
  49978. repeat: [this.repeat.x, this.repeat.y],
  49979. offset: [this.offset.x, this.offset.y],
  49980. wrap: [this.wrapS, this.wrapT],
  49981. minFilter: this.minFilter,
  49982. magFilter: this.magFilter,
  49983. anisotropy: this.anisotropy
  49984. };
  49985. if (void 0 !== this.image) {
  49986. var r = this.image;
  49987. void 0 === r.uuid && (r.uuid = n.Math.generateUUID()),
  49988. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  49989. uuid: r.uuid,
  49990. url: t(r)
  49991. }),
  49992. i.image = r.uuid
  49993. }
  49994. return e.textures[this.uuid] = i,
  49995. i
  49996. },
  49997. dispose: function() {
  49998. this.dispatchEvent({
  49999. type: "dispose"
  50000. })
  50001. },
  50002. transformUv: function(e) {
  50003. if (this.mapping === n.UVMapping) {
  50004. if (e.multiply(this.repeat),
  50005. e.add(this.offset),
  50006. e.x < 0 || e.x > 1)
  50007. switch (this.wrapS) {
  50008. case n.RepeatWrapping:
  50009. e.x = e.x - Math.floor(e.x);
  50010. break;
  50011. case n.ClampToEdgeWrapping:
  50012. e.x = e.x < 0 ? 0 : 1;
  50013. break;
  50014. case n.MirroredRepeatWrapping:
  50015. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  50016. }
  50017. if (e.y < 0 || e.y > 1)
  50018. switch (this.wrapT) {
  50019. case n.RepeatWrapping:
  50020. e.y = e.y - Math.floor(e.y);
  50021. break;
  50022. case n.ClampToEdgeWrapping:
  50023. e.y = e.y < 0 ? 0 : 1;
  50024. break;
  50025. case n.MirroredRepeatWrapping:
  50026. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  50027. }
  50028. this.flipY && (e.y = 1 - e.y)
  50029. }
  50030. }
  50031. },
  50032. n.EventDispatcher.prototype.apply(n.Texture.prototype),
  50033. n.TextureIdCount = 0,
  50034. n.CanvasTexture = function(e, t, i, r, o, a, s, l, c) {
  50035. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  50036. this.needsUpdate = !0
  50037. }
  50038. ,
  50039. n.CanvasTexture.prototype = Object.create(n.Texture.prototype),
  50040. n.CanvasTexture.prototype.constructor = n.CanvasTexture,
  50041. n.CubeTexture = function(e, t, i, r, o, a, s, l, c) {
  50042. e = void 0 !== e ? e : [],
  50043. t = void 0 !== t ? t : n.CubeReflectionMapping,
  50044. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  50045. this.flipY = !1
  50046. }
  50047. ,
  50048. n.CubeTexture.prototype = Object.create(n.Texture.prototype),
  50049. n.CubeTexture.prototype.constructor = n.CubeTexture,
  50050. Object.defineProperty(n.CubeTexture.prototype, "images", {
  50051. get: function() {
  50052. return this.image
  50053. },
  50054. set: function(e) {
  50055. this.image = e
  50056. }
  50057. }),
  50058. n.CompressedTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  50059. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  50060. this.image = {
  50061. width: t,
  50062. height: i
  50063. },
  50064. this.mipmaps = e,
  50065. this.flipY = !1,
  50066. this.generateMipmaps = !1
  50067. }
  50068. ,
  50069. n.CompressedTexture.prototype = Object.create(n.Texture.prototype),
  50070. n.CompressedTexture.prototype.constructor = n.CompressedTexture,
  50071. n.DataTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  50072. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  50073. this.image = {
  50074. data: e,
  50075. width: t,
  50076. height: i
  50077. },
  50078. this.magFilter = void 0 !== c ? c : n.NearestFilter,
  50079. this.minFilter = void 0 !== h ? h : n.NearestFilter,
  50080. this.flipY = !1,
  50081. this.generateMipmaps = !1
  50082. }
  50083. ,
  50084. n.DataTexture.prototype = Object.create(n.Texture.prototype),
  50085. n.DataTexture.prototype.constructor = n.DataTexture,
  50086. n.VideoTexture = function(e, t, i, r, o, a, s, l, c) {
  50087. function h() {
  50088. requestAnimationFrame(h)
  50089. if( !e.paused && e.readyState === e.HAVE_ENOUGH_DATA){//改 add !e.paused
  50090. u.needsUpdate = !0
  50091. }
  50092. }
  50093. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  50094. this.generateMipmaps = !1;
  50095. var u = this;
  50096. h()
  50097. }
  50098. ,
  50099. n.VideoTexture.prototype = Object.create(n.Texture.prototype),
  50100. n.VideoTexture.prototype.constructor = n.VideoTexture,
  50101. n.Group = function() {
  50102. n.Object3D.call(this),
  50103. this.type = "Group"
  50104. }
  50105. ,
  50106. n.Group.prototype = Object.create(n.Object3D.prototype),
  50107. n.Group.prototype.constructor = n.Group,
  50108. n.Points = function(e, t) {
  50109. n.Object3D.call(this),
  50110. this.type = "Points",
  50111. this.geometry = void 0 !== e ? e : new n.Geometry,
  50112. this.material = void 0 !== t ? t : new n.PointsMaterial({
  50113. color: 16777215 * Math.random()
  50114. })
  50115. }
  50116. ,
  50117. n.Points.prototype = Object.create(n.Object3D.prototype),
  50118. n.Points.prototype.constructor = n.Points,
  50119. n.Points.prototype.raycast = function() {
  50120. var e = new n.Matrix4
  50121. , t = new n.Ray
  50122. , i = new n.Sphere;
  50123. return function(r, o) {
  50124. function a(e, i) {
  50125. var n = t.distanceSqToPoint(e);
  50126. if (n < d) {
  50127. var a = t.closestPointToPoint(e);
  50128. a.applyMatrix4(c);
  50129. var l = r.ray.origin.distanceTo(a);
  50130. if (l < r.near || l > r.far)
  50131. return;
  50132. o.push({
  50133. distance: l,
  50134. distanceToRay: Math.sqrt(n),
  50135. point: a.clone(),
  50136. index: i,
  50137. face: null,
  50138. object: s
  50139. })
  50140. }
  50141. }
  50142. var s = this
  50143. , l = this.geometry
  50144. , c = this.matrixWorld
  50145. , h = r.params.Points.threshold;
  50146. if (null === l.boundingSphere && l.computeBoundingSphere(),
  50147. i.copy(l.boundingSphere),
  50148. i.applyMatrix4(c),
  50149. r.ray.intersectsSphere(i) !== !1) {
  50150. e.getInverse(c),
  50151. t.copy(r.ray).applyMatrix4(e);
  50152. var u = h / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  50153. , d = u * u
  50154. , p = new n.Vector3;
  50155. if (l instanceof n.BufferGeometry) {
  50156. var f = l.index
  50157. , g = l.attributes
  50158. , m = g.position.array;
  50159. if (null !== f)
  50160. for (var v = f.array, A = 0, y = v.length; A < y; A++) {
  50161. var C = v[A];
  50162. p.fromArray(m, 3 * C),
  50163. a(p, C)
  50164. }
  50165. else
  50166. for (var A = 0, I = m.length / 3; A < I; A++)
  50167. p.fromArray(m, 3 * A),
  50168. a(p, A)
  50169. } else
  50170. for (var E = l.vertices, A = 0, I = E.length; A < I; A++)
  50171. a(E[A], A)
  50172. }
  50173. }
  50174. }(),
  50175. n.Points.prototype.clone = function() {
  50176. return new this.constructor(this.geometry,this.material).copy(this)
  50177. }
  50178. ,
  50179. n.Line = function(e, t, i) {
  50180. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  50181. new n.LineSegments(e,t)) : (n.Object3D.call(this),
  50182. this.type = "Line",
  50183. this.geometry = void 0 !== e ? e : new n.Geometry,
  50184. void (this.material = void 0 !== t ? t : new n.LineBasicMaterial({
  50185. color: 16777215 * Math.random()
  50186. })))
  50187. }
  50188. ,
  50189. n.Line.prototype = Object.create(n.Object3D.prototype),
  50190. n.Line.prototype.constructor = n.Line,
  50191. n.Line.prototype.raycast = function() {
  50192. var e = new n.Matrix4
  50193. , t = new n.Ray
  50194. , i = new n.Sphere;
  50195. return function(r, o) {
  50196. var a = r.linePrecision
  50197. , s = a * a
  50198. , l = this.geometry
  50199. , c = this.matrixWorld;
  50200. if (null === l.boundingSphere && l.computeBoundingSphere(),
  50201. i.copy(l.boundingSphere),
  50202. i.applyMatrix4(c),
  50203. r.ray.intersectsSphere(i) !== !1) {
  50204. e.getInverse(c),
  50205. t.copy(r.ray).applyMatrix4(e);
  50206. var h = new n.Vector3
  50207. , u = new n.Vector3
  50208. , d = new n.Vector3
  50209. , p = new n.Vector3
  50210. , f = this instanceof n.LineSegments ? 2 : 1;
  50211. if (l instanceof n.BufferGeometry) {
  50212. var g = l.index
  50213. , m = l.attributes
  50214. , v = m.position.array;
  50215. if (null !== g)
  50216. for (var A = g.array, y = 0, C = A.length - 1; y < C; y += f) {
  50217. var I = A[y]
  50218. , E = A[y + 1];
  50219. h.fromArray(v, 3 * I),
  50220. u.fromArray(v, 3 * E);
  50221. var b = t.distanceSqToSegment(h, u, p, d);
  50222. if (!(b > s)) {
  50223. p.applyMatrix4(this.matrixWorld);
  50224. var w = r.ray.origin.distanceTo(p);
  50225. w < r.near || w > r.far || o.push({
  50226. distance: w,
  50227. point: d.clone().applyMatrix4(this.matrixWorld),
  50228. index: y,
  50229. face: null,
  50230. faceIndex: null,
  50231. object: this
  50232. })
  50233. }
  50234. }
  50235. else
  50236. for (var y = 0, C = v.length / 3 - 1; y < C; y += f) {
  50237. h.fromArray(v, 3 * y),
  50238. u.fromArray(v, 3 * y + 3);
  50239. var b = t.distanceSqToSegment(h, u, p, d);
  50240. if (!(b > s)) {
  50241. p.applyMatrix4(this.matrixWorld);
  50242. var w = r.ray.origin.distanceTo(p);
  50243. w < r.near || w > r.far || o.push({
  50244. distance: w,
  50245. point: d.clone().applyMatrix4(this.matrixWorld),
  50246. index: y,
  50247. face: null,
  50248. faceIndex: null,
  50249. object: this
  50250. })
  50251. }
  50252. }
  50253. } else if (l instanceof n.Geometry)
  50254. for (var _ = l.vertices, T = _.length, y = 0; y < T - 1; y += f) {
  50255. var b = t.distanceSqToSegment(_[y], _[y + 1], p, d);
  50256. if (!(b > s)) {
  50257. p.applyMatrix4(this.matrixWorld);
  50258. var w = r.ray.origin.distanceTo(p);
  50259. w < r.near || w > r.far || o.push({
  50260. distance: w,
  50261. point: d.clone().applyMatrix4(this.matrixWorld),
  50262. index: y,
  50263. face: null,
  50264. faceIndex: null,
  50265. object: this
  50266. })
  50267. }
  50268. }
  50269. }
  50270. }
  50271. }(),
  50272. n.Line.prototype.clone = function() {
  50273. return new this.constructor(this.geometry,this.material).copy(this)
  50274. }
  50275. ,
  50276. n.LineStrip = 0,
  50277. n.LinePieces = 1,
  50278. n.LineSegments = function(e, t) {
  50279. n.Line.call(this, e, t),
  50280. this.type = "LineSegments"
  50281. }
  50282. ,
  50283. n.LineSegments.prototype = Object.create(n.Line.prototype),
  50284. n.LineSegments.prototype.constructor = n.LineSegments,
  50285. n.Mesh = function(e, t) {
  50286. n.Object3D.call(this),
  50287. this.type = "Mesh",
  50288. this.geometry = void 0 !== e ? e : new n.Geometry,
  50289. this.material = void 0 !== t ? t : new n.MeshBasicMaterial({
  50290. color: 16777215 * Math.random()
  50291. }),
  50292. this.drawMode = n.TrianglesDrawMode,
  50293. this.updateMorphTargets()
  50294. }
  50295. ,
  50296. n.Mesh.prototype = Object.create(n.Object3D.prototype),
  50297. n.Mesh.prototype.constructor = n.Mesh,
  50298. n.Mesh.prototype.setDrawMode = function(e) {
  50299. this.drawMode = e
  50300. }
  50301. ,
  50302. n.Mesh.prototype.updateMorphTargets = function() {
  50303. if (void 0 !== this.geometry.morphTargets && this.geometry.morphTargets.length > 0) {
  50304. this.morphTargetBase = -1,
  50305. this.morphTargetInfluences = [],
  50306. this.morphTargetDictionary = {};
  50307. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  50308. this.morphTargetInfluences.push(0),
  50309. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  50310. }
  50311. }
  50312. ,
  50313. n.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  50314. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  50315. 0)
  50316. }
  50317. ,
  50318. n.Mesh.prototype.raycast = function() {
  50319. function e(e, t, i, r, o, a, s) {
  50320. return n.Triangle.barycoordFromPoint(e, t, i, r, m),
  50321. o.multiplyScalar(m.x),
  50322. a.multiplyScalar(m.y),
  50323. s.multiplyScalar(m.z),
  50324. o.add(a).add(s),
  50325. o.clone()
  50326. }
  50327. function t(e, t, i, r, o, a, s) {
  50328. var l, c = e.material;
  50329. if (l = c.side === n.BackSide ? i.intersectTriangle(a, o, r, !0, s) : i.intersectTriangle(r, o, a, c.side !== n.DoubleSide, s),
  50330. null === l)
  50331. return null;
  50332. A.copy(s),
  50333. A.applyMatrix4(e.matrixWorld);
  50334. var h = t.ray.origin.distanceTo(A);
  50335. return h < t.near || h > t.far ? null : {
  50336. distance: h,
  50337. point: A.clone(),
  50338. object: e
  50339. }
  50340. }
  50341. function i(i, r, o, a, h, u, d, m) {
  50342. s.fromArray(a, 3 * u),
  50343. l.fromArray(a, 3 * d),
  50344. c.fromArray(a, 3 * m);
  50345. var A = t(i, r, o, s, l, c, v);
  50346. return A && (h && (p.fromArray(h, 2 * u),
  50347. f.fromArray(h, 2 * d),
  50348. g.fromArray(h, 2 * m),
  50349. A.uv = e(v, s, l, c, p, f, g)),
  50350. A.face = new n.Face3(u,d,m,n.Triangle.normal(s, l, c)),
  50351. A.faceIndex = u),
  50352. A
  50353. }
  50354. var r = new n.Matrix4
  50355. , o = new n.Ray
  50356. , a = new n.Sphere
  50357. , s = new n.Vector3
  50358. , l = new n.Vector3
  50359. , c = new n.Vector3
  50360. , h = new n.Vector3
  50361. , u = new n.Vector3
  50362. , d = new n.Vector3
  50363. , p = new n.Vector2
  50364. , f = new n.Vector2
  50365. , g = new n.Vector2
  50366. , m = new n.Vector3
  50367. , v = new n.Vector3
  50368. , A = new n.Vector3;
  50369. return function(m, A) {
  50370. var y = this.geometry
  50371. , C = this.material
  50372. , I = this.matrixWorld;
  50373. if (void 0 !== C && (null === y.boundingSphere && y.computeBoundingSphere(),
  50374. a.copy(y.boundingSphere),
  50375. a.applyMatrix4(I),
  50376. m.ray.intersectsSphere(a) !== !1 && (r.getInverse(I),
  50377. o.copy(m.ray).applyMatrix4(r),
  50378. null === y.boundingBox || o.intersectsBox(y.boundingBox) !== !1))) {
  50379. var E, b;
  50380. if (y instanceof n.BufferGeometry) {
  50381. var w, _, T, x = y.index, S = y.attributes, M = S.position.array;
  50382. if (void 0 !== S.uv && (E = S.uv.array),
  50383. null !== x)
  50384. for (var R = x.array, P = 0, O = R.length; P < O; P += 3)
  50385. w = R[P],
  50386. _ = R[P + 1],
  50387. T = R[P + 2],
  50388. b = i(this, m, o, M, E, w, _, T),
  50389. b && (b.faceIndex = Math.floor(P / 3),
  50390. A.push(b));
  50391. else
  50392. for (var P = 0, O = M.length; P < O; P += 9)
  50393. w = P / 3,
  50394. _ = w + 1,
  50395. T = w + 2,
  50396. b = i(this, m, o, M, E, w, _, T),
  50397. b && (b.index = w,
  50398. A.push(b))
  50399. } else if (y instanceof n.Geometry) {
  50400. 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];
  50401. k.length > 0 && (E = k);
  50402. for (var H = 0, G = U.length; H < G; H++) {
  50403. var z = U[H]
  50404. , W = B === !0 ? F[z.materialIndex] : C;
  50405. if (void 0 !== W) {
  50406. if (L = V[z.a],
  50407. D = V[z.b],
  50408. N = V[z.c],
  50409. W.morphTargets === !0) {
  50410. var j = y.morphTargets
  50411. , Y = this.morphTargetInfluences;
  50412. s.set(0, 0, 0),
  50413. l.set(0, 0, 0),
  50414. c.set(0, 0, 0);
  50415. for (var X = 0, Z = j.length; X < Z; X++) {
  50416. var q = Y[X];
  50417. if (0 !== q) {
  50418. var K = j[X].vertices;
  50419. s.addScaledVector(h.subVectors(K[z.a], L), q),
  50420. l.addScaledVector(u.subVectors(K[z.b], D), q),
  50421. c.addScaledVector(d.subVectors(K[z.c], N), q)
  50422. }
  50423. }
  50424. s.add(L),
  50425. l.add(D),
  50426. c.add(N),
  50427. L = s,
  50428. D = l,
  50429. N = c
  50430. }
  50431. if (b = t(this, m, o, L, D, N, v)) {
  50432. if (E) {
  50433. var Q = E[H];
  50434. p.copy(Q[0]),
  50435. f.copy(Q[1]),
  50436. g.copy(Q[2]),
  50437. b.uv = e(v, L, D, N, p, f, g)
  50438. }
  50439. b.face = z,
  50440. b.faceIndex = H,
  50441. A.push(b)
  50442. }
  50443. }
  50444. }
  50445. }
  50446. }
  50447. }
  50448. }(),
  50449. n.Mesh.prototype.clone = function() {
  50450. return new this.constructor(this.geometry,this.material).copy(this)
  50451. }
  50452. ,
  50453. n.Bone = function(e) {
  50454. n.Object3D.call(this),
  50455. this.type = "Bone",
  50456. this.skin = e
  50457. }
  50458. ,
  50459. n.Bone.prototype = Object.create(n.Object3D.prototype),
  50460. n.Bone.prototype.constructor = n.Bone,
  50461. n.Bone.prototype.copy = function(e) {
  50462. return n.Object3D.prototype.copy.call(this, e),
  50463. this.skin = e.skin,
  50464. this
  50465. }
  50466. ,
  50467. n.Skeleton = function(e, t, i) {
  50468. if (this.useVertexTexture = void 0 === i || i,
  50469. this.identityMatrix = new n.Matrix4,
  50470. e = e || [],
  50471. this.bones = e.slice(0),
  50472. this.useVertexTexture) {
  50473. var r = Math.sqrt(4 * this.bones.length);
  50474. r = n.Math.nextPowerOfTwo(Math.ceil(r)),
  50475. r = Math.max(r, 4),
  50476. this.boneTextureWidth = r,
  50477. this.boneTextureHeight = r,
  50478. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  50479. this.boneTexture = new n.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,n.RGBAFormat,n.FloatType)
  50480. } else
  50481. this.boneMatrices = new Float32Array(16 * this.bones.length);
  50482. if (void 0 === t)
  50483. this.calculateInverses();
  50484. else if (this.bones.length === t.length)
  50485. this.boneInverses = t.slice(0);
  50486. else {
  50487. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  50488. this.boneInverses = [];
  50489. for (var o = 0, a = this.bones.length; o < a; o++)
  50490. this.boneInverses.push(new n.Matrix4)
  50491. }
  50492. }
  50493. ,
  50494. n.Skeleton.prototype.calculateInverses = function() {
  50495. this.boneInverses = [];
  50496. for (var e = 0, t = this.bones.length; e < t; e++) {
  50497. var i = new n.Matrix4;
  50498. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  50499. this.boneInverses.push(i)
  50500. }
  50501. }
  50502. ,
  50503. n.Skeleton.prototype.pose = function() {
  50504. for (var e, t = 0, i = this.bones.length; t < i; t++)
  50505. e = this.bones[t],
  50506. e && e.matrixWorld.getInverse(this.boneInverses[t]);
  50507. for (var t = 0, i = this.bones.length; t < i; t++)
  50508. e = this.bones[t],
  50509. e && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  50510. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  50511. e.matrix.decompose(e.position, e.quaternion, e.scale));
  50512. }
  50513. ,
  50514. n.Skeleton.prototype.update = function() {
  50515. var e = new n.Matrix4;
  50516. return function() {
  50517. for (var t = 0, i = this.bones.length; t < i; t++) {
  50518. var n = this.bones[t] ? this.bones[t].matrixWorld : this.identityMatrix;
  50519. e.multiplyMatrices(n, this.boneInverses[t]),
  50520. e.flattenToArrayOffset(this.boneMatrices, 16 * t)
  50521. }
  50522. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  50523. }
  50524. }(),
  50525. n.Skeleton.prototype.clone = function() {
  50526. return new n.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  50527. }
  50528. ,
  50529. n.SkinnedMesh = function(e, t, i) {
  50530. n.Mesh.call(this, e, t),
  50531. this.type = "SkinnedMesh",
  50532. this.bindMode = "attached",
  50533. this.bindMatrix = new n.Matrix4,
  50534. this.bindMatrixInverse = new n.Matrix4;
  50535. var r = [];
  50536. if (this.geometry && void 0 !== this.geometry.bones) {
  50537. for (var o, a, s = 0, l = this.geometry.bones.length; s < l; ++s)
  50538. a = this.geometry.bones[s],
  50539. o = new n.Bone(this),
  50540. r.push(o),
  50541. o.name = a.name,
  50542. o.position.fromArray(a.pos),
  50543. o.quaternion.fromArray(a.rotq),
  50544. void 0 !== a.scl && o.scale.fromArray(a.scl);
  50545. for (var s = 0, l = this.geometry.bones.length; s < l; ++s)
  50546. a = this.geometry.bones[s],
  50547. a.parent !== -1 && null !== a.parent ? r[a.parent].add(r[s]) : this.add(r[s])
  50548. }
  50549. this.normalizeSkinWeights(),
  50550. this.updateMatrixWorld(!0),
  50551. this.bind(new n.Skeleton(r,void 0,i), this.matrixWorld)
  50552. }
  50553. ,
  50554. n.SkinnedMesh.prototype = Object.create(n.Mesh.prototype),
  50555. n.SkinnedMesh.prototype.constructor = n.SkinnedMesh,
  50556. n.SkinnedMesh.prototype.bind = function(e, t) {
  50557. this.skeleton = e,
  50558. void 0 === t && (this.updateMatrixWorld(!0),
  50559. this.skeleton.calculateInverses(),
  50560. t = this.matrixWorld),
  50561. this.bindMatrix.copy(t),
  50562. this.bindMatrixInverse.getInverse(t)
  50563. }
  50564. ,
  50565. n.SkinnedMesh.prototype.pose = function() {
  50566. this.skeleton.pose()
  50567. }
  50568. ,
  50569. n.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  50570. if (this.geometry instanceof n.Geometry)
  50571. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  50572. var t = this.geometry.skinWeights[e]
  50573. , i = 1 / t.lengthManhattan();
  50574. i !== 1 / 0 ? t.multiplyScalar(i) : t.set(1, 0, 0, 0)
  50575. }
  50576. else if (this.geometry instanceof n.BufferGeometry)
  50577. for (var r = new n.Vector4, o = this.geometry.attributes.skinWeight, e = 0; e < o.count; e++) {
  50578. r.x = o.getX(e),
  50579. r.y = o.getY(e),
  50580. r.z = o.getZ(e),
  50581. r.w = o.getW(e);
  50582. var i = 1 / r.lengthManhattan();
  50583. i !== 1 / 0 ? r.multiplyScalar(i) : r.set(1, 0, 0, 0),
  50584. o.setXYZW(e, r.x, r.y, r.z, r.w)
  50585. }
  50586. }
  50587. ,
  50588. n.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  50589. n.Mesh.prototype.updateMatrixWorld.call(this, !0),
  50590. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  50591. }
  50592. ,
  50593. n.SkinnedMesh.prototype.clone = function() {
  50594. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  50595. }
  50596. ,
  50597. n.LOD = function() {
  50598. n.Object3D.call(this),
  50599. this.type = "LOD",
  50600. Object.defineProperties(this, {
  50601. levels: {
  50602. enumerable: !0,
  50603. value: []
  50604. },
  50605. objects: {
  50606. get: function() {
  50607. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  50608. this.levels
  50609. }
  50610. }
  50611. })
  50612. }
  50613. ,
  50614. n.LOD.prototype = Object.create(n.Object3D.prototype),
  50615. n.LOD.prototype.constructor = n.LOD,
  50616. n.LOD.prototype.addLevel = function(e, t) {
  50617. void 0 === t && (t = 0),
  50618. t = Math.abs(t);
  50619. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  50620. ;
  50621. i.splice(n, 0, {
  50622. distance: t,
  50623. object: e
  50624. }),
  50625. this.add(e)
  50626. }
  50627. ,
  50628. n.LOD.prototype.getObjectForDistance = function(e) {
  50629. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  50630. ;
  50631. return t[i - 1].object
  50632. }
  50633. ,
  50634. n.LOD.prototype.raycast = function() {
  50635. var e = new n.Vector3;
  50636. return function(t, i) {
  50637. e.setFromMatrixPosition(this.matrixWorld);
  50638. var n = t.ray.origin.distanceTo(e);
  50639. this.getObjectForDistance(n).raycast(t, i)
  50640. }
  50641. }(),
  50642. n.LOD.prototype.update = function() {
  50643. var e = new n.Vector3
  50644. , t = new n.Vector3;
  50645. return function(i) {
  50646. var n = this.levels;
  50647. if (n.length > 1) {
  50648. e.setFromMatrixPosition(i.matrixWorld),
  50649. t.setFromMatrixPosition(this.matrixWorld);
  50650. var r = e.distanceTo(t);
  50651. n[0].object.visible = !0;
  50652. for (var o = 1, a = n.length; o < a && r >= n[o].distance; o++)
  50653. n[o - 1].object.visible = !1,
  50654. n[o].object.visible = !0;
  50655. for (; o < a; o++)
  50656. n[o].object.visible = !1
  50657. }
  50658. }
  50659. }(),
  50660. n.LOD.prototype.copy = function(e) {
  50661. n.Object3D.prototype.copy.call(this, e, !1);
  50662. for (var t = e.levels, i = 0, r = t.length; i < r; i++) {
  50663. var o = t[i];
  50664. this.addLevel(o.object.clone(), o.distance)
  50665. }
  50666. return this
  50667. }
  50668. ,
  50669. n.LOD.prototype.toJSON = function(e) {
  50670. var t = n.Object3D.prototype.toJSON.call(this, e);
  50671. t.object.levels = [];
  50672. for (var i = this.levels, r = 0, o = i.length; r < o; r++) {
  50673. var a = i[r];
  50674. t.object.levels.push({
  50675. object: a.object.uuid,
  50676. distance: a.distance
  50677. })
  50678. }
  50679. return t
  50680. }
  50681. ,
  50682. n.Sprite = function() {
  50683. var e = new Uint16Array([0, 1, 2, 0, 2, 3])
  50684. , t = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0])
  50685. , i = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1])
  50686. , r = new n.BufferGeometry;
  50687. return r.setIndex(new n.BufferAttribute(e,1)),
  50688. r.addAttribute("position", new n.BufferAttribute(t,3)),
  50689. r.addAttribute("uv", new n.BufferAttribute(i,2)),
  50690. function(e) {
  50691. n.Object3D.call(this),
  50692. this.type = "Sprite",
  50693. this.geometry = r,
  50694. this.material = void 0 !== e ? e : new n.SpriteMaterial
  50695. }
  50696. }(),
  50697. n.Sprite.prototype = Object.create(n.Object3D.prototype),
  50698. n.Sprite.prototype.constructor = n.Sprite,
  50699. n.Sprite.prototype.raycast = function() {
  50700. var e = new n.Vector3;
  50701. return function(t, i) {
  50702. e.setFromMatrixPosition(this.matrixWorld);
  50703. var n = t.ray.distanceSqToPoint(e)
  50704. , r = this.scale.x * this.scale.y;
  50705. n > r || i.push({
  50706. distance: Math.sqrt(n),
  50707. point: this.position,
  50708. face: null,
  50709. object: this
  50710. })
  50711. }
  50712. }(),
  50713. n.Sprite.prototype.clone = function() {
  50714. return new this.constructor(this.material).copy(this)
  50715. }
  50716. ,
  50717. n.Particle = n.Sprite,
  50718. n.LensFlare = function(e, t, i, r, o) {
  50719. n.Object3D.call(this),
  50720. this.lensFlares = [],
  50721. this.positionScreen = new n.Vector3,
  50722. this.customUpdateCallback = void 0,
  50723. void 0 !== e && this.add(e, t, i, r, o)
  50724. }
  50725. ,
  50726. n.LensFlare.prototype = Object.create(n.Object3D.prototype),
  50727. n.LensFlare.prototype.constructor = n.LensFlare,
  50728. n.LensFlare.prototype.add = function(e, t, i, r, o, a) {
  50729. void 0 === t && (t = -1),
  50730. void 0 === i && (i = 0),
  50731. void 0 === a && (a = 1),
  50732. void 0 === o && (o = new n.Color(16777215)),
  50733. void 0 === r && (r = n.NormalBlending),
  50734. i = Math.min(i, Math.max(0, i)),
  50735. this.lensFlares.push({
  50736. texture: e,
  50737. size: t,
  50738. distance: i,
  50739. x: 0,
  50740. y: 0,
  50741. z: 0,
  50742. scale: 1,
  50743. rotation: 0,
  50744. opacity: a,
  50745. color: o,
  50746. blending: r
  50747. })
  50748. }
  50749. ,
  50750. n.LensFlare.prototype.updateLensFlares = function() {
  50751. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  50752. for (e = 0; e < i; e++)
  50753. t = this.lensFlares[e],
  50754. t.x = this.positionScreen.x + n * t.distance,
  50755. t.y = this.positionScreen.y + r * t.distance,
  50756. t.wantedRotation = t.x * Math.PI * .25,
  50757. t.rotation += .25 * (t.wantedRotation - t.rotation)
  50758. }
  50759. ,
  50760. n.LensFlare.prototype.copy = function(e) {
  50761. n.Object3D.prototype.copy.call(this, e),
  50762. this.positionScreen.copy(e.positionScreen),
  50763. this.customUpdateCallback = e.customUpdateCallback;
  50764. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  50765. this.lensFlares.push(e.lensFlares[t]);
  50766. return this
  50767. }
  50768. ,
  50769. n.Scene = function() {
  50770. n.Object3D.call(this),
  50771. this.type = "Scene",
  50772. this.fog = null,
  50773. this.overrideMaterial = null,
  50774. this.autoUpdate = !0
  50775. }
  50776. ,
  50777. n.Scene.prototype = Object.create(n.Object3D.prototype),
  50778. n.Scene.prototype.constructor = n.Scene,
  50779. n.Scene.prototype.copy = function(e, t) {
  50780. return n.Object3D.prototype.copy.call(this, e, t),
  50781. null !== e.fog && (this.fog = e.fog.clone()),
  50782. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  50783. this.autoUpdate = e.autoUpdate,
  50784. this.matrixAutoUpdate = e.matrixAutoUpdate,
  50785. this
  50786. }
  50787. ,
  50788. n.Fog = function(e, t, i) {
  50789. this.name = "",
  50790. this.color = new n.Color(e),
  50791. this.near = void 0 !== t ? t : 1,
  50792. this.far = void 0 !== i ? i : 1e3
  50793. }
  50794. ,
  50795. n.Fog.prototype.clone = function() {
  50796. return new n.Fog(this.color.getHex(),this.near,this.far)
  50797. }
  50798. ,
  50799. n.FogExp2 = function(e, t) {
  50800. this.name = "",
  50801. this.color = new n.Color(e),
  50802. this.density = void 0 !== t ? t : 25e-5
  50803. }
  50804. ,
  50805. n.FogExp2.prototype.clone = function() {
  50806. return new n.FogExp2(this.color.getHex(),this.density)
  50807. }
  50808. ,
  50809. n.ShaderChunk = {},
  50810. n.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  50811. n.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  50812. n.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  50813. 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",
  50814. n.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  50815. n.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  50816. n.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  50817. 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",
  50818. 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",
  50819. n.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  50820. n.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  50821. n.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  50822. n.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  50823. 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",
  50824. 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",
  50825. n.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  50826. n.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  50827. n.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  50828. 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",
  50829. n.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  50830. 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",
  50831. n.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  50832. 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",
  50833. 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",
  50834. 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",
  50835. 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",
  50836. 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",
  50837. 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",
  50838. n.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  50839. n.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  50840. 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",
  50841. 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",
  50842. n.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  50843. 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",
  50844. n.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  50845. n.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  50846. 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",
  50847. 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",
  50848. 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",
  50849. n.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  50850. 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",
  50851. 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",
  50852. 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",
  50853. n.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  50854. n.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  50855. 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",
  50856. n.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  50857. n.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  50858. n.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  50859. 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",
  50860. 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";
  50861. 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";
  50862. 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",
  50863. 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",
  50864. n.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  50865. 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",
  50866. n.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  50867. n.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  50868. 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",
  50869. 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",
  50870. 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",
  50871. 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",
  50872. 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",
  50873. 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",
  50874. 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",
  50875. 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",
  50876. 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",
  50877. n.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  50878. n.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  50879. 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",
  50880. n.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  50881. n.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  50882. n.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  50883. 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",
  50884. 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",
  50885. 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",
  50886. 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",
  50887. n.UniformsUtils = {
  50888. merge: function(e) {
  50889. for (var t = {}, i = 0; i < e.length; i++) {
  50890. var n = this.clone(e[i]);
  50891. for (var r in n)
  50892. t[r] = n[r]
  50893. }
  50894. return t
  50895. },
  50896. clone: function(e) {
  50897. var t = {};
  50898. for (var i in e) {
  50899. t[i] = {};
  50900. for (var r in e[i]) {
  50901. var o = e[i][r];
  50902. 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
  50903. }
  50904. }
  50905. return t
  50906. }
  50907. },
  50908. n.UniformsLib = {
  50909. common: {
  50910. diffuse: {
  50911. type: "c",
  50912. value: new n.Color(15658734)
  50913. },
  50914. opacity: {
  50915. type: "f",
  50916. value: 1
  50917. },
  50918. map: {
  50919. type: "t",
  50920. value: null
  50921. },
  50922. offsetRepeat: {
  50923. type: "v4",
  50924. value: new n.Vector4(0,0,1,1)
  50925. },
  50926. specularMap: {
  50927. type: "t",
  50928. value: null
  50929. },
  50930. alphaMap: {
  50931. type: "t",
  50932. value: null
  50933. },
  50934. envMap: {
  50935. type: "t",
  50936. value: null
  50937. },
  50938. flipEnvMap: {
  50939. type: "f",
  50940. value: -1
  50941. },
  50942. reflectivity: {
  50943. type: "f",
  50944. value: 1
  50945. },
  50946. refractionRatio: {
  50947. type: "f",
  50948. value: .98
  50949. }
  50950. },
  50951. aomap: {
  50952. aoMap: {
  50953. type: "t",
  50954. value: null
  50955. },
  50956. aoMapIntensity: {
  50957. type: "f",
  50958. value: 1
  50959. }
  50960. },
  50961. lightmap: {
  50962. lightMap: {
  50963. type: "t",
  50964. value: null
  50965. },
  50966. lightMapIntensity: {
  50967. type: "f",
  50968. value: 1
  50969. }
  50970. },
  50971. emissivemap: {
  50972. emissiveMap: {
  50973. type: "t",
  50974. value: null
  50975. }
  50976. },
  50977. bumpmap: {
  50978. bumpMap: {
  50979. type: "t",
  50980. value: null
  50981. },
  50982. bumpScale: {
  50983. type: "f",
  50984. value: 1
  50985. }
  50986. },
  50987. normalmap: {
  50988. normalMap: {
  50989. type: "t",
  50990. value: null
  50991. },
  50992. normalScale: {
  50993. type: "v2",
  50994. value: new n.Vector2(1,1)
  50995. }
  50996. },
  50997. displacementmap: {
  50998. displacementMap: {
  50999. type: "t",
  51000. value: null
  51001. },
  51002. displacementScale: {
  51003. type: "f",
  51004. value: 1
  51005. },
  51006. displacementBias: {
  51007. type: "f",
  51008. value: 0
  51009. }
  51010. },
  51011. roughnessmap: {
  51012. roughnessMap: {
  51013. type: "t",
  51014. value: null
  51015. }
  51016. },
  51017. metalnessmap: {
  51018. metalnessMap: {
  51019. type: "t",
  51020. value: null
  51021. }
  51022. },
  51023. fog: {
  51024. fogDensity: {
  51025. type: "f",
  51026. value: 25e-5
  51027. },
  51028. fogNear: {
  51029. type: "f",
  51030. value: 1
  51031. },
  51032. fogFar: {
  51033. type: "f",
  51034. value: 2e3
  51035. },
  51036. fogColor: {
  51037. type: "c",
  51038. value: new n.Color(16777215)
  51039. }
  51040. },
  51041. lights: {
  51042. ambientLightColor: {
  51043. type: "fv",
  51044. value: []
  51045. },
  51046. directionalLights: {
  51047. type: "sa",
  51048. value: [],
  51049. properties: {
  51050. direction: {
  51051. type: "v3"
  51052. },
  51053. color: {
  51054. type: "c"
  51055. },
  51056. shadow: {
  51057. type: "i"
  51058. },
  51059. shadowBias: {
  51060. type: "f"
  51061. },
  51062. shadowRadius: {
  51063. type: "f"
  51064. },
  51065. shadowMapSize: {
  51066. type: "v2"
  51067. }
  51068. }
  51069. },
  51070. directionalShadowMap: {
  51071. type: "tv",
  51072. value: []
  51073. },
  51074. directionalShadowMatrix: {
  51075. type: "m4v",
  51076. value: []
  51077. },
  51078. spotLights: {
  51079. type: "sa",
  51080. value: [],
  51081. properties: {
  51082. color: {
  51083. type: "c"
  51084. },
  51085. position: {
  51086. type: "v3"
  51087. },
  51088. direction: {
  51089. type: "v3"
  51090. },
  51091. distance: {
  51092. type: "f"
  51093. },
  51094. coneCos: {
  51095. type: "f"
  51096. },
  51097. penumbraCos: {
  51098. type: "f"
  51099. },
  51100. decay: {
  51101. type: "f"
  51102. },
  51103. shadow: {
  51104. type: "i"
  51105. },
  51106. shadowBias: {
  51107. type: "f"
  51108. },
  51109. shadowRadius: {
  51110. type: "f"
  51111. },
  51112. shadowMapSize: {
  51113. type: "v2"
  51114. }
  51115. }
  51116. },
  51117. spotShadowMap: {
  51118. type: "tv",
  51119. value: []
  51120. },
  51121. spotShadowMatrix: {
  51122. type: "m4v",
  51123. value: []
  51124. },
  51125. pointLights: {
  51126. type: "sa",
  51127. value: [],
  51128. properties: {
  51129. color: {
  51130. type: "c"
  51131. },
  51132. position: {
  51133. type: "v3"
  51134. },
  51135. decay: {
  51136. type: "f"
  51137. },
  51138. distance: {
  51139. type: "f"
  51140. },
  51141. shadow: {
  51142. type: "i"
  51143. },
  51144. shadowBias: {
  51145. type: "f"
  51146. },
  51147. shadowRadius: {
  51148. type: "f"
  51149. },
  51150. shadowMapSize: {
  51151. type: "v2"
  51152. }
  51153. }
  51154. },
  51155. pointShadowMap: {
  51156. type: "tv",
  51157. value: []
  51158. },
  51159. pointShadowMatrix: {
  51160. type: "m4v",
  51161. value: []
  51162. },
  51163. hemisphereLights: {
  51164. type: "sa",
  51165. value: [],
  51166. properties: {
  51167. direction: {
  51168. type: "v3"
  51169. },
  51170. skyColor: {
  51171. type: "c"
  51172. },
  51173. groundColor: {
  51174. type: "c"
  51175. }
  51176. }
  51177. }
  51178. },
  51179. points: {
  51180. diffuse: {
  51181. type: "c",
  51182. value: new n.Color(15658734)
  51183. },
  51184. opacity: {
  51185. type: "f",
  51186. value: 1
  51187. },
  51188. size: {
  51189. type: "f",
  51190. value: 1
  51191. },
  51192. scale: {
  51193. type: "f",
  51194. value: 1
  51195. },
  51196. map: {
  51197. type: "t",
  51198. value: null
  51199. },
  51200. offsetRepeat: {
  51201. type: "v4",
  51202. value: new n.Vector4(0,0,1,1)
  51203. }
  51204. }
  51205. },
  51206. 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",
  51207. 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",
  51208. 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",
  51209. 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",
  51210. 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",
  51211. 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",
  51212. 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",
  51213. 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",
  51214. 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",
  51215. 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",
  51216. 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",
  51217. 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",
  51218. 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",
  51219. 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",
  51220. 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",
  51221. 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",
  51222. 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",
  51223. 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",
  51224. 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",
  51225. 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",
  51226. 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",
  51227. 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",
  51228. 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",
  51229. 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",
  51230. n.ShaderLib = {
  51231. basic: {
  51232. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.fog]),
  51233. vertexShader: n.ShaderChunk.meshbasic_vert,
  51234. fragmentShader: n.ShaderChunk.meshbasic_frag
  51235. },
  51236. lambert: {
  51237. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.fog, n.UniformsLib.lights, {
  51238. emissive: {
  51239. type: "c",
  51240. value: new n.Color(0)
  51241. }
  51242. }]),
  51243. vertexShader: n.ShaderChunk.meshlambert_vert,
  51244. fragmentShader: n.ShaderChunk.meshlambert_frag
  51245. },
  51246. phong: {
  51247. 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, {
  51248. emissive: {
  51249. type: "c",
  51250. value: new n.Color(0)
  51251. },
  51252. specular: {
  51253. type: "c",
  51254. value: new n.Color(1118481)
  51255. },
  51256. shininess: {
  51257. type: "f",
  51258. value: 30
  51259. }
  51260. }]),
  51261. vertexShader: n.ShaderChunk.meshphong_vert,
  51262. fragmentShader: n.ShaderChunk.meshphong_frag
  51263. },
  51264. standard: {
  51265. 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, {
  51266. emissive: {
  51267. type: "c",
  51268. value: new n.Color(0)
  51269. },
  51270. roughness: {
  51271. type: "f",
  51272. value: .5
  51273. },
  51274. metalness: {
  51275. type: "f",
  51276. value: 0
  51277. },
  51278. envMapIntensity: {
  51279. type: "f",
  51280. value: 1
  51281. }
  51282. }]),
  51283. vertexShader: n.ShaderChunk.meshstandard_vert,
  51284. fragmentShader: n.ShaderChunk.meshstandard_frag
  51285. },
  51286. points: {
  51287. uniforms: n.UniformsUtils.merge([n.UniformsLib.points, n.UniformsLib.fog]),
  51288. vertexShader: n.ShaderChunk.points_vert,
  51289. fragmentShader: n.ShaderChunk.points_frag
  51290. },
  51291. dashed: {
  51292. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.fog, {
  51293. scale: {
  51294. type: "f",
  51295. value: 1
  51296. },
  51297. dashSize: {
  51298. type: "f",
  51299. value: 1
  51300. },
  51301. totalSize: {
  51302. type: "f",
  51303. value: 2
  51304. }
  51305. }]),
  51306. vertexShader: n.ShaderChunk.linedashed_vert,
  51307. fragmentShader: n.ShaderChunk.linedashed_frag
  51308. },
  51309. depth: {
  51310. uniforms: {
  51311. mNear: {
  51312. type: "f",
  51313. value: 1
  51314. },
  51315. mFar: {
  51316. type: "f",
  51317. value: 2e3
  51318. },
  51319. opacity: {
  51320. type: "f",
  51321. value: 1
  51322. }
  51323. },
  51324. vertexShader: n.ShaderChunk.depth_vert,
  51325. fragmentShader: n.ShaderChunk.depth_frag
  51326. },
  51327. normal: {
  51328. uniforms: {
  51329. opacity: {
  51330. type: "f",
  51331. value: 1
  51332. }
  51333. },
  51334. vertexShader: n.ShaderChunk.normal_vert,
  51335. fragmentShader: n.ShaderChunk.normal_frag
  51336. },
  51337. cube: {
  51338. uniforms: {
  51339. tCube: {
  51340. type: "t",
  51341. value: null
  51342. },
  51343. tFlip: {
  51344. type: "f",
  51345. value: -1
  51346. }
  51347. },
  51348. vertexShader: n.ShaderChunk.cube_vert,
  51349. fragmentShader: n.ShaderChunk.cube_frag
  51350. },
  51351. equirect: {
  51352. uniforms: {
  51353. tEquirect: {
  51354. type: "t",
  51355. value: null
  51356. },
  51357. tFlip: {
  51358. type: "f",
  51359. value: -1
  51360. }
  51361. },
  51362. vertexShader: n.ShaderChunk.equirect_vert,
  51363. fragmentShader: n.ShaderChunk.equirect_frag
  51364. },
  51365. depthRGBA: {
  51366. uniforms: {},
  51367. vertexShader: n.ShaderChunk.depthRGBA_vert,
  51368. fragmentShader: n.ShaderChunk.depthRGBA_frag
  51369. },
  51370. distanceRGBA: {
  51371. uniforms: {
  51372. lightPos: {
  51373. type: "v3",
  51374. value: new n.Vector3(0,0,0)
  51375. }
  51376. },
  51377. vertexShader: n.ShaderChunk.distanceRGBA_vert,
  51378. fragmentShader: n.ShaderChunk.distanceRGBA_frag
  51379. }
  51380. },
  51381. n.WebGLRenderer = function(e) {
  51382. function t() {
  51383. return null === ye ? Oe : 1
  51384. }
  51385. function i(e, t, i, n) {
  51386. se === !0 && (e *= n,
  51387. t *= n,
  51388. i *= n),
  51389. Ye.clearColor(e, t, i, n)
  51390. }
  51391. function r() {
  51392. Ye.init(),
  51393. Ye.scissor(we.copy(Le).multiplyScalar(Oe)),
  51394. Ye.viewport(Te.copy(Ne).multiplyScalar(Oe)),
  51395. i(Se.r, Se.g, Se.b, Me)
  51396. }
  51397. function o() {
  51398. Ae = null,
  51399. be = null,
  51400. Ee = "",
  51401. Ie = -1,
  51402. Ye.reset()
  51403. }
  51404. function a(e) {
  51405. e.preventDefault(),
  51406. o(),
  51407. r(),
  51408. Xe.clear()
  51409. }
  51410. function s(e) {
  51411. var t = e.target;
  51412. t.removeEventListener("dispose", s),
  51413. h(t),
  51414. ke.textures--
  51415. }
  51416. function l(e) {
  51417. var t = e.target;
  51418. t.removeEventListener("dispose", l),
  51419. u(t),
  51420. ke.textures--
  51421. }
  51422. function c(e) {
  51423. var t = e.target;
  51424. t.removeEventListener("dispose", c),
  51425. d(t)
  51426. }
  51427. function h(e) {
  51428. var t = Xe.get(e);
  51429. if (e.image && t.__image__webglTextureCube)
  51430. Ge.deleteTexture(t.__image__webglTextureCube);
  51431. else {
  51432. if (void 0 === t.__webglInit)
  51433. return;
  51434. Ge.deleteTexture(t.__webglTexture)
  51435. }
  51436. Xe.delete(e)
  51437. }
  51438. function u(e) {
  51439. var t = Xe.get(e)
  51440. , i = Xe.get(e.texture);
  51441. if (e && void 0 !== i.__webglTexture) {
  51442. if (Ge.deleteTexture(i.__webglTexture),
  51443. e instanceof n.WebGLRenderTargetCube)
  51444. for (var r = 0; r < 6; r++)
  51445. Ge.deleteFramebuffer(t.__webglFramebuffer[r]),
  51446. Ge.deleteRenderbuffer(t.__webglDepthbuffer[r]);
  51447. else
  51448. Ge.deleteFramebuffer(t.__webglFramebuffer),
  51449. Ge.deleteRenderbuffer(t.__webglDepthbuffer);
  51450. Xe.delete(e.texture),
  51451. Xe.delete(e)
  51452. }
  51453. }
  51454. function d(e) {
  51455. p(e),
  51456. Xe.delete(e)
  51457. }
  51458. function p(e) {
  51459. var t = Xe.get(e).program;
  51460. e.program = void 0,
  51461. void 0 !== t && qe.releaseProgram(t)
  51462. }
  51463. function f(e, t, i, r) {
  51464. var o;
  51465. if (i instanceof n.InstancedBufferGeometry && (o = We.get("ANGLE_instanced_arrays"),
  51466. null === o))
  51467. return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  51468. void 0 === r && (r = 0),
  51469. Ye.initAttributes();
  51470. var a = i.attributes
  51471. , s = t.getAttributes()
  51472. , l = e.defaultAttributeValues;
  51473. for (var c in s) {
  51474. var h = s[c];
  51475. if (h >= 0) {
  51476. var u = a[c];
  51477. if (void 0 !== u) {
  51478. var d = u.itemSize
  51479. , p = Ze.getAttributeBuffer(u);
  51480. if (u instanceof n.InterleavedBufferAttribute) {
  51481. var f = u.data
  51482. , g = f.stride
  51483. , m = u.offset;
  51484. f instanceof n.InstancedInterleavedBuffer ? (Ye.enableAttributeAndDivisor(h, f.meshPerAttribute, o),
  51485. void 0 === i.maxInstancedCount && (i.maxInstancedCount = f.meshPerAttribute * f.count)) : Ye.enableAttribute(h),
  51486. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  51487. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, g * f.array.BYTES_PER_ELEMENT, (r * g + m) * f.array.BYTES_PER_ELEMENT)
  51488. } else
  51489. u instanceof n.InstancedBufferAttribute ? (Ye.enableAttributeAndDivisor(h, u.meshPerAttribute, o),
  51490. void 0 === i.maxInstancedCount && (i.maxInstancedCount = u.meshPerAttribute * u.count)) : Ye.enableAttribute(h),
  51491. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  51492. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, 0, r * d * 4)
  51493. } else if (void 0 !== l) {
  51494. var v = l[c];
  51495. if (void 0 !== v)
  51496. switch (v.length) {
  51497. case 2:
  51498. Ge.vertexAttrib2fv(h, v);
  51499. break;
  51500. case 3:
  51501. Ge.vertexAttrib3fv(h, v);
  51502. break;
  51503. case 4:
  51504. Ge.vertexAttrib4fv(h, v);
  51505. break;
  51506. default:
  51507. Ge.vertexAttrib1fv(h, v)
  51508. }
  51509. }
  51510. }
  51511. }
  51512. Ye.disableUnusedAttributes()
  51513. }
  51514. function g(e, t) {
  51515. return Math.abs(t[0]) - Math.abs(e[0])
  51516. }
  51517. function m(e, t) {
  51518. 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
  51519. }
  51520. function v(e, t) {
  51521. 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
  51522. }
  51523. function A(e, t, i, n, r) {
  51524. var o, a;
  51525. i.transparent ? (o = de,
  51526. a = ++pe) : (o = he,
  51527. a = ++ue);
  51528. var s = o[a];
  51529. void 0 !== s ? (s.id = e.id,
  51530. s.object = e,
  51531. s.geometry = t,
  51532. s.material = i,
  51533. s.z = Ve.z,
  51534. s.group = r) : (s = {
  51535. id: e.id,
  51536. object: e,
  51537. geometry: t,
  51538. material: i,
  51539. z: Ve.z,
  51540. group: r
  51541. },
  51542. o.push(s))
  51543. }
  51544. function y(e, t) {
  51545. if (e.visible !== !1) {
  51546. if (e.layers.test(t.layers))
  51547. if (e instanceof n.Light)
  51548. ce.push(e);
  51549. else if (e instanceof n.Sprite)
  51550. e.frustumCulled !== !1 && Be.intersectsObject(e) !== !0 || ge.push(e);
  51551. else if (e instanceof n.LensFlare)
  51552. me.push(e);
  51553. else if (e instanceof n.ImmediateRenderObject)
  51554. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  51555. Ve.applyProjection(Fe)),
  51556. A(e, null, e.material, Ve.z, null);
  51557. else if ((e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) && (e instanceof n.SkinnedMesh && e.skeleton.update(),
  51558. e.frustumCulled === !1 || Be.intersectsObject(e) === !0)) {
  51559. var i = e.material;
  51560. if (i.visible === !0) {
  51561. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  51562. Ve.applyProjection(Fe));
  51563. var r = Ze.update(e);
  51564. if (i instanceof n.MultiMaterial)
  51565. for (var o = r.groups, a = i.materials, s = 0, l = o.length; s < l; s++) {
  51566. var c = o[s]
  51567. , h = a[c.materialIndex];
  51568. h.visible === !0 && A(e, r, h, Ve.z, c)
  51569. }
  51570. else
  51571. A(e, r, i, Ve.z, null)
  51572. }
  51573. }
  51574. for (var u = e.children, s = 0, l = u.length; s < l; s++)
  51575. y(u[s], t)
  51576. }
  51577. }
  51578. function C(e, t, i, r) {
  51579. for (var o = 0, a = e.length; o < a; o++) {
  51580. var s = e[o]
  51581. , l = s.object
  51582. , c = s.geometry
  51583. , h = void 0 === r ? s.material : r
  51584. , u = s.group;
  51585. if (l.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  51586. l.normalMatrix.getNormalMatrix(l.modelViewMatrix),
  51587. l instanceof n.ImmediateRenderObject) {
  51588. E(h);
  51589. var d = w(t, i, h, l);
  51590. Ee = "",
  51591. l.render(function(e) {
  51592. ve.renderBufferImmediate(e, d, h)
  51593. })
  51594. } else
  51595. ve.renderBufferDirect(t, i, c, h, l, u)
  51596. }
  51597. }
  51598. function I(e, t, i) {
  51599. var r = Xe.get(e)
  51600. , o = qe.getParameters(e, Ue, t, i)
  51601. , a = qe.getProgramCode(e, o)
  51602. , s = r.program
  51603. , l = !0;
  51604. if (void 0 === s)
  51605. e.addEventListener("dispose", c);
  51606. else if (s.code !== a)
  51607. p(e);
  51608. else {
  51609. if (void 0 !== o.shaderID)
  51610. return;
  51611. l = !1
  51612. }
  51613. if (l) {
  51614. if (o.shaderID) {
  51615. var h = n.ShaderLib[o.shaderID];
  51616. r.__webglShader = {
  51617. name: e.type,
  51618. uniforms: n.UniformsUtils.clone(h.uniforms),
  51619. vertexShader: h.vertexShader,
  51620. fragmentShader: h.fragmentShader
  51621. }
  51622. } else
  51623. r.__webglShader = {
  51624. name: e.type,
  51625. uniforms: e.uniforms,
  51626. vertexShader: e.vertexShader,
  51627. fragmentShader: e.fragmentShader
  51628. };
  51629. e.__webglShader = r.__webglShader,
  51630. s = qe.acquireProgram(e, o, a),
  51631. r.program = s,
  51632. e.program = s
  51633. }
  51634. var u = s.getAttributes();
  51635. if (e.morphTargets) {
  51636. e.numSupportedMorphTargets = 0;
  51637. for (var d = 0; d < ve.maxMorphTargets; d++)
  51638. u["morphTarget" + d] >= 0 && e.numSupportedMorphTargets++
  51639. }
  51640. if (e.morphNormals) {
  51641. e.numSupportedMorphNormals = 0;
  51642. for (var d = 0; d < ve.maxMorphNormals; d++)
  51643. u["morphNormal" + d] >= 0 && e.numSupportedMorphNormals++
  51644. }
  51645. r.uniformsList = [];
  51646. var f = r.__webglShader.uniforms
  51647. , g = r.program.getUniforms();
  51648. for (var m in f) {
  51649. var v = g[m];
  51650. v && r.uniformsList.push([r.__webglShader.uniforms[m], v])
  51651. }
  51652. (e instanceof n.MeshPhongMaterial || e instanceof n.MeshLambertMaterial || e instanceof n.MeshStandardMaterial || e.lights) && (r.lightsHash = Ue.hash,
  51653. f.ambientLightColor.value = Ue.ambient,
  51654. f.directionalLights.value = Ue.directional,
  51655. f.spotLights.value = Ue.spot,
  51656. f.pointLights.value = Ue.point,
  51657. f.hemisphereLights.value = Ue.hemi,
  51658. f.directionalShadowMap.value = Ue.directionalShadowMap,
  51659. f.directionalShadowMatrix.value = Ue.directionalShadowMatrix,
  51660. f.spotShadowMap.value = Ue.spotShadowMap,
  51661. f.spotShadowMatrix.value = Ue.spotShadowMatrix,
  51662. f.pointShadowMap.value = Ue.pointShadowMap,
  51663. f.pointShadowMatrix.value = Ue.pointShadowMatrix),
  51664. r.hasDynamicUniforms = !1;
  51665. for (var A = 0, y = r.uniformsList.length; A < y; A++) {
  51666. var C = r.uniformsList[A][0];
  51667. if (C.dynamic === !0) {
  51668. r.hasDynamicUniforms = !0;
  51669. break
  51670. }
  51671. }
  51672. }
  51673. function E(e) {
  51674. b(e),
  51675. 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),
  51676. Ye.setDepthFunc(e.depthFunc),
  51677. Ye.setDepthTest(e.depthTest),
  51678. Ye.setDepthWrite(e.depthWrite),
  51679. Ye.setColorWrite(e.colorWrite),
  51680. Ye.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  51681. }
  51682. function b(e) {
  51683. e.side !== n.DoubleSide ? Ye.enable(Ge.CULL_FACE) : Ye.disable(Ge.CULL_FACE),
  51684. Ye.setFlipSided(e.side === n.BackSide)
  51685. }
  51686. function w(e, t, i, r) {
  51687. xe = 0;
  51688. var o = Xe.get(i);
  51689. void 0 === o.program && (i.needsUpdate = !0),
  51690. void 0 !== o.lightsHash && o.lightsHash !== Ue.hash && (i.needsUpdate = !0),
  51691. i.needsUpdate && (I(i, t, r),
  51692. i.needsUpdate = !1);
  51693. var a = !1
  51694. , s = !1
  51695. , l = !1
  51696. , c = o.program
  51697. , h = c.getUniforms()
  51698. , u = o.__webglShader.uniforms;
  51699. if (c.id !== Ae && (Ge.useProgram(c.program),
  51700. Ae = c.id,
  51701. a = !0,
  51702. s = !0,
  51703. l = !0),
  51704. i.id !== Ie && (Ie = i.id,
  51705. s = !0),
  51706. (a || e !== be) && (Ge.uniformMatrix4fv(h.projectionMatrix, !1, e.projectionMatrix.elements),
  51707. je.logarithmicDepthBuffer && Ge.uniform1f(h.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  51708. e !== be && (be = e,
  51709. s = !0,
  51710. l = !0),
  51711. (i instanceof n.ShaderMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial || i.envMap) && void 0 !== h.cameraPosition && (Ve.setFromMatrixPosition(e.matrixWorld),
  51712. Ge.uniform3f(h.cameraPosition, Ve.x, Ve.y, Ve.z)),
  51713. (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),
  51714. void 0 !== h.toneMappingExposure && Ge.uniform1f(h.toneMappingExposure, ve.toneMappingExposure),
  51715. void 0 !== h.toneMappingWhitePoint && Ge.uniform1f(h.toneMappingWhitePoint, ve.toneMappingWhitePoint)),
  51716. i.skinning)
  51717. if (r.bindMatrix && void 0 !== h.bindMatrix && Ge.uniformMatrix4fv(h.bindMatrix, !1, r.bindMatrix.elements),
  51718. r.bindMatrixInverse && void 0 !== h.bindMatrixInverse && Ge.uniformMatrix4fv(h.bindMatrixInverse, !1, r.bindMatrixInverse.elements),
  51719. je.floatVertexTextures && r.skeleton && r.skeleton.useVertexTexture) {
  51720. if (void 0 !== h.boneTexture) {
  51721. var d = B();
  51722. Ge.uniform1i(h.boneTexture, d),
  51723. ve.setTexture(r.skeleton.boneTexture, d)
  51724. }
  51725. void 0 !== h.boneTextureWidth && Ge.uniform1i(h.boneTextureWidth, r.skeleton.boneTextureWidth),
  51726. void 0 !== h.boneTextureHeight && Ge.uniform1i(h.boneTextureHeight, r.skeleton.boneTextureHeight)
  51727. } else
  51728. r.skeleton && r.skeleton.boneMatrices && void 0 !== h.boneGlobalMatrices && Ge.uniformMatrix4fv(h.boneGlobalMatrices, !1, r.skeleton.boneMatrices);
  51729. return s && ((i instanceof n.MeshPhongMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshStandardMaterial || i.lights) && D(u, l),
  51730. t && i.fog && R(u, t),
  51731. (i instanceof n.MeshBasicMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial) && T(u, i),
  51732. i instanceof n.LineBasicMaterial ? x(u, i) : i instanceof n.LineDashedMaterial ? (x(u, i),
  51733. 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,
  51734. u.mFar.value = e.far,
  51735. u.opacity.value = i.opacity) : i instanceof n.MeshNormalMaterial && (u.opacity.value = i.opacity),
  51736. V(o.uniformsList)),
  51737. N(h, r),
  51738. void 0 !== h.modelMatrix && Ge.uniformMatrix4fv(h.modelMatrix, !1, r.matrixWorld.elements),
  51739. o.hasDynamicUniforms === !0 && _(o.uniformsList, r, e),
  51740. c
  51741. }
  51742. function _(e, t, i) {
  51743. for (var n = [], r = 0, o = e.length; r < o; r++) {
  51744. var a = e[r][0]
  51745. , s = a.onUpdateCallback;
  51746. void 0 !== s && (s.bind(a)(t, i),
  51747. n.push(e[r]))
  51748. }
  51749. V(n)
  51750. }
  51751. function T(e, t) {
  51752. e.opacity.value = t.opacity,
  51753. e.diffuse.value = t.color,
  51754. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  51755. e.map.value = t.map,
  51756. e.specularMap.value = t.specularMap,
  51757. e.alphaMap.value = t.alphaMap,
  51758. t.aoMap && (e.aoMap.value = t.aoMap,
  51759. e.aoMapIntensity.value = t.aoMapIntensity);
  51760. var i;
  51761. 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),
  51762. void 0 !== i) {
  51763. i instanceof n.WebGLRenderTarget && (i = i.texture);
  51764. var r = i.offset
  51765. , o = i.repeat;
  51766. e.offsetRepeat.value.set(r.x, r.y, o.x, o.y)
  51767. }
  51768. e.envMap.value = t.envMap,
  51769. e.flipEnvMap.value = t.envMap instanceof n.WebGLRenderTargetCube ? 1 : -1,
  51770. e.reflectivity.value = t.reflectivity,
  51771. e.refractionRatio.value = t.refractionRatio
  51772. }
  51773. function x(e, t) {
  51774. e.diffuse.value = t.color,
  51775. e.opacity.value = t.opacity
  51776. }
  51777. function S(e, t) {
  51778. e.dashSize.value = t.dashSize,
  51779. e.totalSize.value = t.dashSize + t.gapSize,
  51780. e.scale.value = t.scale
  51781. }
  51782. function M(e, t) {
  51783. if (e.diffuse.value = t.color,
  51784. e.opacity.value = t.opacity,
  51785. e.size.value = t.size * Oe,
  51786. e.scale.value = te.clientHeight / 2,
  51787. e.map.value = t.map,
  51788. null !== t.map) {
  51789. var i = t.map.offset
  51790. , n = t.map.repeat;
  51791. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  51792. }
  51793. }
  51794. function R(e, t) {
  51795. e.fogColor.value = t.color,
  51796. t instanceof n.Fog ? (e.fogNear.value = t.near,
  51797. e.fogFar.value = t.far) : t instanceof n.FogExp2 && (e.fogDensity.value = t.density)
  51798. }
  51799. function P(e, t) {
  51800. t.lightMap && (e.lightMap.value = t.lightMap,
  51801. e.lightMapIntensity.value = t.lightMapIntensity),
  51802. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  51803. }
  51804. function O(e, t) {
  51805. e.specular.value = t.specular,
  51806. e.shininess.value = Math.max(t.shininess, 1e-4),
  51807. t.lightMap && (e.lightMap.value = t.lightMap,
  51808. e.lightMapIntensity.value = t.lightMapIntensity),
  51809. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  51810. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  51811. e.bumpScale.value = t.bumpScale),
  51812. t.normalMap && (e.normalMap.value = t.normalMap,
  51813. e.normalScale.value.copy(t.normalScale)),
  51814. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  51815. e.displacementScale.value = t.displacementScale,
  51816. e.displacementBias.value = t.displacementBias)
  51817. }
  51818. function L(e, t) {
  51819. e.roughness.value = t.roughness,
  51820. e.metalness.value = t.metalness,
  51821. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  51822. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  51823. t.lightMap && (e.lightMap.value = t.lightMap,
  51824. e.lightMapIntensity.value = t.lightMapIntensity),
  51825. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  51826. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  51827. e.bumpScale.value = t.bumpScale),
  51828. t.normalMap && (e.normalMap.value = t.normalMap,
  51829. e.normalScale.value.copy(t.normalScale)),
  51830. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  51831. e.displacementScale.value = t.displacementScale,
  51832. e.displacementBias.value = t.displacementBias),
  51833. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  51834. }
  51835. function D(e, t) {
  51836. e.ambientLightColor.needsUpdate = t,
  51837. e.directionalLights.needsUpdate = t,
  51838. e.pointLights.needsUpdate = t,
  51839. e.spotLights.needsUpdate = t,
  51840. e.hemisphereLights.needsUpdate = t
  51841. }
  51842. function N(e, t) {
  51843. Ge.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  51844. e.normalMatrix && Ge.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  51845. }
  51846. function B() {
  51847. var e = xe;
  51848. return e >= je.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + je.maxTextures),
  51849. xe += 1,
  51850. e
  51851. }
  51852. function F(e, t, i, r) {
  51853. var o, a;
  51854. if ("1i" === t)
  51855. Ge.uniform1i(i, r);
  51856. else if ("1f" === t)
  51857. Ge.uniform1f(i, r);
  51858. else if ("2f" === t)
  51859. Ge.uniform2f(i, r[0], r[1]);
  51860. else if ("3f" === t)
  51861. Ge.uniform3f(i, r[0], r[1], r[2]);
  51862. else if ("4f" === t)
  51863. Ge.uniform4f(i, r[0], r[1], r[2], r[3]);
  51864. else if ("1iv" === t)
  51865. Ge.uniform1iv(i, r);
  51866. else if ("3iv" === t)
  51867. Ge.uniform3iv(i, r);
  51868. else if ("1fv" === t)
  51869. Ge.uniform1fv(i, r);
  51870. else if ("2fv" === t)
  51871. Ge.uniform2fv(i, r);
  51872. else if ("3fv" === t)
  51873. Ge.uniform3fv(i, r);
  51874. else if ("4fv" === t)
  51875. Ge.uniform4fv(i, r);
  51876. else if ("Matrix2fv" === t)
  51877. Ge.uniformMatrix2fv(i, !1, r);
  51878. else if ("Matrix3fv" === t)
  51879. Ge.uniformMatrix3fv(i, !1, r);
  51880. else if ("Matrix4fv" === t)
  51881. Ge.uniformMatrix4fv(i, !1, r);
  51882. else if ("i" === t)
  51883. Ge.uniform1i(i, r);
  51884. else if ("f" === t)
  51885. Ge.uniform1f(i, r);
  51886. else if ("v2" === t)
  51887. Ge.uniform2f(i, r.x, r.y);
  51888. else if ("v3" === t)
  51889. Ge.uniform3f(i, r.x, r.y, r.z);
  51890. else if ("v4" === t)
  51891. Ge.uniform4f(i, r.x, r.y, r.z, r.w);
  51892. else if ("c" === t)
  51893. Ge.uniform3f(i, r.r, r.g, r.b);
  51894. else if ("s" === t) {
  51895. var s = e.properties;
  51896. for (var l in s) {
  51897. var c = s[l]
  51898. , h = i[l]
  51899. , u = r[l];
  51900. F(c, c.type, h, u)
  51901. }
  51902. } else if ("sa" === t)
  51903. for (var s = e.properties, d = 0, p = r.length; d < p; d++)
  51904. for (var l in s) {
  51905. var c = s[l]
  51906. , h = i[d][l]
  51907. , u = r[d][l];
  51908. F(c, c.type, h, u)
  51909. }
  51910. else if ("iv1" === t)
  51911. Ge.uniform1iv(i, r);
  51912. else if ("iv" === t)
  51913. Ge.uniform3iv(i, r);
  51914. else if ("fv1" === t)
  51915. Ge.uniform1fv(i, r);
  51916. else if ("fv" === t)
  51917. Ge.uniform3fv(i, r);
  51918. else if ("v2v" === t) {
  51919. void 0 === e._array && (e._array = new Float32Array(2 * r.length));
  51920. for (var d = 0, f = 0, g = r.length; d < g; d++,
  51921. f += 2)
  51922. e._array[f + 0] = r[d].x,
  51923. e._array[f + 1] = r[d].y;
  51924. Ge.uniform2fv(i, e._array)
  51925. } else if ("v3v" === t) {
  51926. void 0 === e._array && (e._array = new Float32Array(3 * r.length));
  51927. for (var d = 0, m = 0, g = r.length; d < g; d++,
  51928. m += 3)
  51929. e._array[m + 0] = r[d].x,
  51930. e._array[m + 1] = r[d].y,
  51931. e._array[m + 2] = r[d].z;
  51932. Ge.uniform3fv(i, e._array)
  51933. } else if ("v4v" === t) {
  51934. void 0 === e._array && (e._array = new Float32Array(4 * r.length));
  51935. for (var d = 0, v = 0, g = r.length; d < g; d++,
  51936. v += 4)
  51937. e._array[v + 0] = r[d].x,
  51938. e._array[v + 1] = r[d].y,
  51939. e._array[v + 2] = r[d].z,
  51940. e._array[v + 3] = r[d].w;
  51941. Ge.uniform4fv(i, e._array)
  51942. } else if ("m2" === t)
  51943. Ge.uniformMatrix2fv(i, !1, r.elements);
  51944. else if ("m3" === t)
  51945. Ge.uniformMatrix3fv(i, !1, r.elements);
  51946. else if ("m3v" === t) {
  51947. void 0 === e._array && (e._array = new Float32Array(9 * r.length));
  51948. for (var d = 0, g = r.length; d < g; d++)
  51949. r[d].flattenToArrayOffset(e._array, 9 * d);
  51950. Ge.uniformMatrix3fv(i, !1, e._array)
  51951. } else if ("m4" === t)
  51952. Ge.uniformMatrix4fv(i, !1, r.elements);
  51953. else if ("m4v" === t) {
  51954. void 0 === e._array && (e._array = new Float32Array(16 * r.length));
  51955. for (var d = 0, g = r.length; d < g; d++)
  51956. r[d].flattenToArrayOffset(e._array, 16 * d);
  51957. Ge.uniformMatrix4fv(i, !1, e._array)
  51958. } else if ("t" === t) {
  51959. if (o = r,
  51960. a = B(),
  51961. Ge.uniform1i(i, a),
  51962. !o)
  51963. return;
  51964. 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)
  51965. } else if ("tv" === t) {
  51966. void 0 === e._array && (e._array = []);
  51967. for (var d = 0, g = e.value.length; d < g; d++)
  51968. e._array[d] = B();
  51969. Ge.uniform1iv(i, e._array);
  51970. for (var d = 0, g = e.value.length; d < g; d++)
  51971. o = e.value[d],
  51972. a = e._array[d],
  51973. 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))
  51974. } else
  51975. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  51976. }
  51977. function V(e) {
  51978. for (var t = 0, i = e.length; t < i; t++) {
  51979. var n = e[t][0];
  51980. if (n.needsUpdate !== !1) {
  51981. var r = n.type
  51982. , o = e[t][1]
  51983. , a = n.value;
  51984. F(n, r, o, a)
  51985. }
  51986. }
  51987. }
  51988. function U(e, t) {
  51989. 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;
  51990. for (Ue.shadowsPointLight = 0,
  51991. i = 0,
  51992. r = e.length; i < r; i++)
  51993. if (o = e[i],
  51994. a = o.color,
  51995. s = o.intensity,
  51996. l = o.distance,
  51997. o instanceof n.AmbientLight)
  51998. c += a.r * s,
  51999. h += a.g * s,
  52000. u += a.b * s;
  52001. else if (o instanceof n.DirectionalLight) {
  52002. var A = Ke.get(o);
  52003. A.color.copy(o.color).multiplyScalar(o.intensity),
  52004. A.direction.setFromMatrixPosition(o.matrixWorld),
  52005. Ve.setFromMatrixPosition(o.target.matrixWorld),
  52006. A.direction.sub(Ve),
  52007. A.direction.transformDirection(d),
  52008. A.shadow = o.castShadow,
  52009. o.castShadow && (A.shadowBias = o.shadow.bias,
  52010. A.shadowRadius = o.shadow.radius,
  52011. A.shadowMapSize = o.shadow.mapSize,
  52012. Ue.shadows[v++] = o),
  52013. Ue.directionalShadowMap[p] = o.shadow.map,
  52014. Ue.directionalShadowMatrix[p] = o.shadow.matrix,
  52015. Ue.directional[p++] = A
  52016. } else if (o instanceof n.SpotLight) {
  52017. var A = Ke.get(o);
  52018. A.position.setFromMatrixPosition(o.matrixWorld),
  52019. A.position.applyMatrix4(d),
  52020. A.color.copy(a).multiplyScalar(s),
  52021. A.distance = l,
  52022. A.direction.setFromMatrixPosition(o.matrixWorld),
  52023. Ve.setFromMatrixPosition(o.target.matrixWorld),
  52024. A.direction.sub(Ve),
  52025. A.direction.transformDirection(d),
  52026. A.coneCos = Math.cos(o.angle),
  52027. A.penumbraCos = Math.cos(o.angle * (1 - o.penumbra)),
  52028. A.decay = 0 === o.distance ? 0 : o.decay,
  52029. A.shadow = o.castShadow,
  52030. o.castShadow && (A.shadowBias = o.shadow.bias,
  52031. A.shadowRadius = o.shadow.radius,
  52032. A.shadowMapSize = o.shadow.mapSize,
  52033. Ue.shadows[v++] = o),
  52034. Ue.spotShadowMap[g] = o.shadow.map,
  52035. Ue.spotShadowMatrix[g] = o.shadow.matrix,
  52036. Ue.spot[g++] = A
  52037. } else if (o instanceof n.PointLight) {
  52038. var A = Ke.get(o);
  52039. A.position.setFromMatrixPosition(o.matrixWorld),
  52040. A.position.applyMatrix4(d),
  52041. A.color.copy(o.color).multiplyScalar(o.intensity),
  52042. A.distance = o.distance,
  52043. A.decay = 0 === o.distance ? 0 : o.decay,
  52044. A.shadow = o.castShadow,
  52045. o.castShadow && (A.shadowBias = o.shadow.bias,
  52046. A.shadowRadius = o.shadow.radius,
  52047. A.shadowMapSize = o.shadow.mapSize,
  52048. Ue.shadows[v++] = o),
  52049. Ue.pointShadowMap[f] = o.shadow.map,
  52050. void 0 === Ue.pointShadowMatrix[f] && (Ue.pointShadowMatrix[f] = new n.Matrix4),
  52051. Ve.setFromMatrixPosition(o.matrixWorld).negate(),
  52052. Ue.pointShadowMatrix[f].identity().setPosition(Ve),
  52053. Ue.point[f++] = A
  52054. } else if (o instanceof n.HemisphereLight) {
  52055. var A = Ke.get(o);
  52056. A.direction.setFromMatrixPosition(o.matrixWorld),
  52057. A.direction.transformDirection(d),
  52058. A.direction.normalize(),
  52059. A.skyColor.copy(o.color).multiplyScalar(s),
  52060. A.groundColor.copy(o.groundColor).multiplyScalar(s),
  52061. Ue.hemi[m++] = A
  52062. }
  52063. Ue.ambient[0] = c,
  52064. Ue.ambient[1] = h,
  52065. Ue.ambient[2] = u,
  52066. Ue.directional.length = p,
  52067. Ue.spot.length = g,
  52068. Ue.point.length = f,
  52069. Ue.hemi.length = m,
  52070. Ue.shadows.length = v,
  52071. Ue.hash = p + "," + f + "," + g + "," + m + "," + v
  52072. }
  52073. function k(e, t, i) {
  52074. var r;
  52075. if (i ? (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, ee(t.wrapS)),
  52076. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, ee(t.wrapT)),
  52077. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, ee(t.magFilter)),
  52078. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, ee(t.minFilter))) : (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, Ge.CLAMP_TO_EDGE),
  52079. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, Ge.CLAMP_TO_EDGE),
  52080. 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),
  52081. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, $(t.magFilter)),
  52082. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, $(t.minFilter)),
  52083. 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)),
  52084. r = We.get("EXT_texture_filter_anisotropic")) {
  52085. if (t.type === n.FloatType && null === We.get("OES_texture_float_linear"))
  52086. return;
  52087. if (t.type === n.HalfFloatType && null === We.get("OES_texture_half_float_linear"))
  52088. return;
  52089. (t.anisotropy > 1 || Xe.get(t).__currentAnisotropy) && (Ge.texParameterf(e, r.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, ve.getMaxAnisotropy())),
  52090. Xe.get(t).__currentAnisotropy = t.anisotropy)
  52091. }
  52092. }
  52093. function H(e, t, i) {
  52094. void 0 === e.__webglInit && (e.__webglInit = !0,
  52095. t.addEventListener("dispose", s),
  52096. e.__webglTexture = Ge.createTexture(),
  52097. ke.textures++),
  52098. Ye.activeTexture(Ge.TEXTURE0 + i),
  52099. Ye.bindTexture(Ge.TEXTURE_2D, e.__webglTexture),
  52100. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, t.flipY),
  52101. Ge.pixelStorei(Ge.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  52102. Ge.pixelStorei(Ge.UNPACK_ALIGNMENT, t.unpackAlignment);
  52103. var r = G(t.image, je.maxTextureSize);
  52104. W(t) && z(r) === !1 && (r = j(r));
  52105. var o = z(r)
  52106. , a = ee(t.format)
  52107. , l = ee(t.type);
  52108. k(Ge.TEXTURE_2D, t, o);
  52109. var c, h = t.mipmaps;
  52110. if (t instanceof n.DataTexture)
  52111. if (h.length > 0 && o) {
  52112. for (var u = 0, d = h.length; u < d; u++)
  52113. c = h[u],
  52114. Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data);
  52115. t.generateMipmaps = !1
  52116. } else
  52117. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, r.width, r.height, 0, a, l, r.data);
  52118. else if (t instanceof n.CompressedTexture)
  52119. for (var u = 0, d = h.length; u < d; u++)
  52120. c = h[u],
  52121. 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);
  52122. else if (h.length > 0 && o) {
  52123. for (var u = 0, d = h.length; u < d; u++)
  52124. c = h[u],
  52125. Ye.texImage2D(Ge.TEXTURE_2D, u, a, a, l, c);
  52126. t.generateMipmaps = !1
  52127. } else
  52128. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, a, l, r);
  52129. t.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  52130. e.__version = t.version,
  52131. t.onUpdate && t.onUpdate(t)
  52132. }
  52133. function G(e, t) {
  52134. if (e.width > t || e.height > t) {
  52135. var i = t / Math.max(e.width, e.height)
  52136. , n = document.createElement("canvas");
  52137. n.width = Math.floor(e.width * i),
  52138. n.height = Math.floor(e.height * i);
  52139. var r = n.getContext("2d");
  52140. return r.drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  52141. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  52142. n
  52143. }
  52144. return e
  52145. }
  52146. function z(e) {
  52147. return n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height)
  52148. }
  52149. function W(e) {
  52150. return e.wrapS !== n.ClampToEdgeWrapping || e.wrapT !== n.ClampToEdgeWrapping || e.minFilter !== n.NearestFilter && e.minFilter !== n.LinearFilter
  52151. }
  52152. function j(e) {
  52153. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  52154. var t = document.createElement("canvas");
  52155. t.width = n.Math.nearestPowerOfTwo(e.width),
  52156. t.height = n.Math.nearestPowerOfTwo(e.height);
  52157. var i = t.getContext("2d");
  52158. return i.drawImage(e, 0, 0, t.width, t.height),
  52159. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  52160. t
  52161. }
  52162. return e
  52163. }
  52164. function Y(e, t) {
  52165. var i = Xe.get(e);
  52166. if (6 === e.image.length)
  52167. if (e.version > 0 && i.__version !== e.version) {
  52168. i.__image__webglTextureCube || (e.addEventListener("dispose", s),
  52169. i.__image__webglTextureCube = Ge.createTexture(),
  52170. ke.textures++),
  52171. Ye.activeTexture(Ge.TEXTURE0 + t),
  52172. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  52173. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, e.flipY);
  52174. for (var r = e instanceof n.CompressedTexture, o = e.image[0]instanceof n.DataTexture, a = [], l = 0; l < 6; l++)
  52175. !ve.autoScaleCubemaps || r || o ? a[l] = o ? e.image[l].image : e.image[l] : a[l] = G(e.image[l], je.maxCubemapSize);
  52176. var c = a[0]
  52177. , h = z(c)
  52178. , u = ee(e.format)
  52179. , d = ee(e.type);
  52180. k(Ge.TEXTURE_CUBE_MAP, e, h);
  52181. for (var l = 0; l < 6; l++)
  52182. if (r)
  52183. for (var p, f = a[l].mipmaps, g = 0, m = f.length; g < m; g++)
  52184. p = f[g],
  52185. 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);
  52186. else
  52187. 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]);
  52188. e.generateMipmaps && h && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  52189. i.__version = e.version,
  52190. e.onUpdate && e.onUpdate(e)
  52191. } else
  52192. Ye.activeTexture(Ge.TEXTURE0 + t),
  52193. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  52194. }
  52195. function X(e, t) {
  52196. Ye.activeTexture(Ge.TEXTURE0 + t),
  52197. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, Xe.get(e).__webglTexture)
  52198. }
  52199. function Z(e, t, i, n) {
  52200. var r = ee(t.texture.format)
  52201. , o = ee(t.texture.type);
  52202. Ye.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  52203. Ge.bindFramebuffer(Ge.FRAMEBUFFER, e),
  52204. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, i, n, Xe.get(t.texture).__webglTexture, 0),
  52205. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  52206. }
  52207. function q(e, t) {
  52208. Ge.bindRenderbuffer(Ge.RENDERBUFFER, e),
  52209. t.depthBuffer && !t.stencilBuffer ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_COMPONENT16, t.width, t.height),
  52210. 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),
  52211. Ge.framebufferRenderbuffer(Ge.FRAMEBUFFER, Ge.DEPTH_STENCIL_ATTACHMENT, Ge.RENDERBUFFER, e)) : Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.RGBA4, t.width, t.height),
  52212. Ge.bindRenderbuffer(Ge.RENDERBUFFER, null)
  52213. }
  52214. function K(e) {
  52215. var t = Xe.get(e)
  52216. , i = e instanceof n.WebGLRenderTargetCube;
  52217. if (i) {
  52218. t.__webglDepthbuffer = [];
  52219. for (var r = 0; r < 6; r++)
  52220. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer[r]),
  52221. t.__webglDepthbuffer[r] = Ge.createRenderbuffer(),
  52222. q(t.__webglDepthbuffer[r], e)
  52223. } else
  52224. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer),
  52225. t.__webglDepthbuffer = Ge.createRenderbuffer(),
  52226. q(t.__webglDepthbuffer, e);
  52227. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  52228. }
  52229. function Q(e) {
  52230. var t = Xe.get(e)
  52231. , i = Xe.get(e.texture);
  52232. e.addEventListener("dispose", l),
  52233. i.__webglTexture = Ge.createTexture(),
  52234. ke.textures++;
  52235. var r = e instanceof n.WebGLRenderTargetCube
  52236. , o = n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height);
  52237. if (r) {
  52238. t.__webglFramebuffer = [];
  52239. for (var a = 0; a < 6; a++)
  52240. t.__webglFramebuffer[a] = Ge.createFramebuffer()
  52241. } else
  52242. t.__webglFramebuffer = Ge.createFramebuffer();
  52243. if (r) {
  52244. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__webglTexture),
  52245. k(Ge.TEXTURE_CUBE_MAP, e.texture, o);
  52246. for (var a = 0; a < 6; a++)
  52247. Z(t.__webglFramebuffer[a], e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + a);
  52248. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  52249. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, null)
  52250. } else
  52251. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture),
  52252. k(Ge.TEXTURE_2D, e.texture, o),
  52253. Z(t.__webglFramebuffer, e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_2D),
  52254. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  52255. Ye.bindTexture(Ge.TEXTURE_2D, null);
  52256. e.depthBuffer && K(e)
  52257. }
  52258. function J(e) {
  52259. var t = e instanceof n.WebGLRenderTargetCube ? Ge.TEXTURE_CUBE_MAP : Ge.TEXTURE_2D
  52260. , i = Xe.get(e.texture).__webglTexture;
  52261. Ye.bindTexture(t, i),
  52262. Ge.generateMipmap(t),
  52263. Ye.bindTexture(t, null)
  52264. }
  52265. function $(e) {
  52266. return e === n.NearestFilter || e === n.NearestMipMapNearestFilter || e === n.NearestMipMapLinearFilter ? Ge.NEAREST : Ge.LINEAR
  52267. }
  52268. function ee(e) {
  52269. var t;
  52270. if (e === n.RepeatWrapping)
  52271. return Ge.REPEAT;
  52272. if (e === n.ClampToEdgeWrapping)
  52273. return Ge.CLAMP_TO_EDGE;
  52274. if (e === n.MirroredRepeatWrapping)
  52275. return Ge.MIRRORED_REPEAT;
  52276. if (e === n.NearestFilter)
  52277. return Ge.NEAREST;
  52278. if (e === n.NearestMipMapNearestFilter)
  52279. return Ge.NEAREST_MIPMAP_NEAREST;
  52280. if (e === n.NearestMipMapLinearFilter)
  52281. return Ge.NEAREST_MIPMAP_LINEAR;
  52282. if (e === n.LinearFilter)
  52283. return Ge.LINEAR;
  52284. if (e === n.LinearMipMapNearestFilter)
  52285. return Ge.LINEAR_MIPMAP_NEAREST;
  52286. if (e === n.LinearMipMapLinearFilter)
  52287. return Ge.LINEAR_MIPMAP_LINEAR;
  52288. if (e === n.UnsignedByteType)
  52289. return Ge.UNSIGNED_BYTE;
  52290. if (e === n.UnsignedShort4444Type)
  52291. return Ge.UNSIGNED_SHORT_4_4_4_4;
  52292. if (e === n.UnsignedShort5551Type)
  52293. return Ge.UNSIGNED_SHORT_5_5_5_1;
  52294. if (e === n.UnsignedShort565Type)
  52295. return Ge.UNSIGNED_SHORT_5_6_5;
  52296. if (e === n.ByteType)
  52297. return Ge.BYTE;
  52298. if (e === n.ShortType)
  52299. return Ge.SHORT;
  52300. if (e === n.UnsignedShortType)
  52301. return Ge.UNSIGNED_SHORT;
  52302. if (e === n.IntType)
  52303. return Ge.INT;
  52304. if (e === n.UnsignedIntType)
  52305. return Ge.UNSIGNED_INT;
  52306. if (e === n.FloatType)
  52307. return Ge.FLOAT;
  52308. if (t = We.get("OES_texture_half_float"),
  52309. null !== t && e === n.HalfFloatType)
  52310. return t.HALF_FLOAT_OES;
  52311. if (e === n.AlphaFormat)
  52312. return Ge.ALPHA;
  52313. if (e === n.RGBFormat)
  52314. return Ge.RGB;
  52315. if (e === n.RGBAFormat)
  52316. return Ge.RGBA;
  52317. if (e === n.LuminanceFormat)
  52318. return Ge.LUMINANCE;
  52319. if (e === n.LuminanceAlphaFormat)
  52320. return Ge.LUMINANCE_ALPHA;
  52321. if (e === n.AddEquation)
  52322. return Ge.FUNC_ADD;
  52323. if (e === n.SubtractEquation)
  52324. return Ge.FUNC_SUBTRACT;
  52325. if (e === n.ReverseSubtractEquation)
  52326. return Ge.FUNC_REVERSE_SUBTRACT;
  52327. if (e === n.ZeroFactor)
  52328. return Ge.ZERO;
  52329. if (e === n.OneFactor)
  52330. return Ge.ONE;
  52331. if (e === n.SrcColorFactor)
  52332. return Ge.SRC_COLOR;
  52333. if (e === n.OneMinusSrcColorFactor)
  52334. return Ge.ONE_MINUS_SRC_COLOR;
  52335. if (e === n.SrcAlphaFactor)
  52336. return Ge.SRC_ALPHA;
  52337. if (e === n.OneMinusSrcAlphaFactor)
  52338. return Ge.ONE_MINUS_SRC_ALPHA;
  52339. if (e === n.DstAlphaFactor)
  52340. return Ge.DST_ALPHA;
  52341. if (e === n.OneMinusDstAlphaFactor)
  52342. return Ge.ONE_MINUS_DST_ALPHA;
  52343. if (e === n.DstColorFactor)
  52344. return Ge.DST_COLOR;
  52345. if (e === n.OneMinusDstColorFactor)
  52346. return Ge.ONE_MINUS_DST_COLOR;
  52347. if (e === n.SrcAlphaSaturateFactor)
  52348. return Ge.SRC_ALPHA_SATURATE;
  52349. if (t = We.get("WEBGL_compressed_texture_s3tc"),
  52350. null !== t) {
  52351. if (e === n.RGB_S3TC_DXT1_Format)
  52352. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  52353. if (e === n.RGBA_S3TC_DXT1_Format)
  52354. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  52355. if (e === n.RGBA_S3TC_DXT3_Format)
  52356. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  52357. if (e === n.RGBA_S3TC_DXT5_Format)
  52358. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  52359. }
  52360. if (t = We.get("WEBGL_compressed_texture_pvrtc"),
  52361. null !== t) {
  52362. if (e === n.RGB_PVRTC_4BPPV1_Format)
  52363. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  52364. if (e === n.RGB_PVRTC_2BPPV1_Format)
  52365. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  52366. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  52367. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  52368. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  52369. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  52370. }
  52371. if (t = We.get("WEBGL_compressed_texture_etc1"),
  52372. null !== t && e === n.RGB_ETC1_Format)
  52373. return t.COMPRESSED_RGB_ETC1_WEBGL;
  52374. if (t = We.get("EXT_blend_minmax"),
  52375. null !== t) {
  52376. if (e === n.MinEquation)
  52377. return t.MIN_EXT;
  52378. if (e === n.MaxEquation)
  52379. return t.MAX_EXT
  52380. }
  52381. return 0
  52382. }
  52383. console.log("THREE.WebGLRenderer", n.REVISION),
  52384. e = e || {};
  52385. var te = void 0 !== e.canvas ? e.canvas : document.createElement("canvas")
  52386. , ie = void 0 !== e.context ? e.context : null
  52387. , ne = void 0 !== e.alpha && e.alpha
  52388. , re = void 0 === e.depth || e.depth
  52389. , oe = void 0 === e.stencil || e.stencil
  52390. , ae = void 0 !== e.antialias && e.antialias
  52391. , se = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  52392. , le = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  52393. , ce = []
  52394. , he = []
  52395. , ue = -1
  52396. , de = []
  52397. , pe = -1
  52398. , fe = new Float32Array(8)
  52399. , ge = []
  52400. , me = [];
  52401. this.domElement = te,
  52402. this.context = null,
  52403. this.autoClear = !0,
  52404. this.autoClearColor = !0,
  52405. this.autoClearDepth = !0,
  52406. this.autoClearStencil = !0,
  52407. this.sortObjects = !0,
  52408. this.gammaFactor = 2,
  52409. this.gammaInput = !1,
  52410. this.gammaOutput = !1,
  52411. this.physicallyCorrectLights = !1,
  52412. this.toneMapping = n.LinearToneMapping,
  52413. this.toneMappingExposure = 1,
  52414. this.toneMappingWhitePoint = 1,
  52415. this.maxMorphTargets = 8,
  52416. this.maxMorphNormals = 4,
  52417. this.autoScaleCubemaps = !0;
  52418. var ve = this
  52419. , Ae = null
  52420. , ye = null
  52421. , Ce = null
  52422. , Ie = -1
  52423. , Ee = ""
  52424. , be = null
  52425. , we = new n.Vector4
  52426. , _e = null
  52427. , Te = new n.Vector4
  52428. , xe = 0
  52429. , Se = new n.Color(0)
  52430. , Me = 0
  52431. , Re = te.width
  52432. , Pe = te.height
  52433. , Oe = 1
  52434. , Le = new n.Vector4(0,0,Re,Pe)
  52435. , De = !1
  52436. , Ne = new n.Vector4(0,0,Re,Pe)
  52437. , Be = new n.Frustum
  52438. , Fe = new n.Matrix4
  52439. , Ve = new n.Vector3
  52440. , Ue = {
  52441. hash: "",
  52442. ambient: [0, 0, 0],
  52443. directional: [],
  52444. directionalShadowMap: [],
  52445. directionalShadowMatrix: [],
  52446. spot: [],
  52447. spotShadowMap: [],
  52448. spotShadowMatrix: [],
  52449. point: [],
  52450. pointShadowMap: [],
  52451. pointShadowMatrix: [],
  52452. hemi: [],
  52453. shadows: [],
  52454. shadowsPointLight: 0
  52455. }
  52456. , ke = {
  52457. geometries: 0,
  52458. textures: 0
  52459. }
  52460. , He = {
  52461. calls: 0,
  52462. vertices: 0,
  52463. faces: 0,
  52464. points: 0
  52465. };
  52466. this.info = {
  52467. render: He,
  52468. memory: ke,
  52469. programs: null
  52470. };
  52471. var Ge;
  52472. try {
  52473. var ze = {
  52474. alpha: ne,
  52475. depth: re,
  52476. stencil: oe,
  52477. antialias: ae,
  52478. premultipliedAlpha: se,
  52479. preserveDrawingBuffer: le
  52480. };
  52481. if (Ge = ie || te.getContext("webgl", ze) || te.getContext("experimental-webgl", ze),
  52482. null === Ge)
  52483. throw null !== te.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  52484. void 0 === Ge.getShaderPrecisionFormat && (Ge.getShaderPrecisionFormat = function() {
  52485. return {
  52486. rangeMin: 1,
  52487. rangeMax: 1,
  52488. precision: 1
  52489. }
  52490. }
  52491. ),
  52492. te.addEventListener("webglcontextlost", a, !1)
  52493. } catch (e) {
  52494. console.error("THREE.WebGLRenderer: " + e)
  52495. }
  52496. var We = new n.WebGLExtensions(Ge);
  52497. We.get("OES_texture_float"),
  52498. We.get("OES_texture_float_linear"),
  52499. We.get("OES_texture_half_float"),
  52500. We.get("OES_texture_half_float_linear"),
  52501. We.get("OES_standard_derivatives"),
  52502. We.get("ANGLE_instanced_arrays"),
  52503. We.get("OES_element_index_uint") && (n.BufferGeometry.MaxIndex = 4294967296);
  52504. var je = new n.WebGLCapabilities(Ge,We,e)
  52505. , Ye = new n.WebGLState(Ge,We,ee)
  52506. , Xe = new n.WebGLProperties
  52507. , Ze = new n.WebGLObjects(Ge,Xe,this.info)
  52508. , qe = new n.WebGLPrograms(this,je)
  52509. , Ke = new n.WebGLLights;
  52510. this.info.programs = qe.programs;
  52511. var Qe = new n.WebGLBufferRenderer(Ge,We,He)
  52512. , Je = new n.WebGLIndexedBufferRenderer(Ge,We,He);
  52513. r(),
  52514. this.context = Ge,
  52515. this.capabilities = je,
  52516. this.extensions = We,
  52517. this.properties = Xe,
  52518. this.state = Ye;
  52519. var $e = new n.WebGLShadowMap(this,Ue,Ze);
  52520. this.shadowMap = $e;
  52521. var et = new n.SpritePlugin(this,ge)
  52522. , tt = new n.LensFlarePlugin(this,me);
  52523. this.getContext = function() {
  52524. return Ge
  52525. }
  52526. ,
  52527. this.getContextAttributes = function() {
  52528. return Ge.getContextAttributes()
  52529. }
  52530. ,
  52531. this.forceContextLoss = function() {
  52532. We.get("WEBGL_lose_context").loseContext()
  52533. }
  52534. ,
  52535. this.getMaxAnisotropy = function() {
  52536. var e;
  52537. return function() {
  52538. if (void 0 !== e)
  52539. return e;
  52540. var t = We.get("EXT_texture_filter_anisotropic");
  52541. return e = null !== t ? Ge.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  52542. }
  52543. }(),
  52544. this.getPrecision = function() {
  52545. return je.precision
  52546. }
  52547. ,
  52548. this.getPixelRatio = function() {
  52549. return Oe
  52550. }
  52551. ,
  52552. this.setPixelRatio = function(e) {
  52553. void 0 !== e && (Oe = e,
  52554. this.setSize(Ne.z, Ne.w, !1))
  52555. }
  52556. ,
  52557. this.getSize = function() {
  52558. return {
  52559. width: Re,
  52560. height: Pe
  52561. }
  52562. }
  52563. ,
  52564. this.setSize = function(e, t, i, devicePixelRatio) {
  52565. if(devicePixelRatio != void 0) Oe = devicePixelRatio; //xzw add 改分辨率 始终保持清晰
  52566. Re = e,
  52567. Pe = t,
  52568. te.width = e * Oe,
  52569. te.height = t * Oe,
  52570. i !== !1 && (te.style.width = e + "px",
  52571. te.style.height = t + "px"),
  52572. this.setViewport(0, 0, e, t)
  52573. }
  52574. ,
  52575. this.setViewport = function(e, t, i, n) {
  52576. Ye.viewport(Ne.set(e, t, i, n))
  52577. }
  52578. ,
  52579. this.setScissor = function(e, t, i, n) {
  52580. Ye.scissor(Le.set(e, t, i, n))
  52581. }
  52582. ,
  52583. this.setScissorTest = function(e) {
  52584. Ye.setScissorTest(De = e)
  52585. }
  52586. ,
  52587. this.getClearColor = function() {
  52588. return Se
  52589. }
  52590. ,
  52591. this.setClearColor = function(e, t) {
  52592. Se.set(e),
  52593. Me = void 0 !== t ? t : 1,
  52594. i(Se.r, Se.g, Se.b, Me)
  52595. }
  52596. ,
  52597. this.getClearAlpha = function() {
  52598. return Me
  52599. }
  52600. ,
  52601. this.setClearAlpha = function(e) {
  52602. Me = e,
  52603. i(Se.r, Se.g, Se.b, Me)
  52604. }
  52605. ,
  52606. this.clear = function(e, t, i) {
  52607. var n = 0;
  52608. (void 0 === e || e) && (n |= Ge.COLOR_BUFFER_BIT),
  52609. (void 0 === t || t) && (n |= Ge.DEPTH_BUFFER_BIT),
  52610. (void 0 === i || i) && (n |= Ge.STENCIL_BUFFER_BIT),
  52611. Ge.clear(n)
  52612. }
  52613. ,
  52614. this.clearColor = function() {
  52615. this.clear(!0, !1, !1)
  52616. }
  52617. ,
  52618. this.clearDepth = function() {
  52619. this.clear(!1, !0, !1)
  52620. }
  52621. ,
  52622. this.clearStencil = function() {
  52623. this.clear(!1, !1, !0)
  52624. }
  52625. ,
  52626. this.clearTarget = function(e, t, i, n) {
  52627. this.setRenderTarget(e),
  52628. this.clear(t, i, n)
  52629. }
  52630. ,
  52631. this.resetGLState = o,
  52632. this.dispose = function() {
  52633. te.removeEventListener("webglcontextlost", a, !1)
  52634. }
  52635. ,
  52636. this.renderBufferImmediate = function(e, t, i) {
  52637. Ye.initAttributes();
  52638. var r = Xe.get(e);
  52639. e.hasPositions && !r.position && (r.position = Ge.createBuffer()),
  52640. e.hasNormals && !r.normal && (r.normal = Ge.createBuffer()),
  52641. e.hasUvs && !r.uv && (r.uv = Ge.createBuffer()),
  52642. e.hasColors && !r.color && (r.color = Ge.createBuffer());
  52643. var o = t.getAttributes();
  52644. if (e.hasPositions && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.position),
  52645. Ge.bufferData(Ge.ARRAY_BUFFER, e.positionArray, Ge.DYNAMIC_DRAW),
  52646. Ye.enableAttribute(o.position),
  52647. Ge.vertexAttribPointer(o.position, 3, Ge.FLOAT, !1, 0, 0)),
  52648. e.hasNormals) {
  52649. if (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.normal),
  52650. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === n.FlatShading)
  52651. for (var a = 0, s = 3 * e.count; a < s; a += 9) {
  52652. var l = e.normalArray
  52653. , c = (l[a + 0] + l[a + 3] + l[a + 6]) / 3
  52654. , h = (l[a + 1] + l[a + 4] + l[a + 7]) / 3
  52655. , u = (l[a + 2] + l[a + 5] + l[a + 8]) / 3;
  52656. l[a + 0] = c,
  52657. l[a + 1] = h,
  52658. l[a + 2] = u,
  52659. l[a + 3] = c,
  52660. l[a + 4] = h,
  52661. l[a + 5] = u,
  52662. l[a + 6] = c,
  52663. l[a + 7] = h,
  52664. l[a + 8] = u
  52665. }
  52666. Ge.bufferData(Ge.ARRAY_BUFFER, e.normalArray, Ge.DYNAMIC_DRAW),
  52667. Ye.enableAttribute(o.normal),
  52668. Ge.vertexAttribPointer(o.normal, 3, Ge.FLOAT, !1, 0, 0)
  52669. }
  52670. e.hasUvs && i.map && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.uv),
  52671. Ge.bufferData(Ge.ARRAY_BUFFER, e.uvArray, Ge.DYNAMIC_DRAW),
  52672. Ye.enableAttribute(o.uv),
  52673. Ge.vertexAttribPointer(o.uv, 2, Ge.FLOAT, !1, 0, 0)),
  52674. e.hasColors && i.vertexColors !== n.NoColors && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.color),
  52675. Ge.bufferData(Ge.ARRAY_BUFFER, e.colorArray, Ge.DYNAMIC_DRAW),
  52676. Ye.enableAttribute(o.color),
  52677. Ge.vertexAttribPointer(o.color, 3, Ge.FLOAT, !1, 0, 0)),
  52678. Ye.disableUnusedAttributes(),
  52679. Ge.drawArrays(Ge.TRIANGLES, 0, e.count),
  52680. e.count = 0
  52681. }
  52682. ,
  52683. this.renderBufferDirect = function(e, i, r, o, a, s) {
  52684. E(o);
  52685. var l = w(e, i, o, a)
  52686. , c = !1
  52687. , h = r.id + "_" + l.id + "_" + o.wireframe;
  52688. h !== Ee && (Ee = h,
  52689. c = !0);
  52690. var u = a.morphTargetInfluences;
  52691. if (void 0 !== u) {
  52692. for (var d = [], p = 0, m = u.length; p < m; p++) {
  52693. var v = u[p];
  52694. d.push([v, p])
  52695. }
  52696. d.sort(g),
  52697. d.length > 8 && (d.length = 8);
  52698. for (var A = r.morphAttributes, p = 0, m = d.length; p < m; p++) {
  52699. var v = d[p];
  52700. if (fe[p] = v[0],
  52701. 0 !== v[0]) {
  52702. var y = v[1];
  52703. o.morphTargets === !0 && A.position && r.addAttribute("morphTarget" + p, A.position[y]),
  52704. o.morphNormals === !0 && A.normal && r.addAttribute("morphNormal" + p, A.normal[y])
  52705. } else
  52706. o.morphTargets === !0 && r.removeAttribute("morphTarget" + p),
  52707. o.morphNormals === !0 && r.removeAttribute("morphNormal" + p)
  52708. }
  52709. var C = l.getUniforms();
  52710. null !== C.morphTargetInfluences && Ge.uniform1fv(C.morphTargetInfluences, fe),
  52711. c = !0
  52712. }
  52713. var y = r.index
  52714. , I = r.attributes.position;
  52715. o.wireframe === !0 && (y = Ze.getWireframeAttribute(r));
  52716. var b;
  52717. null !== y ? (b = Je,
  52718. b.setIndex(y)) : b = Qe,
  52719. c && (f(o, l, r),
  52720. null !== y && Ge.bindBuffer(Ge.ELEMENT_ARRAY_BUFFER, Ze.getAttributeBuffer(y)));
  52721. var _ = 0
  52722. , T = 1 / 0;
  52723. null !== y ? T = y.count : void 0 !== I && (T = I.count);
  52724. var x = r.drawRange.start
  52725. , S = r.drawRange.count
  52726. , M = null !== s ? s.start : 0
  52727. , R = null !== s ? s.count : 1 / 0
  52728. , P = Math.max(_, x, M)
  52729. , O = Math.min(_ + T, x + S, M + R) - 1
  52730. , L = Math.max(0, O - P + 1);
  52731. if (a instanceof n.Mesh)
  52732. if (o.wireframe === !0)
  52733. Ye.setLineWidth(o.wireframeLinewidth * t()),
  52734. b.setMode(Ge.LINES);
  52735. else
  52736. switch (a.drawMode) {
  52737. case n.TrianglesDrawMode:
  52738. b.setMode(Ge.TRIANGLES);
  52739. break;
  52740. case n.TriangleStripDrawMode:
  52741. b.setMode(Ge.TRIANGLE_STRIP);
  52742. break;
  52743. case n.TriangleFanDrawMode:
  52744. b.setMode(Ge.TRIANGLE_FAN)
  52745. }
  52746. else if (a instanceof n.Line) {
  52747. var D = o.linewidth;
  52748. void 0 === D && (D = 1),
  52749. Ye.setLineWidth(D * t()),
  52750. a instanceof n.LineSegments ? b.setMode(Ge.LINES) : b.setMode(Ge.LINE_STRIP)
  52751. } else
  52752. a instanceof n.Points && b.setMode(Ge.POINTS);
  52753. r instanceof n.InstancedBufferGeometry ? r.maxInstancedCount > 0 && b.renderInstances(r, P, L) : b.render(P, L)
  52754. }
  52755. ,
  52756. this.render = function(e, t, i, r) {
  52757. if (t instanceof n.Camera == !1)
  52758. return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");
  52759. var o = e.fog;
  52760. if (Ee = "",
  52761. Ie = -1,
  52762. be = null,
  52763. e.autoUpdate === !0 && e.updateMatrixWorld(),
  52764. null === t.parent && t.updateMatrixWorld(),
  52765. t.matrixWorldInverse.getInverse(t.matrixWorld),
  52766. Fe.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  52767. Be.setFromMatrix(Fe),
  52768. ce.length = 0,
  52769. ue = -1,
  52770. pe = -1,
  52771. ge.length = 0,
  52772. me.length = 0,
  52773. y(e, t),
  52774. he.length = ue + 1,
  52775. de.length = pe + 1,
  52776. ve.sortObjects === !0 && (he.sort(m),
  52777. de.sort(v)),
  52778. U(ce, t),
  52779. $e.render(e, t),
  52780. He.calls = 0,
  52781. He.vertices = 0,
  52782. He.faces = 0,
  52783. He.points = 0,
  52784. void 0 === i && (i = null),
  52785. this.setRenderTarget(i),
  52786. (this.autoClear || r) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  52787. e.overrideMaterial) {
  52788. var a = e.overrideMaterial;
  52789. C(he, t, o, a),
  52790. C(de, t, o, a)
  52791. } else
  52792. Ye.setBlending(n.NoBlending),
  52793. C(he, t, o),
  52794. C(de, t, o);
  52795. if (et.render(e, t),
  52796. tt.render(e, t, Te),
  52797. i) {
  52798. var s = i.texture;
  52799. s.generateMipmaps && z(i) && s.minFilter !== n.NearestFilter && s.minFilter !== n.LinearFilter && J(i)
  52800. }
  52801. Ye.setDepthTest(!0),
  52802. Ye.setDepthWrite(!0),
  52803. Ye.setColorWrite(!0)
  52804. }
  52805. ,
  52806. this.setFaceCulling = function(e, t) {
  52807. e === n.CullFaceNone ? Ye.disable(Ge.CULL_FACE) : (t === n.FrontFaceDirectionCW ? Ge.frontFace(Ge.CW) : Ge.frontFace(Ge.CCW),
  52808. e === n.CullFaceBack ? Ge.cullFace(Ge.BACK) : e === n.CullFaceFront ? Ge.cullFace(Ge.FRONT) : Ge.cullFace(Ge.FRONT_AND_BACK),
  52809. Ye.enable(Ge.CULL_FACE))
  52810. }
  52811. ,
  52812. this.setTexture = function(e, t) {
  52813. var i = Xe.get(e);
  52814. if (e.version > 0 && i.__version !== e.version) {
  52815. var n = e.image;
  52816. 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)
  52817. }
  52818. Ye.activeTexture(Ge.TEXTURE0 + t),
  52819. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture)
  52820. }
  52821. ,
  52822. this.getCurrentRenderTarget = function() {
  52823. return ye
  52824. }
  52825. ,
  52826. this.setRenderTargetFramebuffer = function ( renderTarget, defaultFramebuffer ) {//add
  52827. const renderTargetProperties = Xe.get( renderTarget );
  52828. renderTargetProperties.__webglFramebuffer = defaultFramebuffer;
  52829. renderTargetProperties.__useDefaultFramebuffer = defaultFramebuffer === undefined;
  52830. },
  52831. this.setFramebuffer = function ( value ) {//add
  52832. if ( Ce !== value && ye === null ) Ge.bindFramebuffer( 36160, value );
  52833. Ce = value;
  52834. },
  52835. this.setRenderTarget = function(e) {
  52836. ye = e,
  52837. e && void 0 === Xe.get(e).__webglFramebuffer && Q(e);
  52838. var t, i = e instanceof n.WebGLRenderTargetCube;
  52839. if (e) {
  52840. var r = Xe.get(e);
  52841. t = i ? r.__webglFramebuffer[e.activeCubeFace] : r.__webglFramebuffer,
  52842. we.copy(e.scissor),
  52843. _e = e.scissorTest,
  52844. Te.copy(e.viewport)
  52845. } else
  52846. t = null,
  52847. we.copy(Le).multiplyScalar(Oe),
  52848. _e = De,
  52849. Te.copy(Ne).multiplyScalar(Oe);
  52850. if (Ce !== t && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, t),
  52851. Ce = t),
  52852. Ye.scissor(we),
  52853. Ye.setScissorTest(_e),
  52854. Ye.viewport(Te),
  52855. i) {
  52856. var o = Xe.get(e.texture);
  52857. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, o.__webglTexture, e.activeMipMapLevel)
  52858. }
  52859. }
  52860. ,
  52861. this.readRenderTargetPixels = function(e, t, i, r, o, a) {
  52862. if (e instanceof n.WebGLRenderTarget == !1)
  52863. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
  52864. var s = Xe.get(e).__webglFramebuffer;
  52865. if (s) {
  52866. var l = !1;
  52867. s !== Ce && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, s),
  52868. l = !0);
  52869. try {
  52870. var c = e.texture;
  52871. if (c.format !== n.RGBAFormat && ee(c.format) !== Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_FORMAT))
  52872. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  52873. 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")))
  52874. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  52875. 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.")
  52876. } finally {
  52877. l && Ge.bindFramebuffer(Ge.FRAMEBUFFER, Ce)
  52878. }
  52879. }
  52880. }
  52881. }
  52882. ,
  52883. n.WebGLRenderTarget = function(e, t, i) {
  52884. this.uuid = n.Math.generateUUID(),
  52885. this.width = e,
  52886. this.height = t,
  52887. this.scissor = new n.Vector4(0,0,e,t),
  52888. this.scissorTest = !1,
  52889. this.viewport = new n.Vector4(0,0,e,t),
  52890. i = i || {},
  52891. void 0 === i.minFilter && (i.minFilter = n.LinearFilter),
  52892. this.texture = new n.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  52893. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  52894. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  52895. }
  52896. ,
  52897. n.WebGLRenderTarget.prototype = {
  52898. constructor: n.WebGLRenderTarget,
  52899. setSize: function(e, t) {
  52900. this.width === e && this.height === t || (this.width = e,
  52901. this.height = t,
  52902. this.dispose()),
  52903. this.viewport.set(0, 0, e, t),
  52904. this.scissor.set(0, 0, e, t)
  52905. },
  52906. clone: function() {
  52907. return (new this.constructor).copy(this)
  52908. },
  52909. copy: function(e) {
  52910. return this.width = e.width,
  52911. this.height = e.height,
  52912. this.viewport.copy(e.viewport),
  52913. this.texture = e.texture.clone(),
  52914. this.depthBuffer = e.depthBuffer,
  52915. this.stencilBuffer = e.stencilBuffer,
  52916. this
  52917. },
  52918. dispose: function() {
  52919. this.dispatchEvent({
  52920. type: "dispose"
  52921. })
  52922. }
  52923. },
  52924. n.EventDispatcher.prototype.apply(n.WebGLRenderTarget.prototype),
  52925. n.WebGLRenderTargetCube = function(e, t, i) {
  52926. n.WebGLRenderTarget.call(this, e, t, i),
  52927. this.activeCubeFace = 0,
  52928. this.activeMipMapLevel = 0
  52929. }
  52930. ,
  52931. n.WebGLRenderTargetCube.prototype = Object.create(n.WebGLRenderTarget.prototype),
  52932. n.WebGLRenderTargetCube.prototype.constructor = n.WebGLRenderTargetCube,
  52933. n.WebGLBufferRenderer = function(e, t, i) {
  52934. function r(e) {
  52935. s = e
  52936. }
  52937. function o(t, n) {
  52938. e.drawArrays(s, t, n),
  52939. i.calls++,
  52940. i.vertices += n,
  52941. s === e.TRIANGLES && (i.faces += n / 3)
  52942. }
  52943. function a(r) {
  52944. var o = t.get("ANGLE_instanced_arrays");
  52945. if (null === o)
  52946. return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  52947. var a = r.attributes.position
  52948. , l = 0;
  52949. a instanceof n.InterleavedBufferAttribute ? (l = a.data.count,
  52950. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)) : (l = a.count,
  52951. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)),
  52952. i.calls++,
  52953. i.vertices += l * r.maxInstancedCount,
  52954. s === e.TRIANGLES && (i.faces += r.maxInstancedCount * l / 3)
  52955. }
  52956. var s;
  52957. this.setMode = r,
  52958. this.render = o,
  52959. this.renderInstances = a
  52960. }
  52961. ,
  52962. n.WebGLIndexedBufferRenderer = function(e, t, i) {
  52963. function n(e) {
  52964. s = e
  52965. }
  52966. function r(i) {
  52967. i.array instanceof Uint32Array && t.get("OES_element_index_uint") ? (l = e.UNSIGNED_INT,
  52968. c = 4) : (l = e.UNSIGNED_SHORT,
  52969. c = 2)
  52970. }
  52971. function o(t, n) {
  52972. e.drawElements(s, n, l, t * c),
  52973. i.calls++,
  52974. i.vertices += n,
  52975. s === e.TRIANGLES && (i.faces += n / 3)
  52976. }
  52977. function a(n, r, o) {
  52978. var a = t.get("ANGLE_instanced_arrays");
  52979. 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),
  52980. i.calls++,
  52981. i.vertices += o * n.maxInstancedCount,
  52982. void (s === e.TRIANGLES && (i.faces += n.maxInstancedCount * o / 3)))
  52983. }
  52984. var s, l, c;
  52985. this.setMode = n,
  52986. this.setIndex = r,
  52987. this.render = o,
  52988. this.renderInstances = a
  52989. }
  52990. ,
  52991. n.WebGLExtensions = function(e) {
  52992. var t = {};
  52993. this.get = function(i) {
  52994. if (void 0 !== t[i])
  52995. return t[i];
  52996. var n;
  52997. switch (i) {
  52998. case "EXT_texture_filter_anisotropic":
  52999. n = e.getExtension("EXT_texture_filter_anisotropic") || e.getExtension("MOZ_EXT_texture_filter_anisotropic") || e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  53000. break;
  53001. case "WEBGL_compressed_texture_s3tc":
  53002. n = e.getExtension("WEBGL_compressed_texture_s3tc") || e.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  53003. break;
  53004. case "WEBGL_compressed_texture_pvrtc":
  53005. n = e.getExtension("WEBGL_compressed_texture_pvrtc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  53006. break;
  53007. case "WEBGL_compressed_texture_etc1":
  53008. n = e.getExtension("WEBGL_compressed_texture_etc1");
  53009. break;
  53010. default:
  53011. n = e.getExtension(i)
  53012. }
  53013. return null === n && console.warn("THREE.WebGLRenderer: " + i + " extension not supported."),
  53014. t[i] = n,
  53015. n
  53016. }
  53017. }
  53018. ,
  53019. n.WebGLCapabilities = function(e, t, i) {
  53020. function n(t) {
  53021. if ("highp" === t) {
  53022. if (e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.HIGH_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.HIGH_FLOAT).precision > 0)
  53023. return "highp";
  53024. t = "mediump"
  53025. }
  53026. 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"
  53027. }
  53028. this.getMaxPrecision = n,
  53029. this.precision = void 0 !== i.precision ? i.precision : "highp",
  53030. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  53031. this.maxTextures = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
  53032. this.maxVertexTextures = e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  53033. this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE),
  53034. this.maxCubemapSize = e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),
  53035. this.maxAttributes = e.getParameter(e.MAX_VERTEX_ATTRIBS),
  53036. this.maxVertexUniforms = e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),
  53037. this.maxVaryings = e.getParameter(e.MAX_VARYING_VECTORS),
  53038. this.maxFragmentUniforms = e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),
  53039. this.vertexTextures = this.maxVertexTextures > 0,
  53040. this.floatFragmentTextures = !!t.get("OES_texture_float"),
  53041. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  53042. var r = n(this.precision);
  53043. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  53044. this.precision = r),
  53045. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!t.get("EXT_frag_depth"))
  53046. }
  53047. ,
  53048. n.WebGLGeometries = function(e, t, i) {
  53049. function r(e) {
  53050. var t = e.geometry;
  53051. if (void 0 !== h[t.id])
  53052. return h[t.id];
  53053. t.addEventListener("dispose", o);
  53054. var r;
  53055. return t instanceof n.BufferGeometry ? r = t : t instanceof n.Geometry && (void 0 === t._bufferGeometry && (t._bufferGeometry = (new n.BufferGeometry).setFromObject(e)),
  53056. r = t._bufferGeometry),
  53057. h[t.id] = r,
  53058. i.memory.geometries++,
  53059. r
  53060. }
  53061. function o(e) {
  53062. var n = e.target
  53063. , r = h[n.id];
  53064. null !== r.index && s(r.index),
  53065. l(r.attributes),
  53066. n.removeEventListener("dispose", o),
  53067. delete h[n.id];
  53068. var a = t.get(n);
  53069. a.wireframe && s(a.wireframe),
  53070. t.delete(n);
  53071. var c = t.get(r);
  53072. c.wireframe && s(c.wireframe),
  53073. t.delete(r),
  53074. i.memory.geometries--
  53075. }
  53076. function a(e) {
  53077. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  53078. }
  53079. function s(t) {
  53080. var i = a(t);
  53081. void 0 !== i && (e.deleteBuffer(i),
  53082. c(t))
  53083. }
  53084. function l(e) {
  53085. for (var t in e)
  53086. s(e[t])
  53087. }
  53088. function c(e) {
  53089. e instanceof n.InterleavedBufferAttribute ? t.delete(e.data) : t.delete(e)
  53090. }
  53091. var h = {};
  53092. this.get = r
  53093. }
  53094. ,
  53095. n.WebGLLights = function() {
  53096. var e = {};
  53097. this.get = function(t) {
  53098. if (void 0 !== e[t.id])
  53099. return e[t.id];
  53100. var i;
  53101. switch (t.type) {
  53102. case "DirectionalLight":
  53103. i = {
  53104. direction: new n.Vector3,
  53105. color: new n.Color,
  53106. shadow: !1,
  53107. shadowBias: 0,
  53108. shadowRadius: 1,
  53109. shadowMapSize: new n.Vector2
  53110. };
  53111. break;
  53112. case "SpotLight":
  53113. i = {
  53114. position: new n.Vector3,
  53115. direction: new n.Vector3,
  53116. color: new n.Color,
  53117. distance: 0,
  53118. coneCos: 0,
  53119. penumbraCos: 0,
  53120. decay: 0,
  53121. shadow: !1,
  53122. shadowBias: 0,
  53123. shadowRadius: 1,
  53124. shadowMapSize: new n.Vector2
  53125. };
  53126. break;
  53127. case "PointLight":
  53128. i = {
  53129. position: new n.Vector3,
  53130. color: new n.Color,
  53131. distance: 0,
  53132. decay: 0,
  53133. shadow: !1,
  53134. shadowBias: 0,
  53135. shadowRadius: 1,
  53136. shadowMapSize: new n.Vector2
  53137. };
  53138. break;
  53139. case "HemisphereLight":
  53140. i = {
  53141. direction: new n.Vector3,
  53142. skyColor: new n.Color,
  53143. groundColor: new n.Color
  53144. }
  53145. }
  53146. return e[t.id] = i,
  53147. i
  53148. }
  53149. }
  53150. ,
  53151. n.WebGLObjects = function(e, t, i) {
  53152. function r(t) {
  53153. var i = u.get(t);
  53154. t.geometry instanceof n.Geometry && i.updateFromObject(t);
  53155. var r = i.index
  53156. , a = i.attributes;
  53157. null !== r && o(r, e.ELEMENT_ARRAY_BUFFER);
  53158. for (var s in a)
  53159. o(a[s], e.ARRAY_BUFFER);
  53160. var l = i.morphAttributes;
  53161. for (var s in l)
  53162. for (var c = l[s], h = 0, d = c.length; h < d; h++)
  53163. o(c[h], e.ARRAY_BUFFER);
  53164. return i
  53165. }
  53166. function o(e, i) {
  53167. var r = e instanceof n.InterleavedBufferAttribute ? e.data : e
  53168. , o = t.get(r);
  53169. void 0 === o.__webglBuffer ? a(o, r, i) : o.version !== r.version && s(o, r, i)
  53170. }
  53171. function a(t, i, n) {
  53172. t.__webglBuffer = e.createBuffer(),
  53173. e.bindBuffer(n, t.__webglBuffer);
  53174. var r = i.dynamic ? e.DYNAMIC_DRAW : e.STATIC_DRAW;
  53175. e.bufferData(n, i.array, r),
  53176. t.version = i.version
  53177. }
  53178. function s(t, i, n) {
  53179. e.bindBuffer(n, t.__webglBuffer),
  53180. 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)),
  53181. i.updateRange.count = 0),
  53182. t.version = i.version
  53183. }
  53184. function l(e) {
  53185. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  53186. }
  53187. function c(i) {
  53188. var r = t.get(i);
  53189. if (void 0 !== r.wireframe)
  53190. return r.wireframe;
  53191. var a = []
  53192. , s = i.index
  53193. , l = i.attributes
  53194. , c = l.position;
  53195. if (null !== s)
  53196. for (var u = {}, d = s.array, p = 0, f = d.length; p < f; p += 3) {
  53197. var g = d[p + 0]
  53198. , m = d[p + 1]
  53199. , v = d[p + 2];
  53200. h(u, g, m) && a.push(g, m),
  53201. h(u, m, v) && a.push(m, v),
  53202. h(u, v, g) && a.push(v, g)
  53203. }
  53204. else
  53205. for (var d = l.position.array, p = 0, f = d.length / 3 - 1; p < f; p += 3) {
  53206. var g = p + 0
  53207. , m = p + 1
  53208. , v = p + 2;
  53209. a.push(g, m, m, v, v, g)
  53210. }
  53211. var A = c.count > 65535 ? Uint32Array : Uint16Array
  53212. , y = new n.BufferAttribute(new A(a),1);
  53213. return o(y, e.ELEMENT_ARRAY_BUFFER),
  53214. r.wireframe = y,
  53215. y
  53216. }
  53217. function h(e, t, i) {
  53218. if (t > i) {
  53219. var n = t;
  53220. t = i,
  53221. i = n
  53222. }
  53223. var r = e[t];
  53224. return void 0 === r ? (e[t] = [i],
  53225. !0) : r.indexOf(i) === -1 && (r.push(i),
  53226. !0)
  53227. }
  53228. var u = new n.WebGLGeometries(e,t,i);
  53229. this.getAttributeBuffer = l,
  53230. this.getWireframeAttribute = c,
  53231. this.update = r
  53232. }
  53233. ,
  53234. n.WebGLProgram = function() {
  53235. function e(e) {
  53236. switch (e) {
  53237. case n.LinearEncoding:
  53238. return ["Linear", "( value )"];
  53239. case n.sRGBEncoding:
  53240. return ["sRGB", "( value )"];
  53241. case n.RGBEEncoding:
  53242. return ["RGBE", "( value )"];
  53243. case n.RGBM7Encoding:
  53244. return ["RGBM", "( value, 7.0 )"];
  53245. case n.RGBM16Encoding:
  53246. return ["RGBM", "( value, 16.0 )"];
  53247. case n.RGBDEncoding:
  53248. return ["RGBD", "( value, 256.0 )"];
  53249. case n.GammaEncoding:
  53250. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  53251. default:
  53252. throw new Error("unsupported encoding: " + e)
  53253. }
  53254. }
  53255. function t(t, i) {
  53256. var n = e(i);
  53257. return "vec4 " + t + "( vec4 value ) { return " + n[0] + "ToLinear" + n[1] + "; }"
  53258. }
  53259. function i(t, i) {
  53260. var n = e(i);
  53261. return "vec4 " + t + "( vec4 value ) { return LinearTo" + n[0] + n[1] + "; }"
  53262. }
  53263. function r(e, t) {
  53264. var i;
  53265. switch (t) {
  53266. case n.LinearToneMapping:
  53267. i = "Linear";
  53268. break;
  53269. case n.ReinhardToneMapping:
  53270. i = "Reinhard";
  53271. break;
  53272. case n.Uncharted2ToneMapping:
  53273. i = "Uncharted2";
  53274. break;
  53275. case n.CineonToneMapping:
  53276. i = "OptimizedCineon";
  53277. break;
  53278. default:
  53279. throw new Error("unsupported toneMapping: " + t)
  53280. }
  53281. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  53282. }
  53283. function o(e, t, i) {
  53284. e = e || {};
  53285. 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" : ""];
  53286. return n.filter(c).join("\n")
  53287. }
  53288. function a(e) {
  53289. var t = [];
  53290. for (var i in e) {
  53291. var n = e[i];
  53292. n !== !1 && t.push("#define " + i + " " + n)
  53293. }
  53294. return t.join("\n")
  53295. }
  53296. function s(e, t, i) {
  53297. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), o = 0; o < r; o++) {
  53298. var a = e.getActiveUniform(t, o)
  53299. , s = a.name
  53300. , l = e.getUniformLocation(t, s)
  53301. , c = f.exec(s);
  53302. if (c) {
  53303. var h = c[1]
  53304. , u = c[2]
  53305. , d = n[h];
  53306. d || (d = n[h] = {}),
  53307. d[u] = l
  53308. } else if (c = g.exec(s)) {
  53309. var p = c[1]
  53310. , v = c[2]
  53311. , A = c[3]
  53312. , y = n[p];
  53313. y || (y = n[p] = []);
  53314. var C = y[v];
  53315. C || (C = y[v] = {}),
  53316. C[A] = l
  53317. } else if (c = m.exec(s)) {
  53318. var p = c[1];
  53319. n[p] = l
  53320. } else
  53321. n[s] = l
  53322. }
  53323. return n
  53324. }
  53325. function l(e, t, i) {
  53326. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), o = 0; o < r; o++) {
  53327. var a = e.getActiveAttrib(t, o)
  53328. , s = a.name;
  53329. n[s] = e.getAttribLocation(t, s)
  53330. }
  53331. return n
  53332. }
  53333. function c(e) {
  53334. return "" !== e
  53335. }
  53336. function h(e, t) {
  53337. 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)
  53338. }
  53339. function u(e) {
  53340. function t(e, t) {
  53341. var i = n.ShaderChunk[t];
  53342. if (void 0 === i)
  53343. throw new Error("Can not resolve #include <" + t + ">");
  53344. return u(i)
  53345. }
  53346. var i = /#include +<([\w\d.]+)>/g;
  53347. return e.replace(i, t)
  53348. }
  53349. function d(e) {
  53350. function t(e, t, i, n) {
  53351. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  53352. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  53353. return r
  53354. }
  53355. var i = /for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;
  53356. return e.replace(i, t)
  53357. }
  53358. var p = 0
  53359. , f = /^([\w\d_]+)\.([\w\d_]+)$/
  53360. , g = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/
  53361. , m = /^([\w\d_]+)\[0\]$/;
  53362. return function(e, f, g, m) {
  53363. var v = e.context
  53364. , A = g.extensions
  53365. , y = g.defines
  53366. , C = g.__webglShader.vertexShader
  53367. , I = g.__webglShader.fragmentShader
  53368. , E = "SHADOWMAP_TYPE_BASIC";
  53369. m.shadowMapType === n.PCFShadowMap ? E = "SHADOWMAP_TYPE_PCF" : m.shadowMapType === n.PCFSoftShadowMap && (E = "SHADOWMAP_TYPE_PCF_SOFT");
  53370. var b = "ENVMAP_TYPE_CUBE"
  53371. , w = "ENVMAP_MODE_REFLECTION"
  53372. , _ = "ENVMAP_BLENDING_MULTIPLY";
  53373. if (m.envMap) {
  53374. switch (g.envMap.mapping) {
  53375. case n.CubeReflectionMapping:
  53376. case n.CubeRefractionMapping:
  53377. b = "ENVMAP_TYPE_CUBE";
  53378. break;
  53379. case n.CubeUVReflectionMapping:
  53380. case n.CubeUVRefractionMapping:
  53381. b = "ENVMAP_TYPE_CUBE_UV";
  53382. break;
  53383. case n.EquirectangularReflectionMapping:
  53384. case n.EquirectangularRefractionMapping:
  53385. b = "ENVMAP_TYPE_EQUIREC";
  53386. break;
  53387. case n.SphericalReflectionMapping:
  53388. b = "ENVMAP_TYPE_SPHERE"
  53389. }
  53390. switch (g.envMap.mapping) {
  53391. case n.CubeRefractionMapping:
  53392. case n.EquirectangularRefractionMapping:
  53393. w = "ENVMAP_MODE_REFRACTION"
  53394. }
  53395. switch (g.combine) {
  53396. case n.MultiplyOperation:
  53397. _ = "ENVMAP_BLENDING_MULTIPLY";
  53398. break;
  53399. case n.MixOperation:
  53400. _ = "ENVMAP_BLENDING_MIX";
  53401. break;
  53402. case n.AddOperation:
  53403. _ = "ENVMAP_BLENDING_ADD"
  53404. }
  53405. }
  53406. var T, x, S = e.gammaFactor > 0 ? e.gammaFactor : 1, M = o(A, m, e.extensions), R = a(y), P = v.createProgram();
  53407. g instanceof n.RawShaderMaterial ? (T = "",
  53408. 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"),
  53409. 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")),
  53410. C = u(C, m),
  53411. C = h(C, m),
  53412. I = u(I, m),
  53413. I = h(I, m),
  53414. g instanceof n.ShaderMaterial == !1 && (C = d(C),
  53415. I = d(I));
  53416. var O = T + C
  53417. , L = x + I
  53418. , D = n.WebGLShader(v, v.VERTEX_SHADER, O)
  53419. , N = n.WebGLShader(v, v.FRAGMENT_SHADER, L);
  53420. v.attachShader(P, D),
  53421. v.attachShader(P, N),
  53422. void 0 !== g.index0AttributeName ? v.bindAttribLocation(P, 0, g.index0AttributeName) : m.morphTargets === !0 && v.bindAttribLocation(P, 0, "position"),
  53423. v.linkProgram(P);
  53424. var B = v.getProgramInfoLog(P)
  53425. , F = v.getShaderInfoLog(D)
  53426. , V = v.getShaderInfoLog(N)
  53427. , U = !0
  53428. , k = !0;
  53429. v.getProgramParameter(P, v.LINK_STATUS) === !1 ? (U = !1,
  53430. 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),
  53431. k && (this.diagnostics = {
  53432. runnable: U,
  53433. material: g,
  53434. programLog: B,
  53435. vertexShader: {
  53436. log: F,
  53437. prefix: T
  53438. },
  53439. fragmentShader: {
  53440. log: V,
  53441. prefix: x
  53442. }
  53443. }),
  53444. v.deleteShader(D),
  53445. v.deleteShader(N);
  53446. var H;
  53447. this.getUniforms = function() {
  53448. return void 0 === H && (H = s(v, P)),
  53449. H
  53450. }
  53451. ;
  53452. var G;
  53453. return this.getAttributes = function() {
  53454. return void 0 === G && (G = l(v, P)),
  53455. G
  53456. }
  53457. ,
  53458. this.destroy = function() {
  53459. v.deleteProgram(P),
  53460. this.program = void 0
  53461. }
  53462. ,
  53463. Object.defineProperties(this, {
  53464. uniforms: {
  53465. get: function() {
  53466. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  53467. this.getUniforms()
  53468. }
  53469. },
  53470. attributes: {
  53471. get: function() {
  53472. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  53473. this.getAttributes()
  53474. }
  53475. }
  53476. }),
  53477. this.id = p++,
  53478. this.code = f,
  53479. this.usedTimes = 1,
  53480. this.program = P,
  53481. this.vertexShader = D,
  53482. this.fragmentShader = N,
  53483. this
  53484. }
  53485. }(),
  53486. n.WebGLPrograms = function(e, t) {
  53487. function i(e) {
  53488. if (t.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  53489. return 1024;
  53490. var i = t.maxVertexUniforms
  53491. , r = Math.floor((i - 20) / 4)
  53492. , o = r;
  53493. return void 0 !== e && e instanceof n.SkinnedMesh && (o = Math.min(e.skeleton.bones.length, o),
  53494. 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)")),
  53495. o
  53496. }
  53497. function r(e, t) {
  53498. var i;
  53499. return e ? e instanceof n.Texture ? i = e.encoding : e instanceof n.WebGLRenderTarget && (i = e.texture.encoding) : i = n.LinearEncoding,
  53500. i === n.LinearEncoding && t && (i = n.GammaEncoding),
  53501. i
  53502. }
  53503. var o = []
  53504. , a = {
  53505. MeshDepthMaterial: "depth",
  53506. MeshNormalMaterial: "normal",
  53507. MeshBasicMaterial: "basic",
  53508. MeshLambertMaterial: "lambert",
  53509. MeshPhongMaterial: "phong",
  53510. MeshStandardMaterial: "standard",
  53511. LineBasicMaterial: "basic",
  53512. LineDashedMaterial: "dashed",
  53513. PointsMaterial: "points"
  53514. }
  53515. , 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"];
  53516. this.getParameters = function(o, s, l, c) {
  53517. var h = a[o.type]
  53518. , u = i(c)
  53519. , d = e.getPrecision();
  53520. null !== o.precision && (d = t.getMaxPrecision(o.precision),
  53521. d !== o.precision && console.warn("THREE.WebGLProgram.getParameters:", o.precision, "not supported, using", d, "instead."));
  53522. var p = {
  53523. shaderID: h,
  53524. precision: d,
  53525. supportsVertexTextures: t.vertexTextures,
  53526. outputEncoding: r(e.getCurrentRenderTarget(), e.gammaOutput),
  53527. map: !!o.map,
  53528. mapEncoding: r(o.map, e.gammaInput),
  53529. envMap: !!o.envMap,
  53530. envMapMode: o.envMap && o.envMap.mapping,
  53531. envMapEncoding: r(o.envMap, e.gammaInput),
  53532. envMapCubeUV: !!o.envMap && (o.envMap.mapping === n.CubeUVReflectionMapping || o.envMap.mapping === n.CubeUVRefractionMapping),
  53533. lightMap: !!o.lightMap,
  53534. aoMap: !!o.aoMap,
  53535. emissiveMap: !!o.emissiveMap,
  53536. emissiveMapEncoding: r(o.emissiveMap, e.gammaInput),
  53537. bumpMap: !!o.bumpMap,
  53538. normalMap: !!o.normalMap,
  53539. displacementMap: !!o.displacementMap,
  53540. roughnessMap: !!o.roughnessMap,
  53541. metalnessMap: !!o.metalnessMap,
  53542. specularMap: !!o.specularMap,
  53543. alphaMap: !!o.alphaMap,
  53544. combine: o.combine,
  53545. vertexColors: o.vertexColors,
  53546. fog: l,
  53547. useFog: o.fog,
  53548. fogExp: l instanceof n.FogExp2,
  53549. flatShading: o.shading === n.FlatShading,
  53550. sizeAttenuation: o.sizeAttenuation,
  53551. logarithmicDepthBuffer: t.logarithmicDepthBuffer,
  53552. skinning: o.skinning,
  53553. maxBones: u,
  53554. useVertexTexture: t.floatVertexTextures && c && c.skeleton && c.skeleton.useVertexTexture,
  53555. morphTargets: o.morphTargets,
  53556. morphNormals: o.morphNormals,
  53557. maxMorphTargets: e.maxMorphTargets,
  53558. maxMorphNormals: e.maxMorphNormals,
  53559. numDirLights: s.directional.length,
  53560. numPointLights: s.point.length,
  53561. numSpotLights: s.spot.length,
  53562. numHemiLights: s.hemi.length,
  53563. pointLightShadows: s.shadowsPointLight,
  53564. shadowMapEnabled: e.shadowMap.enabled && c.receiveShadow && s.shadows.length > 0,
  53565. shadowMapType: e.shadowMap.type,
  53566. toneMapping: e.toneMapping,
  53567. physicallyCorrectLights: e.physicallyCorrectLights,
  53568. premultipliedAlpha: o.premultipliedAlpha,
  53569. alphaTest: o.alphaTest,
  53570. doubleSided: o.side === n.DoubleSide,
  53571. flipSided: o.side === n.BackSide
  53572. };
  53573. return p
  53574. }
  53575. ,
  53576. this.getProgramCode = function(e, t) {
  53577. var i = [];
  53578. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  53579. i.push(e.vertexShader)),
  53580. void 0 !== e.defines)
  53581. for (var n in e.defines)
  53582. i.push(n),
  53583. i.push(e.defines[n]);
  53584. for (var r = 0; r < s.length; r++) {
  53585. var o = s[r];
  53586. i.push(o),
  53587. i.push(t[o])
  53588. }
  53589. return i.join()
  53590. }
  53591. ,
  53592. this.acquireProgram = function(t, i, r) {
  53593. for (var a, s = 0, l = o.length; s < l; s++) {
  53594. var c = o[s];
  53595. if (c.code === r) {
  53596. a = c,
  53597. ++a.usedTimes;
  53598. break
  53599. }
  53600. }
  53601. return void 0 === a && (a = new n.WebGLProgram(e,r,t,i),
  53602. o.push(a)),
  53603. a
  53604. }
  53605. ,
  53606. this.releaseProgram = function(e) {
  53607. if (0 === --e.usedTimes) {
  53608. var t = o.indexOf(e);
  53609. o[t] = o[o.length - 1],
  53610. o.pop(),
  53611. e.destroy()
  53612. }
  53613. }
  53614. ,
  53615. this.programs = o
  53616. }
  53617. ,
  53618. n.WebGLProperties = function() {
  53619. var e = {};
  53620. this.get = function(t) {
  53621. var i = t.uuid
  53622. , n = e[i];
  53623. return void 0 === n && (n = {},
  53624. e[i] = n),
  53625. n
  53626. }
  53627. ,
  53628. this.delete = function(t) {
  53629. delete e[t.uuid]
  53630. }
  53631. ,
  53632. this.clear = function() {
  53633. e = {}
  53634. }
  53635. }
  53636. ,
  53637. n.WebGLShader = function() {
  53638. function e(e) {
  53639. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  53640. t[i] = i + 1 + ": " + t[i];
  53641. return t.join("\n")
  53642. }
  53643. return function(t, i, n) {
  53644. var r = t.createShader(i);
  53645. return t.shaderSource(r, n),
  53646. t.compileShader(r),
  53647. t.getShaderParameter(r, t.COMPILE_STATUS) === !1 && console.error("THREE.WebGLShader: Shader couldn't compile."),
  53648. "" !== t.getShaderInfoLog(r) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", i === t.VERTEX_SHADER ? "vertex" : "fragment", t.getShaderInfoLog(r), e(n)),
  53649. r
  53650. }
  53651. }(),
  53652. n.WebGLShadowMap = function(e, t, i) {
  53653. function r(e, t, i, r) {
  53654. var o = e.geometry
  53655. , a = null
  53656. , s = v
  53657. , l = e.customDepthMaterial;
  53658. if (i && (s = A,
  53659. l = e.customDistanceMaterial),
  53660. l)
  53661. a = l;
  53662. else {
  53663. var c = void 0 !== o.morphTargets && o.morphTargets.length > 0 && t.morphTargets
  53664. , h = e instanceof n.SkinnedMesh && t.skinning
  53665. , u = 0;
  53666. c && (u |= f),
  53667. h && (u |= g),
  53668. a = s[u]
  53669. }
  53670. return a.visible = t.visible,
  53671. a.wireframe = t.wireframe,
  53672. a.wireframeLinewidth = t.wireframeLinewidth,
  53673. i && void 0 !== a.uniforms.lightPos && a.uniforms.lightPos.value.copy(r),
  53674. a
  53675. }
  53676. function o(e, t, i) {
  53677. if (e.visible !== !1) {
  53678. 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)) {
  53679. var r = e.material;
  53680. r.visible === !0 && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  53681. p.push(e))
  53682. }
  53683. for (var a = e.children, s = 0, c = a.length; s < c; s++)
  53684. o(a[s], t, i)
  53685. }
  53686. }
  53687. 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) {
  53688. var x = 0 !== (T & f)
  53689. , S = 0 !== (T & g)
  53690. , M = new n.ShaderMaterial({
  53691. uniforms: b,
  53692. vertexShader: E.vertexShader,
  53693. fragmentShader: E.fragmentShader,
  53694. morphTargets: x,
  53695. skinning: S
  53696. });
  53697. v[T] = M;
  53698. var R = new n.ShaderMaterial({
  53699. defines: {
  53700. USE_SHADOWMAP: ""
  53701. },
  53702. uniforms: _,
  53703. vertexShader: w.vertexShader,
  53704. fragmentShader: w.fragmentShader,
  53705. morphTargets: x,
  53706. skinning: S
  53707. });
  53708. A[T] = R
  53709. }
  53710. var P = this;
  53711. this.enabled = !1,
  53712. this.autoUpdate = !0,
  53713. this.needsUpdate = !1,
  53714. this.type = n.PCFShadowMap,
  53715. this.cullFace = n.CullFaceFront,
  53716. this.render = function(f, g) {
  53717. var m, v, A = t.shadows;
  53718. if (0 !== A.length && P.enabled !== !1 && (P.autoUpdate !== !1 || P.needsUpdate !== !1)) {
  53719. s.clearColor(1, 1, 1, 1),
  53720. s.disable(a.BLEND),
  53721. s.enable(a.CULL_FACE),
  53722. a.frontFace(a.CCW),
  53723. a.cullFace(P.cullFace === n.CullFaceFront ? a.FRONT : a.BACK),
  53724. s.setDepthTest(!0),
  53725. s.setScissorTest(!1);
  53726. for (var E = 0, b = A.length; E < b; E++) {
  53727. var w = A[E]
  53728. , _ = w.shadow
  53729. , T = _.camera;
  53730. if (h.copy(_.mapSize),
  53731. w instanceof n.PointLight) {
  53732. m = 6,
  53733. v = !0;
  53734. var x = h.x
  53735. , S = h.y;
  53736. I[0].set(2 * x, S, x, S),
  53737. I[1].set(0, S, x, S),
  53738. I[2].set(3 * x, S, x, S),
  53739. I[3].set(x, S, x, S),
  53740. I[4].set(3 * x, 0, x, S),
  53741. I[5].set(x, 0, x, S),
  53742. h.x *= 4,
  53743. h.y *= 2
  53744. } else
  53745. m = 1,
  53746. v = !1;
  53747. if (null === _.map) {
  53748. var M = {
  53749. minFilter: n.NearestFilter,
  53750. magFilter: n.NearestFilter,
  53751. format: n.RGBAFormat
  53752. };
  53753. _.map = new n.WebGLRenderTarget(h.x,h.y,M),
  53754. w instanceof n.SpotLight && (T.aspect = h.x / h.y),
  53755. T.updateProjectionMatrix()
  53756. }
  53757. var R = _.map
  53758. , O = _.matrix;
  53759. d.setFromMatrixPosition(w.matrixWorld),
  53760. T.position.copy(d),
  53761. e.setRenderTarget(R),
  53762. e.clear();
  53763. for (var L = 0; L < m; L++) {
  53764. if (v) {
  53765. u.copy(T.position),
  53766. u.add(y[L]),
  53767. T.up.copy(C[L]),
  53768. T.lookAt(u);
  53769. var D = I[L];
  53770. s.viewport(D)
  53771. } else
  53772. u.setFromMatrixPosition(w.target.matrixWorld),
  53773. T.lookAt(u);
  53774. T.updateMatrixWorld(),
  53775. T.matrixWorldInverse.getInverse(T.matrixWorld),
  53776. O.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  53777. O.multiply(T.projectionMatrix),
  53778. O.multiply(T.matrixWorldInverse),
  53779. c.multiplyMatrices(T.projectionMatrix, T.matrixWorldInverse),
  53780. l.setFromMatrix(c),
  53781. p.length = 0,
  53782. o(f, g, T);
  53783. for (var N = 0, B = p.length; N < B; N++) {
  53784. var F = p[N]
  53785. , V = i.update(F)
  53786. , U = F.material;
  53787. if (U instanceof n.MultiMaterial)
  53788. for (var k = V.groups, H = U.materials, G = 0, z = k.length; G < z; G++) {
  53789. var W = k[G]
  53790. , j = H[W.materialIndex];
  53791. if (j.visible === !0) {
  53792. var Y = r(F, j, v, d);
  53793. e.renderBufferDirect(T, null, V, Y, F, W)
  53794. }
  53795. }
  53796. else {
  53797. var Y = r(F, U, v, d);
  53798. e.renderBufferDirect(T, null, V, Y, F, null)
  53799. }
  53800. }
  53801. }
  53802. }
  53803. var X = e.getClearColor()
  53804. , Z = e.getClearAlpha();
  53805. e.setClearColor(X, Z),
  53806. s.enable(a.BLEND),
  53807. P.cullFace === n.CullFaceFront && a.cullFace(a.BACK),
  53808. P.needsUpdate = !1
  53809. }
  53810. }
  53811. }
  53812. ,
  53813. n.WebGLState = function(e, t, i) {
  53814. var r = this
  53815. , o = new n.Vector4
  53816. , a = new Uint8Array(16)
  53817. , s = new Uint8Array(16)
  53818. , l = new Uint8Array(16)
  53819. , c = {}
  53820. , h = null
  53821. , u = null
  53822. , d = null
  53823. , p = null
  53824. , f = null
  53825. , g = null
  53826. , m = null
  53827. , v = null
  53828. , A = !1
  53829. , y = null
  53830. , C = null
  53831. , I = null
  53832. , E = null
  53833. , b = null
  53834. , w = null
  53835. , _ = null
  53836. , T = null
  53837. , x = null
  53838. , S = null
  53839. , M = null
  53840. , R = null
  53841. , P = null
  53842. , O = null
  53843. , L = null
  53844. , D = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  53845. , N = void 0
  53846. , B = {}
  53847. , F = new n.Vector4
  53848. , V = null
  53849. , U = null
  53850. , k = new n.Vector4
  53851. , H = new n.Vector4
  53852. , G = e.createTexture();
  53853. e.bindTexture(e.TEXTURE_2D, G),
  53854. e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR),
  53855. e.texImage2D(e.TEXTURE_2D, 0, e.RGB, 1, 1, 0, e.RGB, e.UNSIGNED_BYTE, new Uint8Array(3)),
  53856. this.init = function() {
  53857. this.clearColor(0, 0, 0, 1),
  53858. this.clearDepth(1),
  53859. this.clearStencil(0),
  53860. this.enable(e.DEPTH_TEST),
  53861. e.depthFunc(e.LEQUAL),
  53862. e.frontFace(e.CCW),
  53863. e.cullFace(e.BACK),
  53864. this.enable(e.CULL_FACE),
  53865. this.enable(e.BLEND),
  53866. e.blendEquation(e.FUNC_ADD),
  53867. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  53868. }
  53869. ,
  53870. this.initAttributes = function() {
  53871. for (var e = 0, t = a.length; e < t; e++)
  53872. a[e] = 0
  53873. }
  53874. ,
  53875. this.enableAttribute = function(i) {
  53876. if (a[i] = 1,
  53877. 0 === s[i] && (e.enableVertexAttribArray(i),
  53878. s[i] = 1),
  53879. 0 !== l[i]) {
  53880. var n = t.get("ANGLE_instanced_arrays");
  53881. n.vertexAttribDivisorANGLE(i, 0),
  53882. l[i] = 0
  53883. }
  53884. }
  53885. ,
  53886. this.enableAttributeAndDivisor = function(t, i, n) {
  53887. a[t] = 1,
  53888. 0 === s[t] && (e.enableVertexAttribArray(t),
  53889. s[t] = 1),
  53890. l[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  53891. l[t] = i)
  53892. }
  53893. ,
  53894. this.disableUnusedAttributes = function() {
  53895. for (var t = 0, i = s.length; t < i; t++)
  53896. s[t] !== a[t] && (e.disableVertexAttribArray(t),
  53897. s[t] = 0)
  53898. }
  53899. ,
  53900. this.enable = function(t) {
  53901. c[t] !== !0 && (e.enable(t),
  53902. c[t] = !0)
  53903. }
  53904. ,
  53905. this.disable = function(t) {
  53906. c[t] !== !1 && (e.disable(t),
  53907. c[t] = !1)
  53908. }
  53909. ,
  53910. this.getCompressedTextureFormats = function() {
  53911. if (null === h && (h = [],
  53912. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  53913. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  53914. h.push(i[n]);
  53915. return h
  53916. }
  53917. ,
  53918. this.setBlending = function(t, r, o, a, s, l, c, h) {
  53919. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  53920. t === u && h === A || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53921. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  53922. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53923. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  53924. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53925. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  53926. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53927. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53928. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  53929. u = t,
  53930. A = h),
  53931. t === n.CustomBlending ? (s = s || r,
  53932. l = l || o,
  53933. c = c || a,
  53934. r === d && s === g || (e.blendEquationSeparate(i(r), i(s)),
  53935. d = r,
  53936. g = s),
  53937. o === p && a === f && l === m && c === v || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  53938. p = o,
  53939. f = a,
  53940. m = l,
  53941. v = c)) : (d = null,
  53942. p = null,
  53943. f = null,
  53944. g = null,
  53945. m = null,
  53946. v = null)
  53947. }
  53948. ,
  53949. this.setDepthFunc = function(t) {
  53950. if (y !== t) {
  53951. if (t)
  53952. switch (t) {
  53953. case n.NeverDepth:
  53954. e.depthFunc(e.NEVER);
  53955. break;
  53956. case n.AlwaysDepth:
  53957. e.depthFunc(e.ALWAYS);
  53958. break;
  53959. case n.LessDepth:
  53960. e.depthFunc(e.LESS);
  53961. break;
  53962. case n.LessEqualDepth:
  53963. e.depthFunc(e.LEQUAL);
  53964. break;
  53965. case n.EqualDepth:
  53966. e.depthFunc(e.EQUAL);
  53967. break;
  53968. case n.GreaterEqualDepth:
  53969. e.depthFunc(e.GEQUAL);
  53970. break;
  53971. case n.GreaterDepth:
  53972. e.depthFunc(e.GREATER);
  53973. break;
  53974. case n.NotEqualDepth:
  53975. e.depthFunc(e.NOTEQUAL);
  53976. break;
  53977. default:
  53978. e.depthFunc(e.LEQUAL)
  53979. }
  53980. else
  53981. e.depthFunc(e.LEQUAL);
  53982. y = t
  53983. }
  53984. }
  53985. ,
  53986. this.setDepthTest = function(t) {
  53987. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  53988. }
  53989. ,
  53990. this.setDepthWrite = function(t) {
  53991. C !== t && (e.depthMask(t),
  53992. C = t)
  53993. }
  53994. ,
  53995. this.setColorWrite = function(t) {
  53996. I !== t && (e.colorMask(t, t, t, t),
  53997. I = t)
  53998. }
  53999. ,
  54000. this.setStencilFunc = function(t, i, n) {
  54001. b === t && w === i && _ === n || (e.stencilFunc(t, i, n),
  54002. b = t,
  54003. w = i,
  54004. _ = n)
  54005. }
  54006. ,
  54007. this.setStencilOp = function(t, i, n) {
  54008. T === t && x === i && S === n || (e.stencilOp(t, i, n),
  54009. T = t,
  54010. x = i,
  54011. S = n)
  54012. }
  54013. ,
  54014. this.setStencilTest = function(t) {
  54015. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  54016. }
  54017. ,
  54018. this.setStencilWrite = function(t) {
  54019. E !== t && (e.stencilMask(t),
  54020. E = t)
  54021. }
  54022. ,
  54023. this.setFlipSided = function(t) {
  54024. M !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  54025. M = t)
  54026. }
  54027. ,
  54028. this.setLineWidth = function(t) {
  54029. t !== R && (e.lineWidth(t),
  54030. R = t)
  54031. }
  54032. ,
  54033. this.setPolygonOffset = function(t, i, n) {
  54034. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  54035. !t || P === i && O === n || (e.polygonOffset(i, n),
  54036. P = i,
  54037. O = n)
  54038. }
  54039. ,
  54040. this.getScissorTest = function() {
  54041. return L
  54042. }
  54043. ,
  54044. this.setScissorTest = function(t) {
  54045. L = t,
  54046. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  54047. }
  54048. ,
  54049. this.activeTexture = function(t) {
  54050. void 0 === t && (t = e.TEXTURE0 + D - 1),
  54051. N !== t && (e.activeTexture(t),
  54052. N = t)
  54053. }
  54054. ,
  54055. this.bindTexture = function(t, i) {
  54056. void 0 === N && r.activeTexture();
  54057. var n = B[N];
  54058. void 0 === n && (n = {
  54059. type: void 0,
  54060. texture: void 0
  54061. },
  54062. B[N] = n),
  54063. n.type === t && n.texture === i || (e.bindTexture(t, i || G),
  54064. n.type = t,
  54065. n.texture = i)
  54066. }
  54067. ,
  54068. this.compressedTexImage2D = function() {
  54069. try {
  54070. e.compressedTexImage2D.apply(e, arguments)
  54071. } catch (e) {
  54072. console.error(e)
  54073. }
  54074. }
  54075. ,
  54076. this.texImage2D = function() {
  54077. try {
  54078. e.texImage2D.apply(e, arguments)
  54079. } catch (e) {
  54080. console.error(e)
  54081. }
  54082. }
  54083. ,
  54084. this.clearColor = function(t, i, n, r) {
  54085. o.set(t, i, n, r),
  54086. F.equals(o) === !1 && (e.clearColor(t, i, n, r),
  54087. F.copy(o))
  54088. }
  54089. ,
  54090. this.clearDepth = function(t) {
  54091. V !== t && (e.clearDepth(t),
  54092. V = t)
  54093. }
  54094. ,
  54095. this.clearStencil = function(t) {
  54096. U !== t && (e.clearStencil(t),
  54097. U = t)
  54098. }
  54099. ,
  54100. this.scissor = function(t) {
  54101. k.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  54102. k.copy(t))
  54103. }
  54104. ,
  54105. this.viewport = function(t) {
  54106. H.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  54107. H.copy(t))
  54108. }
  54109. ,
  54110. this.reset = function() {
  54111. for (var t = 0; t < s.length; t++)
  54112. 1 === s[t] && (e.disableVertexAttribArray(t),
  54113. s[t] = 0);
  54114. c = {},
  54115. h = null,
  54116. N = void 0,
  54117. B = {},
  54118. u = null,
  54119. I = null,
  54120. C = null,
  54121. E = null,
  54122. M = null
  54123. }
  54124. }
  54125. ,
  54126. n.LensFlarePlugin = function(e, t) {
  54127. function i() {
  54128. var e = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1])
  54129. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  54130. o = p.createBuffer(),
  54131. a = p.createBuffer(),
  54132. p.bindBuffer(p.ARRAY_BUFFER, o),
  54133. p.bufferData(p.ARRAY_BUFFER, e, p.STATIC_DRAW),
  54134. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  54135. p.bufferData(p.ELEMENT_ARRAY_BUFFER, t, p.STATIC_DRAW),
  54136. u = p.createTexture(),
  54137. d = p.createTexture(),
  54138. f.bindTexture(p.TEXTURE_2D, u),
  54139. p.texImage2D(p.TEXTURE_2D, 0, p.RGB, 16, 16, 0, p.RGB, p.UNSIGNED_BYTE, null),
  54140. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  54141. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  54142. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  54143. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  54144. f.bindTexture(p.TEXTURE_2D, d),
  54145. p.texImage2D(p.TEXTURE_2D, 0, p.RGBA, 16, 16, 0, p.RGBA, p.UNSIGNED_BYTE, null),
  54146. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  54147. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  54148. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  54149. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  54150. h = p.getParameter(p.MAX_VERTEX_TEXTURE_IMAGE_UNITS) > 0;
  54151. var i;
  54152. i = h ? {
  54153. 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"),
  54154. 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")
  54155. } : {
  54156. 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"),
  54157. 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")
  54158. },
  54159. s = r(i),
  54160. l = {
  54161. vertex: p.getAttribLocation(s, "position"),
  54162. uv: p.getAttribLocation(s, "uv")
  54163. },
  54164. c = {
  54165. renderType: p.getUniformLocation(s, "renderType"),
  54166. map: p.getUniformLocation(s, "map"),
  54167. occlusionMap: p.getUniformLocation(s, "occlusionMap"),
  54168. opacity: p.getUniformLocation(s, "opacity"),
  54169. color: p.getUniformLocation(s, "color"),
  54170. scale: p.getUniformLocation(s, "scale"),
  54171. rotation: p.getUniformLocation(s, "rotation"),
  54172. screenPosition: p.getUniformLocation(s, "screenPosition")
  54173. }
  54174. }
  54175. function r(t) {
  54176. var i = p.createProgram()
  54177. , n = p.createShader(p.FRAGMENT_SHADER)
  54178. , r = p.createShader(p.VERTEX_SHADER)
  54179. , o = "precision " + e.getPrecision() + " float;\n";
  54180. return p.shaderSource(n, o + t.fragmentShader),
  54181. p.shaderSource(r, o + t.vertexShader),
  54182. p.compileShader(n),
  54183. p.compileShader(r),
  54184. p.attachShader(i, n),
  54185. p.attachShader(i, r),
  54186. p.linkProgram(i),
  54187. i
  54188. }
  54189. var o, a, s, l, c, h, u, d, p = e.context, f = e.state;
  54190. this.render = function(r, g, m) {
  54191. if (0 !== t.length) {
  54192. var v = new n.Vector3
  54193. , A = m.w / m.z
  54194. , y = .5 * m.z
  54195. , C = .5 * m.w
  54196. , I = 16 / m.w
  54197. , E = new n.Vector2(I * A,I)
  54198. , b = new n.Vector3(1,1,0)
  54199. , w = new n.Vector2(1,1);
  54200. void 0 === s && i(),
  54201. p.useProgram(s),
  54202. f.initAttributes(),
  54203. f.enableAttribute(l.vertex),
  54204. f.enableAttribute(l.uv),
  54205. f.disableUnusedAttributes(),
  54206. p.uniform1i(c.occlusionMap, 0),
  54207. p.uniform1i(c.map, 1),
  54208. p.bindBuffer(p.ARRAY_BUFFER, o),
  54209. p.vertexAttribPointer(l.vertex, 2, p.FLOAT, !1, 16, 0),
  54210. p.vertexAttribPointer(l.uv, 2, p.FLOAT, !1, 16, 8),
  54211. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  54212. f.disable(p.CULL_FACE),
  54213. f.setDepthWrite(!1);
  54214. for (var _ = 0, T = t.length; _ < T; _++) {
  54215. I = 16 / m.w,
  54216. E.set(I * A, I);
  54217. var x = t[_];
  54218. if (v.set(x.matrixWorld.elements[12], x.matrixWorld.elements[13], x.matrixWorld.elements[14]),
  54219. v.applyMatrix4(g.matrixWorldInverse),
  54220. v.applyProjection(g.projectionMatrix),
  54221. b.copy(v),
  54222. w.x = b.x * y + y,
  54223. w.y = b.y * C + C,
  54224. h || w.x > 0 && w.x < m.z && w.y > 0 && w.y < m.w) {
  54225. f.activeTexture(p.TEXTURE0),
  54226. f.bindTexture(p.TEXTURE_2D, null),
  54227. f.activeTexture(p.TEXTURE1),
  54228. f.bindTexture(p.TEXTURE_2D, u),
  54229. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGB, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  54230. p.uniform1i(c.renderType, 0),
  54231. p.uniform2f(c.scale, E.x, E.y),
  54232. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  54233. f.disable(p.BLEND),
  54234. f.enable(p.DEPTH_TEST),
  54235. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  54236. f.activeTexture(p.TEXTURE0),
  54237. f.bindTexture(p.TEXTURE_2D, d),
  54238. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGBA, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  54239. p.uniform1i(c.renderType, 1),
  54240. f.disable(p.DEPTH_TEST),
  54241. f.activeTexture(p.TEXTURE1),
  54242. f.bindTexture(p.TEXTURE_2D, u),
  54243. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  54244. x.positionScreen.copy(b),
  54245. x.customUpdateCallback ? x.customUpdateCallback(x) : x.updateLensFlares(),
  54246. p.uniform1i(c.renderType, 2),
  54247. f.enable(p.BLEND);
  54248. for (var S = 0, M = x.lensFlares.length; S < M; S++) {
  54249. var R = x.lensFlares[S];
  54250. R.opacity > .001 && R.scale > .001 && (b.x = R.x,
  54251. b.y = R.y,
  54252. b.z = R.z,
  54253. I = R.size * R.scale / m.w,
  54254. E.x = I * A,
  54255. E.y = I,
  54256. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  54257. p.uniform2f(c.scale, E.x, E.y),
  54258. p.uniform1f(c.rotation, R.rotation),
  54259. p.uniform1f(c.opacity, R.opacity),
  54260. p.uniform3f(c.color, R.color.r, R.color.g, R.color.b),
  54261. f.setBlending(R.blending, R.blendEquation, R.blendSrc, R.blendDst),
  54262. e.setTexture(R.texture, 1),
  54263. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0))
  54264. }
  54265. }
  54266. }
  54267. f.enable(p.CULL_FACE),
  54268. f.enable(p.DEPTH_TEST),
  54269. f.setDepthWrite(!0),
  54270. e.resetGLState()
  54271. }
  54272. }
  54273. }
  54274. ,
  54275. n.SpritePlugin = function(e, t) {
  54276. function i() {
  54277. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  54278. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  54279. a = d.createBuffer(),
  54280. s = d.createBuffer(),
  54281. d.bindBuffer(d.ARRAY_BUFFER, a),
  54282. d.bufferData(d.ARRAY_BUFFER, e, d.STATIC_DRAW),
  54283. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  54284. d.bufferData(d.ELEMENT_ARRAY_BUFFER, t, d.STATIC_DRAW),
  54285. l = r(),
  54286. c = {
  54287. position: d.getAttribLocation(l, "position"),
  54288. uv: d.getAttribLocation(l, "uv")
  54289. },
  54290. h = {
  54291. uvOffset: d.getUniformLocation(l, "uvOffset"),
  54292. uvScale: d.getUniformLocation(l, "uvScale"),
  54293. rotation: d.getUniformLocation(l, "rotation"),
  54294. scale: d.getUniformLocation(l, "scale"),
  54295. color: d.getUniformLocation(l, "color"),
  54296. map: d.getUniformLocation(l, "map"),
  54297. opacity: d.getUniformLocation(l, "opacity"),
  54298. modelViewMatrix: d.getUniformLocation(l, "modelViewMatrix"),
  54299. projectionMatrix: d.getUniformLocation(l, "projectionMatrix"),
  54300. fogType: d.getUniformLocation(l, "fogType"),
  54301. fogDensity: d.getUniformLocation(l, "fogDensity"),
  54302. fogNear: d.getUniformLocation(l, "fogNear"),
  54303. fogFar: d.getUniformLocation(l, "fogFar"),
  54304. fogColor: d.getUniformLocation(l, "fogColor"),
  54305. alphaTest: d.getUniformLocation(l, "alphaTest")
  54306. };
  54307. var i = document.createElement("canvas");
  54308. i.width = 8,
  54309. i.height = 8;
  54310. var o = i.getContext("2d");
  54311. o.fillStyle = "white",
  54312. o.fillRect(0, 0, 8, 8),
  54313. u = new n.Texture(i),
  54314. u.needsUpdate = !0
  54315. }
  54316. function r() {
  54317. var t = d.createProgram()
  54318. , i = d.createShader(d.VERTEX_SHADER)
  54319. , n = d.createShader(d.FRAGMENT_SHADER);
  54320. 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")),
  54321. 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")),
  54322. d.compileShader(i),
  54323. d.compileShader(n),
  54324. d.attachShader(t, i),
  54325. d.attachShader(t, n),
  54326. d.linkProgram(t),
  54327. t
  54328. }
  54329. function o(e, t) {
  54330. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  54331. }
  54332. 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;
  54333. this.render = function(r, v) {
  54334. if (0 !== t.length) {
  54335. void 0 === l && i(),
  54336. d.useProgram(l),
  54337. p.initAttributes(),
  54338. p.enableAttribute(c.position),
  54339. p.enableAttribute(c.uv),
  54340. p.disableUnusedAttributes(),
  54341. p.disable(d.CULL_FACE),
  54342. p.enable(d.BLEND),
  54343. d.bindBuffer(d.ARRAY_BUFFER, a),
  54344. d.vertexAttribPointer(c.position, 2, d.FLOAT, !1, 16, 0),
  54345. d.vertexAttribPointer(c.uv, 2, d.FLOAT, !1, 16, 8),
  54346. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  54347. d.uniformMatrix4fv(h.projectionMatrix, !1, v.projectionMatrix.elements),
  54348. p.activeTexture(d.TEXTURE0),
  54349. d.uniform1i(h.map, 0);
  54350. var A = 0
  54351. , y = 0
  54352. , C = r.fog;
  54353. C ? (d.uniform3f(h.fogColor, C.color.r, C.color.g, C.color.b),
  54354. C instanceof n.Fog ? (d.uniform1f(h.fogNear, C.near),
  54355. d.uniform1f(h.fogFar, C.far),
  54356. d.uniform1i(h.fogType, 1),
  54357. A = 1,
  54358. y = 1) : C instanceof n.FogExp2 && (d.uniform1f(h.fogDensity, C.density),
  54359. d.uniform1i(h.fogType, 2),
  54360. A = 2,
  54361. y = 2)) : (d.uniform1i(h.fogType, 0),
  54362. A = 0,
  54363. y = 0);
  54364. for (var I = 0, E = t.length; I < E; I++) {
  54365. var b = t[I];
  54366. b.modelViewMatrix.multiplyMatrices(v.matrixWorldInverse, b.matrixWorld),
  54367. b.z = -b.modelViewMatrix.elements[14]
  54368. }
  54369. t.sort(o);
  54370. for (var w = [], I = 0, E = t.length; I < E; I++) {
  54371. var b = t[I]
  54372. , _ = b.material;
  54373. d.uniform1f(h.alphaTest, _.alphaTest),
  54374. d.uniformMatrix4fv(h.modelViewMatrix, !1, b.modelViewMatrix.elements),
  54375. b.matrixWorld.decompose(f, g, m),
  54376. w[0] = m.x,
  54377. w[1] = m.y;
  54378. var T = 0;
  54379. r.fog && _.fog && (T = y),
  54380. A !== T && (d.uniform1i(h.fogType, T),
  54381. A = T),
  54382. null !== _.map ? (d.uniform2f(h.uvOffset, _.map.offset.x, _.map.offset.y),
  54383. d.uniform2f(h.uvScale, _.map.repeat.x, _.map.repeat.y)) : (d.uniform2f(h.uvOffset, 0, 0),
  54384. d.uniform2f(h.uvScale, 1, 1)),
  54385. d.uniform1f(h.opacity, _.opacity),
  54386. d.uniform3f(h.color, _.color.r, _.color.g, _.color.b),
  54387. d.uniform1f(h.rotation, _.rotation),
  54388. d.uniform2fv(h.scale, w),
  54389. p.setBlending(_.blending, _.blendEquation, _.blendSrc, _.blendDst),
  54390. p.setDepthTest(_.depthTest),
  54391. p.setDepthWrite(_.depthWrite),
  54392. _.map && _.map.image && _.map.image.width ? e.setTexture(_.map, 0) : e.setTexture(u, 0),
  54393. d.drawElements(d.TRIANGLES, 6, d.UNSIGNED_SHORT, 0)
  54394. }
  54395. p.enable(d.CULL_FACE),
  54396. e.resetGLState()
  54397. }
  54398. }
  54399. }
  54400. ,
  54401. Object.defineProperties(n.Box2.prototype, {
  54402. empty: {
  54403. value: function() {
  54404. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  54405. this.isEmpty()
  54406. }
  54407. },
  54408. isIntersectionBox: {
  54409. value: function(e) {
  54410. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  54411. this.intersectsBox(e)
  54412. }
  54413. }
  54414. }),
  54415. Object.defineProperties(n.Box3.prototype, {
  54416. empty: {
  54417. value: function() {
  54418. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  54419. this.isEmpty()
  54420. }
  54421. },
  54422. isIntersectionBox: {
  54423. value: function(e) {
  54424. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  54425. this.intersectsBox(e)
  54426. }
  54427. },
  54428. isIntersectionSphere: {
  54429. value: function(e) {
  54430. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  54431. this.intersectsSphere(e)
  54432. }
  54433. }
  54434. }),
  54435. Object.defineProperties(n.Matrix3.prototype, {
  54436. multiplyVector3: {
  54437. value: function(e) {
  54438. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  54439. e.applyMatrix3(this)
  54440. }
  54441. },
  54442. multiplyVector3Array: {
  54443. value: function(e) {
  54444. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  54445. this.applyToVector3Array(e)
  54446. }
  54447. }
  54448. }),
  54449. Object.defineProperties(n.Matrix4.prototype, {
  54450. extractPosition: {
  54451. value: function(e) {
  54452. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  54453. this.copyPosition(e)
  54454. }
  54455. },
  54456. setRotationFromQuaternion: {
  54457. value: function(e) {
  54458. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  54459. this.makeRotationFromQuaternion(e)
  54460. }
  54461. },
  54462. multiplyVector3: {
  54463. value: function(e) {
  54464. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  54465. e.applyProjection(this)
  54466. }
  54467. },
  54468. multiplyVector4: {
  54469. value: function(e) {
  54470. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  54471. e.applyMatrix4(this)
  54472. }
  54473. },
  54474. multiplyVector3Array: {
  54475. value: function(e) {
  54476. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  54477. this.applyToVector3Array(e)
  54478. }
  54479. },
  54480. rotateAxis: {
  54481. value: function(e) {
  54482. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  54483. e.transformDirection(this)
  54484. }
  54485. },
  54486. crossVector: {
  54487. value: function(e) {
  54488. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  54489. e.applyMatrix4(this)
  54490. }
  54491. },
  54492. translate: {
  54493. value: function(e) {
  54494. console.error("THREE.Matrix4: .translate() has been removed.")
  54495. }
  54496. },
  54497. rotateX: {
  54498. value: function(e) {
  54499. console.error("THREE.Matrix4: .rotateX() has been removed.")
  54500. }
  54501. },
  54502. rotateY: {
  54503. value: function(e) {
  54504. console.error("THREE.Matrix4: .rotateY() has been removed.")
  54505. }
  54506. },
  54507. rotateZ: {
  54508. value: function(e) {
  54509. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  54510. }
  54511. },
  54512. rotateByAxis: {
  54513. value: function(e, t) {
  54514. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  54515. }
  54516. }
  54517. }),
  54518. Object.defineProperties(n.Plane.prototype, {
  54519. isIntersectionLine: {
  54520. value: function(e) {
  54521. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  54522. this.intersectsLine(e)
  54523. }
  54524. }
  54525. }),
  54526. Object.defineProperties(n.Quaternion.prototype, {
  54527. multiplyVector3: {
  54528. value: function(e) {
  54529. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  54530. e.applyQuaternion(this)
  54531. }
  54532. }
  54533. }),
  54534. Object.defineProperties(n.Ray.prototype, {
  54535. isIntersectionBox: {
  54536. value: function(e) {
  54537. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  54538. this.intersectsBox(e)
  54539. }
  54540. },
  54541. isIntersectionPlane: {
  54542. value: function(e) {
  54543. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  54544. this.intersectsPlane(e)
  54545. }
  54546. },
  54547. isIntersectionSphere: {
  54548. value: function(e) {
  54549. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  54550. this.intersectsSphere(e)
  54551. }
  54552. }
  54553. }),
  54554. Object.defineProperties(n.Vector3.prototype, {
  54555. setEulerFromRotationMatrix: {
  54556. value: function() {
  54557. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  54558. }
  54559. },
  54560. setEulerFromQuaternion: {
  54561. value: function() {
  54562. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  54563. }
  54564. },
  54565. getPositionFromMatrix: {
  54566. value: function(e) {
  54567. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  54568. this.setFromMatrixPosition(e)
  54569. }
  54570. },
  54571. getScaleFromMatrix: {
  54572. value: function(e) {
  54573. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  54574. this.setFromMatrixScale(e)
  54575. }
  54576. },
  54577. getColumnFromMatrix: {
  54578. value: function(e, t) {
  54579. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  54580. this.setFromMatrixColumn(e, t)
  54581. }
  54582. }
  54583. }),
  54584. n.Face4 = function(e, t, i, r, o, a, s) {
  54585. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  54586. new n.Face3(e,t,i,o,a,s)
  54587. }
  54588. ,
  54589. n.Vertex = function(e, t, i) {
  54590. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  54591. new n.Vector3(e,t,i)
  54592. }
  54593. ,
  54594. Object.defineProperties(n.Object3D.prototype, {
  54595. eulerOrder: {
  54596. get: function() {
  54597. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  54598. this.rotation.order
  54599. },
  54600. set: function(e) {
  54601. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  54602. this.rotation.order = e
  54603. }
  54604. },
  54605. getChildByName: {
  54606. value: function(e) {
  54607. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  54608. this.getObjectByName(e)
  54609. }
  54610. },
  54611. renderDepth: {
  54612. set: function(e) {
  54613. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  54614. }
  54615. },
  54616. translate: {
  54617. value: function(e, t) {
  54618. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  54619. this.translateOnAxis(t, e)
  54620. }
  54621. },
  54622. useQuaternion: {
  54623. get: function() {
  54624. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  54625. },
  54626. set: function(e) {
  54627. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  54628. }
  54629. }
  54630. }),
  54631. Object.defineProperties(n, {
  54632. PointCloud: {
  54633. value: function(e, t) {
  54634. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  54635. new n.Points(e,t)
  54636. }
  54637. },
  54638. ParticleSystem: {
  54639. value: function(e, t) {
  54640. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  54641. new n.Points(e,t)
  54642. }
  54643. }
  54644. }),
  54645. Object.defineProperties(n.Light.prototype, {
  54646. onlyShadow: {
  54647. set: function(e) {
  54648. console.warn("THREE.Light: .onlyShadow has been removed.")
  54649. }
  54650. },
  54651. shadowCameraFov: {
  54652. set: function(e) {
  54653. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  54654. this.shadow.camera.fov = e
  54655. }
  54656. },
  54657. shadowCameraLeft: {
  54658. set: function(e) {
  54659. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  54660. this.shadow.camera.left = e
  54661. }
  54662. },
  54663. shadowCameraRight: {
  54664. set: function(e) {
  54665. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  54666. this.shadow.camera.right = e
  54667. }
  54668. },
  54669. shadowCameraTop: {
  54670. set: function(e) {
  54671. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  54672. this.shadow.camera.top = e
  54673. }
  54674. },
  54675. shadowCameraBottom: {
  54676. set: function(e) {
  54677. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  54678. this.shadow.camera.bottom = e
  54679. }
  54680. },
  54681. shadowCameraNear: {
  54682. set: function(e) {
  54683. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  54684. this.shadow.camera.near = e
  54685. }
  54686. },
  54687. shadowCameraFar: {
  54688. set: function(e) {
  54689. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  54690. this.shadow.camera.far = e
  54691. }
  54692. },
  54693. shadowCameraVisible: {
  54694. set: function(e) {
  54695. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  54696. }
  54697. },
  54698. shadowBias: {
  54699. set: function(e) {
  54700. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  54701. this.shadow.bias = e
  54702. }
  54703. },
  54704. shadowDarkness: {
  54705. set: function(e) {
  54706. console.warn("THREE.Light: .shadowDarkness has been removed.")
  54707. }
  54708. },
  54709. shadowMapWidth: {
  54710. set: function(e) {
  54711. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  54712. this.shadow.mapSize.width = e
  54713. }
  54714. },
  54715. shadowMapHeight: {
  54716. set: function(e) {
  54717. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  54718. this.shadow.mapSize.height = e
  54719. }
  54720. }
  54721. }),
  54722. Object.defineProperties(n.BufferAttribute.prototype, {
  54723. length: {
  54724. get: function() {
  54725. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  54726. this.array.length
  54727. }
  54728. }
  54729. }),
  54730. Object.defineProperties(n.BufferGeometry.prototype, {
  54731. drawcalls: {
  54732. get: function() {
  54733. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  54734. this.groups
  54735. }
  54736. },
  54737. offsets: {
  54738. get: function() {
  54739. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  54740. this.groups
  54741. }
  54742. },
  54743. addIndex: {
  54744. value: function(e) {
  54745. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  54746. this.setIndex(e)
  54747. }
  54748. },
  54749. addDrawCall: {
  54750. value: function(e, t, i) {
  54751. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  54752. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  54753. this.addGroup(e, t)
  54754. }
  54755. },
  54756. clearDrawCalls: {
  54757. value: function() {
  54758. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  54759. this.clearGroups()
  54760. }
  54761. },
  54762. computeTangents: {
  54763. value: function() {
  54764. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  54765. }
  54766. },
  54767. computeOffsets: {
  54768. value: function() {
  54769. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  54770. }
  54771. }
  54772. }),
  54773. Object.defineProperties(n.Material.prototype, {
  54774. wrapAround: {
  54775. get: function() {
  54776. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  54777. },
  54778. set: function(e) {
  54779. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  54780. }
  54781. },
  54782. wrapRGB: {
  54783. get: function() {
  54784. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  54785. new n.Color
  54786. }
  54787. }
  54788. }),
  54789. Object.defineProperties(n, {
  54790. PointCloudMaterial: {
  54791. value: function(e) {
  54792. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  54793. new n.PointsMaterial(e)
  54794. }
  54795. },
  54796. ParticleBasicMaterial: {
  54797. value: function(e) {
  54798. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  54799. new n.PointsMaterial(e)
  54800. }
  54801. },
  54802. ParticleSystemMaterial: {
  54803. value: function(e) {
  54804. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  54805. new n.PointsMaterial(e)
  54806. }
  54807. }
  54808. }),
  54809. Object.defineProperties(n.MeshPhongMaterial.prototype, {
  54810. metal: {
  54811. get: function() {
  54812. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  54813. !1
  54814. },
  54815. set: function(e) {
  54816. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  54817. }
  54818. }
  54819. }),
  54820. Object.defineProperties(n.ShaderMaterial.prototype, {
  54821. derivatives: {
  54822. get: function() {
  54823. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  54824. this.extensions.derivatives
  54825. },
  54826. set: function(e) {
  54827. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  54828. this.extensions.derivatives = e
  54829. }
  54830. }
  54831. }),
  54832. Object.defineProperties(n.WebGLRenderer.prototype, {
  54833. supportsFloatTextures: {
  54834. value: function() {
  54835. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  54836. this.extensions.get("OES_texture_float")
  54837. }
  54838. },
  54839. supportsHalfFloatTextures: {
  54840. value: function() {
  54841. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  54842. this.extensions.get("OES_texture_half_float")
  54843. }
  54844. },
  54845. supportsStandardDerivatives: {
  54846. value: function() {
  54847. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  54848. this.extensions.get("OES_standard_derivatives")
  54849. }
  54850. },
  54851. supportsCompressedTextureS3TC: {
  54852. value: function() {
  54853. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  54854. this.extensions.get("WEBGL_compressed_texture_s3tc")
  54855. }
  54856. },
  54857. supportsCompressedTexturePVRTC: {
  54858. value: function() {
  54859. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  54860. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  54861. }
  54862. },
  54863. supportsBlendMinMax: {
  54864. value: function() {
  54865. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  54866. this.extensions.get("EXT_blend_minmax")
  54867. }
  54868. },
  54869. supportsVertexTextures: {
  54870. value: function() {
  54871. return this.capabilities.vertexTextures
  54872. }
  54873. },
  54874. supportsInstancedArrays: {
  54875. value: function() {
  54876. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  54877. this.extensions.get("ANGLE_instanced_arrays")
  54878. }
  54879. },
  54880. enableScissorTest: {
  54881. value: function(e) {
  54882. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  54883. this.setScissorTest(e)
  54884. }
  54885. },
  54886. initMaterial: {
  54887. value: function() {
  54888. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  54889. }
  54890. },
  54891. addPrePlugin: {
  54892. value: function() {
  54893. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  54894. }
  54895. },
  54896. addPostPlugin: {
  54897. value: function() {
  54898. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  54899. }
  54900. },
  54901. updateShadowMap: {
  54902. value: function() {
  54903. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  54904. }
  54905. },
  54906. shadowMapEnabled: {
  54907. get: function() {
  54908. return this.shadowMap.enabled
  54909. },
  54910. set: function(e) {
  54911. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  54912. this.shadowMap.enabled = e
  54913. }
  54914. },
  54915. shadowMapType: {
  54916. get: function() {
  54917. return this.shadowMap.type
  54918. },
  54919. set: function(e) {
  54920. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  54921. this.shadowMap.type = e
  54922. }
  54923. },
  54924. shadowMapCullFace: {
  54925. get: function() {
  54926. return this.shadowMap.cullFace
  54927. },
  54928. set: function(e) {
  54929. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  54930. this.shadowMap.cullFace = e
  54931. }
  54932. }
  54933. }),
  54934. Object.defineProperties(n.WebGLRenderTarget.prototype, {
  54935. wrapS: {
  54936. get: function() {
  54937. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  54938. this.texture.wrapS
  54939. },
  54940. set: function(e) {
  54941. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  54942. this.texture.wrapS = e
  54943. }
  54944. },
  54945. wrapT: {
  54946. get: function() {
  54947. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  54948. this.texture.wrapT
  54949. },
  54950. set: function(e) {
  54951. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  54952. this.texture.wrapT = e
  54953. }
  54954. },
  54955. magFilter: {
  54956. get: function() {
  54957. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  54958. this.texture.magFilter
  54959. },
  54960. set: function(e) {
  54961. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  54962. this.texture.magFilter = e
  54963. }
  54964. },
  54965. minFilter: {
  54966. get: function() {
  54967. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  54968. this.texture.minFilter
  54969. },
  54970. set: function(e) {
  54971. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  54972. this.texture.minFilter = e
  54973. }
  54974. },
  54975. anisotropy: {
  54976. get: function() {
  54977. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  54978. this.texture.anisotropy
  54979. },
  54980. set: function(e) {
  54981. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  54982. this.texture.anisotropy = e
  54983. }
  54984. },
  54985. offset: {
  54986. get: function() {
  54987. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  54988. this.texture.offset
  54989. },
  54990. set: function(e) {
  54991. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  54992. this.texture.offset = e
  54993. }
  54994. },
  54995. repeat: {
  54996. get: function() {
  54997. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  54998. this.texture.repeat
  54999. },
  55000. set: function(e) {
  55001. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  55002. this.texture.repeat = e
  55003. }
  55004. },
  55005. format: {
  55006. get: function() {
  55007. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  55008. this.texture.format
  55009. },
  55010. set: function(e) {
  55011. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  55012. this.texture.format = e
  55013. }
  55014. },
  55015. type: {
  55016. get: function() {
  55017. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  55018. this.texture.type
  55019. },
  55020. set: function(e) {
  55021. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  55022. this.texture.type = e
  55023. }
  55024. },
  55025. generateMipmaps: {
  55026. get: function() {
  55027. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  55028. this.texture.generateMipmaps
  55029. },
  55030. set: function(e) {
  55031. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  55032. this.texture.generateMipmaps = e
  55033. }
  55034. }
  55035. }),
  55036. n.GeometryUtils = {
  55037. merge: function(e, t, i) {
  55038. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");
  55039. var r;
  55040. t instanceof n.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  55041. r = t.matrix,
  55042. t = t.geometry),
  55043. e.merge(t, r, i)
  55044. },
  55045. center: function(e) {
  55046. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  55047. e.center()
  55048. }
  55049. },
  55050. n.ImageUtils = {
  55051. crossOrigin: void 0,
  55052. loadTexture: function(e, t, i, r) {
  55053. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  55054. var o = new n.TextureLoader;
  55055. o.setCrossOrigin(this.crossOrigin);
  55056. var a = o.load(e, i, void 0, r);
  55057. return t && (a.mapping = t),
  55058. a
  55059. },
  55060. loadTextureCube: function(e, t, i, r) {
  55061. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  55062. var o = new n.CubeTextureLoader;
  55063. o.setCrossOrigin(this.crossOrigin);
  55064. var a = o.load(e, i, void 0, r);
  55065. return t && (a.mapping = t),
  55066. a
  55067. },
  55068. loadCompressedTexture: function() {
  55069. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  55070. },
  55071. loadCompressedTextureCube: function() {
  55072. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  55073. }
  55074. },
  55075. n.Projector = function() {
  55076. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  55077. this.projectVector = function(e, t) {
  55078. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  55079. e.project(t)
  55080. }
  55081. ,
  55082. this.unprojectVector = function(e, t) {
  55083. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  55084. e.unproject(t)
  55085. }
  55086. ,
  55087. this.pickingRay = function(e, t) {
  55088. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  55089. }
  55090. }
  55091. ,
  55092. n.CanvasRenderer = function() {
  55093. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  55094. this.domElement = document.createElement("canvas"),
  55095. this.clear = function() {}
  55096. ,
  55097. this.render = function() {}
  55098. ,
  55099. this.setClearColor = function() {}
  55100. ,
  55101. this.setSize = function() {}
  55102. }
  55103. ,
  55104. n.MeshFaceMaterial = n.MultiMaterial,
  55105. n.CurveUtils = {
  55106. tangentQuadraticBezier: function(e, t, i, n) {
  55107. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  55108. },
  55109. tangentCubicBezier: function(e, t, i, n, r) {
  55110. 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
  55111. },
  55112. tangentSpline: function(e, t, i, n, r) {
  55113. var o = 6 * e * e - 6 * e
  55114. , a = 3 * e * e - 4 * e + 1
  55115. , s = -6 * e * e + 6 * e
  55116. , l = 3 * e * e - 2 * e;
  55117. return o + a + s + l
  55118. },
  55119. interpolate: function(e, t, i, n, r) {
  55120. var o = .5 * (i - e)
  55121. , a = .5 * (n - t)
  55122. , s = r * r
  55123. , l = r * s;
  55124. return (2 * t - 2 * i + o + a) * l + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  55125. }
  55126. },
  55127. n.SceneUtils = {
  55128. createMultiMaterialObject: function(e, t) {
  55129. for (var i = new n.Group, r = 0, o = t.length; r < o; r++)
  55130. i.add(new n.Mesh(e,t[r]));
  55131. return i
  55132. },
  55133. detach: function(e, t, i) {
  55134. e.applyMatrix(t.matrixWorld),
  55135. t.remove(e),
  55136. i.add(e)
  55137. },
  55138. attach: function(e, t, i) {
  55139. var r = new n.Matrix4;
  55140. r.getInverse(i.matrixWorld),
  55141. e.applyMatrix(r),
  55142. t.remove(e),
  55143. i.add(e)
  55144. }
  55145. },
  55146. n.ShapeUtils = {
  55147. area: function(e) {
  55148. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  55149. i += e[n].x * e[r].y - e[r].x * e[n].y;
  55150. return .5 * i
  55151. },
  55152. triangulate: function() {
  55153. function e(e, t, i, n, r, o) {
  55154. var a, s, l, c, h, u, d, p, f;
  55155. if (s = e[o[t]].x,
  55156. l = e[o[t]].y,
  55157. c = e[o[i]].x,
  55158. h = e[o[i]].y,
  55159. u = e[o[n]].x,
  55160. d = e[o[n]].y,
  55161. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  55162. return !1;
  55163. var g, m, v, A, y, C, I, E, b, w, _, T, x, S, M;
  55164. for (g = u - c,
  55165. m = d - h,
  55166. v = s - u,
  55167. A = l - d,
  55168. y = c - s,
  55169. C = h - l,
  55170. a = 0; a < r; a++)
  55171. if (p = e[o[a]].x,
  55172. f = e[o[a]].y,
  55173. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = p - s,
  55174. E = f - l,
  55175. b = p - c,
  55176. w = f - h,
  55177. _ = p - u,
  55178. T = f - d,
  55179. M = g * w - m * b,
  55180. x = y * E - C * I,
  55181. S = v * T - A * _,
  55182. M >= -Number.EPSILON && S >= -Number.EPSILON && x >= -Number.EPSILON))
  55183. return !1;
  55184. return !0
  55185. }
  55186. return function(t, i) {
  55187. var r = t.length;
  55188. if (r < 3)
  55189. return null;
  55190. var o, a, s, l = [], c = [], h = [];
  55191. if (n.ShapeUtils.area(t) > 0)
  55192. for (a = 0; a < r; a++)
  55193. c[a] = a;
  55194. else
  55195. for (a = 0; a < r; a++)
  55196. c[a] = r - 1 - a;
  55197. var u = r
  55198. , d = 2 * u;
  55199. for (a = u - 1; u > 2; ) {
  55200. if (d-- <= 0)
  55201. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  55202. i ? h : l;
  55203. if (o = a,
  55204. u <= o && (o = 0),
  55205. a = o + 1,
  55206. u <= a && (a = 0),
  55207. s = a + 1,
  55208. u <= s && (s = 0),
  55209. e(t, o, a, s, u, c)) {
  55210. var p, f, g, m, v;
  55211. for (p = c[o],
  55212. f = c[a],
  55213. g = c[s],
  55214. l.push([t[p], t[f], t[g]]),
  55215. h.push([c[o], c[a], c[s]]),
  55216. m = a,
  55217. v = a + 1; v < u; m++,
  55218. v++)
  55219. c[m] = c[v];
  55220. u--,
  55221. d = 2 * u
  55222. }
  55223. }
  55224. return i ? h : l
  55225. }
  55226. }(),
  55227. triangulateShape: function(e, t) {
  55228. function i(e, t, i) {
  55229. 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
  55230. }
  55231. function r(e, t, n, r, o) {
  55232. var a = t.x - e.x
  55233. , s = t.y - e.y
  55234. , l = r.x - n.x
  55235. , c = r.y - n.y
  55236. , h = e.x - n.x
  55237. , u = e.y - n.y
  55238. , d = s * l - a * c
  55239. , p = s * h - a * u;
  55240. if (Math.abs(d) > Number.EPSILON) {
  55241. var f;
  55242. if (d > 0) {
  55243. if (p < 0 || p > d)
  55244. return [];
  55245. if (f = c * h - l * u,
  55246. f < 0 || f > d)
  55247. return []
  55248. } else {
  55249. if (p > 0 || p < d)
  55250. return [];
  55251. if (f = c * h - l * u,
  55252. f > 0 || f < d)
  55253. return []
  55254. }
  55255. if (0 === f)
  55256. return !o || 0 !== p && p !== d ? [e] : [];
  55257. if (f === d)
  55258. return !o || 0 !== p && p !== d ? [t] : [];
  55259. if (0 === p)
  55260. return [n];
  55261. if (p === d)
  55262. return [r];
  55263. var g = f / d;
  55264. return [{
  55265. x: e.x + g * a,
  55266. y: e.y + g * s
  55267. }]
  55268. }
  55269. if (0 !== p || c * h !== l * u)
  55270. return [];
  55271. var m = 0 === a && 0 === s
  55272. , v = 0 === l && 0 === c;
  55273. if (m && v)
  55274. return e.x !== n.x || e.y !== n.y ? [] : [e];
  55275. if (m)
  55276. return i(n, r, e) ? [e] : [];
  55277. if (v)
  55278. return i(e, t, n) ? [n] : [];
  55279. var A, y, C, I, E, b, w, _;
  55280. return 0 !== a ? (e.x < t.x ? (A = e,
  55281. C = e.x,
  55282. y = t,
  55283. I = t.x) : (A = t,
  55284. C = t.x,
  55285. y = e,
  55286. I = e.x),
  55287. n.x < r.x ? (E = n,
  55288. w = n.x,
  55289. b = r,
  55290. _ = r.x) : (E = r,
  55291. w = r.x,
  55292. b = n,
  55293. _ = n.x)) : (e.y < t.y ? (A = e,
  55294. C = e.y,
  55295. y = t,
  55296. I = t.y) : (A = t,
  55297. C = t.y,
  55298. y = e,
  55299. I = e.y),
  55300. n.y < r.y ? (E = n,
  55301. w = n.y,
  55302. b = r,
  55303. _ = r.y) : (E = r,
  55304. w = r.y,
  55305. b = n,
  55306. _ = n.y)),
  55307. C <= w ? I < w ? [] : I === w ? o ? [] : [E] : I <= _ ? [E, y] : [E, b] : C > _ ? [] : C === _ ? o ? [] : [A] : I <= _ ? [A, y] : [A, b]
  55308. }
  55309. function o(e, t, i, n) {
  55310. var r = t.x - e.x
  55311. , o = t.y - e.y
  55312. , a = i.x - e.x
  55313. , s = i.y - e.y
  55314. , l = n.x - e.x
  55315. , c = n.y - e.y
  55316. , h = r * s - o * a
  55317. , u = r * c - o * l;
  55318. if (Math.abs(h) > Number.EPSILON) {
  55319. var d = l * s - c * a;
  55320. return h > 0 ? u >= 0 && d >= 0 : u >= 0 || d >= 0
  55321. }
  55322. return u > 0
  55323. }
  55324. function a(e, t) {
  55325. function i(e, t) {
  55326. var i = A.length - 1
  55327. , n = e - 1;
  55328. n < 0 && (n = i);
  55329. var r = e + 1;
  55330. r > i && (r = 0);
  55331. var a = o(A[e], A[n], A[r], s[t]);
  55332. if (!a)
  55333. return !1;
  55334. var l = s.length - 1
  55335. , c = t - 1;
  55336. c < 0 && (c = l);
  55337. var h = t + 1;
  55338. return h > l && (h = 0),
  55339. a = o(s[t], s[c], s[h], A[e]),
  55340. !!a
  55341. }
  55342. function n(e, t) {
  55343. var i, n, o;
  55344. for (i = 0; i < A.length; i++)
  55345. if (n = i + 1,
  55346. n %= A.length,
  55347. o = r(e, t, A[i], A[n], !0),
  55348. o.length > 0)
  55349. return !0;
  55350. return !1
  55351. }
  55352. function a(e, i) {
  55353. var n, o, a, s, l;
  55354. for (n = 0; n < y.length; n++)
  55355. for (o = t[y[n]],
  55356. a = 0; a < o.length; a++)
  55357. if (s = a + 1,
  55358. s %= o.length,
  55359. l = r(e, i, o[a], o[s], !0),
  55360. l.length > 0)
  55361. return !0;
  55362. return !1
  55363. }
  55364. 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++)
  55365. y.push(I);
  55366. for (var b = 0, w = 2 * y.length; y.length > 0; ) {
  55367. if (w--,
  55368. w < 0) {
  55369. console.log("Infinite Loop! Holes left:" + y.length + ", Probably Hole outside Shape!");
  55370. break
  55371. }
  55372. for (c = b; c < A.length; c++) {
  55373. h = A[c],
  55374. l = -1;
  55375. for (var I = 0; I < y.length; I++)
  55376. if (d = y[I],
  55377. p = h.x + ":" + h.y + ":" + d,
  55378. void 0 === C[p]) {
  55379. s = t[d];
  55380. for (var _ = 0; _ < s.length; _++)
  55381. if (u = s[_],
  55382. i(c, _) && !n(h, u) && !a(h, u)) {
  55383. l = _,
  55384. y.splice(I, 1),
  55385. f = A.slice(0, c + 1),
  55386. g = A.slice(c),
  55387. m = s.slice(l),
  55388. v = s.slice(0, l + 1),
  55389. A = f.concat(m).concat(v).concat(g),
  55390. b = c;
  55391. break
  55392. }
  55393. if (l >= 0)
  55394. break;
  55395. C[p] = !0
  55396. }
  55397. if (l >= 0)
  55398. break
  55399. }
  55400. }
  55401. return A
  55402. }
  55403. for (var s, l, c, h, u, d, p = {}, f = e.concat(), g = 0, m = t.length; g < m; g++)
  55404. Array.prototype.push.apply(f, t[g]);
  55405. for (s = 0,
  55406. l = f.length; s < l; s++)
  55407. u = f[s].x + ":" + f[s].y,
  55408. void 0 !== p[u] && console.warn("THREE.Shape: Duplicate point", u),
  55409. p[u] = s;
  55410. var v = a(e, t)
  55411. , A = n.ShapeUtils.triangulate(v, !1);
  55412. for (s = 0,
  55413. l = A.length; s < l; s++)
  55414. for (h = A[s],
  55415. c = 0; c < 3; c++)
  55416. u = h[c].x + ":" + h[c].y,
  55417. d = p[u],
  55418. void 0 !== d && (h[c] = d);
  55419. return A.concat()
  55420. },
  55421. isClockWise: function(e) {
  55422. return n.ShapeUtils.area(e) < 0
  55423. },
  55424. b2: function() {
  55425. function e(e, t) {
  55426. var i = 1 - e;
  55427. return i * i * t
  55428. }
  55429. function t(e, t) {
  55430. return 2 * (1 - e) * e * t
  55431. }
  55432. function i(e, t) {
  55433. return e * e * t
  55434. }
  55435. return function(n, r, o, a) {
  55436. return e(n, r) + t(n, o) + i(n, a)
  55437. }
  55438. }(),
  55439. b3: function() {
  55440. function e(e, t) {
  55441. var i = 1 - e;
  55442. return i * i * i * t
  55443. }
  55444. function t(e, t) {
  55445. var i = 1 - e;
  55446. return 3 * i * i * e * t
  55447. }
  55448. function i(e, t) {
  55449. var i = 1 - e;
  55450. return 3 * i * e * e * t
  55451. }
  55452. function n(e, t) {
  55453. return e * e * e * t
  55454. }
  55455. return function(r, o, a, s, l) {
  55456. return e(r, o) + t(r, a) + i(r, s) + n(r, l)
  55457. }
  55458. }()
  55459. },
  55460. n.Curve = function() {}
  55461. ,
  55462. n.Curve.prototype = {
  55463. constructor: n.Curve,
  55464. getPoint: function(e) {
  55465. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  55466. null
  55467. },
  55468. getPointAt: function(e) {
  55469. var t = this.getUtoTmapping(e);
  55470. return this.getPoint(t)
  55471. },
  55472. getPoints: function(e) {
  55473. e || (e = 5);
  55474. var t, i = [];
  55475. for (t = 0; t <= e; t++)
  55476. i.push(this.getPoint(t / e));
  55477. return i
  55478. },
  55479. getSpacedPoints: function(e) {
  55480. e || (e = 5);
  55481. var t, i = [];
  55482. for (t = 0; t <= e; t++)
  55483. i.push(this.getPointAt(t / e));
  55484. return i
  55485. },
  55486. getLength: function() {
  55487. var e = this.getLengths();
  55488. return e[e.length - 1]
  55489. },
  55490. getLengths: function(e) {
  55491. if (e || (e = this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  55492. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  55493. return this.cacheArcLengths;
  55494. this.needsUpdate = !1;
  55495. var t, i, n = [], r = this.getPoint(0), o = 0;
  55496. for (n.push(0),
  55497. i = 1; i <= e; i++)
  55498. t = this.getPoint(i / e),
  55499. o += t.distanceTo(r),
  55500. n.push(o),
  55501. r = t;
  55502. return this.cacheArcLengths = n,
  55503. n
  55504. },
  55505. updateArcLengths: function() {
  55506. this.needsUpdate = !0,
  55507. this.getLengths()
  55508. },
  55509. getUtoTmapping: function(e, t) {
  55510. var i, n = this.getLengths(), r = 0, o = n.length;
  55511. i = t ? t : e * n[o - 1];
  55512. for (var a, s = 0, l = o - 1; s <= l; )
  55513. if (r = Math.floor(s + (l - s) / 2),
  55514. a = n[r] - i,
  55515. a < 0)
  55516. s = r + 1;
  55517. else {
  55518. if (!(a > 0)) {
  55519. l = r;
  55520. break
  55521. }
  55522. l = r - 1
  55523. }
  55524. if (r = l,
  55525. n[r] === i) {
  55526. var c = r / (o - 1);
  55527. return c
  55528. }
  55529. var h = n[r]
  55530. , u = n[r + 1]
  55531. , d = u - h
  55532. , p = (i - h) / d
  55533. , c = (r + p) / (o - 1);
  55534. return c
  55535. },
  55536. getTangent: function(e) {
  55537. var t = 1e-4
  55538. , i = e - t
  55539. , n = e + t;
  55540. i < 0 && (i = 0),
  55541. n > 1 && (n = 1);
  55542. var r = this.getPoint(i)
  55543. , o = this.getPoint(n)
  55544. , a = o.clone().sub(r);
  55545. return a.normalize()
  55546. },
  55547. getTangentAt: function(e) {
  55548. var t = this.getUtoTmapping(e);
  55549. return this.getTangent(t)
  55550. }
  55551. },
  55552. n.Curve.create = function(e, t) {
  55553. return e.prototype = Object.create(n.Curve.prototype),
  55554. e.prototype.constructor = e,
  55555. e.prototype.getPoint = t,
  55556. e
  55557. }
  55558. ,
  55559. n.CurvePath = function() {
  55560. this.curves = [],
  55561. this.autoClose = !1
  55562. }
  55563. ,
  55564. n.CurvePath.prototype = Object.create(n.Curve.prototype),
  55565. n.CurvePath.prototype.constructor = n.CurvePath,
  55566. n.CurvePath.prototype.add = function(e) {
  55567. this.curves.push(e)
  55568. }
  55569. ,
  55570. n.CurvePath.prototype.closePath = function() {
  55571. var e = this.curves[0].getPoint(0)
  55572. , t = this.curves[this.curves.length - 1].getPoint(1);
  55573. e.equals(t) || this.curves.push(new n.LineCurve(t,e))
  55574. }
  55575. ,
  55576. n.CurvePath.prototype.getPoint = function(e) {
  55577. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  55578. if (i[n] >= t) {
  55579. var r = i[n] - t
  55580. , o = this.curves[n]
  55581. , a = 1 - r / o.getLength();
  55582. return o.getPointAt(a)
  55583. }
  55584. n++
  55585. }
  55586. return null
  55587. }
  55588. ,
  55589. n.CurvePath.prototype.getLength = function() {
  55590. var e = this.getCurveLengths();
  55591. return e[e.length - 1]
  55592. }
  55593. ,
  55594. n.CurvePath.prototype.getCurveLengths = function() {
  55595. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  55596. return this.cacheLengths;
  55597. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  55598. t += this.curves[i].getLength(),
  55599. e.push(t);
  55600. return this.cacheLengths = e,
  55601. e
  55602. }
  55603. ,
  55604. n.CurvePath.prototype.createPointsGeometry = function(e) {
  55605. var t = this.getPoints(e);
  55606. return this.createGeometry(t)
  55607. }
  55608. ,
  55609. n.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  55610. var t = this.getSpacedPoints(e);
  55611. return this.createGeometry(t)
  55612. }
  55613. ,
  55614. n.CurvePath.prototype.createGeometry = function(e) {
  55615. for (var t = new n.Geometry, i = 0, r = e.length; i < r; i++) {
  55616. var o = e[i];
  55617. t.vertices.push(new n.Vector3(o.x,o.y,o.z || 0))
  55618. }
  55619. return t
  55620. }
  55621. ,
  55622. n.Font = function(e) {
  55623. this.data = e
  55624. }
  55625. ,
  55626. n.Font.prototype = {
  55627. constructor: n.Font,
  55628. generateShapes: function(e, t, i) {
  55629. function r(e) {
  55630. for (var i = String(e).split(""), n = t / a.resolution, r = 0, s = [], l = 0; l < i.length; l++) {
  55631. var c = o(i[l], n, r);
  55632. r += c.offset,
  55633. s.push(c.path)
  55634. }
  55635. return s
  55636. }
  55637. function o(e, t, r) {
  55638. var o = a.glyphs[e] || a.glyphs["?"];
  55639. if (o) {
  55640. 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;
  55641. if (o.o)
  55642. for (var E = o._cachedOutline || (o._cachedOutline = o.o.split(" ")), b = 0, w = E.length; b < w; ) {
  55643. var _ = E[b++];
  55644. switch (_) {
  55645. case "m":
  55646. s = E[b++] * t + r,
  55647. l = E[b++] * t,
  55648. A.moveTo(s, l);
  55649. break;
  55650. case "l":
  55651. s = E[b++] * t + r,
  55652. l = E[b++] * t,
  55653. A.lineTo(s, l);
  55654. break;
  55655. case "q":
  55656. if (c = E[b++] * t + r,
  55657. h = E[b++] * t,
  55658. p = E[b++] * t + r,
  55659. f = E[b++] * t,
  55660. A.quadraticCurveTo(p, f, c, h),
  55661. v = y[y.length - 1]) {
  55662. u = v.x,
  55663. d = v.y;
  55664. for (var T = 1; T <= i; T++) {
  55665. var x = T / i;
  55666. C(x, u, p, c),
  55667. C(x, d, f, h)
  55668. }
  55669. }
  55670. break;
  55671. case "b":
  55672. if (c = E[b++] * t + r,
  55673. h = E[b++] * t,
  55674. p = E[b++] * t + r,
  55675. f = E[b++] * t,
  55676. g = E[b++] * t + r,
  55677. m = E[b++] * t,
  55678. A.bezierCurveTo(p, f, g, m, c, h),
  55679. v = y[y.length - 1]) {
  55680. u = v.x,
  55681. d = v.y;
  55682. for (var T = 1; T <= i; T++) {
  55683. var x = T / i;
  55684. I(x, u, p, g, c),
  55685. I(x, d, f, m, h)
  55686. }
  55687. }
  55688. }
  55689. }
  55690. return {
  55691. offset: o.ha * t,
  55692. path: A
  55693. }
  55694. }
  55695. }
  55696. void 0 === t && (t = 100),
  55697. void 0 === i && (i = 4);
  55698. for (var a = this.data, s = r(e), l = [], c = 0, h = s.length; c < h; c++)
  55699. Array.prototype.push.apply(l, s[c].toShapes());
  55700. return l
  55701. }
  55702. },
  55703. n.Path = function(e) {
  55704. n.CurvePath.call(this),
  55705. this.actions = [],
  55706. e && this.fromPoints(e)
  55707. }
  55708. ,
  55709. n.Path.prototype = Object.create(n.CurvePath.prototype),
  55710. n.Path.prototype.constructor = n.Path,
  55711. n.Path.prototype.fromPoints = function(e) {
  55712. this.moveTo(e[0].x, e[0].y);
  55713. for (var t = 1, i = e.length; t < i; t++)
  55714. this.lineTo(e[t].x, e[t].y)
  55715. }
  55716. ,
  55717. n.Path.prototype.moveTo = function(e, t) {
  55718. this.actions.push({
  55719. action: "moveTo",
  55720. args: [e, t]
  55721. })
  55722. }
  55723. ,
  55724. n.Path.prototype.lineTo = function(e, t) {
  55725. var i = this.actions[this.actions.length - 1].args
  55726. , r = i[i.length - 2]
  55727. , o = i[i.length - 1]
  55728. , a = new n.LineCurve(new n.Vector2(r,o),new n.Vector2(e,t));
  55729. this.curves.push(a),
  55730. this.actions.push({
  55731. action: "lineTo",
  55732. args: [e, t]
  55733. })
  55734. }
  55735. ,
  55736. n.Path.prototype.quadraticCurveTo = function(e, t, i, r) {
  55737. var o = this.actions[this.actions.length - 1].args
  55738. , a = o[o.length - 2]
  55739. , s = o[o.length - 1]
  55740. , l = new n.QuadraticBezierCurve(new n.Vector2(a,s),new n.Vector2(e,t),new n.Vector2(i,r));
  55741. this.curves.push(l),
  55742. this.actions.push({
  55743. action: "quadraticCurveTo",
  55744. args: [e, t, i, r]
  55745. })
  55746. }
  55747. ,
  55748. n.Path.prototype.bezierCurveTo = function(e, t, i, r, o, a) {
  55749. var s = this.actions[this.actions.length - 1].args
  55750. , l = s[s.length - 2]
  55751. , c = s[s.length - 1]
  55752. , h = new n.CubicBezierCurve(new n.Vector2(l,c),new n.Vector2(e,t),new n.Vector2(i,r),new n.Vector2(o,a));
  55753. this.curves.push(h),
  55754. this.actions.push({
  55755. action: "bezierCurveTo",
  55756. args: [e, t, i, r, o, a]
  55757. })
  55758. }
  55759. ,
  55760. n.Path.prototype.splineThru = function(e) {
  55761. var t = Array.prototype.slice.call(arguments)
  55762. , i = this.actions[this.actions.length - 1].args
  55763. , r = i[i.length - 2]
  55764. , o = i[i.length - 1]
  55765. , a = [new n.Vector2(r,o)];
  55766. Array.prototype.push.apply(a, e);
  55767. var s = new n.SplineCurve(a);
  55768. this.curves.push(s),
  55769. this.actions.push({
  55770. action: "splineThru",
  55771. args: t
  55772. })
  55773. }
  55774. ,
  55775. n.Path.prototype.arc = function(e, t, i, n, r, o) {
  55776. var a = this.actions[this.actions.length - 1].args
  55777. , s = a[a.length - 2]
  55778. , l = a[a.length - 1];
  55779. this.absarc(e + s, t + l, i, n, r, o)
  55780. }
  55781. ,
  55782. n.Path.prototype.absarc = function(e, t, i, n, r, o) {
  55783. this.absellipse(e, t, i, i, n, r, o)
  55784. }
  55785. ,
  55786. n.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  55787. var l = this.actions[this.actions.length - 1].args
  55788. , c = l[l.length - 2]
  55789. , h = l[l.length - 1];
  55790. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  55791. }
  55792. ,
  55793. n.Path.prototype.absellipse = function(e, t, i, r, o, a, s, l) {
  55794. var c = [e, t, i, r, o, a, s, l || 0]
  55795. , h = new n.EllipseCurve(e,t,i,r,o,a,s,l);
  55796. this.curves.push(h);
  55797. var u = h.getPoint(1);
  55798. c.push(u.x),
  55799. c.push(u.y),
  55800. this.actions.push({
  55801. action: "ellipse",
  55802. args: c
  55803. })
  55804. }
  55805. ,
  55806. n.Path.prototype.getSpacedPoints = function(e) {
  55807. e || (e = 40);
  55808. for (var t = [], i = 0; i < e; i++)
  55809. t.push(this.getPoint(i / e));
  55810. return this.autoClose && t.push(t[0]),
  55811. t
  55812. }
  55813. ,
  55814. n.Path.prototype.getPoints = function(e) {
  55815. e = e || 12;
  55816. 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++) {
  55817. var A = this.actions[m]
  55818. , y = A.action
  55819. , C = A.args;
  55820. switch (y) {
  55821. case "moveTo":
  55822. g.push(new n.Vector2(C[0],C[1]));
  55823. break;
  55824. case "lineTo":
  55825. g.push(new n.Vector2(C[0],C[1]));
  55826. break;
  55827. case "quadraticCurveTo":
  55828. t = C[2],
  55829. i = C[3],
  55830. a = C[0],
  55831. s = C[1],
  55832. g.length > 0 ? (h = g[g.length - 1],
  55833. l = h.x,
  55834. c = h.y) : (h = this.actions[m - 1].args,
  55835. l = h[h.length - 2],
  55836. c = h[h.length - 1]);
  55837. for (var I = 1; I <= e; I++) {
  55838. var E = I / e;
  55839. u = p(E, l, a, t),
  55840. d = p(E, c, s, i),
  55841. g.push(new n.Vector2(u,d))
  55842. }
  55843. break;
  55844. case "bezierCurveTo":
  55845. t = C[4],
  55846. i = C[5],
  55847. a = C[0],
  55848. s = C[1],
  55849. r = C[2],
  55850. o = C[3],
  55851. g.length > 0 ? (h = g[g.length - 1],
  55852. l = h.x,
  55853. c = h.y) : (h = this.actions[m - 1].args,
  55854. l = h[h.length - 2],
  55855. c = h[h.length - 1]);
  55856. for (var I = 1; I <= e; I++) {
  55857. var E = I / e;
  55858. u = f(E, l, a, r, t),
  55859. d = f(E, c, s, o, i),
  55860. g.push(new n.Vector2(u,d))
  55861. }
  55862. break;
  55863. case "splineThru":
  55864. h = this.actions[m - 1].args;
  55865. var b = new n.Vector2(h[h.length - 2],h[h.length - 1])
  55866. , w = [b]
  55867. , _ = e * C[0].length;
  55868. w = w.concat(C[0]);
  55869. for (var T = new n.SplineCurve(w), I = 1; I <= _; I++)
  55870. g.push(T.getPointAt(I / _));
  55871. break;
  55872. case "arc":
  55873. 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++) {
  55874. var E = I / N;
  55875. L || (E = 1 - E),
  55876. x = P + E * D,
  55877. u = S + R * Math.cos(x),
  55878. d = M + R * Math.sin(x),
  55879. g.push(new n.Vector2(u,d))
  55880. }
  55881. break;
  55882. case "ellipse":
  55883. 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;
  55884. 0 !== k && (B = Math.cos(k),
  55885. F = Math.sin(k));
  55886. for (var I = 1; I <= N; I++) {
  55887. var E = I / N;
  55888. if (L || (E = 1 - E),
  55889. x = P + E * D,
  55890. u = S + V * Math.cos(x),
  55891. d = M + U * Math.sin(x),
  55892. 0 !== k) {
  55893. var H = u
  55894. , G = d;
  55895. u = (H - S) * B - (G - M) * F + S,
  55896. d = (H - S) * F + (G - M) * B + M
  55897. }
  55898. g.push(new n.Vector2(u,d))
  55899. }
  55900. }
  55901. }
  55902. var z = g[g.length - 1];
  55903. 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),
  55904. this.autoClose && g.push(g[0]),
  55905. g
  55906. }
  55907. ,
  55908. n.Path.prototype.toShapes = function(e, t) {
  55909. function i(e) {
  55910. for (var t = [], i = new n.Path, r = 0, o = e.length; r < o; r++) {
  55911. var a = e[r]
  55912. , s = a.args
  55913. , l = a.action;
  55914. "moveTo" === l && 0 !== i.actions.length && (t.push(i),
  55915. i = new n.Path),
  55916. i[l].apply(i, s)
  55917. }
  55918. return 0 !== i.actions.length && t.push(i),
  55919. t
  55920. }
  55921. function r(e) {
  55922. for (var t = [], i = 0, r = e.length; i < r; i++) {
  55923. var o = e[i]
  55924. , a = new n.Shape;
  55925. a.actions = o.actions,
  55926. a.curves = o.curves,
  55927. t.push(a)
  55928. }
  55929. return t
  55930. }
  55931. function o(e, t) {
  55932. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  55933. var a = t[r]
  55934. , s = t[o]
  55935. , l = s.x - a.x
  55936. , c = s.y - a.y;
  55937. if (Math.abs(c) > Number.EPSILON) {
  55938. if (c < 0 && (a = t[o],
  55939. l = -l,
  55940. s = t[r],
  55941. c = -c),
  55942. e.y < a.y || e.y > s.y)
  55943. continue;
  55944. if (e.y === a.y) {
  55945. if (e.x === a.x)
  55946. return !0
  55947. } else {
  55948. var h = c * (e.x - a.x) - l * (e.y - a.y);
  55949. if (0 === h)
  55950. return !0;
  55951. if (h < 0)
  55952. continue;
  55953. n = !n
  55954. }
  55955. } else {
  55956. if (e.y !== a.y)
  55957. continue;
  55958. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  55959. return !0
  55960. }
  55961. }
  55962. return n
  55963. }
  55964. var a = n.ShapeUtils.isClockWise
  55965. , s = i(this.actions);
  55966. if (0 === s.length)
  55967. return [];
  55968. if (t === !0)
  55969. return r(s);
  55970. var l, c, h, u = [];
  55971. if (1 === s.length)
  55972. return c = s[0],
  55973. h = new n.Shape,
  55974. h.actions = c.actions,
  55975. h.curves = c.curves,
  55976. u.push(h),
  55977. u;
  55978. var d = !a(s[0].getPoints());
  55979. d = e ? !d : d;
  55980. var p, f = [], g = [], m = [], v = 0;
  55981. g[v] = void 0,
  55982. m[v] = [];
  55983. for (var A = 0, y = s.length; A < y; A++)
  55984. c = s[A],
  55985. p = c.getPoints(),
  55986. l = a(p),
  55987. l = e ? !l : l,
  55988. l ? (!d && g[v] && v++,
  55989. g[v] = {
  55990. s: new n.Shape,
  55991. p: p
  55992. },
  55993. g[v].s.actions = c.actions,
  55994. g[v].s.curves = c.curves,
  55995. d && v++,
  55996. m[v] = []) : m[v].push({
  55997. h: c,
  55998. p: p[0]
  55999. });
  56000. if (!g[0])
  56001. return r(s);
  56002. if (g.length > 1) {
  56003. for (var C = !1, I = [], E = 0, b = g.length; E < b; E++)
  56004. f[E] = [];
  56005. for (var E = 0, b = g.length; E < b; E++)
  56006. for (var w = m[E], _ = 0; _ < w.length; _++) {
  56007. for (var T = w[_], x = !0, S = 0; S < g.length; S++)
  56008. o(T.p, g[S].p) && (E !== S && I.push({
  56009. froms: E,
  56010. tos: S,
  56011. hole: _
  56012. }),
  56013. x ? (x = !1,
  56014. f[S].push(T)) : C = !0);
  56015. x && f[E].push(T)
  56016. }
  56017. I.length > 0 && (C || (m = f))
  56018. }
  56019. for (var M, A = 0, R = g.length; A < R; A++) {
  56020. h = g[A].s,
  56021. u.push(h),
  56022. M = m[A];
  56023. for (var P = 0, O = M.length; P < O; P++)
  56024. h.holes.push(M[P].h)
  56025. }
  56026. return u
  56027. }
  56028. ,
  56029. n.Shape = function() {
  56030. n.Path.apply(this, arguments),
  56031. this.holes = []
  56032. }
  56033. ,
  56034. n.Shape.prototype = Object.create(n.Path.prototype),
  56035. n.Shape.prototype.constructor = n.Shape,
  56036. n.Shape.prototype.extrude = function(e) {
  56037. return new n.ExtrudeGeometry(this,e)
  56038. }
  56039. ,
  56040. n.Shape.prototype.makeGeometry = function(e) {
  56041. return new n.ShapeGeometry(this,e)
  56042. }
  56043. ,
  56044. n.Shape.prototype.getPointsHoles = function(e) {
  56045. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  56046. t[i] = this.holes[i].getPoints(e);
  56047. return t
  56048. }
  56049. ,
  56050. n.Shape.prototype.extractAllPoints = function(e) {
  56051. return {
  56052. shape: this.getPoints(e),
  56053. holes: this.getPointsHoles(e)
  56054. }
  56055. }
  56056. ,
  56057. n.Shape.prototype.extractPoints = function(e) {
  56058. return this.extractAllPoints(e)
  56059. }
  56060. ,
  56061. n.LineCurve = function(e, t) {
  56062. this.v1 = e,
  56063. this.v2 = t
  56064. }
  56065. ,
  56066. n.LineCurve.prototype = Object.create(n.Curve.prototype),
  56067. n.LineCurve.prototype.constructor = n.LineCurve,
  56068. n.LineCurve.prototype.getPoint = function(e) {
  56069. var t = this.v2.clone().sub(this.v1);
  56070. return t.multiplyScalar(e).add(this.v1),
  56071. t
  56072. }
  56073. ,
  56074. n.LineCurve.prototype.getPointAt = function(e) {
  56075. return this.getPoint(e)
  56076. }
  56077. ,
  56078. n.LineCurve.prototype.getTangent = function(e) {
  56079. var t = this.v2.clone().sub(this.v1);
  56080. return t.normalize()
  56081. }
  56082. ,
  56083. n.QuadraticBezierCurve = function(e, t, i) {
  56084. this.v0 = e,
  56085. this.v1 = t,
  56086. this.v2 = i
  56087. }
  56088. ,
  56089. n.QuadraticBezierCurve.prototype = Object.create(n.Curve.prototype),
  56090. n.QuadraticBezierCurve.prototype.constructor = n.QuadraticBezierCurve,
  56091. n.QuadraticBezierCurve.prototype.getPoint = function(e) {
  56092. var t = n.ShapeUtils.b2;
  56093. 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))
  56094. }
  56095. ,
  56096. n.QuadraticBezierCurve.prototype.getTangent = function(e) {
  56097. var t = n.CurveUtils.tangentQuadraticBezier;
  56098. 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()
  56099. }
  56100. ,
  56101. n.CubicBezierCurve = function(e, t, i, n) {
  56102. this.v0 = e,
  56103. this.v1 = t,
  56104. this.v2 = i,
  56105. this.v3 = n
  56106. }
  56107. ,
  56108. n.CubicBezierCurve.prototype = Object.create(n.Curve.prototype),
  56109. n.CubicBezierCurve.prototype.constructor = n.CubicBezierCurve,
  56110. n.CubicBezierCurve.prototype.getPoint = function(e) {
  56111. var t = n.ShapeUtils.b3;
  56112. 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))
  56113. }
  56114. ,
  56115. n.CubicBezierCurve.prototype.getTangent = function(e) {
  56116. var t = n.CurveUtils.tangentCubicBezier;
  56117. 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()
  56118. }
  56119. ,
  56120. n.SplineCurve = function(e) {
  56121. this.points = void 0 == e ? [] : e
  56122. }
  56123. ,
  56124. n.SplineCurve.prototype = Object.create(n.Curve.prototype),
  56125. n.SplineCurve.prototype.constructor = n.SplineCurve,
  56126. n.SplineCurve.prototype.getPoint = function(e) {
  56127. var t = this.points
  56128. , i = (t.length - 1) * e
  56129. , r = Math.floor(i)
  56130. , o = i - r
  56131. , a = t[0 === r ? r : r - 1]
  56132. , s = t[r]
  56133. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  56134. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  56135. , h = n.CurveUtils.interpolate;
  56136. return new n.Vector2(h(a.x, s.x, l.x, c.x, o),h(a.y, s.y, l.y, c.y, o))
  56137. }
  56138. ,
  56139. n.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  56140. this.aX = e,
  56141. this.aY = t,
  56142. this.xRadius = i,
  56143. this.yRadius = n,
  56144. this.aStartAngle = r,
  56145. this.aEndAngle = o,
  56146. this.aClockwise = a,
  56147. this.aRotation = s || 0
  56148. }
  56149. ,
  56150. n.EllipseCurve.prototype = Object.create(n.Curve.prototype),
  56151. n.EllipseCurve.prototype.constructor = n.EllipseCurve,
  56152. n.EllipseCurve.prototype.getPoint = function(e) {
  56153. var t = this.aEndAngle - this.aStartAngle;
  56154. t < 0 && (t += 2 * Math.PI),
  56155. t > 2 * Math.PI && (t -= 2 * Math.PI);
  56156. var i;
  56157. i = this.aClockwise === !0 ? this.aEndAngle + (1 - e) * (2 * Math.PI - t) : this.aStartAngle + e * t;
  56158. var r = this.aX + this.xRadius * Math.cos(i)
  56159. , o = this.aY + this.yRadius * Math.sin(i);
  56160. if (0 !== this.aRotation) {
  56161. var a = Math.cos(this.aRotation)
  56162. , s = Math.sin(this.aRotation)
  56163. , l = r
  56164. , c = o;
  56165. r = (l - this.aX) * a - (c - this.aY) * s + this.aX,
  56166. o = (l - this.aX) * s + (c - this.aY) * a + this.aY
  56167. }
  56168. return new n.Vector2(r,o)
  56169. }
  56170. ,
  56171. n.ArcCurve = function(e, t, i, r, o, a) {
  56172. n.EllipseCurve.call(this, e, t, i, i, r, o, a)
  56173. }
  56174. ,
  56175. n.ArcCurve.prototype = Object.create(n.EllipseCurve.prototype),
  56176. n.ArcCurve.prototype.constructor = n.ArcCurve,
  56177. n.LineCurve3 = n.Curve.create(function(e, t) {
  56178. this.v1 = e,
  56179. this.v2 = t
  56180. }, function(e) {
  56181. var t = new n.Vector3;
  56182. return t.subVectors(this.v2, this.v1),
  56183. t.multiplyScalar(e),
  56184. t.add(this.v1),
  56185. t
  56186. }),
  56187. n.QuadraticBezierCurve3 = n.Curve.create(function(e, t, i) {
  56188. this.v0 = e,
  56189. this.v1 = t,
  56190. this.v2 = i
  56191. }, function(e) {
  56192. var t = n.ShapeUtils.b2;
  56193. 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))
  56194. }),
  56195. n.CubicBezierCurve3 = n.Curve.create(function(e, t, i, n) {
  56196. this.v0 = e,
  56197. this.v1 = t,
  56198. this.v2 = i,
  56199. this.v3 = n
  56200. }, function(e) {
  56201. var t = n.ShapeUtils.b3;
  56202. 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))
  56203. }),
  56204. n.SplineCurve3 = n.Curve.create(function(e) {
  56205. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  56206. this.points = void 0 == e ? [] : e
  56207. }, function(e) {
  56208. var t = this.points
  56209. , i = (t.length - 1) * e
  56210. , r = Math.floor(i)
  56211. , o = i - r
  56212. , a = t[0 == r ? r : r - 1]
  56213. , s = t[r]
  56214. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  56215. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  56216. , h = n.CurveUtils.interpolate;
  56217. 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))
  56218. }),
  56219. n.CatmullRomCurve3 = function() {
  56220. function e() {}
  56221. var t = new n.Vector3
  56222. , i = new e
  56223. , r = new e
  56224. , o = new e;
  56225. return e.prototype.init = function(e, t, i, n) {
  56226. this.c0 = e,
  56227. this.c1 = i,
  56228. this.c2 = -3 * e + 3 * t - 2 * i - n,
  56229. this.c3 = 2 * e - 2 * t + i + n
  56230. }
  56231. ,
  56232. e.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  56233. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  56234. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  56235. s *= o,
  56236. l *= o,
  56237. this.init(t, i, s, l)
  56238. }
  56239. ,
  56240. e.prototype.initCatmullRom = function(e, t, i, n, r) {
  56241. this.init(t, i, r * (i - e), r * (n - t))
  56242. }
  56243. ,
  56244. e.prototype.calc = function(e) {
  56245. var t = e * e
  56246. , i = t * e;
  56247. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  56248. }
  56249. ,
  56250. n.Curve.create(function(e) {
  56251. this.points = e || [],
  56252. this.closed = !1
  56253. }, function(e) {
  56254. var a, s, l, c, h = this.points;
  56255. c = h.length,
  56256. c < 2 && console.log("duh, you need at least 2 points"),
  56257. a = (c - (this.closed ? 0 : 1)) * e,
  56258. s = Math.floor(a),
  56259. l = a - s,
  56260. this.closed ? s += s > 0 ? 0 : (Math.floor(Math.abs(s) / h.length) + 1) * h.length : 0 === l && s === c - 1 && (s = c - 2,
  56261. l = 1);
  56262. var u, d, p, f;
  56263. if (this.closed || s > 0 ? u = h[(s - 1) % c] : (t.subVectors(h[0], h[1]).add(h[0]),
  56264. u = t),
  56265. d = h[s % c],
  56266. p = h[(s + 1) % c],
  56267. this.closed || s + 2 < c ? f = h[(s + 2) % c] : (t.subVectors(h[c - 1], h[c - 2]).add(h[c - 1]),
  56268. f = t),
  56269. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  56270. var g = "chordal" === this.type ? .5 : .25
  56271. , m = Math.pow(u.distanceToSquared(d), g)
  56272. , v = Math.pow(d.distanceToSquared(p), g)
  56273. , A = Math.pow(p.distanceToSquared(f), g);
  56274. v < 1e-4 && (v = 1),
  56275. m < 1e-4 && (m = v),
  56276. A < 1e-4 && (A = v),
  56277. i.initNonuniformCatmullRom(u.x, d.x, p.x, f.x, m, v, A),
  56278. r.initNonuniformCatmullRom(u.y, d.y, p.y, f.y, m, v, A),
  56279. o.initNonuniformCatmullRom(u.z, d.z, p.z, f.z, m, v, A)
  56280. } else if ("catmullrom" === this.type) {
  56281. var y = void 0 !== this.tension ? this.tension : .5;
  56282. i.initCatmullRom(u.x, d.x, p.x, f.x, y),
  56283. r.initCatmullRom(u.y, d.y, p.y, f.y, y),
  56284. o.initCatmullRom(u.z, d.z, p.z, f.z, y)
  56285. }
  56286. var C = new n.Vector3(i.calc(l),r.calc(l),o.calc(l));
  56287. return C
  56288. })
  56289. }(),
  56290. n.ClosedSplineCurve3 = function(e) {
  56291. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  56292. n.CatmullRomCurve3.call(this, e),
  56293. this.type = "catmullrom",
  56294. this.closed = !0
  56295. }
  56296. ,
  56297. n.ClosedSplineCurve3.prototype = Object.create(n.CatmullRomCurve3.prototype),
  56298. n.BoxGeometry = function(e, t, i, r, o, a) {
  56299. n.Geometry.call(this),
  56300. this.type = "BoxGeometry",
  56301. this.parameters = {
  56302. width: e,
  56303. height: t,
  56304. depth: i,
  56305. widthSegments: r,
  56306. heightSegments: o,
  56307. depthSegments: a
  56308. },
  56309. this.fromBufferGeometry(new n.BoxBufferGeometry(e,t,i,r,o,a)),
  56310. this.mergeVertices()
  56311. }
  56312. ,
  56313. n.BoxGeometry.prototype = Object.create(n.Geometry.prototype),
  56314. n.BoxGeometry.prototype.constructor = n.BoxGeometry,
  56315. n.CubeGeometry = n.BoxGeometry,
  56316. n.BoxBufferGeometry = function(e, t, i, r, o, a) {
  56317. function s(e, t, i) {
  56318. var n = 0;
  56319. return n += e * t * 2,
  56320. n += e * i * 2,
  56321. n += i * t * 2,
  56322. 4 * n
  56323. }
  56324. function l(e, t, i, r, o, a, s, l, h, u, I) {
  56325. 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++)
  56326. for (var L = O * b - _, D = 0; D < x; D++) {
  56327. var N = D * E - w;
  56328. P[e] = N * r,
  56329. P[t] = L * o,
  56330. P[i] = T,
  56331. p[m] = P.x,
  56332. p[m + 1] = P.y,
  56333. p[m + 2] = P.z,
  56334. P[e] = 0,
  56335. P[t] = 0,
  56336. P[i] = l > 0 ? 1 : -1,
  56337. f[m] = P.x,
  56338. f[m + 1] = P.y,
  56339. f[m + 2] = P.z,
  56340. g[v] = D / h,
  56341. g[v + 1] = 1 - O / u,
  56342. m += 3,
  56343. v += 2,
  56344. M += 1
  56345. }
  56346. for (O = 0; O < u; O++)
  56347. for (D = 0; D < h; D++) {
  56348. var B = y + D + x * O
  56349. , F = y + D + x * (O + 1)
  56350. , V = y + (D + 1) + x * (O + 1)
  56351. , U = y + (D + 1) + x * O;
  56352. d[A] = B,
  56353. d[A + 1] = F,
  56354. d[A + 2] = U,
  56355. d[A + 3] = F,
  56356. d[A + 4] = V,
  56357. d[A + 5] = U,
  56358. A += 6,
  56359. R += 6
  56360. }
  56361. c.addGroup(C, R, I),
  56362. C += R,
  56363. y += M
  56364. }
  56365. n.BufferGeometry.call(this),
  56366. this.type = "BoxBufferGeometry",
  56367. this.parameters = {
  56368. width: e,
  56369. height: t,
  56370. depth: i,
  56371. widthSegments: r,
  56372. heightSegments: o,
  56373. depthSegments: a
  56374. };
  56375. var c = this;
  56376. r = Math.floor(r) || 1,
  56377. o = Math.floor(o) || 1,
  56378. a = Math.floor(a) || 1;
  56379. var h = s(r, o, a)
  56380. , u = h / 4 * 6
  56381. , d = new (u > 65535 ? Uint32Array : Uint16Array)(u)
  56382. , p = new Float32Array(3 * h)
  56383. , f = new Float32Array(3 * h)
  56384. , g = new Float32Array(2 * h)
  56385. , m = 0
  56386. , v = 0
  56387. , A = 0
  56388. , y = 0
  56389. , C = 0;
  56390. l("z", "y", "x", -1, -1, i, t, e, a, o, 0),
  56391. l("z", "y", "x", 1, -1, i, t, -e, a, o, 1),
  56392. l("x", "z", "y", 1, 1, e, i, t, r, a, 2),
  56393. l("x", "z", "y", 1, -1, e, i, -t, r, a, 3),
  56394. l("x", "y", "z", 1, -1, e, t, i, r, o, 4),
  56395. l("x", "y", "z", -1, -1, e, t, -i, r, o, 5),
  56396. this.setIndex(new n.BufferAttribute(d,1)),
  56397. this.addAttribute("position", new n.BufferAttribute(p,3)),
  56398. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  56399. this.addAttribute("uv", new n.BufferAttribute(g,2))
  56400. }
  56401. ,
  56402. n.BoxBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56403. n.BoxBufferGeometry.prototype.constructor = n.BoxBufferGeometry,
  56404. n.CircleGeometry = function(e, t, i, r) {
  56405. n.Geometry.call(this),
  56406. this.type = "CircleGeometry",
  56407. this.parameters = {
  56408. radius: e,
  56409. segments: t,
  56410. thetaStart: i,
  56411. thetaLength: r
  56412. },
  56413. this.fromBufferGeometry(new n.CircleBufferGeometry(e,t,i,r))
  56414. }
  56415. ,
  56416. n.CircleGeometry.prototype = Object.create(n.Geometry.prototype),
  56417. n.CircleGeometry.prototype.constructor = n.CircleGeometry,
  56418. n.CircleBufferGeometry = function(e, t, i, r) {
  56419. n.BufferGeometry.call(this),
  56420. this.type = "CircleBufferGeometry",
  56421. this.parameters = {
  56422. radius: e,
  56423. segments: t,
  56424. thetaStart: i,
  56425. thetaLength: r
  56426. },
  56427. e = e || 50,
  56428. t = void 0 !== t ? Math.max(3, t) : 8,
  56429. i = void 0 !== i ? i : 0,
  56430. r = void 0 !== r ? r : 2 * Math.PI;
  56431. var o = t + 2
  56432. , a = new Float32Array(3 * o)
  56433. , s = new Float32Array(3 * o)
  56434. , l = new Float32Array(2 * o);
  56435. s[2] = 1,
  56436. l[0] = .5,
  56437. l[1] = .5;
  56438. for (var c = 0, h = 3, u = 2; c <= t; c++,
  56439. h += 3,
  56440. u += 2) {
  56441. var d = i + c / t * r;
  56442. a[h] = e * Math.cos(d),
  56443. a[h + 1] = e * Math.sin(d),
  56444. s[h + 2] = 1,
  56445. l[u] = (a[h] / e + 1) / 2,
  56446. l[u + 1] = (a[h + 1] / e + 1) / 2
  56447. }
  56448. for (var p = [], h = 1; h <= t; h++)
  56449. p.push(h, h + 1, 0);
  56450. this.setIndex(new n.BufferAttribute(new Uint16Array(p),1)),
  56451. this.addAttribute("position", new n.BufferAttribute(a,3)),
  56452. this.addAttribute("normal", new n.BufferAttribute(s,3)),
  56453. this.addAttribute("uv", new n.BufferAttribute(l,2)),
  56454. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  56455. }
  56456. ,
  56457. n.CircleBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56458. n.CircleBufferGeometry.prototype.constructor = n.CircleBufferGeometry,
  56459. n.CylinderBufferGeometry = function(e, t, i, r, o, a, s, l) {
  56460. function c() {
  56461. var e = (r + 1) * (o + 1);
  56462. return a === !1 && (e += 2 * (r + 1) + 2 * r),
  56463. e
  56464. }
  56465. function h() {
  56466. var e = r * o * 2 * 3;
  56467. return a === !1 && (e += 2 * r * 3),
  56468. e
  56469. }
  56470. function u() {
  56471. var a, c, h = new n.Vector3, u = new n.Vector3, d = (t - e) / i;
  56472. for (c = 0; c <= o; c++) {
  56473. var p = []
  56474. , f = c / o
  56475. , b = f * (t - e) + e;
  56476. for (a = 0; a <= r; a++) {
  56477. var w = a / r;
  56478. u.x = b * Math.sin(w * l + s),
  56479. u.y = -f * i + E,
  56480. u.z = b * Math.cos(w * l + s),
  56481. m.setXYZ(y, u.x, u.y, u.z),
  56482. h.copy(u),
  56483. (0 === e && 0 === c || 0 === t && c === o) && (h.x = Math.sin(w * l + s),
  56484. h.z = Math.cos(w * l + s)),
  56485. h.setY(Math.sqrt(h.x * h.x + h.z * h.z) * d).normalize(),
  56486. v.setXYZ(y, h.x, h.y, h.z),
  56487. A.setXY(y, w, 1 - f),
  56488. p.push(y),
  56489. y++
  56490. }
  56491. I.push(p)
  56492. }
  56493. for (a = 0; a < r; a++)
  56494. for (c = 0; c < o; c++) {
  56495. var _ = I[c][a]
  56496. , T = I[c + 1][a]
  56497. , x = I[c + 1][a + 1]
  56498. , S = I[c][a + 1];
  56499. g.setX(C, _),
  56500. C++,
  56501. g.setX(C, T),
  56502. C++,
  56503. g.setX(C, S),
  56504. C++,
  56505. g.setX(C, T),
  56506. C++,
  56507. g.setX(C, x),
  56508. C++,
  56509. g.setX(C, S),
  56510. C++
  56511. }
  56512. }
  56513. function d(i) {
  56514. var o, a, c, h = new n.Vector2, u = new n.Vector3, d = i === !0 ? e : t, p = i === !0 ? 1 : -1;
  56515. for (a = y,
  56516. o = 1; o <= r; o++)
  56517. m.setXYZ(y, 0, E * p, 0),
  56518. v.setXYZ(y, 0, p, 0),
  56519. i === !0 ? (h.x = o / r,
  56520. h.y = 0) : (h.x = (o - 1) / r,
  56521. h.y = 1),
  56522. A.setXY(y, h.x, h.y),
  56523. y++;
  56524. for (c = y,
  56525. o = 0; o <= r; o++) {
  56526. var f = o / r;
  56527. u.x = d * Math.sin(f * l + s),
  56528. u.y = E * p,
  56529. u.z = d * Math.cos(f * l + s),
  56530. m.setXYZ(y, u.x, u.y, u.z),
  56531. v.setXYZ(y, 0, p, 0),
  56532. A.setXY(y, f, i === !0 ? 1 : 0),
  56533. y++
  56534. }
  56535. for (o = 0; o < r; o++) {
  56536. var I = a + o
  56537. , b = c + o;
  56538. i === !0 ? (g.setX(C, b),
  56539. C++,
  56540. g.setX(C, b + 1),
  56541. C++,
  56542. g.setX(C, I),
  56543. C++) : (g.setX(C, b + 1),
  56544. C++,
  56545. g.setX(C, b),
  56546. C++,
  56547. g.setX(C, I),
  56548. C++)
  56549. }
  56550. }
  56551. n.BufferGeometry.call(this),
  56552. this.type = "CylinderBufferGeometry",
  56553. this.parameters = {
  56554. radiusTop: e,
  56555. radiusBottom: t,
  56556. height: i,
  56557. radialSegments: r,
  56558. heightSegments: o,
  56559. openEnded: a,
  56560. thetaStart: s,
  56561. thetaLength: l
  56562. },
  56563. e = void 0 !== e ? e : 20,
  56564. t = void 0 !== t ? t : 20,
  56565. i = void 0 !== i ? i : 100,
  56566. r = Math.floor(r) || 8,
  56567. o = Math.floor(o) || 1,
  56568. a = void 0 !== a && a,
  56569. s = void 0 !== s ? s : 0,
  56570. l = void 0 !== l ? l : 2 * Math.PI;
  56571. var p = c()
  56572. , f = h()
  56573. , g = new n.BufferAttribute(new (f > 65535 ? Uint32Array : Uint16Array)(f),1)
  56574. , m = new n.BufferAttribute(new Float32Array(3 * p),3)
  56575. , v = new n.BufferAttribute(new Float32Array(3 * p),3)
  56576. , A = new n.BufferAttribute(new Float32Array(2 * p),2)
  56577. , y = 0
  56578. , C = 0
  56579. , I = []
  56580. , E = i / 2;
  56581. u(),
  56582. a === !1 && (e > 0 && d(!0),
  56583. t > 0 && d(!1)),
  56584. this.setIndex(g),
  56585. this.addAttribute("position", m),
  56586. this.addAttribute("normal", v),
  56587. this.addAttribute("uv", A)
  56588. }
  56589. ,
  56590. n.CylinderBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56591. n.CylinderBufferGeometry.prototype.constructor = n.CylinderBufferGeometry,
  56592. n.CylinderGeometry = function(e, t, i, r, o, a, s, l) {
  56593. n.Geometry.call(this),
  56594. this.type = "CylinderGeometry",
  56595. this.parameters = {
  56596. radiusTop: e,
  56597. radiusBottom: t,
  56598. height: i,
  56599. radialSegments: r,
  56600. heightSegments: o,
  56601. openEnded: a,
  56602. thetaStart: s,
  56603. thetaLength: l
  56604. },
  56605. this.fromBufferGeometry(new n.CylinderBufferGeometry(e,t,i,r,o,a,s,l)),
  56606. this.mergeVertices()
  56607. }
  56608. ,
  56609. n.CylinderGeometry.prototype = Object.create(n.Geometry.prototype),
  56610. n.CylinderGeometry.prototype.constructor = n.CylinderGeometry,
  56611. n.EdgesGeometry = function(e, t) {
  56612. function i(e, t) {
  56613. return e - t
  56614. }
  56615. n.BufferGeometry.call(this),
  56616. t = void 0 !== t ? t : 1;
  56617. var r, o = Math.cos(n.Math.degToRad(t)), a = [0, 0], s = {}, l = ["a", "b", "c"];
  56618. e instanceof n.BufferGeometry ? (r = new n.Geometry,
  56619. r.fromBufferGeometry(e)) : r = e.clone(),
  56620. r.mergeVertices(),
  56621. r.computeFaceNormals();
  56622. for (var c = r.vertices, h = r.faces, u = 0, d = h.length; u < d; u++)
  56623. for (var p = h[u], f = 0; f < 3; f++) {
  56624. a[0] = p[l[f]],
  56625. a[1] = p[l[(f + 1) % 3]],
  56626. a.sort(i);
  56627. var g = a.toString();
  56628. void 0 === s[g] ? s[g] = {
  56629. vert1: a[0],
  56630. vert2: a[1],
  56631. face1: u,
  56632. face2: void 0
  56633. } : s[g].face2 = u
  56634. }
  56635. var m = [];
  56636. for (var g in s) {
  56637. var v = s[g];
  56638. if (void 0 === v.face2 || h[v.face1].normal.dot(h[v.face2].normal) <= o) {
  56639. var A = c[v.vert1];
  56640. m.push(A.x),
  56641. m.push(A.y),
  56642. m.push(A.z),
  56643. A = c[v.vert2],
  56644. m.push(A.x),
  56645. m.push(A.y),
  56646. m.push(A.z)
  56647. }
  56648. }
  56649. this.addAttribute("position", new n.BufferAttribute(new Float32Array(m),3))
  56650. }
  56651. ,
  56652. n.EdgesGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56653. n.EdgesGeometry.prototype.constructor = n.EdgesGeometry,
  56654. n.ExtrudeGeometry = function(e, t) {
  56655. return "undefined" == typeof e ? void (e = []) : (n.Geometry.call(this),
  56656. this.type = "ExtrudeGeometry",
  56657. e = Array.isArray(e) ? e : [e],
  56658. this.addShapeList(e, t),
  56659. void this.computeFaceNormals())
  56660. }
  56661. ;
  56662. n.ExtrudeGeometry.prototype = Object.create(n.Geometry.prototype);
  56663. n.ExtrudeGeometry.prototype.constructor = n.ExtrudeGeometry,
  56664. n.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  56665. for (var i = e.length, n = 0; n < i; n++) {
  56666. var r = e[n];
  56667. this.addShape(r, t)
  56668. }
  56669. }
  56670. ,
  56671. n.ExtrudeGeometry.prototype.addShape = function(e, t) {
  56672. function i(e, t, i) {
  56673. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  56674. t.clone().multiplyScalar(i).add(e)
  56675. }
  56676. function r(e, t, i) {
  56677. 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;
  56678. if (Math.abs(d) > Number.EPSILON) {
  56679. var p = Math.sqrt(u)
  56680. , f = Math.sqrt(c * c + h * h)
  56681. , g = t.x - l / p
  56682. , m = t.y + s / p
  56683. , v = i.x - h / f
  56684. , A = i.y + c / f
  56685. , y = ((v - g) * h - (A - m) * c) / (s * h - l * c);
  56686. r = g + s * y - e.x,
  56687. o = m + l * y - e.y;
  56688. var C = r * r + o * o;
  56689. if (C <= 2)
  56690. return new n.Vector2(r,o);
  56691. a = Math.sqrt(C / 2)
  56692. } else {
  56693. var I = !1;
  56694. s > Number.EPSILON ? c > Number.EPSILON && (I = !0) : s < -Number.EPSILON ? c < -Number.EPSILON && (I = !0) : Math.sign(l) === Math.sign(h) && (I = !0),
  56695. I ? (r = -l,
  56696. o = s,
  56697. a = Math.sqrt(u)) : (r = s,
  56698. o = l,
  56699. a = Math.sqrt(u / 2))
  56700. }
  56701. return new n.Vector2(r / a,o / a)
  56702. }
  56703. function o() {
  56704. if (C) {
  56705. var e = 0
  56706. , t = z * e;
  56707. for (Y = 0; Y < W; Y++)
  56708. G = N[Y],
  56709. c(G[2] + t, G[1] + t, G[0] + t);
  56710. for (e = E + 2 * y,
  56711. t = z * e,
  56712. Y = 0; Y < W; Y++)
  56713. G = N[Y],
  56714. c(G[0] + t, G[1] + t, G[2] + t)
  56715. } else {
  56716. for (Y = 0; Y < W; Y++)
  56717. G = N[Y],
  56718. c(G[2], G[1], G[0]);
  56719. for (Y = 0; Y < W; Y++)
  56720. G = N[Y],
  56721. c(G[0] + z * E, G[1] + z * E, G[2] + z * E)
  56722. }
  56723. }
  56724. function a() {
  56725. var e = 0;
  56726. for (s(B, e),
  56727. e += B.length,
  56728. x = 0,
  56729. S = L.length; x < S; x++)
  56730. T = L[x],
  56731. s(T, e),
  56732. e += T.length
  56733. }
  56734. function s(e, t) {
  56735. var i, n;
  56736. for (Y = e.length; --Y >= 0; ) {
  56737. i = Y,
  56738. n = Y - 1,
  56739. n < 0 && (n = e.length - 1);
  56740. var r = 0
  56741. , o = E + 2 * y;
  56742. for (r = 0; r < o; r++) {
  56743. var a = z * r
  56744. , s = z * (r + 1)
  56745. , l = t + i + a
  56746. , c = t + n + a
  56747. , u = t + n + s
  56748. , d = t + i + s;
  56749. h(l, c, u, d, e, r, o, i, n)
  56750. }
  56751. }
  56752. }
  56753. function l(e, t, i) {
  56754. M.vertices.push(new n.Vector3(e,t,i))
  56755. }
  56756. function c(e, t, i) {
  56757. e += R,
  56758. t += R,
  56759. i += R,
  56760. M.faces.push(new n.Face3(e,t,i,null,null,0));
  56761. var r = _.generateTopUV(M, e, t, i);
  56762. M.faceVertexUvs[0].push(r)
  56763. }
  56764. function h(e, t, i, r, o, a, s, l, c) {
  56765. e += R,
  56766. t += R,
  56767. i += R,
  56768. r += R,
  56769. M.faces.push(new n.Face3(e,t,r,null,null,1)),
  56770. M.faces.push(new n.Face3(t,i,r,null,null,1));
  56771. var h = _.generateSideWallUV(M, e, t, i, r);
  56772. M.faceVertexUvs[0].push([h[0], h[1], h[3]]),
  56773. M.faceVertexUvs[0].push([h[1], h[2], h[3]])
  56774. }
  56775. 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;
  56776. b && (u = b.getSpacedPoints(E),
  56777. w = !0,
  56778. C = !1,
  56779. d = void 0 !== t.frames ? t.frames : new n.TubeGeometry.FrenetFrames(b,E,!1),
  56780. p = new n.Vector3,
  56781. f = new n.Vector3,
  56782. g = new n.Vector3),
  56783. C || (y = 0,
  56784. v = 0,
  56785. A = 0);
  56786. 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);
  56787. if (D) {
  56788. for (O = O.reverse(),
  56789. x = 0,
  56790. S = L.length; x < S; x++)
  56791. T = L[x],
  56792. n.ShapeUtils.isClockWise(T) && (L[x] = T.reverse());
  56793. D = !1
  56794. }
  56795. var N = n.ShapeUtils.triangulateShape(O, L)
  56796. , B = O;
  56797. for (x = 0,
  56798. S = L.length; x < S; x++)
  56799. T = L[x],
  56800. O = O.concat(T);
  56801. 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++,
  56802. Z++,
  56803. q++)
  56804. Z === X && (Z = 0),
  56805. q === X && (q = 0),
  56806. j[Y] = r(B[Y], B[Z], B[q]);
  56807. var K, Q = [], J = j.concat();
  56808. for (x = 0,
  56809. S = L.length; x < S; x++) {
  56810. for (T = L[x],
  56811. K = [],
  56812. Y = 0,
  56813. X = T.length,
  56814. Z = X - 1,
  56815. q = Y + 1; Y < X; Y++,
  56816. Z++,
  56817. q++)
  56818. Z === X && (Z = 0),
  56819. q === X && (q = 0),
  56820. K[Y] = r(T[Y], T[Z], T[q]);
  56821. Q.push(K),
  56822. J = J.concat(K)
  56823. }
  56824. for (F = 0; F < y; F++) {
  56825. for (U = F / y,
  56826. k = v * (1 - U),
  56827. V = A * Math.sin(U * Math.PI / 2),
  56828. Y = 0,
  56829. X = B.length; Y < X; Y++)
  56830. H = i(B[Y], j[Y], V),
  56831. l(H.x, H.y, -k);
  56832. for (x = 0,
  56833. S = L.length; x < S; x++)
  56834. for (T = L[x],
  56835. K = Q[x],
  56836. Y = 0,
  56837. X = T.length; Y < X; Y++)
  56838. H = i(T[Y], K[Y], V),
  56839. l(H.x, H.y, -k)
  56840. }
  56841. for (V = A,
  56842. Y = 0; Y < z; Y++)
  56843. H = C ? i(O[Y], J[Y], V) : O[Y],
  56844. w ? (f.copy(d.normals[0]).multiplyScalar(H.x),
  56845. p.copy(d.binormals[0]).multiplyScalar(H.y),
  56846. g.copy(u[0]).add(f).add(p),
  56847. l(g.x, g.y, g.z)) : l(H.x, H.y, 0);
  56848. var $;
  56849. for ($ = 1; $ <= E; $++)
  56850. for (Y = 0; Y < z; Y++)
  56851. H = C ? i(O[Y], J[Y], V) : O[Y],
  56852. w ? (f.copy(d.normals[$]).multiplyScalar(H.x),
  56853. p.copy(d.binormals[$]).multiplyScalar(H.y),
  56854. g.copy(u[$]).add(f).add(p),
  56855. l(g.x, g.y, g.z)) : l(H.x, H.y, m / E * $);
  56856. for (F = y - 1; F >= 0; F--) {
  56857. for (U = F / y,
  56858. k = v * (1 - U),
  56859. V = A * Math.sin(U * Math.PI / 2),
  56860. Y = 0,
  56861. X = B.length; Y < X; Y++)
  56862. H = i(B[Y], j[Y], V),
  56863. l(H.x, H.y, m + k);
  56864. for (x = 0,
  56865. S = L.length; x < S; x++)
  56866. for (T = L[x],
  56867. K = Q[x],
  56868. Y = 0,
  56869. X = T.length; Y < X; Y++)
  56870. H = i(T[Y], K[Y], V),
  56871. w ? l(H.x, H.y + u[E - 1].y, u[E - 1].x + k) : l(H.x, H.y, m + k)
  56872. }
  56873. o(),
  56874. a()
  56875. }
  56876. ,
  56877. n.ExtrudeGeometry.WorldUVGenerator = {
  56878. generateTopUV: function(e, t, i, r) {
  56879. var o = e.vertices
  56880. , a = o[t]
  56881. , s = o[i]
  56882. , l = o[r];
  56883. return [new n.Vector2(a.x,a.y), new n.Vector2(s.x,s.y), new n.Vector2(l.x,l.y)]
  56884. },
  56885. generateSideWallUV: function(e, t, i, r, o) {
  56886. var a = e.vertices
  56887. , s = a[t]
  56888. , l = a[i]
  56889. , c = a[r]
  56890. , h = a[o];
  56891. 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)]
  56892. }
  56893. },
  56894. n.ShapeGeometry = function(e, t) {
  56895. n.Geometry.call(this),
  56896. this.type = "ShapeGeometry",
  56897. Array.isArray(e) === !1 && (e = [e]),
  56898. this.addShapeList(e, t),
  56899. this.computeFaceNormals()
  56900. }
  56901. ,
  56902. n.ShapeGeometry.prototype = Object.create(n.Geometry.prototype),
  56903. n.ShapeGeometry.prototype.constructor = n.ShapeGeometry,
  56904. n.ShapeGeometry.prototype.addShapeList = function(e, t) {
  56905. for (var i = 0, n = e.length; i < n; i++)
  56906. this.addShape(e[i], t);
  56907. return this
  56908. }
  56909. ,
  56910. n.ShapeGeometry.prototype.addShape = function(e, t) {
  56911. void 0 === t && (t = {});
  56912. 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);
  56913. if (p) {
  56914. for (u = u.reverse(),
  56915. i = 0,
  56916. r = d.length; i < r; i++)
  56917. o = d[i],
  56918. n.ShapeUtils.isClockWise(o) && (d[i] = o.reverse());
  56919. p = !1
  56920. }
  56921. var f = n.ShapeUtils.triangulateShape(u, d);
  56922. for (i = 0,
  56923. r = d.length; i < r; i++)
  56924. o = d[i],
  56925. u = u.concat(o);
  56926. var g, m, v = u.length, A = f.length;
  56927. for (i = 0; i < v; i++)
  56928. g = u[i],
  56929. this.vertices.push(new n.Vector3(g.x,g.y,0));
  56930. for (i = 0; i < A; i++) {
  56931. m = f[i];
  56932. var y = m[0] + c
  56933. , C = m[1] + c
  56934. , I = m[2] + c;
  56935. this.faces.push(new n.Face3(y,C,I,null,null,s)),
  56936. this.faceVertexUvs[0].push(l.generateTopUV(this, y, C, I))
  56937. }
  56938. }
  56939. ,
  56940. n.LatheBufferGeometry = function(e, t, i, r) {
  56941. n.BufferGeometry.call(this),
  56942. this.type = "LatheBufferGeometry",
  56943. this.parameters = {
  56944. points: e,
  56945. segments: t,
  56946. phiStart: i,
  56947. phiLength: r
  56948. },
  56949. t = Math.floor(t) || 12,
  56950. i = i || 0,
  56951. r = r || 2 * Math.PI,
  56952. r = n.Math.clamp(r, 0, 2 * Math.PI);
  56953. 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),
  56954. 1 / t), m = new n.Vector3, v = new n.Vector2;
  56955. for (a = 0; a <= t; a++) {
  56956. var A = i + a * g * r
  56957. , y = Math.sin(A)
  56958. , C = Math.cos(A);
  56959. for (s = 0; s <= e.length - 1; s++)
  56960. m.x = e[s].x * y,
  56961. m.y = e[s].y,
  56962. m.z = e[s].x * C,
  56963. u.setXYZ(p, m.x, m.y, m.z),
  56964. v.x = a / t,
  56965. v.y = s / (e.length - 1),
  56966. d.setXY(p, v.x, v.y),
  56967. p++
  56968. }
  56969. for (a = 0; a < t; a++)
  56970. for (s = 0; s < e.length - 1; s++) {
  56971. o = s + a * e.length;
  56972. var I = o
  56973. , E = o + e.length
  56974. , b = o + e.length + 1
  56975. , w = o + 1;
  56976. h.setX(f, I),
  56977. f++,
  56978. h.setX(f, E),
  56979. f++,
  56980. h.setX(f, w),
  56981. f++,
  56982. h.setX(f, E),
  56983. f++,
  56984. h.setX(f, b),
  56985. f++,
  56986. h.setX(f, w),
  56987. f++
  56988. }
  56989. if (this.setIndex(h),
  56990. this.addAttribute("position", u),
  56991. this.addAttribute("uv", d),
  56992. this.computeVertexNormals(),
  56993. r === 2 * Math.PI) {
  56994. var _ = this.attributes.normal.array
  56995. , T = new n.Vector3
  56996. , x = new n.Vector3
  56997. , S = new n.Vector3;
  56998. for (o = t * e.length * 3,
  56999. a = 0,
  57000. s = 0; a < e.length; a++,
  57001. s += 3)
  57002. T.x = _[s + 0],
  57003. T.y = _[s + 1],
  57004. T.z = _[s + 2],
  57005. x.x = _[o + s + 0],
  57006. x.y = _[o + s + 1],
  57007. x.z = _[o + s + 2],
  57008. S.addVectors(T, x).normalize(),
  57009. _[s + 0] = _[o + s + 0] = S.x,
  57010. _[s + 1] = _[o + s + 1] = S.y,
  57011. _[s + 2] = _[o + s + 2] = S.z
  57012. }
  57013. }
  57014. ,
  57015. n.LatheBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57016. n.LatheBufferGeometry.prototype.constructor = n.LatheBufferGeometry,
  57017. n.LatheGeometry = function(e, t, i, r) {
  57018. n.Geometry.call(this),
  57019. this.type = "LatheGeometry",
  57020. this.parameters = {
  57021. points: e,
  57022. segments: t,
  57023. phiStart: i,
  57024. phiLength: r
  57025. },
  57026. this.fromBufferGeometry(new n.LatheBufferGeometry(e,t,i,r)),
  57027. this.mergeVertices()
  57028. }
  57029. ,
  57030. n.LatheGeometry.prototype = Object.create(n.Geometry.prototype),
  57031. n.LatheGeometry.prototype.constructor = n.LatheGeometry,
  57032. n.PlaneGeometry = function(e, t, i, r) {
  57033. n.Geometry.call(this),
  57034. this.type = "PlaneGeometry",
  57035. this.parameters = {
  57036. width: e,
  57037. height: t,
  57038. widthSegments: i,
  57039. heightSegments: r
  57040. },
  57041. this.fromBufferGeometry(new n.PlaneBufferGeometry(e,t,i,r))
  57042. }
  57043. ,
  57044. n.PlaneGeometry.prototype = Object.create(n.Geometry.prototype),
  57045. n.PlaneGeometry.prototype.constructor = n.PlaneGeometry,
  57046. n.PlaneBufferGeometry = function(e, t, i, r) {
  57047. n.BufferGeometry.call(this),
  57048. this.type = "PlaneBufferGeometry",
  57049. this.parameters = {
  57050. width: e,
  57051. height: t,
  57052. widthSegments: i,
  57053. heightSegments: r
  57054. };
  57055. 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++)
  57056. for (var y = A * d - a, C = 0; C < c; C++) {
  57057. var I = C * u - o;
  57058. p[m] = I,
  57059. p[m + 1] = -y,
  57060. f[m + 2] = 1,
  57061. g[v] = C / s,
  57062. g[v + 1] = 1 - A / l,
  57063. m += 3,
  57064. v += 2
  57065. }
  57066. m = 0;
  57067. for (var E = new (p.length / 3 > 65535 ? Uint32Array : Uint16Array)(s * l * 6), A = 0; A < l; A++)
  57068. for (var C = 0; C < s; C++) {
  57069. var b = C + c * A
  57070. , w = C + c * (A + 1)
  57071. , _ = C + 1 + c * (A + 1)
  57072. , T = C + 1 + c * A;
  57073. E[m] = b,
  57074. E[m + 1] = w,
  57075. E[m + 2] = T,
  57076. E[m + 3] = w,
  57077. E[m + 4] = _,
  57078. E[m + 5] = T,
  57079. m += 6
  57080. }
  57081. this.setIndex(new n.BufferAttribute(E,1)),
  57082. this.addAttribute("position", new n.BufferAttribute(p,3)),
  57083. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  57084. this.addAttribute("uv", new n.BufferAttribute(g,2))
  57085. }
  57086. ,
  57087. n.PlaneBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57088. n.PlaneBufferGeometry.prototype.constructor = n.PlaneBufferGeometry,
  57089. n.RingBufferGeometry = function(e, t, i, r, o, a) {
  57090. n.BufferGeometry.call(this),
  57091. this.type = "RingBufferGeometry",
  57092. this.parameters = {
  57093. innerRadius: e,
  57094. outerRadius: t,
  57095. thetaSegments: i,
  57096. phiSegments: r,
  57097. thetaStart: o,
  57098. thetaLength: a
  57099. },
  57100. e = e || 20,
  57101. t = t || 50,
  57102. o = void 0 !== o ? o : 0,
  57103. a = void 0 !== a ? a : 2 * Math.PI,
  57104. i = void 0 !== i ? Math.max(3, i) : 8,
  57105. r = void 0 !== r ? Math.max(1, r) : 1;
  57106. 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;
  57107. for (l = 0; l <= r; l++) {
  57108. for (c = 0; c <= i; c++)
  57109. s = o + c / i * a,
  57110. C.x = A * Math.cos(s),
  57111. C.y = A * Math.sin(s),
  57112. p.setXYZ(m, C.x, C.y, C.z),
  57113. f.setXYZ(m, 0, 0, 1),
  57114. I.x = (C.x / t + 1) / 2,
  57115. I.y = (C.y / t + 1) / 2,
  57116. g.setXY(m, I.x, I.y),
  57117. m++;
  57118. A += y
  57119. }
  57120. for (l = 0; l < r; l++) {
  57121. var E = l * (i + 1);
  57122. for (c = 0; c < i; c++) {
  57123. s = c + E;
  57124. var b = s
  57125. , w = s + i + 1
  57126. , _ = s + i + 2
  57127. , T = s + 1;
  57128. d.setX(v, b),
  57129. v++,
  57130. d.setX(v, w),
  57131. v++,
  57132. d.setX(v, _),
  57133. v++,
  57134. d.setX(v, b),
  57135. v++,
  57136. d.setX(v, _),
  57137. v++,
  57138. d.setX(v, T),
  57139. v++
  57140. }
  57141. }
  57142. this.setIndex(d),
  57143. this.addAttribute("position", p),
  57144. this.addAttribute("normal", f),
  57145. this.addAttribute("uv", g)
  57146. }
  57147. ,
  57148. n.RingBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57149. n.RingBufferGeometry.prototype.constructor = n.RingBufferGeometry,
  57150. n.RingGeometry = function(e, t, i, r, o, a) {
  57151. n.Geometry.call(this),
  57152. this.type = "RingGeometry",
  57153. this.parameters = {
  57154. innerRadius: e,
  57155. outerRadius: t,
  57156. thetaSegments: i,
  57157. phiSegments: r,
  57158. thetaStart: o,
  57159. thetaLength: a
  57160. },
  57161. this.fromBufferGeometry(new n.RingBufferGeometry(e,t,i,r,o,a))
  57162. }
  57163. ,
  57164. n.RingGeometry.prototype = Object.create(n.Geometry.prototype),
  57165. n.RingGeometry.prototype.constructor = n.RingGeometry,
  57166. n.SphereGeometry = function(e, t, i, r, o, a, s) {
  57167. n.Geometry.call(this),
  57168. this.type = "SphereGeometry",
  57169. this.parameters = {
  57170. radius: e,
  57171. widthSegments: t,
  57172. heightSegments: i,
  57173. phiStart: r,
  57174. phiLength: o,
  57175. thetaStart: a,
  57176. thetaLength: s
  57177. },
  57178. this.fromBufferGeometry(new n.SphereBufferGeometry(e,t,i,r,o,a,s))
  57179. }
  57180. ,
  57181. n.SphereGeometry.prototype = Object.create(n.Geometry.prototype),
  57182. n.SphereGeometry.prototype.constructor = n.SphereGeometry,
  57183. n.SphereBufferGeometry = function(e, t, i, r, o, a, s) {
  57184. n.BufferGeometry.call(this),
  57185. this.type = "SphereBufferGeometry",
  57186. this.parameters = {
  57187. radius: e,
  57188. widthSegments: t,
  57189. heightSegments: i,
  57190. phiStart: r,
  57191. phiLength: o,
  57192. thetaStart: a,
  57193. thetaLength: s
  57194. },
  57195. e = e || 50,
  57196. t = Math.max(3, Math.floor(t) || 8),
  57197. i = Math.max(2, Math.floor(i) || 6),
  57198. r = void 0 !== r ? r : 0,
  57199. o = void 0 !== o ? o : 2 * Math.PI,
  57200. a = void 0 !== a ? a : 0,
  57201. s = void 0 !== s ? s : Math.PI;
  57202. 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++) {
  57203. for (var v = [], A = m / i, y = 0; y <= t; y++) {
  57204. var C = y / t
  57205. , I = -e * Math.cos(r + C * o) * Math.sin(a + A * s)
  57206. , E = e * Math.cos(a + A * s)
  57207. , b = e * Math.sin(r + C * o) * Math.sin(a + A * s);
  57208. g.set(I, E, b).normalize(),
  57209. h.setXYZ(p, I, E, b),
  57210. u.setXYZ(p, g.x, g.y, g.z),
  57211. d.setXY(p, C, 1 - A),
  57212. v.push(p),
  57213. p++
  57214. }
  57215. f.push(v)
  57216. }
  57217. for (var w = [], m = 0; m < i; m++)
  57218. for (var y = 0; y < t; y++) {
  57219. var _ = f[m][y + 1]
  57220. , T = f[m][y]
  57221. , x = f[m + 1][y]
  57222. , S = f[m + 1][y + 1];
  57223. (0 !== m || a > 0) && w.push(_, T, S),
  57224. (m !== i - 1 || l < Math.PI) && w.push(T, x, S)
  57225. }
  57226. this.setIndex(new (h.count > 65535 ? n.Uint32Attribute : n.Uint16Attribute)(w,1)),
  57227. this.addAttribute("position", h),
  57228. this.addAttribute("normal", u),
  57229. this.addAttribute("uv", d),
  57230. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  57231. }
  57232. ,
  57233. n.SphereBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57234. n.SphereBufferGeometry.prototype.constructor = n.SphereBufferGeometry,
  57235. n.TextGeometry = function(e, t) {
  57236. t = t || {};
  57237. var i = t.font;
  57238. if (i instanceof n.Font == !1)
  57239. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  57240. new n.Geometry;
  57241. var r = i.generateShapes(e, t.size, t.curveSegments);
  57242. t.amount = void 0 !== t.height ? t.height : 50,
  57243. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  57244. void 0 === t.bevelSize && (t.bevelSize = 8),
  57245. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  57246. n.ExtrudeGeometry.call(this, r, t),
  57247. this.type = "TextGeometry"
  57248. }
  57249. ,
  57250. n.TextGeometry.prototype = Object.create(n.ExtrudeGeometry.prototype),
  57251. n.TextGeometry.prototype.constructor = n.TextGeometry,
  57252. n.TorusBufferGeometry = function(e, t, i, r, o) {
  57253. n.BufferGeometry.call(this),
  57254. this.type = "TorusBufferGeometry",
  57255. this.parameters = {
  57256. radius: e,
  57257. tube: t,
  57258. radialSegments: i,
  57259. tubularSegments: r,
  57260. arc: o
  57261. },
  57262. e = e || 100,
  57263. t = t || 40,
  57264. i = Math.floor(i) || 8,
  57265. r = Math.floor(r) || 6,
  57266. o = o || 2 * Math.PI;
  57267. 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;
  57268. for (a = 0; a <= i; a++)
  57269. for (s = 0; s <= r; s++) {
  57270. var C = s / r * o
  57271. , I = a / i * Math.PI * 2;
  57272. A.x = (e + t * Math.cos(I)) * Math.cos(C),
  57273. A.y = (e + t * Math.cos(I)) * Math.sin(C),
  57274. A.z = t * Math.sin(I),
  57275. u[f] = A.x,
  57276. u[f + 1] = A.y,
  57277. u[f + 2] = A.z,
  57278. v.x = e * Math.cos(C),
  57279. v.y = e * Math.sin(C),
  57280. y.subVectors(A, v).normalize(),
  57281. d[f] = y.x,
  57282. d[f + 1] = y.y,
  57283. d[f + 2] = y.z,
  57284. p[g] = s / r,
  57285. p[g + 1] = a / i,
  57286. f += 3,
  57287. g += 2
  57288. }
  57289. for (a = 1; a <= i; a++)
  57290. for (s = 1; s <= r; s++) {
  57291. var E = (r + 1) * a + s - 1
  57292. , b = (r + 1) * (a - 1) + s - 1
  57293. , w = (r + 1) * (a - 1) + s
  57294. , _ = (r + 1) * a + s;
  57295. h[m] = E,
  57296. h[m + 1] = b,
  57297. h[m + 2] = _,
  57298. h[m + 3] = b,
  57299. h[m + 4] = w,
  57300. h[m + 5] = _,
  57301. m += 6
  57302. }
  57303. this.setIndex(new n.BufferAttribute(h,1)),
  57304. this.addAttribute("position", new n.BufferAttribute(u,3)),
  57305. this.addAttribute("normal", new n.BufferAttribute(d,3)),
  57306. this.addAttribute("uv", new n.BufferAttribute(p,2))
  57307. }
  57308. ,
  57309. n.TorusBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57310. n.TorusBufferGeometry.prototype.constructor = n.TorusBufferGeometry,
  57311. n.TorusGeometry = function(e, t, i, r, o) {
  57312. n.Geometry.call(this),
  57313. this.type = "TorusGeometry",
  57314. this.parameters = {
  57315. radius: e,
  57316. tube: t,
  57317. radialSegments: i,
  57318. tubularSegments: r,
  57319. arc: o
  57320. },
  57321. this.fromBufferGeometry(new n.TorusBufferGeometry(e,t,i,r,o))
  57322. }
  57323. ,
  57324. n.TorusGeometry.prototype = Object.create(n.Geometry.prototype),
  57325. n.TorusGeometry.prototype.constructor = n.TorusGeometry,
  57326. n.TorusKnotBufferGeometry = function(e, t, i, r, o, a) {
  57327. function s(e, t, i, n, r) {
  57328. var o = Math.cos(e)
  57329. , a = Math.sin(e)
  57330. , s = i / t * e
  57331. , l = Math.cos(s);
  57332. r.x = n * (2 + l) * .5 * o,
  57333. r.y = n * (2 + l) * a * .5,
  57334. r.z = n * Math.sin(s) * .5
  57335. }
  57336. n.BufferGeometry.call(this),
  57337. this.type = "TorusKnotBufferGeometry",
  57338. this.parameters = {
  57339. radius: e,
  57340. tube: t,
  57341. tubularSegments: i,
  57342. radialSegments: r,
  57343. p: o,
  57344. q: a
  57345. },
  57346. e = e || 100,
  57347. t = t || 40,
  57348. i = Math.floor(i) || 64,
  57349. r = Math.floor(r) || 8,
  57350. o = o || 2,
  57351. a = a || 3;
  57352. 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;
  57353. for (l = 0; l <= i; ++l) {
  57354. var T = l / i * o * Math.PI * 2;
  57355. for (s(T, o, a, e, I),
  57356. s(T + .01, o, a, e, E),
  57357. w.subVectors(E, I),
  57358. _.addVectors(E, I),
  57359. b.crossVectors(w, _),
  57360. _.crossVectors(b, w),
  57361. b.normalize(),
  57362. _.normalize(),
  57363. c = 0; c <= r; ++c) {
  57364. var x = c / r * Math.PI * 2
  57365. , S = -t * Math.cos(x)
  57366. , M = t * Math.sin(x);
  57367. A.x = I.x + (S * _.x + M * b.x),
  57368. A.y = I.y + (S * _.y + M * b.y),
  57369. A.z = I.z + (S * _.z + M * b.z),
  57370. p.setXYZ(m, A.x, A.y, A.z),
  57371. y.subVectors(A, I).normalize(),
  57372. f.setXYZ(m, y.x, y.y, y.z),
  57373. C.x = l / i,
  57374. C.y = c / r,
  57375. g.setXY(m, C.x, C.y),
  57376. m++
  57377. }
  57378. }
  57379. for (c = 1; c <= i; c++)
  57380. for (l = 1; l <= r; l++) {
  57381. var R = (r + 1) * (c - 1) + (l - 1)
  57382. , P = (r + 1) * c + (l - 1)
  57383. , O = (r + 1) * c + l
  57384. , L = (r + 1) * (c - 1) + l;
  57385. d.setX(v, R),
  57386. v++,
  57387. d.setX(v, P),
  57388. v++,
  57389. d.setX(v, L),
  57390. v++,
  57391. d.setX(v, P),
  57392. v++,
  57393. d.setX(v, O),
  57394. v++,
  57395. d.setX(v, L),
  57396. v++
  57397. }
  57398. this.setIndex(d),
  57399. this.addAttribute("position", p),
  57400. this.addAttribute("normal", f),
  57401. this.addAttribute("uv", g)
  57402. }
  57403. ,
  57404. n.TorusKnotBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57405. n.TorusKnotBufferGeometry.prototype.constructor = n.TorusKnotBufferGeometry,
  57406. n.TorusKnotGeometry = function(e, t, i, r, o, a, s) {
  57407. n.Geometry.call(this),
  57408. this.type = "TorusKnotGeometry",
  57409. this.parameters = {
  57410. radius: e,
  57411. tube: t,
  57412. tubularSegments: i,
  57413. radialSegments: r,
  57414. p: o,
  57415. q: a
  57416. },
  57417. void 0 !== s && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  57418. this.fromBufferGeometry(new n.TorusKnotBufferGeometry(e,t,i,r,o,a)),
  57419. this.mergeVertices()
  57420. }
  57421. ,
  57422. n.TorusKnotGeometry.prototype = Object.create(n.Geometry.prototype),
  57423. n.TorusKnotGeometry.prototype.constructor = n.TorusKnotGeometry,
  57424. n.TubeGeometry = function(e, t, i, r, o, a) {
  57425. function s(e, t, i) {
  57426. return R.vertices.push(new n.Vector3(e,t,i)) - 1
  57427. }
  57428. n.Geometry.call(this),
  57429. this.type = "TubeGeometry",
  57430. this.parameters = {
  57431. path: e,
  57432. segments: t,
  57433. radius: i,
  57434. radialSegments: r,
  57435. closed: o,
  57436. taper: a
  57437. },
  57438. t = t || 64,
  57439. i = i || 1,
  57440. r = r || 8,
  57441. o = o || !1,
  57442. a = a || n.TubeGeometry.NoTaper;
  57443. 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;
  57444. for (this.tangents = D,
  57445. this.normals = N,
  57446. this.binormals = B,
  57447. v = 0; v < P; v++)
  57448. for (M[v] = [],
  57449. u = v / (P - 1),
  57450. m = e.getPointAt(u),
  57451. l = D[v],
  57452. c = N[v],
  57453. h = B[v],
  57454. p = i * a(u),
  57455. A = 0; A < r; A++)
  57456. d = A / r * 2 * Math.PI,
  57457. f = -p * Math.cos(d),
  57458. g = p * Math.sin(d),
  57459. O.copy(m),
  57460. O.x += f * c.x + g * h.x,
  57461. O.y += f * c.y + g * h.y,
  57462. O.z += f * c.z + g * h.z,
  57463. M[v][A] = s(O.x, O.y, O.z);
  57464. for (v = 0; v < t; v++)
  57465. for (A = 0; A < r; A++)
  57466. y = o ? (v + 1) % t : v + 1,
  57467. C = (A + 1) % r,
  57468. I = M[v][A],
  57469. E = M[y][A],
  57470. b = M[y][C],
  57471. w = M[v][C],
  57472. _ = new n.Vector2(v / t,A / r),
  57473. T = new n.Vector2((v + 1) / t,A / r),
  57474. x = new n.Vector2((v + 1) / t,(A + 1) / r),
  57475. S = new n.Vector2(v / t,(A + 1) / r),
  57476. this.faces.push(new n.Face3(I,E,w)),
  57477. this.faceVertexUvs[0].push([_, T, S]),
  57478. this.faces.push(new n.Face3(E,b,w)),
  57479. this.faceVertexUvs[0].push([T.clone(), x, S.clone()]);
  57480. this.computeFaceNormals(),
  57481. this.computeVertexNormals()
  57482. }
  57483. ,
  57484. n.TubeGeometry.prototype = Object.create(n.Geometry.prototype),
  57485. n.TubeGeometry.prototype.constructor = n.TubeGeometry,
  57486. n.TubeGeometry.NoTaper = function(e) {
  57487. return 1
  57488. }
  57489. ,
  57490. n.TubeGeometry.SinusoidalTaper = function(e) {
  57491. return Math.sin(Math.PI * e)
  57492. }
  57493. ,
  57494. n.TubeGeometry.FrenetFrames = function(e, t, i) {
  57495. function r() {
  57496. f[0] = new n.Vector3,
  57497. g[0] = new n.Vector3,
  57498. a = Number.MAX_VALUE,
  57499. s = Math.abs(p[0].x),
  57500. l = Math.abs(p[0].y),
  57501. c = Math.abs(p[0].z),
  57502. s <= a && (a = s,
  57503. d.set(1, 0, 0)),
  57504. l <= a && (a = l,
  57505. d.set(0, 1, 0)),
  57506. c <= a && d.set(0, 0, 1),
  57507. m.crossVectors(p[0], d).normalize(),
  57508. f[0].crossVectors(p[0], m),
  57509. g[0].crossVectors(p[0], f[0])
  57510. }
  57511. 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;
  57512. for (this.tangents = p,
  57513. this.normals = f,
  57514. this.binormals = g,
  57515. h = 0; h < A; h++)
  57516. u = h / (A - 1),
  57517. p[h] = e.getTangentAt(u),
  57518. p[h].normalize();
  57519. for (r(),
  57520. h = 1; h < A; h++)
  57521. f[h] = f[h - 1].clone(),
  57522. g[h] = g[h - 1].clone(),
  57523. m.crossVectors(p[h - 1], p[h]),
  57524. m.length() > Number.EPSILON && (m.normalize(),
  57525. o = Math.acos(n.Math.clamp(p[h - 1].dot(p[h]), -1, 1)),
  57526. f[h].applyMatrix4(v.makeRotationAxis(m, o))),
  57527. g[h].crossVectors(p[h], f[h]);
  57528. if (i)
  57529. for (o = Math.acos(n.Math.clamp(f[0].dot(f[A - 1]), -1, 1)),
  57530. o /= A - 1,
  57531. p[0].dot(m.crossVectors(f[0], f[A - 1])) > 0 && (o = -o),
  57532. h = 1; h < A; h++)
  57533. f[h].applyMatrix4(v.makeRotationAxis(p[h], o * h)),
  57534. g[h].crossVectors(p[h], f[h])
  57535. }
  57536. ,
  57537. n.PolyhedronGeometry = function(e, t, i, r) {
  57538. function o(e) {
  57539. var t = e.normalize().clone();
  57540. t.index = u.vertices.push(t) - 1;
  57541. var i = l(e) / 2 / Math.PI + .5
  57542. , r = c(e) / Math.PI + .5;
  57543. return t.uv = new n.Vector2(i,1 - r),
  57544. t
  57545. }
  57546. function a(e, t, i, r) {
  57547. var o = new n.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,r);
  57548. u.faces.push(o),
  57549. C.copy(e).add(t).add(i).divideScalar(3);
  57550. var a = l(C);
  57551. u.faceVertexUvs[0].push([h(e.uv, e, a), h(t.uv, t, a), h(i.uv, i, a)])
  57552. }
  57553. function s(e, t) {
  57554. 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++) {
  57555. l[h] = [];
  57556. 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++)
  57557. 0 === g && h === i ? l[h][g] = d : l[h][g] = o(d.clone().lerp(p, g / f))
  57558. }
  57559. for (var h = 0; h < i; h++)
  57560. for (var g = 0; g < 2 * (i - h) - 1; g++) {
  57561. var m = Math.floor(g / 2);
  57562. 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)
  57563. }
  57564. }
  57565. function l(e) {
  57566. return Math.atan2(e.z, -e.x)
  57567. }
  57568. function c(e) {
  57569. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  57570. }
  57571. function h(e, t, i) {
  57572. return i < 0 && 1 === e.x && (e = new n.Vector2(e.x - 1,e.y)),
  57573. 0 === t.x && 0 === t.z && (e = new n.Vector2(i / 2 / Math.PI + .5,e.y)),
  57574. e.clone()
  57575. }
  57576. n.Geometry.call(this),
  57577. this.type = "PolyhedronGeometry",
  57578. this.parameters = {
  57579. vertices: e,
  57580. indices: t,
  57581. radius: i,
  57582. detail: r
  57583. },
  57584. i = i || 1,
  57585. r = r || 0;
  57586. for (var u = this, d = 0, p = e.length; d < p; d += 3)
  57587. o(new n.Vector3(e[d],e[d + 1],e[d + 2]));
  57588. for (var f = this.vertices, g = [], d = 0, m = 0, p = t.length; d < p; d += 3,
  57589. m++) {
  57590. var v = f[t[d]]
  57591. , A = f[t[d + 1]]
  57592. , y = f[t[d + 2]];
  57593. g[m] = new n.Face3(v.index,A.index,y.index,[v.clone(), A.clone(), y.clone()],void 0,m)
  57594. }
  57595. for (var C = new n.Vector3, d = 0, p = g.length; d < p; d++)
  57596. s(g[d], r);
  57597. for (var d = 0, p = this.faceVertexUvs[0].length; d < p; d++) {
  57598. var I = this.faceVertexUvs[0][d]
  57599. , E = I[0].x
  57600. , b = I[1].x
  57601. , w = I[2].x
  57602. , _ = Math.max(E, b, w)
  57603. , T = Math.min(E, b, w);
  57604. _ > .9 && T < .1 && (E < .2 && (I[0].x += 1),
  57605. b < .2 && (I[1].x += 1),
  57606. w < .2 && (I[2].x += 1))
  57607. }
  57608. for (var d = 0, p = this.vertices.length; d < p; d++)
  57609. this.vertices[d].multiplyScalar(i);
  57610. this.mergeVertices(),
  57611. this.computeFaceNormals(),
  57612. this.boundingSphere = new n.Sphere(new n.Vector3,i)
  57613. }
  57614. ,
  57615. n.PolyhedronGeometry.prototype = Object.create(n.Geometry.prototype),
  57616. n.PolyhedronGeometry.prototype.constructor = n.PolyhedronGeometry,
  57617. n.DodecahedronGeometry = function(e, t) {
  57618. var i = (1 + Math.sqrt(5)) / 2
  57619. , r = 1 / i
  57620. , 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]
  57621. , 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];
  57622. n.PolyhedronGeometry.call(this, o, a, e, t),
  57623. this.type = "DodecahedronGeometry",
  57624. this.parameters = {
  57625. radius: e,
  57626. detail: t
  57627. }
  57628. }
  57629. ,
  57630. n.DodecahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  57631. n.DodecahedronGeometry.prototype.constructor = n.DodecahedronGeometry,
  57632. n.IcosahedronGeometry = function(e, t) {
  57633. var i = (1 + Math.sqrt(5)) / 2
  57634. , 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]
  57635. , 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];
  57636. n.PolyhedronGeometry.call(this, r, o, e, t),
  57637. this.type = "IcosahedronGeometry",
  57638. this.parameters = {
  57639. radius: e,
  57640. detail: t
  57641. }
  57642. }
  57643. ,
  57644. n.IcosahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  57645. n.IcosahedronGeometry.prototype.constructor = n.IcosahedronGeometry,
  57646. n.OctahedronGeometry = function(e, t) {
  57647. var i = [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1]
  57648. , 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];
  57649. n.PolyhedronGeometry.call(this, i, r, e, t),
  57650. this.type = "OctahedronGeometry",
  57651. this.parameters = {
  57652. radius: e,
  57653. detail: t
  57654. }
  57655. }
  57656. ,
  57657. n.OctahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  57658. n.OctahedronGeometry.prototype.constructor = n.OctahedronGeometry,
  57659. n.TetrahedronGeometry = function(e, t) {
  57660. var i = [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1]
  57661. , r = [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1];
  57662. n.PolyhedronGeometry.call(this, i, r, e, t),
  57663. this.type = "TetrahedronGeometry",
  57664. this.parameters = {
  57665. radius: e,
  57666. detail: t
  57667. }
  57668. }
  57669. ,
  57670. n.TetrahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  57671. n.TetrahedronGeometry.prototype.constructor = n.TetrahedronGeometry,
  57672. n.ParametricGeometry = function(e, t, i) {
  57673. n.Geometry.call(this),
  57674. this.type = "ParametricGeometry",
  57675. this.parameters = {
  57676. func: e,
  57677. slices: t,
  57678. stacks: i
  57679. };
  57680. var r, o, a, s, l, c = this.vertices, h = this.faces, u = this.faceVertexUvs[0], d = t + 1;
  57681. for (r = 0; r <= i; r++)
  57682. for (l = r / i,
  57683. o = 0; o <= t; o++)
  57684. s = o / t,
  57685. a = e(s, l),
  57686. c.push(a);
  57687. var p, f, g, m, v, A, y, C;
  57688. for (r = 0; r < i; r++)
  57689. for (o = 0; o < t; o++)
  57690. p = r * d + o,
  57691. f = r * d + o + 1,
  57692. g = (r + 1) * d + o + 1,
  57693. m = (r + 1) * d + o,
  57694. v = new n.Vector2(o / t,r / i),
  57695. A = new n.Vector2((o + 1) / t,r / i),
  57696. y = new n.Vector2((o + 1) / t,(r + 1) / i),
  57697. C = new n.Vector2(o / t,(r + 1) / i),
  57698. h.push(new n.Face3(p,f,m)),
  57699. u.push([v, A, C]),
  57700. h.push(new n.Face3(f,g,m)),
  57701. u.push([A.clone(), y, C.clone()]);
  57702. this.computeFaceNormals(),
  57703. this.computeVertexNormals()
  57704. }
  57705. ,
  57706. n.ParametricGeometry.prototype = Object.create(n.Geometry.prototype),
  57707. n.ParametricGeometry.prototype.constructor = n.ParametricGeometry,
  57708. n.WireframeGeometry = function(e) {
  57709. function t(e, t) {
  57710. return e - t
  57711. }
  57712. n.BufferGeometry.call(this);
  57713. var i = [0, 0]
  57714. , r = {}
  57715. , o = ["a", "b", "c"];
  57716. if (e instanceof n.Geometry) {
  57717. for (var a = e.vertices, s = e.faces, l = 0, c = new Uint32Array(6 * s.length), h = 0, u = s.length; h < u; h++)
  57718. for (var d = s[h], p = 0; p < 3; p++) {
  57719. i[0] = d[o[p]],
  57720. i[1] = d[o[(p + 1) % 3]],
  57721. i.sort(t);
  57722. var f = i.toString();
  57723. void 0 === r[f] && (c[2 * l] = i[0],
  57724. c[2 * l + 1] = i[1],
  57725. r[f] = !0,
  57726. l++)
  57727. }
  57728. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  57729. for (var p = 0; p < 2; p++) {
  57730. var m = a[c[2 * h + p]]
  57731. , v = 6 * h + 3 * p;
  57732. g[v + 0] = m.x,
  57733. g[v + 1] = m.y,
  57734. g[v + 2] = m.z
  57735. }
  57736. this.addAttribute("position", new n.BufferAttribute(g,3))
  57737. } else if (e instanceof n.BufferGeometry)
  57738. if (null !== e.index) {
  57739. var A = e.index.array
  57740. , a = e.attributes.position
  57741. , y = e.groups
  57742. , l = 0;
  57743. 0 === y.length && e.addGroup(0, A.length);
  57744. for (var c = new Uint32Array(2 * A.length), C = 0, I = y.length; C < I; ++C)
  57745. for (var E = y[C], b = E.start, w = E.count, h = b, _ = b + w; h < _; h += 3)
  57746. for (var p = 0; p < 3; p++) {
  57747. i[0] = A[h + p],
  57748. i[1] = A[h + (p + 1) % 3],
  57749. i.sort(t);
  57750. var f = i.toString();
  57751. void 0 === r[f] && (c[2 * l] = i[0],
  57752. c[2 * l + 1] = i[1],
  57753. r[f] = !0,
  57754. l++)
  57755. }
  57756. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  57757. for (var p = 0; p < 2; p++) {
  57758. var v = 6 * h + 3 * p
  57759. , T = c[2 * h + p];
  57760. g[v + 0] = a.getX(T),
  57761. g[v + 1] = a.getY(T),
  57762. g[v + 2] = a.getZ(T)
  57763. }
  57764. this.addAttribute("position", new n.BufferAttribute(g,3))
  57765. } else {
  57766. 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++)
  57767. for (var p = 0; p < 3; p++) {
  57768. var v = 18 * h + 6 * p
  57769. , S = 9 * h + 3 * p;
  57770. g[v + 0] = a[S],
  57771. g[v + 1] = a[S + 1],
  57772. g[v + 2] = a[S + 2];
  57773. var T = 9 * h + 3 * ((p + 1) % 3);
  57774. g[v + 3] = a[T],
  57775. g[v + 4] = a[T + 1],
  57776. g[v + 5] = a[T + 2]
  57777. }
  57778. this.addAttribute("position", new n.BufferAttribute(g,3))
  57779. }
  57780. }
  57781. ,
  57782. n.WireframeGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57783. n.WireframeGeometry.prototype.constructor = n.WireframeGeometry,
  57784. n.AxisHelper = function(e) {
  57785. e = e || 1;
  57786. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  57787. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  57788. , r = new n.BufferGeometry;
  57789. r.addAttribute("position", new n.BufferAttribute(t,3)),
  57790. r.addAttribute("color", new n.BufferAttribute(i,3));
  57791. var o = new n.LineBasicMaterial({
  57792. vertexColors: n.VertexColors
  57793. });
  57794. n.LineSegments.call(this, r, o)
  57795. }
  57796. ,
  57797. n.AxisHelper.prototype = Object.create(n.LineSegments.prototype),
  57798. n.AxisHelper.prototype.constructor = n.AxisHelper,
  57799. n.ArrowHelper = function() {
  57800. var e = new n.Geometry;
  57801. e.vertices.push(new n.Vector3(0,0,0), new n.Vector3(0,1,0));
  57802. var t = new n.CylinderGeometry(0,.5,1,5,1);
  57803. return t.translate(0, -.5, 0),
  57804. function(i, r, o, a, s, l) {
  57805. n.Object3D.call(this),
  57806. void 0 === a && (a = 16776960),
  57807. void 0 === o && (o = 1),
  57808. void 0 === s && (s = .2 * o),
  57809. void 0 === l && (l = .2 * s),
  57810. this.position.copy(r),
  57811. this.line = new n.Line(e,new n.LineBasicMaterial({
  57812. color: a
  57813. })),
  57814. this.line.matrixAutoUpdate = !1,
  57815. this.add(this.line),
  57816. this.cone = new n.Mesh(t,new n.MeshBasicMaterial({
  57817. color: a
  57818. })),
  57819. this.cone.matrixAutoUpdate = !1,
  57820. this.add(this.cone),
  57821. this.setDirection(i),
  57822. this.setLength(o, s, l)
  57823. }
  57824. }(),
  57825. n.ArrowHelper.prototype = Object.create(n.Object3D.prototype),
  57826. n.ArrowHelper.prototype.constructor = n.ArrowHelper,
  57827. n.ArrowHelper.prototype.setDirection = function() {
  57828. var e, t = new n.Vector3;
  57829. return function(i) {
  57830. 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(),
  57831. e = Math.acos(i.y),
  57832. this.quaternion.setFromAxisAngle(t, e))
  57833. }
  57834. }(),
  57835. n.ArrowHelper.prototype.setLength = function(e, t, i) {
  57836. void 0 === t && (t = .2 * e),
  57837. void 0 === i && (i = .2 * t),
  57838. this.line.scale.set(1, Math.max(0, e - t), 1),
  57839. this.line.updateMatrix(),
  57840. this.cone.scale.set(i, t, i),
  57841. this.cone.position.y = e,
  57842. this.cone.updateMatrix()
  57843. }
  57844. ,
  57845. n.ArrowHelper.prototype.setColor = function(e) {
  57846. this.line.material.color.set(e),
  57847. this.cone.material.color.set(e)
  57848. }
  57849. ,
  57850. n.BoxHelper = function(e) {
  57851. 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])
  57852. , i = new Float32Array(24)
  57853. , r = new n.BufferGeometry;
  57854. r.setIndex(new n.BufferAttribute(t,1)),
  57855. r.addAttribute("position", new n.BufferAttribute(i,3)),
  57856. n.LineSegments.call(this, r, new n.LineBasicMaterial({
  57857. color: 16776960
  57858. })),
  57859. void 0 !== e && this.update(e)
  57860. }
  57861. ,
  57862. n.BoxHelper.prototype = Object.create(n.LineSegments.prototype),
  57863. n.BoxHelper.prototype.constructor = n.BoxHelper,
  57864. n.BoxHelper.prototype.update = function() {
  57865. var e = new n.Box3;
  57866. return function(t) {
  57867. if (e.setFromObject(t),
  57868. !e.isEmpty()) {
  57869. var i = e.min
  57870. , n = e.max
  57871. , r = this.geometry.attributes.position
  57872. , o = r.array;
  57873. o[0] = n.x,
  57874. o[1] = n.y,
  57875. o[2] = n.z,
  57876. o[3] = i.x,
  57877. o[4] = n.y,
  57878. o[5] = n.z,
  57879. o[6] = i.x,
  57880. o[7] = i.y,
  57881. o[8] = n.z,
  57882. o[9] = n.x,
  57883. o[10] = i.y,
  57884. o[11] = n.z,
  57885. o[12] = n.x,
  57886. o[13] = n.y,
  57887. o[14] = i.z,
  57888. o[15] = i.x,
  57889. o[16] = n.y,
  57890. o[17] = i.z,
  57891. o[18] = i.x,
  57892. o[19] = i.y,
  57893. o[20] = i.z,
  57894. o[21] = n.x,
  57895. o[22] = i.y,
  57896. o[23] = i.z,
  57897. r.needsUpdate = !0,
  57898. this.geometry.computeBoundingSphere()
  57899. }
  57900. }
  57901. }(),
  57902. n.BoundingBoxHelper = function(e, t) {
  57903. var i = void 0 !== t ? t : 8947848;
  57904. this.object = e,
  57905. this.box = new n.Box3,
  57906. n.Mesh.call(this, new n.BoxGeometry(1,1,1), new n.MeshBasicMaterial({
  57907. color: i,
  57908. wireframe: !0
  57909. }))
  57910. }
  57911. ,
  57912. n.BoundingBoxHelper.prototype = Object.create(n.Mesh.prototype),
  57913. n.BoundingBoxHelper.prototype.constructor = n.BoundingBoxHelper,
  57914. n.BoundingBoxHelper.prototype.update = function() {
  57915. this.box.setFromObject(this.object),
  57916. this.box.size(this.scale),
  57917. this.box.center(this.position)
  57918. }
  57919. ,
  57920. n.CameraHelper = function(e) {
  57921. function t(e, t, n) {
  57922. i(e, n),
  57923. i(t, n)
  57924. }
  57925. function i(e, t) {
  57926. r.vertices.push(new n.Vector3),
  57927. r.colors.push(new n.Color(t)),
  57928. void 0 === a[e] && (a[e] = []),
  57929. a[e].push(r.vertices.length - 1)
  57930. }
  57931. var r = new n.Geometry
  57932. , o = new n.LineBasicMaterial({
  57933. color: 16777215,
  57934. vertexColors: n.FaceColors
  57935. })
  57936. , a = {}
  57937. , s = 16755200
  57938. , l = 16711680
  57939. , c = 43775
  57940. , h = 16777215
  57941. , u = 3355443;
  57942. t("n1", "n2", s),
  57943. t("n2", "n4", s),
  57944. t("n4", "n3", s),
  57945. t("n3", "n1", s),
  57946. t("f1", "f2", s),
  57947. t("f2", "f4", s),
  57948. t("f4", "f3", s),
  57949. t("f3", "f1", s),
  57950. t("n1", "f1", s),
  57951. t("n2", "f2", s),
  57952. t("n3", "f3", s),
  57953. t("n4", "f4", s),
  57954. t("p", "n1", l),
  57955. t("p", "n2", l),
  57956. t("p", "n3", l),
  57957. t("p", "n4", l),
  57958. t("u1", "u2", c),
  57959. t("u2", "u3", c),
  57960. t("u3", "u1", c),
  57961. t("c", "t", h),
  57962. t("p", "c", u),
  57963. t("cn1", "cn2", u),
  57964. t("cn3", "cn4", u),
  57965. t("cf1", "cf2", u),
  57966. t("cf3", "cf4", u),
  57967. n.LineSegments.call(this, r, o),
  57968. this.camera = e,
  57969. this.camera.updateProjectionMatrix(),
  57970. this.matrix = e.matrixWorld,
  57971. this.matrixAutoUpdate = !1,
  57972. this.pointMap = a,
  57973. this.update()
  57974. }
  57975. ,
  57976. n.CameraHelper.prototype = Object.create(n.LineSegments.prototype),
  57977. n.CameraHelper.prototype.constructor = n.CameraHelper,
  57978. n.CameraHelper.prototype.update = function() {
  57979. function e(e, n, a, s) {
  57980. r.set(n, a, s).unproject(o);
  57981. var l = i[e];
  57982. if (void 0 !== l)
  57983. for (var c = 0, h = l.length; c < h; c++)
  57984. t.vertices[l[c]].copy(r)
  57985. }
  57986. var t, i, r = new n.Vector3, o = new n.Camera;
  57987. return function() {
  57988. t = this.geometry,
  57989. i = this.pointMap;
  57990. var n = 1
  57991. , r = 1;
  57992. o.projectionMatrix.copy(this.camera.projectionMatrix),
  57993. e("c", 0, 0, -1),
  57994. e("t", 0, 0, 1),
  57995. e("n1", -n, -r, -1),
  57996. e("n2", n, -r, -1),
  57997. e("n3", -n, r, -1),
  57998. e("n4", n, r, -1),
  57999. e("f1", -n, -r, 1),
  58000. e("f2", n, -r, 1),
  58001. e("f3", -n, r, 1),
  58002. e("f4", n, r, 1),
  58003. e("u1", .7 * n, 1.1 * r, -1),
  58004. e("u2", .7 * -n, 1.1 * r, -1),
  58005. e("u3", 0, 2 * r, -1),
  58006. e("cf1", -n, 0, 1),
  58007. e("cf2", n, 0, 1),
  58008. e("cf3", 0, -r, 1),
  58009. e("cf4", 0, r, 1),
  58010. e("cn1", -n, 0, -1),
  58011. e("cn2", n, 0, -1),
  58012. e("cn3", 0, -r, -1),
  58013. e("cn4", 0, r, -1),
  58014. t.verticesNeedUpdate = !0
  58015. }
  58016. }(),
  58017. n.DirectionalLightHelper = function(e, t) {
  58018. n.Object3D.call(this),
  58019. this.light = e,
  58020. this.light.updateMatrixWorld(),
  58021. this.matrix = e.matrixWorld,
  58022. this.matrixAutoUpdate = !1,
  58023. t = t || 1;
  58024. var i = new n.Geometry;
  58025. 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));
  58026. var r = new n.LineBasicMaterial({
  58027. fog: !1
  58028. });
  58029. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  58030. this.lightPlane = new n.Line(i,r),
  58031. this.add(this.lightPlane),
  58032. i = new n.Geometry,
  58033. i.vertices.push(new n.Vector3, new n.Vector3),
  58034. r = new n.LineBasicMaterial({
  58035. fog: !1
  58036. }),
  58037. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  58038. this.targetLine = new n.Line(i,r),
  58039. this.add(this.targetLine),
  58040. this.update()
  58041. }
  58042. ,
  58043. n.DirectionalLightHelper.prototype = Object.create(n.Object3D.prototype),
  58044. n.DirectionalLightHelper.prototype.constructor = n.DirectionalLightHelper,
  58045. n.DirectionalLightHelper.prototype.dispose = function() {
  58046. this.lightPlane.geometry.dispose(),
  58047. this.lightPlane.material.dispose(),
  58048. this.targetLine.geometry.dispose(),
  58049. this.targetLine.material.dispose()
  58050. }
  58051. ,
  58052. n.DirectionalLightHelper.prototype.update = function() {
  58053. var e = new n.Vector3
  58054. , t = new n.Vector3
  58055. , i = new n.Vector3;
  58056. return function() {
  58057. e.setFromMatrixPosition(this.light.matrixWorld),
  58058. t.setFromMatrixPosition(this.light.target.matrixWorld),
  58059. i.subVectors(t, e),
  58060. this.lightPlane.lookAt(i),
  58061. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  58062. this.targetLine.geometry.vertices[1].copy(i),
  58063. this.targetLine.geometry.verticesNeedUpdate = !0,
  58064. this.targetLine.material.color.copy(this.lightPlane.material.color)
  58065. }
  58066. }(),
  58067. n.EdgesHelper = function(e, t, i) {
  58068. var r = void 0 !== t ? t : 16777215;
  58069. n.LineSegments.call(this, new n.EdgesGeometry(e.geometry,i), new n.LineBasicMaterial({
  58070. color: r
  58071. })),
  58072. this.matrix = e.matrixWorld,
  58073. this.matrixAutoUpdate = !1
  58074. }
  58075. ,
  58076. n.EdgesHelper.prototype = Object.create(n.LineSegments.prototype),
  58077. n.EdgesHelper.prototype.constructor = n.EdgesHelper,
  58078. n.FaceNormalsHelper = function(e, t, i, r) {
  58079. this.object = e,
  58080. this.size = void 0 !== t ? t : 1;
  58081. var o = void 0 !== i ? i : 16776960
  58082. , a = void 0 !== r ? r : 1
  58083. , s = 0
  58084. , l = this.object.geometry;
  58085. l instanceof n.Geometry ? s = l.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  58086. var c = new n.BufferGeometry
  58087. , h = new n.Float32Attribute(2 * s * 3,3);
  58088. c.addAttribute("position", h),
  58089. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  58090. color: o,
  58091. linewidth: a
  58092. })),
  58093. this.matrixAutoUpdate = !1,
  58094. this.update()
  58095. }
  58096. ,
  58097. n.FaceNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  58098. n.FaceNormalsHelper.prototype.constructor = n.FaceNormalsHelper,
  58099. n.FaceNormalsHelper.prototype.update = function() {
  58100. var e = new n.Vector3
  58101. , t = new n.Vector3
  58102. , i = new n.Matrix3;
  58103. return function() {
  58104. this.object.updateMatrixWorld(!0),
  58105. i.getNormalMatrix(this.object.matrixWorld);
  58106. 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++) {
  58107. var u = s[c]
  58108. , d = u.normal;
  58109. e.copy(a[u.a]).add(a[u.b]).add(a[u.c]).divideScalar(3).applyMatrix4(n),
  58110. t.copy(d).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  58111. r.setXYZ(l, e.x, e.y, e.z),
  58112. l += 1,
  58113. r.setXYZ(l, t.x, t.y, t.z),
  58114. l += 1
  58115. }
  58116. return r.needsUpdate = !0,
  58117. this
  58118. }
  58119. }(),
  58120. n.GridHelper = function(e, t) {
  58121. var i = new n.Geometry
  58122. , r = new n.LineBasicMaterial({
  58123. vertexColors: n.VertexColors
  58124. });
  58125. this.color1 = new n.Color(4473924),
  58126. this.color2 = new n.Color(8947848);
  58127. for (var o = -e; o <= e; o += t) {
  58128. 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));
  58129. var a = 0 === o ? this.color1 : this.color2;
  58130. i.colors.push(a, a, a, a)
  58131. }
  58132. n.LineSegments.call(this, i, r)
  58133. }
  58134. ,
  58135. n.GridHelper.prototype = Object.create(n.LineSegments.prototype),
  58136. n.GridHelper.prototype.constructor = n.GridHelper,
  58137. n.GridHelper.prototype.setColors = function(e, t) {
  58138. this.color1.set(e),
  58139. this.color2.set(t),
  58140. this.geometry.colorsNeedUpdate = !0
  58141. }
  58142. ,
  58143. n.HemisphereLightHelper = function(e, t) {
  58144. n.Object3D.call(this),
  58145. this.light = e,
  58146. this.light.updateMatrixWorld(),
  58147. this.matrix = e.matrixWorld,
  58148. this.matrixAutoUpdate = !1,
  58149. this.colors = [new n.Color, new n.Color];
  58150. var i = new n.SphereGeometry(t,4,2);
  58151. i.rotateX(-Math.PI / 2);
  58152. for (var r = 0, o = 8; r < o; r++)
  58153. i.faces[r].color = this.colors[r < 4 ? 0 : 1];
  58154. var a = new n.MeshBasicMaterial({
  58155. vertexColors: n.FaceColors,
  58156. wireframe: !0
  58157. });
  58158. this.lightSphere = new n.Mesh(i,a),
  58159. this.add(this.lightSphere),
  58160. this.update()
  58161. }
  58162. ,
  58163. n.HemisphereLightHelper.prototype = Object.create(n.Object3D.prototype),
  58164. n.HemisphereLightHelper.prototype.constructor = n.HemisphereLightHelper,
  58165. n.HemisphereLightHelper.prototype.dispose = function() {
  58166. this.lightSphere.geometry.dispose(),
  58167. this.lightSphere.material.dispose()
  58168. }
  58169. ,
  58170. n.HemisphereLightHelper.prototype.update = function() {
  58171. var e = new n.Vector3;
  58172. return function() {
  58173. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  58174. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  58175. this.lightSphere.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate()),
  58176. this.lightSphere.geometry.colorsNeedUpdate = !0
  58177. }
  58178. }(),
  58179. n.PointLightHelper = function(e, t) {
  58180. this.light = e,
  58181. this.light.updateMatrixWorld();
  58182. var i = new n.SphereGeometry(t,4,2)
  58183. , r = new n.MeshBasicMaterial({
  58184. wireframe: !0,
  58185. fog: !1
  58186. });
  58187. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  58188. n.Mesh.call(this, i, r),
  58189. this.matrix = this.light.matrixWorld,
  58190. this.matrixAutoUpdate = !1
  58191. }
  58192. ,
  58193. n.PointLightHelper.prototype = Object.create(n.Mesh.prototype),
  58194. n.PointLightHelper.prototype.constructor = n.PointLightHelper,
  58195. n.PointLightHelper.prototype.dispose = function() {
  58196. this.geometry.dispose(),
  58197. this.material.dispose()
  58198. }
  58199. ,
  58200. n.PointLightHelper.prototype.update = function() {
  58201. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  58202. }
  58203. ,
  58204. n.SkeletonHelper = function(e) {
  58205. this.bones = this.getBoneList(e);
  58206. for (var t = new n.Geometry, i = 0; i < this.bones.length; i++) {
  58207. var r = this.bones[i];
  58208. r.parent instanceof n.Bone && (t.vertices.push(new n.Vector3),
  58209. t.vertices.push(new n.Vector3),
  58210. t.colors.push(new n.Color(0,0,1)),
  58211. t.colors.push(new n.Color(0,1,0)))
  58212. }
  58213. t.dynamic = !0;
  58214. var o = new n.LineBasicMaterial({
  58215. vertexColors: n.VertexColors,
  58216. depthTest: !1,
  58217. depthWrite: !1,
  58218. transparent: !0
  58219. });
  58220. n.LineSegments.call(this, t, o),
  58221. this.root = e,
  58222. this.matrix = e.matrixWorld,
  58223. this.matrixAutoUpdate = !1,
  58224. this.update()
  58225. }
  58226. ,
  58227. n.SkeletonHelper.prototype = Object.create(n.LineSegments.prototype),
  58228. n.SkeletonHelper.prototype.constructor = n.SkeletonHelper,
  58229. n.SkeletonHelper.prototype.getBoneList = function(e) {
  58230. var t = [];
  58231. e instanceof n.Bone && t.push(e);
  58232. for (var i = 0; i < e.children.length; i++)
  58233. t.push.apply(t, this.getBoneList(e.children[i]));
  58234. return t
  58235. }
  58236. ,
  58237. n.SkeletonHelper.prototype.update = function() {
  58238. 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++) {
  58239. var a = this.bones[o];
  58240. a.parent instanceof n.Bone && (i.multiplyMatrices(t, a.matrixWorld),
  58241. e.vertices[r].setFromMatrixPosition(i),
  58242. i.multiplyMatrices(t, a.parent.matrixWorld),
  58243. e.vertices[r + 1].setFromMatrixPosition(i),
  58244. r += 2)
  58245. }
  58246. e.verticesNeedUpdate = !0,
  58247. e.computeBoundingSphere()
  58248. }
  58249. ,
  58250. n.SpotLightHelper = function(e) {
  58251. n.Object3D.call(this),
  58252. this.light = e,
  58253. this.light.updateMatrixWorld(),
  58254. this.matrix = e.matrixWorld,
  58255. this.matrixAutoUpdate = !1;
  58256. var t = new n.CylinderGeometry(0,1,1,8,1,!0);
  58257. t.translate(0, -.5, 0),
  58258. t.rotateX(-Math.PI / 2);
  58259. var i = new n.MeshBasicMaterial({
  58260. wireframe: !0,
  58261. fog: !1
  58262. });
  58263. this.cone = new n.Mesh(t,i),
  58264. this.add(this.cone),
  58265. this.update()
  58266. }
  58267. ,
  58268. n.SpotLightHelper.prototype = Object.create(n.Object3D.prototype),
  58269. n.SpotLightHelper.prototype.constructor = n.SpotLightHelper,
  58270. n.SpotLightHelper.prototype.dispose = function() {
  58271. this.cone.geometry.dispose(),
  58272. this.cone.material.dispose()
  58273. }
  58274. ,
  58275. n.SpotLightHelper.prototype.update = function() {
  58276. var e = new n.Vector3
  58277. , t = new n.Vector3;
  58278. return function() {
  58279. var i = this.light.distance ? this.light.distance : 1e4
  58280. , n = i * Math.tan(this.light.angle);
  58281. this.cone.scale.set(n, n, i),
  58282. e.setFromMatrixPosition(this.light.matrixWorld),
  58283. t.setFromMatrixPosition(this.light.target.matrixWorld),
  58284. this.cone.lookAt(t.sub(e)),
  58285. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  58286. }
  58287. }(),
  58288. n.VertexNormalsHelper = function(e, t, i, r) {
  58289. this.object = e,
  58290. this.size = void 0 !== t ? t : 1;
  58291. var o = void 0 !== i ? i : 16711680
  58292. , a = void 0 !== r ? r : 1
  58293. , s = 0
  58294. , l = this.object.geometry;
  58295. l instanceof n.Geometry ? s = 3 * l.faces.length : l instanceof n.BufferGeometry && (s = l.attributes.normal.count);
  58296. var c = new n.BufferGeometry
  58297. , h = new n.Float32Attribute(2 * s * 3,3);
  58298. c.addAttribute("position", h),
  58299. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  58300. color: o,
  58301. linewidth: a
  58302. })),
  58303. this.matrixAutoUpdate = !1,
  58304. this.update()
  58305. }
  58306. ,
  58307. n.VertexNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  58308. n.VertexNormalsHelper.prototype.constructor = n.VertexNormalsHelper,
  58309. n.VertexNormalsHelper.prototype.update = function() {
  58310. var e = new n.Vector3
  58311. , t = new n.Vector3
  58312. , i = new n.Matrix3;
  58313. return function() {
  58314. var r = ["a", "b", "c"];
  58315. this.object.updateMatrixWorld(!0),
  58316. i.getNormalMatrix(this.object.matrixWorld);
  58317. var o = this.object.matrixWorld
  58318. , a = this.geometry.attributes.position
  58319. , s = this.object.geometry;
  58320. if (s instanceof n.Geometry)
  58321. for (var l = s.vertices, c = s.faces, h = 0, u = 0, d = c.length; u < d; u++)
  58322. for (var p = c[u], f = 0, g = p.vertexNormals.length; f < g; f++) {
  58323. var m = l[p[r[f]]]
  58324. , v = p.vertexNormals[f];
  58325. e.copy(m).applyMatrix4(o),
  58326. t.copy(v).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  58327. a.setXYZ(h, e.x, e.y, e.z),
  58328. h += 1,
  58329. a.setXYZ(h, t.x, t.y, t.z),
  58330. h += 1
  58331. }
  58332. else if (s instanceof n.BufferGeometry)
  58333. for (var A = s.attributes.position, y = s.attributes.normal, h = 0, f = 0, g = A.count; f < g; f++)
  58334. e.set(A.getX(f), A.getY(f), A.getZ(f)).applyMatrix4(o),
  58335. t.set(y.getX(f), y.getY(f), y.getZ(f)),
  58336. t.applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  58337. a.setXYZ(h, e.x, e.y, e.z),
  58338. h += 1,
  58339. a.setXYZ(h, t.x, t.y, t.z),
  58340. h += 1;
  58341. return a.needsUpdate = !0,
  58342. this
  58343. }
  58344. }(),
  58345. n.WireframeHelper = function(e, t) {
  58346. var i = void 0 !== t ? t : 16777215;
  58347. n.LineSegments.call(this, new n.WireframeGeometry(e.geometry), new n.LineBasicMaterial({
  58348. color: i
  58349. })),
  58350. this.matrix = e.matrixWorld,
  58351. this.matrixAutoUpdate = !1
  58352. }
  58353. ,
  58354. n.WireframeHelper.prototype = Object.create(n.LineSegments.prototype),
  58355. n.WireframeHelper.prototype.constructor = n.WireframeHelper,
  58356. n.ImmediateRenderObject = function(e) {
  58357. n.Object3D.call(this),
  58358. this.material = e,
  58359. this.render = function(e) {}
  58360. }
  58361. ,
  58362. n.ImmediateRenderObject.prototype = Object.create(n.Object3D.prototype),
  58363. n.ImmediateRenderObject.prototype.constructor = n.ImmediateRenderObject,
  58364. n.MorphBlendMesh = function(e, t) {
  58365. n.Mesh.call(this, e, t),
  58366. this.animationsMap = {},
  58367. this.animationsList = [];
  58368. var i = this.geometry.morphTargets.length
  58369. , r = "__default"
  58370. , o = 0
  58371. , a = i - 1
  58372. , s = i / 1;
  58373. this.createAnimation(r, o, a, s),
  58374. this.setAnimationWeight(r, 1)
  58375. }
  58376. ,
  58377. n.MorphBlendMesh.prototype = Object.create(n.Mesh.prototype),
  58378. n.MorphBlendMesh.prototype.constructor = n.MorphBlendMesh,
  58379. n.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  58380. var r = {
  58381. start: t,
  58382. end: i,
  58383. length: i - t + 1,
  58384. fps: n,
  58385. duration: (i - t) / n,
  58386. lastFrame: 0,
  58387. currentFrame: 0,
  58388. active: !1,
  58389. time: 0,
  58390. direction: 1,
  58391. weight: 1,
  58392. directionBackwards: !1,
  58393. mirroredLoop: !1
  58394. };
  58395. this.animationsMap[e] = r,
  58396. this.animationsList.push(r)
  58397. }
  58398. ,
  58399. n.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  58400. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  58401. var s = r.morphTargets[o]
  58402. , l = s.name.match(i);
  58403. if (l && l.length > 1) {
  58404. var c = l[1];
  58405. n[c] || (n[c] = {
  58406. start: 1 / 0,
  58407. end: -(1 / 0)
  58408. });
  58409. var h = n[c];
  58410. o < h.start && (h.start = o),
  58411. o > h.end && (h.end = o),
  58412. t || (t = c)
  58413. }
  58414. }
  58415. for (var c in n) {
  58416. var h = n[c];
  58417. this.createAnimation(c, h.start, h.end, e)
  58418. }
  58419. this.firstAnimation = t
  58420. }
  58421. ,
  58422. n.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  58423. var t = this.animationsMap[e];
  58424. t && (t.direction = 1,
  58425. t.directionBackwards = !1)
  58426. }
  58427. ,
  58428. n.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  58429. var t = this.animationsMap[e];
  58430. t && (t.direction = -1,
  58431. t.directionBackwards = !0)
  58432. }
  58433. ,
  58434. n.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  58435. var i = this.animationsMap[e];
  58436. i && (i.fps = t,
  58437. i.duration = (i.end - i.start) / i.fps)
  58438. }
  58439. ,
  58440. n.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  58441. var i = this.animationsMap[e];
  58442. i && (i.duration = t,
  58443. i.fps = (i.end - i.start) / i.duration)
  58444. }
  58445. ,
  58446. n.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  58447. var i = this.animationsMap[e];
  58448. i && (i.weight = t)
  58449. }
  58450. ,
  58451. n.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  58452. var i = this.animationsMap[e];
  58453. i && (i.time = t)
  58454. }
  58455. ,
  58456. n.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  58457. var t = 0
  58458. , i = this.animationsMap[e];
  58459. return i && (t = i.time),
  58460. t
  58461. }
  58462. ,
  58463. n.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  58464. var t = -1
  58465. , i = this.animationsMap[e];
  58466. return i && (t = i.duration),
  58467. t
  58468. }
  58469. ,
  58470. n.MorphBlendMesh.prototype.playAnimation = function(e) {
  58471. var t = this.animationsMap[e];
  58472. t ? (t.time = 0,
  58473. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  58474. }
  58475. ,
  58476. n.MorphBlendMesh.prototype.stopAnimation = function(e) {
  58477. var t = this.animationsMap[e];
  58478. t && (t.active = !1)
  58479. }
  58480. ,
  58481. n.MorphBlendMesh.prototype.update = function(e) {
  58482. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  58483. var r = this.animationsList[t];
  58484. if (r.active) {
  58485. var o = r.duration / r.length;
  58486. r.time += r.direction * e,
  58487. r.mirroredLoop ? (r.time > r.duration || r.time < 0) && (r.direction *= -1,
  58488. r.time > r.duration && (r.time = r.duration,
  58489. r.directionBackwards = !0),
  58490. r.time < 0 && (r.time = 0,
  58491. r.directionBackwards = !1)) : (r.time = r.time % r.duration,
  58492. r.time < 0 && (r.time += r.duration));
  58493. var a = r.start + n.Math.clamp(Math.floor(r.time / o), 0, r.length - 1)
  58494. , s = r.weight;
  58495. a !== r.currentFrame && (this.morphTargetInfluences[r.lastFrame] = 0,
  58496. this.morphTargetInfluences[r.currentFrame] = 1 * s,
  58497. this.morphTargetInfluences[a] = 0,
  58498. r.lastFrame = r.currentFrame,
  58499. r.currentFrame = a);
  58500. var l = r.time % o / o;
  58501. r.directionBackwards && (l = 1 - l),
  58502. r.currentFrame !== r.lastFrame ? (this.morphTargetInfluences[r.currentFrame] = l * s,
  58503. this.morphTargetInfluences[r.lastFrame] = (1 - l) * s) : this.morphTargetInfluences[r.currentFrame] = s
  58504. }
  58505. }
  58506. }
  58507. ,
  58508. "undefined" != typeof i ? ("undefined" != typeof t && t.exports && (i = t.exports = n),
  58509. i.THREE = n) : this.THREE = n
  58510. window.THREE = n
  58511. getObjLoader()
  58512. initByTHREE(THREE)
  58513. //getWebXRManager()
  58514. }
  58515. , {}]
  58516. }, {}, [116]);
  58517. class PanTransGuide{
  58518. constructor(player){
  58519. this.player = player
  58520. this.currentIndex = 0
  58521. this.getNodes()
  58522. }
  58523. getNodes(){
  58524. this.nodes = []
  58525. let path = this.player.path
  58526. let last
  58527. let index = this.player.model.heroLocations.findIndex(e=>e.name == '沉浸看展') //先去掉之前旧的数据
  58528. if(index>-1){
  58529. let locations = this.player.model.heroLocations[index].heroLocations
  58530. this.player.model.heroLocations.splice(index,1)
  58531. }
  58532. let get = (e, originItem)=>{
  58533. if(e.cameraMode != 'panorama'){
  58534. e.originItem = originItem
  58535. this.nodes.push(e)
  58536. return last = null //断连
  58537. }
  58538. if(last){
  58539. e.visited = true
  58540. path.setWarpDestination(e)
  58541. path.setWarpDestPano()
  58542. let A = path.getHeroPano(last),
  58543. B = path.warpDestPano
  58544. if(e.momentTour == 'black' && A!=B){
  58545. path.nodes = [A.id,B.id];//直接加入
  58546. }else{
  58547. path.nodes = path.findShortestPath(A, B)
  58548. if(path.nodes == null){//两个点之间不相通
  58549. console.log('两个点之间不相通',A.id,B.id)
  58550. path.nodes = [A.id,B.id];//直接加入
  58551. }
  58552. }
  58553. let wholeDis = 0, disSections = []
  58554. path.nodes.forEach((cur,i)=>{
  58555. if(i==0)return
  58556. let prePano = this.player.model.panos.get(path.nodes[i-1])
  58557. let curPano = this.player.model.panos.get(cur)
  58558. let dis = prePano.position.distanceTo(curPano.position)
  58559. disSections.push(dis)
  58560. wholeDis += dis
  58561. },0)
  58562. let quaStart = last.quaternion
  58563. let quaEnd = e.quaternion
  58564. path.nodes.forEach((panoId,j)=>{
  58565. if(j == 0){
  58566. if(path.nodes.length == 1)return this.nodes.push({panoId,quaternion:quaEnd})//原地旋转
  58567. if(!last) return //和上一段末尾重复
  58568. return this.nodes.push({panoId,quaternion:quaStart})
  58569. }
  58570. let r = disSections[j-1] / wholeDis
  58571. let quaternion = quaStart.clone()
  58572. lerp.quaternion(quaternion, quaEnd)(r)
  58573. this.nodes.push({panoId, quaternion})
  58574. })
  58575. }
  58576. last = e
  58577. }
  58578. this.player.model.heroLocations.forEach((e,i)=>{
  58579. if(e.heroLocations){
  58580. e.heroLocations.forEach((a,j)=> get(a, [i,j]))
  58581. }else{
  58582. get(e,[i,0])
  58583. }
  58584. })
  58585. //补 因为last前一个可能不是panorama,导致last没加进nodes
  58586. if(last && !last.visited){
  58587. get(last)
  58588. }
  58589. }
  58590. go(axis){
  58591. if(this.player.flying)return
  58592. let aimNode
  58593. let cur = this.nodes[this.currentIndex]
  58594. if(cur.panoId != this.player.currentPano.id && player.mode == 'panorama'){//已走动){//已走动
  58595. let curs = this.nodes.filter(e=>e.panoId == this.player.currentPano)
  58596. curs.sort((a,b)=>{ //如果有多个,找到和currentIndex最接近的,可能是刚走过的
  58597. let indexA = this.nodes.indexOf(a)
  58598. let indexB = this.nodes.indexOf(b)
  58599. return Math.abs(indexA - this.currentIndex) < Math.abs(indexB - this.currentIndex)
  58600. })
  58601. cur = curs[0]
  58602. if(!cur){//不在道上 . 找离当前位置最近的node
  58603. let disMap = new Map
  58604. let nodes_ = this.nodes.filter(e=>!e.originItem)
  58605. nodes_.forEach(e=>{
  58606. disMap.set(e,player.currentPano.position.distanceToSquared(this.player.model.panos.get(e.panoId).position))
  58607. })
  58608. let sorted = nodes_.slice().sort((a,b)=>{
  58609. return disMap.get(a) - disMap.get(b)
  58610. })
  58611. this.currentIndex = this.nodes.indexOf(sorted[0])//next
  58612. if(axis == -1){
  58613. this.moveIndex(-1)
  58614. }
  58615. aimNode = this.nodes[this.currentIndex]
  58616. }
  58617. }
  58618. let lastIndex = this.currentIndex
  58619. if(!aimNode){
  58620. this.moveIndex(axis)
  58621. aimNode = this.nodes[this.currentIndex]
  58622. }
  58623. if(aimNode.originItem){//要飞出的,直接用导览飞
  58624. player.director.setDestinationItem(aimNode.originItem)
  58625. player.director.goToDestination()
  58626. return
  58627. }
  58628. //let dis = this.player.model.panos.get(aimNode.panoId).position.distanceTo(this.player.position)
  58629. let moveStyle = (lastIndex == 0 && axis == -1 || this.currentIndex == 0 && axis != -1) ? "blackToPano" : "flyToPano"
  58630. this.player[moveStyle]({pano: this.player.model.panos.get(aimNode.panoId), quaternion:aimNode.quaternion}, ()=>{
  58631. //更新导览进度条
  58632. player.director.setDestinationItem( player.director.findNearestItem(true,true) )
  58633. })
  58634. }
  58635. moveIndex(step){
  58636. this.currentIndex += (step + this.nodes.length)
  58637. this.currentIndex %= this.nodes.length
  58638. return this.currentIndex
  58639. }
  58640. }
  58641. //2025新的需求 沉浸看展直接使用导览
  58642. window.tourPlayCtl = {
  58643. go(axis){
  58644. player.guider2.go(axis)
  58645. }
  58646. }
  58647. /*
  58648. function getWebXRManager(){
  58649. class ArrayCamera extends THREE.PerspectiveCamera {
  58650. constructor(array = []) {
  58651. super();
  58652. this.isArrayCamera = true;
  58653. this.cameras = array;
  58654. }
  58655. }
  58656. function WebGLAnimation() {
  58657. let context = null;
  58658. let isAnimating = false;
  58659. let animationLoop = null;
  58660. let requestId = null;
  58661. function onAnimationFrame(time, frame) {
  58662. animationLoop(time, frame);
  58663. requestId = context.requestAnimationFrame(onAnimationFrame);
  58664. }
  58665. return {
  58666. start: function () {
  58667. if (isAnimating === true) return;
  58668. if (animationLoop === null) return;
  58669. requestId = context.requestAnimationFrame(onAnimationFrame);
  58670. isAnimating = true;
  58671. },
  58672. stop: function () {
  58673. context.cancelAnimationFrame(requestId);
  58674. isAnimating = false;
  58675. },
  58676. setAnimationLoop: function (callback) {
  58677. animationLoop = callback;
  58678. },
  58679. setContext: function (value) {
  58680. context = value;
  58681. }
  58682. };
  58683. }
  58684. function WebXRManager( renderer, gl ) {
  58685. var scope = this;
  58686. var session = null;
  58687. // var framebufferScaleFactor = 1.0;
  58688. var referenceSpace = null;
  58689. var referenceSpaceType = 'local-floor';
  58690. var pose = null;
  58691. var controllers = [];
  58692. var sortedInputSources = [];
  58693. function isPresenting() {
  58694. return session !== null && referenceSpace !== null;
  58695. }
  58696. //
  58697. var cameraL = new THREE.PerspectiveCamera();
  58698. cameraL.layers.enable( 1 );
  58699. cameraL.viewport = new THREE.Vector4();
  58700. var cameraR = new THREE.PerspectiveCamera();
  58701. cameraR.layers.enable( 2 );
  58702. cameraR.viewport = new THREE.Vector4();
  58703. var cameraVR = new ArrayCamera( [ cameraL, cameraR ] );
  58704. cameraVR.layers.enable( 1 );
  58705. cameraVR.layers.enable( 2 );
  58706. //
  58707. this.enabled = false;
  58708. this.getController = function ( id ) {
  58709. var controller = controllers[ id ];
  58710. if ( controller === undefined ) {
  58711. controller = new THREE.Group();
  58712. controller.matrixAutoUpdate = false;
  58713. controller.visible = false;
  58714. controllers[ id ] = controller;
  58715. }
  58716. return controller;
  58717. };
  58718. //
  58719. function onSessionEvent( event ) {
  58720. for ( var i = 0; i < controllers.length; i ++ ) {
  58721. if ( sortedInputSources[ i ] === event.inputSource ) {
  58722. controllers[ i ].dispatchEvent( { type: event.type } );
  58723. }
  58724. }
  58725. }
  58726. function onSessionEnd() {
  58727. renderer.setFramebuffer( null );
  58728. renderer.setRenderTarget( renderer.getRenderTarget() ); // Hack #15830
  58729. animation.stop();
  58730. scope.dispatchEvent( { type: 'sessionend' } );
  58731. }
  58732. function onRequestReferenceSpace( value ) {
  58733. referenceSpace = value;
  58734. animation.setContext( session );
  58735. animation.start();
  58736. scope.dispatchEvent( { type: 'sessionstart' } );
  58737. }
  58738. this.setFramebufferScaleFactor = function ( ) {
  58739. // framebufferScaleFactor = value;
  58740. };
  58741. this.setReferenceSpaceType = function ( value ) {
  58742. referenceSpaceType = value;
  58743. };
  58744. this.getSession = function () {
  58745. return session;
  58746. };
  58747. this.setSession = function ( value ) {
  58748. session = value;
  58749. if ( session !== null ) {
  58750. session.addEventListener( 'select', onSessionEvent );
  58751. session.addEventListener( 'selectstart', onSessionEvent );
  58752. session.addEventListener( 'selectend', onSessionEvent );
  58753. session.addEventListener( 'end', onSessionEnd );
  58754. // eslint-disable-next-line no-undef
  58755. session.updateRenderState( { baseLayer: new XRWebGLLayer( session, gl, { antialias: false } ) } );
  58756. session.requestReferenceSpace( referenceSpaceType ).then( onRequestReferenceSpace );
  58757. //
  58758. session.addEventListener( 'inputsourceschange', updateInputSources );
  58759. updateInputSources();
  58760. }
  58761. };
  58762. function updateInputSources() {
  58763. for ( var i = 0; i < controllers.length; i ++ ) {
  58764. sortedInputSources[ i ] = findInputSource( i );
  58765. }
  58766. }
  58767. function findInputSource( id ) {
  58768. var inputSources = session.inputSources;
  58769. for ( var i = 0; i < inputSources.length; i ++ ) {
  58770. var inputSource = inputSources[ i ];
  58771. var handedness = inputSource.handedness;
  58772. if ( id === 0 && ( handedness === 'none' || handedness === 'right' ) ) return inputSource;
  58773. if ( id === 1 && ( handedness === 'left' ) ) return inputSource;
  58774. }
  58775. }
  58776. //
  58777. function updateCamera( camera, parent ) {
  58778. if ( parent === null ) {
  58779. camera.matrixWorld.copy( camera.matrix );
  58780. } else {
  58781. camera.matrixWorld.multiplyMatrices( parent.matrixWorld, camera.matrix );
  58782. }
  58783. camera.matrixWorldInverse.getInverse( camera.matrixWorld );
  58784. }
  58785. this.getCamera = function ( camera ) {
  58786. if ( isPresenting() ) {
  58787. var parent = camera.parent;
  58788. var cameras = cameraVR.cameras;
  58789. updateCamera( cameraVR, parent );
  58790. for ( var i = 0; i < cameras.length; i ++ ) {
  58791. updateCamera( cameras[ i ], parent );
  58792. }
  58793. // update camera and its children
  58794. camera.matrixWorld.copy( cameraVR.matrixWorld );
  58795. var children = camera.children;
  58796. for ( var i = 0, l = children.length; i < l; i ++ ) {
  58797. children[ i ].updateMatrixWorld( true );
  58798. }
  58799. setProjectionFromUnion( cameraVR, cameraL, cameraR );
  58800. return cameraVR;
  58801. }
  58802. return camera;
  58803. };
  58804. this.isPresenting = isPresenting;
  58805. // Animation Loop
  58806. var onAnimationFrameCallback = null;
  58807. function onAnimationFrame( time, frame ) {
  58808. pose = frame.getViewerPose( referenceSpace );
  58809. if ( pose !== null ) {
  58810. var views = pose.views;
  58811. var baseLayer = session.renderState.baseLayer;
  58812. renderer.setFramebuffer( baseLayer.framebuffer );
  58813. for ( var i = 0; i < views.length; i ++ ) {
  58814. var view = views[ i ];
  58815. var viewport = baseLayer.getViewport( view );
  58816. var viewMatrix = view.transform.inverse.matrix;
  58817. var camera = cameraVR.cameras[ i ];
  58818. camera.matrix.fromArray( viewMatrix ).getInverse( camera.matrix );
  58819. camera.projectionMatrix.fromArray( view.projectionMatrix );
  58820. camera.viewport.set( viewport.x, viewport.y, viewport.width, viewport.height );
  58821. if ( i === 0 ) {
  58822. cameraVR.matrix.copy( camera.matrix );
  58823. }
  58824. }
  58825. }
  58826. //
  58827. for ( var i = 0; i < controllers.length; i ++ ) {
  58828. var controller = controllers[ i ];
  58829. var inputSource = sortedInputSources[ i ];
  58830. if ( inputSource ) {
  58831. var inputPose = frame.getPose( inputSource.targetRaySpace, referenceSpace );
  58832. if ( inputPose !== null ) {
  58833. controller.matrix.fromArray( inputPose.transform.matrix );
  58834. controller.matrix.decompose( controller.position, controller.rotation, controller.scale );
  58835. controller.visible = true;
  58836. continue;
  58837. }
  58838. }
  58839. controller.visible = false;
  58840. }
  58841. if ( onAnimationFrameCallback ) onAnimationFrameCallback( time );
  58842. }
  58843. var animation = new WebGLAnimation();
  58844. animation.setAnimationLoop( onAnimationFrame );
  58845. this.setAnimationLoop = function ( callback ) {
  58846. onAnimationFrameCallback = callback;
  58847. };
  58848. this.dispose = function () {};
  58849. // DEPRECATED
  58850. this.getStandingMatrix = function () {
  58851. console.warn( 'THREE.WebXRManager: getStandingMatrix() is no longer needed.' );
  58852. return new THREE.Matrix4();
  58853. };
  58854. this.getDevice = function () {
  58855. console.warn( 'THREE.WebXRManager: getDevice() has been deprecated.' );
  58856. };
  58857. this.setDevice = function () {
  58858. console.warn( 'THREE.WebXRManager: setDevice() has been deprecated.' );
  58859. };
  58860. this.setFrameOfReferenceType = function () {
  58861. console.warn( 'THREE.WebXRManager: setFrameOfReferenceType() has been deprecated.' );
  58862. };
  58863. this.submitFrame = function () {};
  58864. }
  58865. Object.assign( WebXRManager.prototype, THREE.EventDispatcher.prototype );
  58866. THREE.WebXRManager = WebXRManager
  58867. }
  58868. function getWebXRManager(){
  58869. class ArrayCamera extends THREE.PerspectiveCamera {
  58870. constructor(array = []) {
  58871. super();
  58872. this.isArrayCamera = true;
  58873. this.cameras = array;
  58874. }
  58875. }
  58876. class WebXRController {
  58877. constructor() {
  58878. this._targetRay = null;
  58879. this._grip = null;
  58880. this._hand = null;
  58881. }
  58882. getHandSpace() {
  58883. if (this._hand === null) {
  58884. this._hand = new THREE.Group();
  58885. this._hand.matrixAutoUpdate = false;
  58886. this._hand.visible = false;
  58887. this._hand.joints = {};
  58888. this._hand.inputState = {
  58889. pinching: false
  58890. };
  58891. }
  58892. return this._hand;
  58893. }
  58894. getTargetRaySpace() {
  58895. if (this._targetRay === null) {
  58896. this._targetRay = new THREE.Group();
  58897. this._targetRay.matrixAutoUpdate = false;
  58898. this._targetRay.visible = false;
  58899. this._targetRay.hasLinearVelocity = false;
  58900. this._targetRay.linearVelocity = new THREE.Vector3();
  58901. this._targetRay.hasAngularVelocity = false;
  58902. this._targetRay.angularVelocity = new THREE.Vector3();
  58903. }
  58904. return this._targetRay;
  58905. }
  58906. getGripSpace() {
  58907. if (this._grip === null) {
  58908. this._grip = new THREE.Group();
  58909. this._grip.matrixAutoUpdate = false;
  58910. this._grip.visible = false;
  58911. this._grip.hasLinearVelocity = false;
  58912. this._grip.linearVelocity = new THREE.Vector3();
  58913. this._grip.hasAngularVelocity = false;
  58914. this._grip.angularVelocity = new THREE.Vector3();
  58915. }
  58916. return this._grip;
  58917. }
  58918. dispatchEvent(event) {
  58919. if (this._targetRay !== null) {
  58920. this._targetRay.dispatchEvent(event);
  58921. }
  58922. if (this._grip !== null) {
  58923. this._grip.dispatchEvent(event);
  58924. }
  58925. if (this._hand !== null) {
  58926. this._hand.dispatchEvent(event);
  58927. }
  58928. return this;
  58929. }
  58930. disconnect(inputSource) {
  58931. this.dispatchEvent({
  58932. type: 'disconnected',
  58933. data: inputSource
  58934. });
  58935. if (this._targetRay !== null) {
  58936. this._targetRay.visible = false;
  58937. }
  58938. if (this._grip !== null) {
  58939. this._grip.visible = false;
  58940. }
  58941. if (this._hand !== null) {
  58942. this._hand.visible = false;
  58943. }
  58944. return this;
  58945. }
  58946. update(inputSource, frame, referenceSpace) {
  58947. let inputPose = null;
  58948. let gripPose = null;
  58949. let handPose = null;
  58950. const targetRay = this._targetRay;
  58951. const grip = this._grip;
  58952. const hand = this._hand;
  58953. if (inputSource && frame.session.visibilityState !== 'visible-blurred') {
  58954. if (hand && inputSource.hand) {
  58955. handPose = true;
  58956. for (const inputjoint of inputSource.hand.values()) {
  58957. // Update the joints groups with the XRJoint poses
  58958. const jointPose = frame.getJointPose(inputjoint, referenceSpace);
  58959. if (hand.joints[inputjoint.jointName] === undefined) {
  58960. // The transform of this joint will be updated with the joint pose on each frame
  58961. const joint = new THREE.Group();
  58962. joint.matrixAutoUpdate = false;
  58963. joint.visible = false;
  58964. hand.joints[inputjoint.jointName] = joint; // ??
  58965. hand.add(joint);
  58966. }
  58967. const joint = hand.joints[inputjoint.jointName];
  58968. if (jointPose !== null) {
  58969. joint.matrix.fromArray(jointPose.transform.matrix);
  58970. joint.matrix.decompose(joint.position, joint.rotation, joint.scale);
  58971. joint.jointRadius = jointPose.radius;
  58972. }
  58973. joint.visible = jointPose !== null;
  58974. } // Custom events
  58975. // Check pinchz
  58976. const indexTip = hand.joints['index-finger-tip'];
  58977. const thumbTip = hand.joints['thumb-tip'];
  58978. const distance = indexTip.position.distanceTo(thumbTip.position);
  58979. const distanceToPinch = 0.02;
  58980. const threshold = 0.005;
  58981. if (hand.inputState.pinching && distance > distanceToPinch + threshold) {
  58982. hand.inputState.pinching = false;
  58983. this.dispatchEvent({
  58984. type: 'pinchend',
  58985. handedness: inputSource.handedness,
  58986. target: this
  58987. });
  58988. } else if (!hand.inputState.pinching && distance <= distanceToPinch - threshold) {
  58989. hand.inputState.pinching = true;
  58990. this.dispatchEvent({
  58991. type: 'pinchstart',
  58992. handedness: inputSource.handedness,
  58993. target: this
  58994. });
  58995. }
  58996. } else {
  58997. if (grip !== null && inputSource.gripSpace) {
  58998. gripPose = frame.getPose(inputSource.gripSpace, referenceSpace);
  58999. if (gripPose !== null) {
  59000. grip.matrix.fromArray(gripPose.transform.matrix);
  59001. grip.matrix.decompose(grip.position, grip.rotation, grip.scale);
  59002. if (gripPose.linearVelocity) {
  59003. grip.hasLinearVelocity = true;
  59004. grip.linearVelocity.copy(gripPose.linearVelocity);
  59005. } else {
  59006. grip.hasLinearVelocity = false;
  59007. }
  59008. if (gripPose.angularVelocity) {
  59009. grip.hasAngularVelocity = true;
  59010. grip.angularVelocity.copy(gripPose.angularVelocity);
  59011. } else {
  59012. grip.hasAngularVelocity = false;
  59013. }
  59014. }
  59015. }
  59016. }
  59017. if (targetRay !== null) {
  59018. inputPose = frame.getPose(inputSource.targetRaySpace, referenceSpace); // Some runtimes (namely Vive Cosmos with Vive OpenXR Runtime) have only grip space and ray space is equal to it
  59019. if (inputPose === null && gripPose !== null) {
  59020. inputPose = gripPose;
  59021. }
  59022. if (inputPose !== null) {
  59023. targetRay.matrix.fromArray(inputPose.transform.matrix);
  59024. targetRay.matrix.decompose(targetRay.position, targetRay.rotation, targetRay.scale);
  59025. if (inputPose.linearVelocity) {
  59026. targetRay.hasLinearVelocity = true;
  59027. targetRay.linearVelocity.copy(inputPose.linearVelocity);
  59028. } else {
  59029. targetRay.hasLinearVelocity = false;
  59030. }
  59031. if (inputPose.angularVelocity) {
  59032. targetRay.hasAngularVelocity = true;
  59033. targetRay.angularVelocity.copy(inputPose.angularVelocity);
  59034. } else {
  59035. targetRay.hasAngularVelocity = false;
  59036. }
  59037. this.dispatchEvent(_moveEvent);
  59038. }
  59039. }
  59040. }
  59041. if (targetRay !== null) {
  59042. targetRay.visible = inputPose !== null;
  59043. }
  59044. if (grip !== null) {
  59045. grip.visible = gripPose !== null;
  59046. }
  59047. if (hand !== null) {
  59048. hand.visible = handPose !== null;
  59049. }
  59050. return this;
  59051. }
  59052. }
  59053. function WebGLAnimation() {
  59054. let context = null;
  59055. let isAnimating = false;
  59056. let animationLoop = null;
  59057. let requestId = null;
  59058. function onAnimationFrame(time, frame) {
  59059. animationLoop(time, frame);
  59060. requestId = context.requestAnimationFrame(onAnimationFrame);
  59061. }
  59062. return {
  59063. start: function () {
  59064. if (isAnimating === true) return;
  59065. if (animationLoop === null) return;
  59066. requestId = context.requestAnimationFrame(onAnimationFrame);
  59067. isAnimating = true;
  59068. },
  59069. stop: function () {
  59070. context.cancelAnimationFrame(requestId);
  59071. isAnimating = false;
  59072. },
  59073. setAnimationLoop: function (callback) {
  59074. animationLoop = callback;
  59075. },
  59076. setContext: function (value) {
  59077. context = value;
  59078. }
  59079. };
  59080. }
  59081. class WebXRManager extends THREE.EventDispatcher {
  59082. constructor(renderer, gl) {
  59083. super();
  59084. const scope = this;
  59085. let session = null;
  59086. let framebufferScaleFactor = 1.0;
  59087. let referenceSpace = null;
  59088. let referenceSpaceType = 'local-floor';
  59089. let customReferenceSpace = null;
  59090. let pose = null;
  59091. let glBinding = null;
  59092. let glProjLayer = null;
  59093. let glBaseLayer = null;
  59094. let xrFrame = null;
  59095. const attributes = gl.getContextAttributes();
  59096. let initialRenderTarget = null;
  59097. let newRenderTarget = null;
  59098. const controllers = [];
  59099. const controllerInputSources = []; //
  59100. const cameraL = new THREE.PerspectiveCamera();
  59101. cameraL.layers.enable(1);
  59102. cameraL.viewport = new THREE.Vector4();
  59103. const cameraR = new THREE.PerspectiveCamera();
  59104. cameraR.layers.enable(2);
  59105. cameraR.viewport = new THREE.Vector4();
  59106. const cameras = [cameraL, cameraR];
  59107. const cameraVR = new ArrayCamera();
  59108. cameraVR.layers.enable(1);
  59109. cameraVR.layers.enable(2);
  59110. let _currentDepthNear = null;
  59111. let _currentDepthFar = null; //
  59112. this.cameraAutoUpdate = true;
  59113. this.enabled = false;
  59114. this.isPresenting = false;
  59115. this.getController = function (index) {
  59116. let controller = controllers[index];
  59117. if (controller === undefined) {
  59118. controller = new WebXRController();
  59119. controllers[index] = controller;
  59120. }
  59121. return controller.getTargetRaySpace();
  59122. };
  59123. this.getControllerGrip = function (index) {
  59124. let controller = controllers[index];
  59125. if (controller === undefined) {
  59126. controller = new WebXRController();
  59127. controllers[index] = controller;
  59128. }
  59129. return controller.getGripSpace();
  59130. };
  59131. this.getHand = function (index) {
  59132. let controller = controllers[index];
  59133. if (controller === undefined) {
  59134. controller = new WebXRController();
  59135. controllers[index] = controller;
  59136. }
  59137. return controller.getHandSpace();
  59138. }; //
  59139. function onSessionEvent(event) {
  59140. const controllerIndex = controllerInputSources.indexOf(event.inputSource);
  59141. if (controllerIndex === -1) {
  59142. return;
  59143. }
  59144. const controller = controllers[controllerIndex];
  59145. if (controller !== undefined) {
  59146. controller.dispatchEvent({
  59147. type: event.type,
  59148. data: event.inputSource
  59149. });
  59150. }
  59151. }
  59152. function onSessionEnd() {
  59153. session.removeEventListener('select', onSessionEvent);
  59154. session.removeEventListener('selectstart', onSessionEvent);
  59155. session.removeEventListener('selectend', onSessionEvent);
  59156. session.removeEventListener('squeeze', onSessionEvent);
  59157. session.removeEventListener('squeezestart', onSessionEvent);
  59158. session.removeEventListener('squeezeend', onSessionEvent);
  59159. session.removeEventListener('end', onSessionEnd);
  59160. session.removeEventListener('inputsourceschange', onInputSourcesChange);
  59161. for (let i = 0; i < controllers.length; i++) {
  59162. const inputSource = controllerInputSources[i];
  59163. if (inputSource === null) continue;
  59164. controllerInputSources[i] = null;
  59165. controllers[i].disconnect(inputSource);
  59166. }
  59167. _currentDepthNear = null;
  59168. _currentDepthFar = null; // restore framebuffer/rendering state
  59169. renderer.setRenderTarget(initialRenderTarget);
  59170. glBaseLayer = null;
  59171. glProjLayer = null;
  59172. glBinding = null;
  59173. session = null;
  59174. newRenderTarget = null; //
  59175. animation.stop();
  59176. scope.isPresenting = false;
  59177. scope.dispatchEvent({
  59178. type: 'sessionend'
  59179. });
  59180. }
  59181. this.setFramebufferScaleFactor = function (value) {
  59182. framebufferScaleFactor = value;
  59183. if (scope.isPresenting === true) {
  59184. console.warn('THREE.WebXRManager: Cannot change framebuffer scale while presenting.');
  59185. }
  59186. };
  59187. this.setReferenceSpaceType = function (value) {
  59188. referenceSpaceType = value;
  59189. if (scope.isPresenting === true) {
  59190. console.warn('THREE.WebXRManager: Cannot change reference space type while presenting.');
  59191. }
  59192. };
  59193. this.getReferenceSpace = function () {
  59194. return customReferenceSpace || referenceSpace;
  59195. };
  59196. this.setReferenceSpace = function (space) {
  59197. customReferenceSpace = space;
  59198. };
  59199. this.getBaseLayer = function () {
  59200. return glProjLayer !== null ? glProjLayer : glBaseLayer;
  59201. };
  59202. this.getBinding = function () {
  59203. return glBinding;
  59204. };
  59205. this.getFrame = function () {
  59206. return xrFrame;
  59207. };
  59208. this.getSession = function () {
  59209. return session;
  59210. };
  59211. this.setSession = async function (value) {
  59212. session = value;
  59213. if (session !== null) {
  59214. initialRenderTarget = renderer.getCurrentRenderTarget();
  59215. session.addEventListener('select', onSessionEvent);
  59216. session.addEventListener('selectstart', onSessionEvent);
  59217. session.addEventListener('selectend', onSessionEvent);
  59218. session.addEventListener('squeeze', onSessionEvent);
  59219. session.addEventListener('squeezestart', onSessionEvent);
  59220. session.addEventListener('squeezeend', onSessionEvent);
  59221. session.addEventListener('end', onSessionEnd);
  59222. session.addEventListener('inputsourceschange', onInputSourcesChange);
  59223. if (attributes.xrCompatible !== true) {
  59224. await gl.makeXRCompatible();
  59225. }
  59226. if (session.renderState.layers === undefined || renderer.capabilities.isWebGL2 === false) {
  59227. const layerInit = {
  59228. antialias: session.renderState.layers === undefined ? attributes.antialias : true,
  59229. alpha: attributes.alpha,
  59230. depth: attributes.depth,
  59231. stencil: attributes.stencil,
  59232. framebufferScaleFactor: framebufferScaleFactor
  59233. };
  59234. glBaseLayer = new XRWebGLLayer(session, gl, layerInit);
  59235. session.updateRenderState({
  59236. baseLayer: glBaseLayer
  59237. });
  59238. newRenderTarget = new THREE.WebGLRenderTarget(glBaseLayer.framebufferWidth, glBaseLayer.framebufferHeight, {
  59239. format: THREE.RGBAFormat,
  59240. type: THREE.UnsignedByteType,
  59241. encoding: renderer.outputEncoding
  59242. });
  59243. } else {
  59244. let depthFormat = null;
  59245. let depthType = null;
  59246. let glDepthFormat = null;
  59247. if (attributes.depth) {
  59248. glDepthFormat = attributes.stencil ? gl.DEPTH24_STENCIL8 : gl.DEPTH_COMPONENT24;
  59249. depthFormat = attributes.stencil ? DepthStencilFormat : DepthFormat;
  59250. depthType = attributes.stencil ? UnsignedInt248Type : UnsignedIntType;
  59251. }
  59252. const projectionlayerInit = {
  59253. colorFormat: gl.RGBA8,
  59254. depthFormat: glDepthFormat,
  59255. scaleFactor: framebufferScaleFactor
  59256. };
  59257. glBinding = new XRWebGLBinding(session, gl);
  59258. glProjLayer = glBinding.createProjectionLayer(projectionlayerInit);
  59259. session.updateRenderState({
  59260. layers: [glProjLayer]
  59261. });
  59262. newRenderTarget = new THREE.WebGLRenderTarget(glProjLayer.textureWidth, glProjLayer.textureHeight, {
  59263. format: THREE.RGBAFormat,
  59264. type: THREE.UnsignedByteType,
  59265. depthTexture: new THREE.DepthTexture(glProjLayer.textureWidth, glProjLayer.textureHeight, depthType, undefined, undefined, undefined, undefined, undefined, undefined, depthFormat),
  59266. stencilBuffer: attributes.stencil,
  59267. encoding: renderer.outputEncoding,
  59268. samples: attributes.antialias ? 4 : 0
  59269. });
  59270. const renderTargetProperties = renderer.properties.get(newRenderTarget);
  59271. renderTargetProperties.__ignoreDepthValues = glProjLayer.ignoreDepthValues;
  59272. }
  59273. newRenderTarget.isXRRenderTarget = true; // TODO Remove this when possible, see #23278
  59274. // Set foveation to maximum.
  59275. this.setFoveation(1.0);
  59276. customReferenceSpace = null;
  59277. referenceSpace = await session.requestReferenceSpace(referenceSpaceType);
  59278. animation.setContext(session);
  59279. animation.start();
  59280. scope.isPresenting = true;
  59281. scope.dispatchEvent({
  59282. type: 'sessionstart'
  59283. });
  59284. }
  59285. };
  59286. function onInputSourcesChange(event) {
  59287. // Notify disconnected
  59288. for (let i = 0; i < event.removed.length; i++) {
  59289. const inputSource = event.removed[i];
  59290. const index = controllerInputSources.indexOf(inputSource);
  59291. if (index >= 0) {
  59292. controllerInputSources[index] = null;
  59293. controllers[index].dispatchEvent({
  59294. type: 'disconnected',
  59295. data: inputSource
  59296. });
  59297. }
  59298. } // Notify connected
  59299. for (let i = 0; i < event.added.length; i++) {
  59300. const inputSource = event.added[i];
  59301. let controllerIndex = controllerInputSources.indexOf(inputSource);
  59302. if (controllerIndex === -1) {
  59303. // Assign input source a controller that currently has no input source
  59304. for (let i = 0; i < controllers.length; i++) {
  59305. if (i >= controllerInputSources.length) {
  59306. controllerInputSources.push(inputSource);
  59307. controllerIndex = i;
  59308. break;
  59309. } else if (controllerInputSources[i] === null) {
  59310. controllerInputSources[i] = inputSource;
  59311. controllerIndex = i;
  59312. break;
  59313. }
  59314. } // If all controllers do currently receive input we ignore new ones
  59315. if (controllerIndex === -1) break;
  59316. }
  59317. const controller = controllers[controllerIndex];
  59318. if (controller) {
  59319. controller.dispatchEvent({
  59320. type: 'connected',
  59321. data: inputSource
  59322. });
  59323. }
  59324. }
  59325. } //
  59326. const cameraLPos = new THREE.Vector3();
  59327. const cameraRPos = new THREE.Vector3();
  59328. function setProjectionFromUnion(camera, cameraL, cameraR) {
  59329. cameraLPos.setFromMatrixPosition(cameraL.matrixWorld);
  59330. cameraRPos.setFromMatrixPosition(cameraR.matrixWorld);
  59331. const ipd = cameraLPos.distanceTo(cameraRPos);
  59332. const projL = cameraL.projectionMatrix.elements;
  59333. const projR = cameraR.projectionMatrix.elements; // VR systems will have identical far and near planes, and
  59334. // most likely identical top and bottom frustum extents.
  59335. // Use the left camera for these values.
  59336. const near = projL[14] / (projL[10] - 1);
  59337. const far = projL[14] / (projL[10] + 1);
  59338. const topFov = (projL[9] + 1) / projL[5];
  59339. const bottomFov = (projL[9] - 1) / projL[5];
  59340. const leftFov = (projL[8] - 1) / projL[0];
  59341. const rightFov = (projR[8] + 1) / projR[0];
  59342. const left = near * leftFov;
  59343. const right = near * rightFov; // Calculate the new camera's position offset from the
  59344. // left camera. xOffset should be roughly half `ipd`.
  59345. const zOffset = ipd / (-leftFov + rightFov);
  59346. const xOffset = zOffset * -leftFov; // TODO: Better way to apply this offset?
  59347. cameraL.matrixWorld.decompose(camera.position, camera.quaternion, camera.scale);
  59348. camera.translateX(xOffset);
  59349. camera.translateZ(zOffset);
  59350. camera.matrixWorld.compose(camera.position, camera.quaternion, camera.scale);
  59351. camera.matrixWorldInverse.copy(camera.matrixWorld).invert(); // Find the union of the frustum values of the cameras and scale
  59352. // the values so that the near plane's position does not change in world space,
  59353. // although must now be relative to the new union camera.
  59354. const near2 = near + zOffset;
  59355. const far2 = far + zOffset;
  59356. const left2 = left - xOffset;
  59357. const right2 = right + (ipd - xOffset);
  59358. const top2 = topFov * far / far2 * near2;
  59359. const bottom2 = bottomFov * far / far2 * near2;
  59360. camera.projectionMatrix.makePerspective(left2, right2, top2, bottom2, near2, far2);
  59361. }
  59362. function updateCamera(camera, parent) {
  59363. if (parent === null) {
  59364. camera.matrixWorld.copy(camera.matrix);
  59365. } else {
  59366. camera.matrixWorld.multiplyMatrices(parent.matrixWorld, camera.matrix);
  59367. }
  59368. camera.matrixWorldInverse.copy(camera.matrixWorld).invert();
  59369. }
  59370. this.updateCamera = function (camera) {
  59371. if (session === null) return;
  59372. cameraVR.near = cameraR.near = cameraL.near = camera.near;
  59373. cameraVR.far = cameraR.far = cameraL.far = camera.far;
  59374. if (_currentDepthNear !== cameraVR.near || _currentDepthFar !== cameraVR.far) {
  59375. // Note that the new renderState won't apply until the next frame. See #18320
  59376. session.updateRenderState({
  59377. depthNear: cameraVR.near,
  59378. depthFar: cameraVR.far
  59379. });
  59380. _currentDepthNear = cameraVR.near;
  59381. _currentDepthFar = cameraVR.far;
  59382. }
  59383. const parent = camera.parent;
  59384. const cameras = cameraVR.cameras;
  59385. updateCamera(cameraVR, parent);
  59386. for (let i = 0; i < cameras.length; i++) {
  59387. updateCamera(cameras[i], parent);
  59388. }
  59389. cameraVR.matrixWorld.decompose(cameraVR.position, cameraVR.quaternion, cameraVR.scale); // update user camera and its children
  59390. camera.position.copy(cameraVR.position);
  59391. camera.quaternion.copy(cameraVR.quaternion);
  59392. camera.scale.copy(cameraVR.scale);
  59393. camera.matrix.copy(cameraVR.matrix);
  59394. camera.matrixWorld.copy(cameraVR.matrixWorld);
  59395. const children = camera.children;
  59396. for (let i = 0, l = children.length; i < l; i++) {
  59397. children[i].updateMatrixWorld(true);
  59398. } // update projection matrix for proper view frustum culling
  59399. if (cameras.length === 2) {
  59400. setProjectionFromUnion(cameraVR, cameraL, cameraR);
  59401. } else {
  59402. // assume single camera setup (AR)
  59403. cameraVR.projectionMatrix.copy(cameraL.projectionMatrix);
  59404. }
  59405. };
  59406. this.getCamera = function () {
  59407. return cameraVR;
  59408. };
  59409. this.getFoveation = function () {
  59410. if (glProjLayer !== null) {
  59411. return glProjLayer.fixedFoveation;
  59412. }
  59413. if (glBaseLayer !== null) {
  59414. return glBaseLayer.fixedFoveation;
  59415. }
  59416. return undefined;
  59417. };
  59418. this.setFoveation = function (foveation) {
  59419. // 0 = no foveation = full resolution
  59420. // 1 = maximum foveation = the edges render at lower resolution
  59421. if (glProjLayer !== null) {
  59422. glProjLayer.fixedFoveation = foveation;
  59423. }
  59424. if (glBaseLayer !== null && glBaseLayer.fixedFoveation !== undefined) {
  59425. glBaseLayer.fixedFoveation = foveation;
  59426. }
  59427. }; // Animation Loop
  59428. let onAnimationFrameCallback = null;
  59429. function onAnimationFrame(time, frame) {
  59430. pose = frame.getViewerPose(customReferenceSpace || referenceSpace);
  59431. xrFrame = frame;
  59432. if (pose !== null) {
  59433. const views = pose.views;
  59434. if (glBaseLayer !== null) {
  59435. renderer.setRenderTargetFramebuffer(newRenderTarget, glBaseLayer.framebuffer);
  59436. renderer.setRenderTarget(newRenderTarget);
  59437. }
  59438. let cameraVRNeedsUpdate = false; // check if it's necessary to rebuild cameraVR's camera list
  59439. if (views.length !== cameraVR.cameras.length) {
  59440. cameraVR.cameras.length = 0;
  59441. cameraVRNeedsUpdate = true;
  59442. }
  59443. for (let i = 0; i < views.length; i++) {
  59444. const view = views[i];
  59445. let viewport = null;
  59446. if (glBaseLayer !== null) {
  59447. viewport = glBaseLayer.getViewport(view);
  59448. } else {
  59449. const glSubImage = glBinding.getViewSubImage(glProjLayer, view);
  59450. viewport = glSubImage.viewport; // For side-by-side projection, we only produce a single texture for both eyes.
  59451. if (i === 0) {
  59452. renderer.setRenderTargetTextures(newRenderTarget, glSubImage.colorTexture, glProjLayer.ignoreDepthValues ? undefined : glSubImage.depthStencilTexture);
  59453. renderer.setRenderTarget(newRenderTarget);
  59454. }
  59455. }
  59456. let camera = cameras[i];
  59457. if (camera === undefined) {
  59458. camera = new THREE.PerspectiveCamera();
  59459. camera.layers.enable(i);
  59460. camera.viewport = new THREE.Vector4();
  59461. cameras[i] = camera;
  59462. }
  59463. camera.matrix.fromArray(view.transform.matrix);
  59464. camera.projectionMatrix.fromArray(view.projectionMatrix);
  59465. camera.viewport.set(viewport.x, viewport.y, viewport.width, viewport.height);
  59466. if (i === 0) {
  59467. cameraVR.matrix.copy(camera.matrix);
  59468. }
  59469. if (cameraVRNeedsUpdate === true) {
  59470. cameraVR.cameras.push(camera);
  59471. }
  59472. }
  59473. } //
  59474. for (let i = 0; i < controllers.length; i++) {
  59475. const inputSource = controllerInputSources[i];
  59476. const controller = controllers[i];
  59477. if (inputSource !== null && controller !== undefined) {
  59478. controller.update(inputSource, frame, customReferenceSpace || referenceSpace);
  59479. }
  59480. }
  59481. if (onAnimationFrameCallback) onAnimationFrameCallback(time, frame);
  59482. xrFrame = null;
  59483. }
  59484. const animation = new WebGLAnimation();
  59485. animation.setAnimationLoop(onAnimationFrame);
  59486. this.setAnimationLoop = function (callback) {
  59487. onAnimationFrameCallback = callback;
  59488. };
  59489. this.dispose = function () {};
  59490. }
  59491. }
  59492. THREE.WebXRManager = WebXRManager
  59493. } */
  59494. /*
  59495. var addMagnifier = function(){
  59496. class Magnifier extends THREE.Object3D {
  59497. constructor () {
  59498. super()
  59499. let circleGeo = new THREE.CircleGeometry(0.1, 100);
  59500. this.camera = new THREE.PerspectiveCamera(50, 1, 0.1, 1); //fov aspect near far
  59501. this.renderTarget = new THREE.WebGLRenderTarget(256,256, {
  59502. minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter,
  59503. format: THREE.RGBAFormat ,
  59504. //type: THREE.FloatType,
  59505. //minFilter: THREE.NearestFilter,
  59506. //magFilter: THREE.NearestFilter,
  59507. } )
  59508. this.mesh = new THREE.Mesh(circleGeo, new THREE.MeshBasicMaterial({
  59509. side: THREE.DoubleSide ,
  59510. map: this.renderTarget.texture ,
  59511. transparent:true,
  59512. depthTest: !1,
  59513. depthWrite: !1,
  59514. }))
  59515. this.overlayMesh = new THREE.Mesh(circleGeo, new THREE.MeshBasicMaterial({
  59516. side: THREE.DoubleSide ,
  59517. map: Texture.load('images/crosshair.png') ,
  59518. transparent:true,
  59519. depthTest: !1,
  59520. depthWrite: !1,
  59521. }))
  59522. this.add(this.mesh)
  59523. this.add(this.overlayMesh)
  59524. player.model.add(this);
  59525. player.magnifier = this;
  59526. }
  59527. update(aimPos){
  59528. const magDistance_ = 0.3;
  59529. var playerPos = player.position
  59530. var vec = playerPos.clone().sub(aimPos).normalize().multiplyScalar(magDistance_)
  59531. this.camera.position.copy(aimPos.clone().add(vec))
  59532. this.camera.lookAt(aimPos)
  59533. var playerCamera = player.camera
  59534. this.quaternion.copy(playerCamera.quaternion);
  59535. var pos2d = player.mouse.clone();
  59536. var shift = 400;
  59537. var clientHeight = player.domElement.clientHeight
  59538. var clientY = - (pos2d.y - 1) * clientHeight / 2;
  59539. pos2d.y = clientY < 300 ? pos2d.y - shift/clientHeight : pos2d.y + shift/clientHeight
  59540. let newPos = new THREE.Vector3(pos2d.x,pos2d.y,0.7).unproject(playerCamera);
  59541. this.position.copy(newPos)
  59542. var renderer = player.sceneRenderer.renderer
  59543. var oldAutoClear = renderer.autoClear
  59544. renderer.autoClear = false
  59545. //renderer.clear( true, true, true );
  59546. renderer.render(player.sceneRenderer.scene, this.camera, this.renderTarget, true)
  59547. renderer.autoClear = oldAutoClear
  59548. }
  59549. }
  59550. new Magnifier()
  59551. }
  59552. */
  59553. /*
  59554. 笔记:
  59555. 导览缩放的几处: 1 搜索smoothZoomFovTo 2 flightStepWalk里
  59556. {
  59557. //到导览中某个点位(假设点位不重复)
  59558. var id = 73
  59559. var p = player.model.heroLocations.find(e=>e.heroLocations && e.heroLocations.find(e=>e.panoId == id))
  59560. var i = player.model.heroLocations.indexOf(p)
  59561. var p1 = p.heroLocations.find(e=>e.panoId == id)
  59562. var j = p.heroLocations.indexOf(p1)
  59563. player.director.goToHighlight([i,j])
  59564. }
  59565. 展示版导览改为就近导览,所以一开始并非第一个。如果在最后一个点上会自动从头开始
  59566. 关于pc-nav 4k
  59567. 两种选择,1 按照正常流程,因为nav为4k所以直接使用4k的tiledPanoRenderTarget, 但useUltraHighResolutionPanos需要开启才能达到4k,否则是2k。这样的话第一个点位需要手动重新替换tiledPanoRenderTarget,所以废弃
  59568. 2 使zoomed一直为true,直接使用zoomRenderTarget。 参考之前写过的三屏的本地4k。 且创建的tiledPanoRenderTarget不能超过2048否则过渡卡顿;且直到到达该点后才能下载4k,否则不会渲染到zoomRenderTarget上
  59569. 如果body使用transform旋转90度,需要改的地方:
  59570. convertScreenPositionToNDC: function(e, t, i) {//rotate 90 body: transform: rotate(90deg);
  59571. return i = i || new n.Vector2,
  59572. i.y = e / $("#player").height() * 2 - 1, //注意,当body旋转90度后,虽然clientX和clinetY是按照正常垂直视角,但player的长宽和原先一样,不会因为倒转而交换
  59573. i.x = t / $("#player").width() * 2 - 1,
  59574. i
  59575. },
  59576. outsideControl的 n.prototype.onTouchMove = function(e) {中的
  59577. this.pan(this.panDelta.x, this.panDelta.y) 改为 this.pan(this.panDelta.y, -this.panDelta.x), //rotate 90
  59578. 还有
  59579. this.rotateLeft(2 * Math.PI * this.rotateDelta.y / $("#player").width() * this.rotateSpeed), //rotate 90
  59580. this.rotateUp(2 * Math.PI * -this.rotateDelta.x / $("#player").height() * this.rotateSpeed),
  59581. ===================
  59582. 一些事件
  59583. player.model.on("floor.changed",(currentFloor, mode, oldFloor)=>{//楼层变化
  59584. player.on("pano.chosen", 旧的pano, 新的pano) //点位变化前
  59585. player.on("flying.ended", 新位置, 旧位置, 新的pano, 旧的pano) //点位变化后,或飞出后
  59586. 一些后缀
  59587. &panoLabel 加pano标签
  59588. director.on("tour.end") //导览结束 是否在导览播放中:player.director.tourInProgress() 不包括点击item
  59589. player.isWarping() //是否在导览中,包括点击item的fly
  59590. 我加了个 director.on("warp.end")
  59591. */