main_2020_show.js 2.6 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653546545465554656546575465854659546605466154662546635466454665546665466754668546695467054671546725467354674546755467654677546785467954680546815468254683546845468554686546875468854689546905469154692546935469454695546965469754698546995470054701547025470354704547055470654707547085470954710547115471254713547145471554716547175471854719547205472154722547235472454725547265472754728547295473054731547325473354734547355473654737547385473954740547415474254743547445474554746547475474854749547505475154752547535475454755547565475754758547595476054761547625476354764547655476654767547685476954770547715477254773547745477554776547775477854779547805478154782547835478454785547865478754788547895479054791547925479354794547955479654797547985479954800548015480254803548045480554806548075480854809548105481154812548135481454815548165481754818548195482054821548225482354824548255482654827548285482954830548315483254833548345483554836548375483854839548405484154842548435484454845548465484754848548495485054851548525485354854548555485654857548585485954860548615486254863548645486554866548675486854869548705487154872548735487454875548765487754878548795488054881548825488354884548855488654887548885488954890548915489254893548945489554896548975489854899549005490154902549035490454905549065490754908549095491054911549125491354914549155491654917549185491954920549215492254923549245492554926549275492854929549305493154932549335493454935549365493754938549395494054941549425494354944549455494654947549485494954950549515495254953549545495554956549575495854959549605496154962549635496454965549665496754968549695497054971549725497354974549755497654977549785497954980549815498254983549845498554986549875498854989549905499154992549935499454995549965499754998549995500055001550025500355004550055500655007550085500955010550115501255013550145501555016550175501855019550205502155022550235502455025550265502755028550295503055031550325503355034550355503655037550385503955040550415504255043550445504555046550475504855049550505505155052550535505455055550565505755058550595506055061550625506355064550655506655067550685506955070550715507255073550745507555076550775507855079550805508155082550835508455085550865508755088550895509055091550925509355094550955509655097550985509955100551015510255103551045510555106551075510855109551105511155112551135511455115551165511755118551195512055121551225512355124551255512655127551285512955130551315513255133551345513555136551375513855139551405514155142551435514455145551465514755148551495515055151551525515355154551555515655157551585515955160551615516255163551645516555166551675516855169551705517155172551735517455175551765517755178551795518055181551825518355184551855518655187551885518955190551915519255193551945519555196551975519855199552005520155202552035520455205552065520755208552095521055211552125521355214552155521655217552185521955220552215522255223552245522555226552275522855229552305523155232552335523455235552365523755238552395524055241552425524355244552455524655247552485524955250552515525255253552545525555256552575525855259552605526155262552635526455265552665526755268552695527055271552725527355274552755527655277552785527955280552815528255283552845528555286552875528855289552905529155292552935529455295552965529755298552995530055301553025530355304553055530655307553085530955310553115531255313553145531555316553175531855319553205532155322553235532455325553265532755328553295533055331553325533355334553355533655337553385533955340553415534255343553445534555346553475534855349553505535155352553535535455355553565535755358553595536055361553625536355364553655536655367553685536955370553715537255373553745537555376553775537855379553805538155382553835538455385553865538755388553895539055391553925539355394553955539655397553985539955400554015540255403554045540555406554075540855409554105541155412554135541455415554165541755418554195542055421554225542355424554255542655427554285542955430554315543255433554345543555436554375543855439554405544155442554435544455445554465544755448554495545055451554525545355454554555545655457554585545955460554615546255463554645546555466554675546855469554705547155472554735547455475554765547755478554795548055481554825548355484554855548655487554885548955490554915549255493554945549555496554975549855499555005550155502555035550455505555065550755508555095551055511555125551355514555155551655517555185551955520555215552255523555245552555526555275552855529555305553155532555335553455535555365553755538555395554055541555425554355544555455554655547555485554955550555515555255553555545555555556555575555855559555605556155562555635556455565555665556755568555695557055571555725557355574555755557655577555785557955580555815558255583555845558555586555875558855589555905559155592555935559455595555965559755598555995560055601556025560355604556055560655607556085560955610556115561255613556145561555616556175561855619556205562155622556235562455625556265562755628556295563055631556325563355634556355563655637556385563955640556415564255643556445564555646556475564855649556505565155652556535565455655556565565755658556595566055661556625566355664556655566655667556685566955670556715567255673556745567555676556775567855679556805568155682556835568455685556865568755688556895569055691556925569355694556955569655697556985569955700557015570255703557045570555706557075570855709557105571155712557135571455715557165571755718557195572055721557225572355724557255572655727557285572955730557315573255733557345573555736557375573855739557405574155742557435574455745557465574755748557495575055751557525575355754557555575655757557585575955760557615576255763557645576555766557675576855769557705577155772557735577455775557765577755778557795578055781557825578355784557855578655787557885578955790557915579255793557945579555796557975579855799558005580155802558035580455805558065580755808558095581055811558125581355814558155581655817558185581955820558215582255823558245582555826558275582855829558305583155832558335583455835558365583755838558395584055841558425584355844558455584655847558485584955850558515585255853558545585555856558575585855859558605586155862558635586455865558665586755868558695587055871558725587355874558755587655877558785587955880558815588255883558845588555886558875588855889558905589155892558935589455895558965589755898558995590055901559025590355904559055590655907559085590955910559115591255913559145591555916559175591855919559205592155922559235592455925559265592755928559295593055931559325593355934559355593655937559385593955940559415594255943559445594555946559475594855949559505595155952559535595455955559565595755958559595596055961559625596355964559655596655967559685596955970559715597255973559745597555976559775597855979559805598155982559835598455985559865598755988559895599055991559925599355994559955599655997559985599956000560015600256003560045600556006560075600856009560105601156012560135601456015560165601756018560195602056021560225602356024560255602656027560285602956030560315603256033560345603556036560375603856039560405604156042560435604456045560465604756048560495605056051560525605356054560555605656057560585605956060560615606256063560645606556066560675606856069560705607156072560735607456075560765607756078560795608056081560825608356084560855608656087560885608956090560915609256093560945609556096560975609856099561005610156102561035610456105561065610756108561095611056111561125611356114561155611656117561185611956120561215612256123561245612556126561275612856129561305613156132561335613456135561365613756138561395614056141561425614356144561455614656147561485614956150561515615256153561545615556156561575615856159561605616156162561635616456165561665616756168561695617056171561725617356174561755617656177561785617956180561815618256183561845618556186561875618856189561905619156192561935619456195561965619756198561995620056201562025620356204562055620656207562085620956210562115621256213562145621556216562175621856219562205622156222562235622456225562265622756228562295623056231562325623356234562355623656237562385623956240562415624256243562445624556246562475624856249562505625156252562535625456255562565625756258562595626056261562625626356264562655626656267562685626956270562715627256273562745627556276562775627856279562805628156282562835628456285562865628756288562895629056291562925629356294562955629656297562985629956300563015630256303563045630556306563075630856309563105631156312563135631456315563165631756318563195632056321563225632356324563255632656327563285632956330563315633256333563345633556336563375633856339563405634156342563435634456345563465634756348563495635056351563525635356354563555635656357563585635956360563615636256363563645636556366563675636856369563705637156372563735637456375563765637756378563795638056381563825638356384563855638656387563885638956390563915639256393563945639556396563975639856399564005640156402564035640456405564065640756408564095641056411564125641356414564155641656417564185641956420564215642256423564245642556426564275642856429564305643156432564335643456435564365643756438564395644056441564425644356444564455644656447564485644956450564515645256453564545645556456564575645856459564605646156462564635646456465564665646756468564695647056471564725647356474564755647656477564785647956480564815648256483564845648556486564875648856489564905649156492564935649456495564965649756498564995650056501565025650356504565055650656507565085650956510565115651256513565145651556516565175651856519565205652156522565235652456525565265652756528565295653056531565325653356534565355653656537565385653956540565415654256543565445654556546565475654856549565505655156552565535655456555565565655756558565595656056561565625656356564565655656656567565685656956570565715657256573565745657556576565775657856579565805658156582565835658456585565865658756588565895659056591565925659356594565955659656597565985659956600566015660256603566045660556606566075660856609566105661156612566135661456615566165661756618566195662056621566225662356624566255662656627566285662956630566315663256633566345663556636566375663856639566405664156642566435664456645566465664756648566495665056651566525665356654566555665656657566585665956660566615666256663566645666556666566675666856669566705667156672566735667456675566765667756678566795668056681566825668356684566855668656687566885668956690566915669256693566945669556696566975669856699567005670156702567035670456705567065670756708567095671056711567125671356714567155671656717567185671956720567215672256723567245672556726567275672856729567305673156732567335673456735567365673756738567395674056741567425674356744567455674656747567485674956750567515675256753567545675556756567575675856759567605676156762567635676456765567665676756768567695677056771567725677356774567755677656777567785677956780567815678256783567845678556786567875678856789567905679156792567935679456795567965679756798567995680056801568025680356804568055680656807568085680956810568115681256813568145681556816568175681856819568205682156822568235682456825568265682756828568295683056831568325683356834568355683656837568385683956840568415684256843568445684556846568475684856849568505685156852568535685456855568565685756858568595686056861568625686356864568655686656867568685686956870568715687256873568745687556876568775687856879568805688156882568835688456885568865688756888568895689056891568925689356894568955689656897568985689956900569015690256903569045690556906569075690856909569105691156912569135691456915569165691756918569195692056921569225692356924569255692656927569285692956930569315693256933569345693556936569375693856939569405694156942569435694456945569465694756948569495695056951569525695356954569555695656957569585695956960569615696256963569645696556966569675696856969569705697156972569735697456975569765697756978569795698056981569825698356984569855698656987569885698956990569915699256993569945699556996569975699856999570005700157002570035700457005570065700757008570095701057011570125701357014570155701657017570185701957020570215702257023570245702557026570275702857029570305703157032570335703457035570365703757038570395704057041570425704357044570455704657047570485704957050570515705257053570545705557056570575705857059570605706157062570635706457065570665706757068570695707057071570725707357074570755707657077570785707957080570815708257083570845708557086570875708857089570905709157092570935709457095570965709757098570995710057101571025710357104571055710657107571085710957110571115711257113571145711557116571175711857119571205712157122571235712457125571265712757128571295713057131571325713357134571355713657137571385713957140571415714257143571445714557146571475714857149571505715157152571535715457155571565715757158571595716057161571625716357164571655716657167571685716957170571715717257173571745717557176571775717857179571805718157182571835718457185571865718757188571895719057191571925719357194571955719657197571985719957200572015720257203572045720557206572075720857209572105721157212572135721457215572165721757218572195722057221572225722357224572255722657227572285722957230572315723257233572345723557236572375723857239572405724157242572435724457245572465724757248572495725057251572525725357254572555725657257572585725957260572615726257263572645726557266572675726857269572705727157272572735727457275572765727757278572795728057281572825728357284572855728657287572885728957290572915729257293572945729557296572975729857299573005730157302573035730457305573065730757308573095731057311573125731357314573155731657317573185731957320573215732257323573245732557326573275732857329573305733157332573335733457335573365733757338573395734057341573425734357344573455734657347573485734957350573515735257353573545735557356573575735857359573605736157362573635736457365573665736757368573695737057371573725737357374573755737657377573785737957380573815738257383573845738557386573875738857389573905739157392573935739457395573965739757398573995740057401574025740357404574055740657407574085740957410574115741257413574145741557416574175741857419574205742157422574235742457425574265742757428574295743057431574325743357434574355743657437574385743957440574415744257443574445744557446574475744857449574505745157452574535745457455574565745757458574595746057461574625746357464574655746657467574685746957470574715747257473574745747557476574775747857479574805748157482574835748457485574865748757488574895749057491574925749357494574955749657497574985749957500575015750257503575045750557506575075750857509575105751157512575135751457515575165751757518575195752057521575225752357524575255752657527575285752957530575315753257533575345753557536575375753857539575405754157542575435754457545575465754757548575495755057551575525755357554575555755657557575585755957560575615756257563575645756557566575675756857569575705757157572575735757457575575765757757578575795758057581575825758357584575855758657587575885758957590575915759257593575945759557596575975759857599576005760157602576035760457605576065760757608576095761057611576125761357614576155761657617576185761957620576215762257623576245762557626576275762857629576305763157632576335763457635576365763757638576395764057641576425764357644576455764657647576485764957650576515765257653576545765557656576575765857659576605766157662576635766457665576665766757668576695767057671576725767357674576755767657677576785767957680576815768257683576845768557686576875768857689576905769157692576935769457695576965769757698576995770057701577025770357704577055770657707577085770957710577115771257713577145771557716577175771857719577205772157722577235772457725577265772757728577295773057731577325773357734577355773657737577385773957740577415774257743577445774557746577475774857749577505775157752577535775457755577565775757758577595776057761577625776357764577655776657767577685776957770577715777257773577745777557776577775777857779577805778157782577835778457785577865778757788577895779057791577925779357794577955779657797577985779957800578015780257803578045780557806578075780857809578105781157812578135781457815578165781757818578195782057821578225782357824578255782657827578285782957830578315783257833578345783557836578375783857839578405784157842578435784457845578465784757848578495785057851578525785357854578555785657857578585785957860578615786257863578645786557866578675786857869578705787157872578735787457875578765787757878578795788057881578825788357884578855788657887578885788957890578915789257893578945789557896578975789857899579005790157902579035790457905579065790757908579095791057911579125791357914579155791657917579185791957920579215792257923579245792557926579275792857929579305793157932579335793457935579365793757938579395794057941579425794357944579455794657947579485794957950579515795257953579545795557956579575795857959579605796157962579635796457965579665796757968579695797057971579725797357974579755797657977579785797957980579815798257983579845798557986579875798857989579905799157992579935799457995579965799757998579995800058001580025800358004580055800658007580085800958010580115801258013580145801558016580175801858019580205802158022580235802458025580265802758028580295803058031580325803358034580355803658037580385803958040580415804258043580445804558046580475804858049580505805158052580535805458055580565805758058580595806058061580625806358064580655806658067580685806958070580715807258073580745807558076580775807858079580805808158082580835808458085580865808758088580895809058091580925809358094580955809658097580985809958100581015810258103581045810558106581075810858109581105811158112581135811458115581165811758118581195812058121581225812358124581255812658127581285812958130581315813258133581345813558136581375813858139581405814158142581435814458145581465814758148581495815058151581525815358154581555815658157581585815958160581615816258163581645816558166581675816858169581705817158172581735817458175581765817758178581795818058181581825818358184581855818658187581885818958190581915819258193581945819558196581975819858199582005820158202582035820458205582065820758208582095821058211582125821358214582155821658217582185821958220582215822258223582245822558226582275822858229582305823158232582335823458235582365823758238582395824058241582425824358244582455824658247582485824958250582515825258253582545825558256582575825858259582605826158262582635826458265582665826758268582695827058271582725827358274582755827658277582785827958280582815828258283582845828558286582875828858289582905829158292582935829458295582965829758298582995830058301583025830358304583055830658307583085830958310583115831258313583145831558316583175831858319583205832158322583235832458325583265832758328583295833058331583325833358334583355833658337583385833958340583415834258343583445834558346583475834858349583505835158352583535835458355583565835758358583595836058361583625836358364583655836658367583685836958370583715837258373583745837558376583775837858379583805838158382583835838458385583865838758388583895839058391583925839358394583955839658397583985839958400584015840258403584045840558406584075840858409584105841158412584135841458415584165841758418584195842058421584225842358424584255842658427584285842958430584315843258433584345843558436584375843858439584405844158442584435844458445584465844758448584495845058451584525845358454584555845658457584585845958460584615846258463584645846558466584675846858469584705847158472584735847458475584765847758478584795848058481584825848358484584855848658487584885848958490584915849258493584945849558496584975849858499585005850158502585035850458505585065850758508585095851058511585125851358514585155851658517585185851958520585215852258523585245852558526585275852858529585305853158532585335853458535585365853758538585395854058541585425854358544585455854658547585485854958550585515855258553585545855558556585575855858559585605856158562585635856458565585665856758568585695857058571585725857358574585755857658577585785857958580585815858258583585845858558586585875858858589585905859158592585935859458595585965859758598585995860058601586025860358604586055860658607586085860958610586115861258613586145861558616586175861858619586205862158622586235862458625586265862758628586295863058631586325863358634586355863658637586385863958640586415864258643586445864558646586475864858649586505865158652586535865458655586565865758658586595866058661586625866358664586655866658667586685866958670586715867258673586745867558676586775867858679586805868158682586835868458685586865868758688586895869058691586925869358694586955869658697586985869958700587015870258703587045870558706587075870858709587105871158712587135871458715587165871758718587195872058721587225872358724587255872658727587285872958730587315873258733587345873558736587375873858739587405874158742587435874458745587465874758748587495875058751587525875358754587555875658757587585875958760587615876258763587645876558766587675876858769587705877158772587735877458775587765877758778587795878058781587825878358784587855878658787587885878958790587915879258793587945879558796587975879858799588005880158802588035880458805588065880758808588095881058811588125881358814588155881658817588185881958820588215882258823588245882558826588275882858829588305883158832588335883458835588365883758838588395884058841588425884358844588455884658847588485884958850588515885258853588545885558856588575885858859588605886158862588635886458865588665886758868588695887058871588725887358874588755887658877588785887958880588815888258883588845888558886588875888858889588905889158892588935889458895588965889758898588995890058901589025890358904589055890658907589085890958910589115891258913589145891558916589175891858919589205892158922589235892458925589265892758928589295893058931589325893358934589355893658937589385893958940589415894258943589445894558946589475894858949589505895158952589535895458955589565895758958589595896058961589625896358964589655896658967589685896958970589715897258973589745897558976589775897858979589805898158982589835898458985589865898758988589895899058991589925899358994589955899658997589985899959000590015900259003590045900559006590075900859009590105901159012590135901459015590165901759018590195902059021590225902359024590255902659027590285902959030590315903259033590345903559036590375903859039590405904159042590435904459045590465904759048590495905059051590525905359054590555905659057590585905959060590615906259063590645906559066590675906859069590705907159072590735907459075590765907759078590795908059081590825908359084590855908659087590885908959090590915909259093590945909559096590975909859099591005910159102591035910459105591065910759108591095911059111591125911359114591155911659117591185911959120591215912259123591245912559126591275912859129591305913159132591335913459135591365913759138591395914059141591425914359144591455914659147591485914959150591515915259153591545915559156591575915859159591605916159162591635916459165591665916759168591695917059171591725917359174591755917659177591785917959180591815918259183591845918559186591875918859189591905919159192591935919459195591965919759198591995920059201592025920359204592055920659207592085920959210592115921259213592145921559216592175921859219592205922159222592235922459225592265922759228592295923059231592325923359234592355923659237592385923959240592415924259243592445924559246592475924859249592505925159252592535925459255592565925759258592595926059261592625926359264592655926659267592685926959270592715927259273592745927559276592775927859279592805928159282592835928459285592865928759288592895929059291592925929359294592955929659297592985929959300593015930259303593045930559306593075930859309593105931159312593135931459315593165931759318593195932059321593225932359324593255932659327593285932959330593315933259333593345933559336593375933859339593405934159342593435934459345593465934759348593495935059351593525935359354593555935659357593585935959360593615936259363593645936559366593675936859369593705937159372593735937459375593765937759378593795938059381593825938359384593855938659387593885938959390593915939259393593945939559396593975939859399594005940159402594035940459405594065940759408594095941059411594125941359414594155941659417594185941959420594215942259423594245942559426594275942859429594305943159432594335943459435594365943759438594395944059441594425944359444594455944659447594485944959450594515945259453594545945559456594575945859459594605946159462594635946459465594665946759468594695947059471594725947359474594755947659477594785947959480594815948259483594845948559486594875948859489594905949159492594935949459495594965949759498594995950059501595025950359504595055950659507595085950959510595115951259513595145951559516595175951859519595205952159522595235952459525595265952759528595295953059531595325953359534595355953659537595385953959540595415954259543595445954559546595475954859549595505955159552595535955459555595565955759558595595956059561595625956359564595655956659567595685956959570595715957259573595745957559576595775957859579595805958159582595835958459585595865958759588595895959059591595925959359594595955959659597595985959959600596015960259603596045960559606596075960859609596105961159612596135961459615596165961759618596195962059621596225962359624596255962659627596285962959630596315963259633596345963559636596375963859639596405964159642596435964459645596465964759648596495965059651596525965359654596555965659657596585965959660596615966259663596645966559666596675966859669596705967159672596735967459675596765967759678596795968059681596825968359684596855968659687596885968959690596915969259693596945969559696596975969859699597005970159702597035970459705597065970759708597095971059711597125971359714597155971659717597185971959720597215972259723597245972559726597275972859729597305973159732597335973459735597365973759738597395974059741597425974359744597455974659747597485974959750597515975259753597545975559756597575975859759597605976159762597635976459765597665976759768597695977059771597725977359774597755977659777597785977959780597815978259783597845978559786597875978859789597905979159792597935979459795597965979759798597995980059801598025980359804598055980659807598085980959810598115981259813598145981559816598175981859819598205982159822598235982459825598265982759828598295983059831598325983359834598355983659837598385983959840598415984259843598445984559846598475984859849598505985159852598535985459855598565985759858598595986059861598625986359864598655986659867598685986959870598715987259873598745987559876598775987859879598805988159882598835988459885598865988759888598895989059891598925989359894598955989659897598985989959900599015990259903599045990559906599075990859909599105991159912599135991459915599165991759918599195992059921599225992359924599255992659927599285992959930599315993259933599345993559936599375993859939599405994159942599435994459945599465994759948599495995059951599525995359954599555995659957599585995959960599615996259963599645996559966599675996859969599705997159972599735997459975599765997759978599795998059981599825998359984599855998659987599885998959990599915999259993599945999559996599975999859999600006000160002600036000460005600066000760008600096001060011600126001360014600156001660017600186001960020600216002260023600246002560026600276002860029600306003160032600336003460035600366003760038600396004060041600426004360044600456004660047600486004960050600516005260053600546005560056600576005860059600606006160062600636006460065600666006760068600696007060071600726007360074600756007660077600786007960080600816008260083600846008560086600876008860089600906009160092600936009460095600966009760098600996010060101601026010360104601056010660107601086010960110601116011260113601146011560116601176011860119601206012160122601236012460125601266012760128601296013060131601326013360134601356013660137601386013960140601416014260143601446014560146601476014860149601506015160152601536015460155601566015760158601596016060161601626016360164601656016660167601686016960170601716017260173601746017560176601776017860179601806018160182601836018460185601866018760188601896019060191601926019360194601956019660197601986019960200602016020260203602046020560206602076020860209602106021160212602136021460215602166021760218602196022060221602226022360224602256022660227602286022960230602316023260233602346023560236602376023860239602406024160242602436024460245602466024760248602496025060251602526025360254602556025660257602586025960260602616026260263602646026560266602676026860269602706027160272602736027460275602766027760278602796028060281602826028360284602856028660287602886028960290602916029260293602946029560296602976029860299603006030160302603036030460305603066030760308603096031060311603126031360314603156031660317603186031960320603216032260323603246032560326603276032860329603306033160332603336033460335603366033760338603396034060341603426034360344603456034660347603486034960350603516035260353603546035560356603576035860359603606036160362603636036460365603666036760368603696037060371603726037360374603756037660377603786037960380603816038260383603846038560386603876038860389603906039160392603936039460395603966039760398603996040060401604026040360404604056040660407604086040960410604116041260413604146041560416604176041860419604206042160422604236042460425604266042760428604296043060431604326043360434604356043660437604386043960440604416044260443604446044560446604476044860449604506045160452604536045460455604566045760458604596046060461604626046360464604656046660467604686046960470604716047260473604746047560476604776047860479604806048160482604836048460485604866048760488604896049060491604926049360494604956049660497604986049960500605016050260503605046050560506605076050860509605106051160512605136051460515605166051760518605196052060521605226052360524605256052660527605286052960530605316053260533605346053560536605376053860539605406054160542605436054460545605466054760548605496055060551605526055360554605556055660557605586055960560605616056260563605646056560566605676056860569605706057160572605736057460575605766057760578605796058060581605826058360584605856058660587605886058960590605916059260593605946059560596605976059860599606006060160602606036060460605606066060760608606096061060611606126061360614606156061660617606186061960620606216062260623606246062560626606276062860629606306063160632606336063460635606366063760638606396064060641606426064360644606456064660647606486064960650606516065260653606546065560656606576065860659606606066160662606636066460665606666066760668606696067060671606726067360674606756067660677606786067960680606816068260683606846068560686606876068860689606906069160692606936069460695606966069760698606996070060701607026070360704607056070660707607086070960710607116071260713607146071560716607176071860719607206072160722607236072460725607266072760728607296073060731607326073360734607356073660737607386073960740607416074260743607446074560746607476074860749607506075160752607536075460755607566075760758607596076060761607626076360764607656076660767607686076960770607716077260773607746077560776607776077860779607806078160782607836078460785607866078760788607896079060791607926079360794607956079660797607986079960800608016080260803608046080560806608076080860809608106081160812608136081460815608166081760818608196082060821608226082360824608256082660827608286082960830608316083260833608346083560836608376083860839608406084160842608436084460845608466084760848608496085060851608526085360854608556085660857608586085960860608616086260863608646086560866608676086860869608706087160872608736087460875608766087760878608796088060881608826088360884608856088660887608886088960890608916089260893608946089560896608976089860899609006090160902609036090460905609066090760908609096091060911609126091360914609156091660917609186091960920609216092260923609246092560926609276092860929609306093160932609336093460935609366093760938609396094060941609426094360944609456094660947609486094960950609516095260953609546095560956609576095860959609606096160962609636096460965609666096760968609696097060971609726097360974609756097660977609786097960980609816098260983609846098560986609876098860989609906099160992609936099460995609966099760998
  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
  4885. }else if(dis == result.dis){//如果两个位置相同,优先播放在导览条上离激活的最近的那段导览
  4886. /* if(this.itemCompare(item, this.currentItem, 'equal')){//优先用当前的
  4887. result.item = item, result.dis = dis
  4888. }else if(this.currentItem && Math.abs(item[0]-this.currentItem[0]) < Math.abs(result.item[0]-this.currentItem[0])){
  4889. result.item = item, result.dis = dis
  4890. } */
  4891. if(this.currentItem){
  4892. let dis1 = [Math.abs(item[0] - this.currentItem[0]), Math.abs(item[1] - this.currentItem[1])] //当前差距
  4893. let dis2 = [Math.abs(result.item[0] - this.currentItem[0]), Math.abs(result.item[1] - this.currentItem[1])]
  4894. if( this.itemCompare(dis1, dis2, 'less')){
  4895. result.item = item, result.dis = dis
  4896. }
  4897. }
  4898. }
  4899. }
  4900. }
  4901. this.model.heroLocations.forEach((e,i)=>{
  4902. if(e.heroLocations){
  4903. if(searchEvery){
  4904. e.heroLocations.forEach((a,j)=>{
  4905. compare(a, [i,j])
  4906. })
  4907. }else{
  4908. var location = e.heroLocations.find(e=>e.panoId != void 0)
  4909. location && compare(location, [i,0]) //跳到此区域开头
  4910. }
  4911. }else{
  4912. compare(e, [i,0])
  4913. }
  4914. })
  4915. if(endToStart && this.atEndOfTour(result.item)){ //如果是最后一个点,直接跳到开头,否则导览开始就在终点的话不会从头开始
  4916. return [0,0] //但注意最后是区域的话result.item是区域开头,除非站在最末最末尾的位置,上面的atDestinationPano直接返回
  4917. }
  4918. return result.item
  4919. }
  4920. n.prototype.playTour = function() {
  4921. if (!this.bounceable() && this.model.heroLocations.length) {
  4922. // ------------这部分处理逻辑目前已由playTourNearBy()取代------------------------------------
  4923. // if(!this.currentItem) this.currentItem = []
  4924. // if(this.currentItem[0] != 0 || this.destinationItem[0]!= this.nItems-1){
  4925. // // zeg 从当前pano进行自动导览
  4926. // let currentPanoDestinations = this.panoIdMap.get(this.player.currentPano.id)
  4927. // // this.model.heroLocations.forEach( (value, index) => {
  4928. // // if(value.heroLocations.find( hl => hl.panoId == this.player.currentPano.id )) {
  4929. // // currentPanoDestinations.push(index)
  4930. // // }
  4931. // // })
  4932. // if(!currentPanoDestinations) {
  4933. // // let panoIndex = this.model.panos.list.findIndex( pano => pano.id == this.player.currentPano.id )
  4934. // let panoIndex = this.model.panos.list.indexOf( this.player.currentPano )
  4935. // let neighbourIndex = [ panoIndex + 1, panoIndex - 1, panoIndex + 2, panoIndex - 2, panoIndex + 3, panoIndex - 3 ]
  4936. // for(var i = 0; i < neighbourIndex.length; i++) {
  4937. // currentPanoDestinations = this.panoIdMap.get(this.model.panos.list[neighbourIndex[i]]&&this.model.panos.list[neighbourIndex[i]].id)
  4938. // if(currentPanoDestinations && currentPanoDestinations[0] != 0) break
  4939. // }
  4940. // if(!currentPanoDestinations) currentPanoDestinations = [0];
  4941. // }
  4942. // if(currentPanoDestinations.indexOf(this.currentItem[0]) == -1) {
  4943. // this.currentItem[0] = currentPanoDestinations[0]
  4944. // }
  4945. // }
  4946. return this.tourIsPlaying ? void A.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4947. this.tourInProgress = !0,
  4948. this.reachSource = "play",
  4949. this.tourIsPlaying = !0,
  4950. this.wasZoomEnabled = this.player.zoomEnabled,
  4951. this.player.zoomEnabled = !1,
  4952. this.resetSpecialTransition(),
  4953. this.emit("update.controls"),
  4954. this.emit(p.TourStart),
  4955. this.player.enablePreRendering(),
  4956. // this.currentItem[1] = null,
  4957. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4958. this.goToDestination()) : /* this.goNext() */(this.tourAdvance(0) ,this.goToDestination()))) //xzw: 不要直接跳到下一个点开始,从当前点开始,否则当一段区域内只有一个导览时播放会立刻跳到下一个缩略图进行。
  4959. }
  4960. }
  4961. n.prototype.playTourNearBy = function() {//就近导览
  4962. if (!this.bounceable()){
  4963. return this.tourIsPlaying ? void A.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4964. this.tourInProgress = !0,
  4965. this.reachSource = "play",
  4966. this.tourIsPlaying = !0,
  4967. this.wasZoomEnabled = this.player.zoomEnabled,
  4968. this.player.zoomEnabled = !1,
  4969. this.resetSpecialTransition(),
  4970. this.emit("update.controls"),
  4971. this.emit(p.TourStart),
  4972. this.player.enablePreRendering(),
  4973. /* this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4974. this.goToDestination()) : this.goNext())) */
  4975. this.setDestinationItem(this.findNearestItem()) , this.goToDestination()) )
  4976. }
  4977. }
  4978. ,
  4979. /* n.prototype.bgmReplay = function() {//xzw add 结束tour后可能要继续播放背景音乐
  4980. } */
  4981. n.prototype.stopTour = function(isAutoStop) {//停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  4982. SoundManager.pause('tour',true), // zeg 自动导览暂停时同时停止语音
  4983. this.isInterrupted() || this.transitionStage === y.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4984. this.tourIsPlaying = !1,
  4985. this.interrupt(),
  4986. this.clearWalkingSectionPaused(),
  4987. this.resetSpecialTransition(),
  4988. this.emit("update.controls"))
  4989. }
  4990. ,
  4991. n.prototype.endTourProgress = function() {
  4992. this.tourInProgress = !1,
  4993. this.emit("update.controls"),
  4994. this.emit(p.TourEnd)
  4995. }
  4996. ,
  4997. n.prototype.goToHighlight = function(e) {
  4998. if (this.wouldInterrupt())
  4999. this.itemCompare(this.destinationItem,e,'equal') ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  5000. else {
  5001. if (A.debug("<tour.goto " + e + ">"),
  5002. this.isInterrupted())
  5003. return;
  5004. this.clearWalkingSectionPaused(),
  5005. this.setDestinationItem(e),
  5006. this.useSpecialTransition("Hilight")
  5007. this.goToDestination(true),//add true
  5008. h.trackAlways("reach_highlight", {
  5009. reach_source: "thumb"
  5010. })
  5011. }
  5012. }
  5013. ,
  5014. n.prototype.prevHighlight = function() {
  5015. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  5016. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  5017. this.reachSource = "prev",
  5018. this.goPrev()))
  5019. }
  5020. ,
  5021. n.prototype.nextHighlight = function() {
  5022. this.bounceable() || (this.player.emit("tour_manual", "next"),
  5023. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  5024. this.reachSource = "next",
  5025. this.goNext()))
  5026. }
  5027. ,
  5028. n.prototype.changeMode = function(e) {
  5029. var t = $.Deferred()
  5030. , i = t.resolve.bind(t)
  5031. , n = t.reject.bind(t);
  5032. this.emit(p.StartModeChange);
  5033. var r = function() {
  5034. return this.clearWalkingSectionPaused(),
  5035. !!this.wouldInterrupt() && (this.interrupt(),
  5036. !0)
  5037. }
  5038. .bind(this);
  5039. if (!r()) {
  5040. switch (e) {
  5041. case c.PANORAMA:
  5042. 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);
  5043. break;
  5044. case c.DOLLHOUSE:
  5045. case c.FLOORPLAN:
  5046. this.player.flyToNewMode({
  5047. mode: e
  5048. }).done(i).fail(n);
  5049. break;
  5050. case c.OUTDOOR:
  5051. 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)
  5052. }
  5053. return t.promise()
  5054. }
  5055. }
  5056. ,
  5057. n.prototype.atEndOfTour = function(currentItem=this.currentItem) {
  5058. var end = currentItem && currentItem[0] >= this.nItems - 1;
  5059. if(end){
  5060. var heroLocations = this.model.heroLocations[this.nItems-1].heroLocations
  5061. if(heroLocations){
  5062. end = currentItem[1] >= heroLocations.length - 1
  5063. }
  5064. }
  5065. return end;
  5066. }
  5067. ,
  5068. n.prototype.firstDestination = function() {
  5069. //return 0 < this.nItems ? 0 : null
  5070. return 0 < this.nItems ? [0,0]: null
  5071. }
  5072. ,
  5073. n.prototype.finalDestination = function() {
  5074. //return 0 < this.nItems ? this.nItems - 1 : null
  5075. return 0 < this.nItems ? [this.nItems - 1,0]: null
  5076. }
  5077. ,
  5078. n.prototype.goPrev = function() {
  5079. this.tourAdvance(-1)
  5080. }
  5081. ,
  5082. n.prototype.goNext = function() {
  5083. this.tourAdvance(1)
  5084. }
  5085. ,
  5086. n.prototype.setDestinationItem = function(e) {
  5087. this.destinationItem = e,
  5088. this.emit("update.controls")
  5089. }
  5090. ,
  5091. n.prototype.setCurrentItem = function(e) {
  5092. this.currentItem = e,
  5093. this.emit("update.controls")
  5094. }
  5095. ,
  5096. n.prototype.nextItem = function(currentItem) {
  5097. //return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  5098. if(currentItem == void 0)return this.firstDestination()
  5099. var currentLocation = this.model.heroLocations[currentItem[0]];
  5100. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  5101. var item;
  5102. if(this.currentItem[1] >= currentChildNum - 1){//子目录中最后一个
  5103. item = [currentItem[0] + 1, 0] //结果可能超出nItems
  5104. }else{
  5105. item = [currentItem[0] , currentItem[1]+1]
  5106. }
  5107. if(item[0] >= this.nItems ){
  5108. item = this.firstDestination()
  5109. }
  5110. return item;
  5111. //暂时不理会endlessLoop,默认为false
  5112. }
  5113. ,
  5114. n.prototype.prevItem = function(currentItem) {
  5115. //return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  5116. if(currentItem == void 0)return this.firstDestination()
  5117. var item;
  5118. var lastLocation = this.model.heroLocations[currentItem[0]-1];
  5119. if(!lastLocation) return this.finalDestination()//[-1, 0]//this.setDestinationItem([-1, 0]) //结果小于0
  5120. else{
  5121. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  5122. if(this.currentItem[1] == 0){//子目录中第一个
  5123. return [currentItem[0] - 1, lastChildNum-1]
  5124. }else{
  5125. return [currentItem[0], currentItem[1]-1]
  5126. }
  5127. }
  5128. }
  5129. ,
  5130. n.prototype.tourAdvance = function(e) {//e是1或-1 或 0
  5131. A.debug("tourAdvance(" + e + ")")
  5132. if(null === this.currentItem || void 0 === this.currentItem){
  5133. this.setDestinationItem(this.firstDestination())
  5134. // this.setDestinationItem([currentPanoDestinations[0], 0])
  5135. }else{
  5136. var item = this.currentItem
  5137. if(e == 1){
  5138. item = this.nextItem(this.currentItem)
  5139. }else if(e == -1){
  5140. item = this.prevItem(this.currentItem)
  5141. }
  5142. this.setDestinationItem(item)
  5143. }
  5144. if(this.itemCompare(this.destinationItem, this.finalDestination(), 'equal')/* [0] < 0 */){
  5145. this.useSpecialTransition("reverse-looping to end")
  5146. }else if(this.itemCompare(this.destinationItem, this.firstDestination(), 'equal')){
  5147. this.useSpecialTransition("looping back to start")
  5148. }
  5149. /* var momentTour = this.getMomentTour(this.destinationItem);
  5150. if ( "black" === momentTour) { // 方奕卓 瞬间过渡, 相机缩放至1
  5151. var zoomLevel = this.player.zoomLevel;
  5152. this.player.zoomEnabled = true;
  5153. var zoom = function(e, d) {
  5154. this.player.zoomTo((1-e)*zoomLevel, true)
  5155. }.bind(this)
  5156. s.start(zoom, 1500, function(){
  5157. }, 0, d.easeOutQuad, "zoom")
  5158. } */
  5159. this.goToDestination()
  5160. }
  5161. ,
  5162. n.prototype.getMomentTour = function(destinationItem) {//add
  5163. var wholeMomentTour = window.DATA.momentTour || "walk"; //最外层 还有一种是'std'
  5164. if(!destinationItem) return wholeMomentTour
  5165. else{
  5166. var currentLocation = this.model.getHeroDescriptorByIndex(destinationItem)//最内层。 如果有使用最内层
  5167. if(currentLocation.momentTour)return currentLocation.momentTour;
  5168. var currentLocation_ = this.model.heroLocations[destinationItem[0]];
  5169. return currentLocation_.momentTour || wholeMomentTour; //若中间层或最内层有就使用,否则使用最外层
  5170. }
  5171. }
  5172. ,
  5173. t.exports = n
  5174. }
  5175. ).call(this, "/js/director.js")
  5176. }
  5177. , {
  5178. "./analytics": 4,
  5179. "./enum/BlackoutStyle": 18,
  5180. "./enum/ControlEvents": 21,
  5181. "./enum/DirectorEvents": 23,
  5182. "./enum/ModelManagerEvents": 33,
  5183. "./enum/PathDiscardMode": 38,
  5184. "./enum/PathDisplayMode": 39,
  5185. "./enum/PlayerEvents": 40,
  5186. "./enum/Viewmode": 51,
  5187. "./enum/WarpStyle": 52,
  5188. "./model/ModelManager": 140,
  5189. "./player": 155,
  5190. "./settings": 166,
  5191. "./util/logger": 189,
  5192. "./util/transitions": 195,
  5193. events: 202,
  5194. three: 217
  5195. }],
  5196. 16: [function(e, t, i) {
  5197. "use strict";
  5198. var n = e("three")
  5199. , r = e("./enum/Viewmode")
  5200. , o = (e("./settings"),
  5201. e("./util/transitions"))
  5202. , a = e("./enum/PlayerEvents")
  5203. , s = new n.ShaderPass(n.HorizontalBlurShader)
  5204. , l = new n.ShaderPass(n.VerticalBlurShader);
  5205. l.renderToScreen = !0;
  5206. var c = $("#player").width() / $("#player").height();
  5207. isNaN(c) && (c = 1);
  5208. var h = {
  5209. currentBlur: 0,
  5210. aspect: c,
  5211. blurStrength: 1,
  5212. hblurPass: s,
  5213. vblurPass: l,
  5214. fastTranMaskPass : new n.TransitionPass()
  5215. ,
  5216. bindEvents: function(e) {
  5217. e.on(a.ModeChanged, function(e, t) {
  5218. e === r.PANORAMA && (o.cancel(h.blur),
  5219. o.cancel(h.addBlur),
  5220. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  5221. })
  5222. },
  5223. blur: function(e) {
  5224. h.currentBlur = e;
  5225. var t = e * h.blurStrength;
  5226. l.uniforms.v.value = t / 512 * h.aspect,
  5227. s.uniforms.h.value = t / 512
  5228. },
  5229. addBlur: function(e) {
  5230. e = Math.max(e, h.currentBlur),
  5231. h.blur(e)
  5232. },
  5233. removeBlur: function(e) {
  5234. e = Math.min(1 - e, h.currentBlur),
  5235. h.blur(e)
  5236. }
  5237. };
  5238. h.blur(0),
  5239. t.exports = h
  5240. }
  5241. , {
  5242. "./enum/PlayerEvents": 40,
  5243. "./enum/Viewmode": 51,
  5244. "./settings": 166,
  5245. "./util/transitions": 195,
  5246. three: 217
  5247. }],
  5248. 17: [function(e, t, i) {
  5249. "use strict";
  5250. t.exports = {
  5251. UNKNOWN: 0,
  5252. ALIGNED: 1,
  5253. UNALIGNED: 2,
  5254. PLACED: 3
  5255. }
  5256. }
  5257. , {}],
  5258. 18: [function(e, t, i) {
  5259. "use strict";
  5260. t.exports = {
  5261. NONE: 0,
  5262. MIDDLE: 1,
  5263. END: 2,
  5264. BEGINNING: 3,
  5265. FADEIN: 4
  5266. }
  5267. }
  5268. , {}],
  5269. 19: [function(e, t, i) {
  5270. "use strict";
  5271. var n = e("three");
  5272. t.exports = {
  5273. newBlue: new n.Color(4967932),
  5274. altBlue: new n.Color(47355),
  5275. tagDefault: new n.Color(223357),
  5276. classicBlue: new n.Color(53759),
  5277. mpYellow: new n.Color(16502016),
  5278. mpOrange: new n.Color(16428055),
  5279. mpBlue: new n.Color(12096),
  5280. mpLtGrey: new n.Color(13751252),
  5281. mpDkGrey: new n.Color(10000019),
  5282. mpRed: new n.Color(12525854),
  5283. mpOrangeDesat: new n.Color(16764529),
  5284. mpBlueDesat: new n.Color(4034734),
  5285. mpRedDesat: new n.Color(14705505),
  5286. white: new n.Color(16777215),
  5287. black: new n.Color(0),
  5288. _desat: function(e, t) {
  5289. var i = t || .3
  5290. , r = (new n.Color).copy(e).getHSL();
  5291. return (new n.Color).setHSL(r.h, r.s * (1 - i), r.l)
  5292. },
  5293. _darken: function(e, t) {
  5294. var i = t || .2
  5295. , r = e.getHSL();
  5296. return (new n.Color).setHSL(r.h, r.s, r.l * (1 - i))
  5297. }
  5298. }
  5299. }
  5300. , {
  5301. three: 217
  5302. }],
  5303. 20: [function(e, t, i) {
  5304. "use strict";
  5305. t.exports = {
  5306. NONE: -1,
  5307. ROTATE: 0,
  5308. DOLLY: 1,
  5309. PAN: 2,
  5310. ROTATE_DOLLY: 3,
  5311. PAN_DOLLY: 4
  5312. }
  5313. }
  5314. , {}],
  5315. 21: [function(e, t, i) {
  5316. "use strict";
  5317. t.exports = {
  5318. Move: "move",
  5319. InteractionDirect: "interaction.direct",
  5320. InteractionKey: "interaction.key",
  5321. InteractionGui: "interaction.gui",
  5322. FlyInDirection: "fly.direction",
  5323. InputStart: "input.start",
  5324. Pinch: "input.pinch",
  5325. Scroll: "input.scroll",
  5326. AutoPanInterrupt: "autopan.interrupt",
  5327. AutoPanComplete: "autopan.complete",
  5328. AutoPanClamped: "autopan.clamped",
  5329. LongTap: "longtap"
  5330. }
  5331. }
  5332. , {}],
  5333. 22: [function(e, t, i) {
  5334. "use strict";
  5335. t.exports = Object.freeze({
  5336. FORWARD: "FORWARD",
  5337. LEFT: "LEFT",
  5338. RIGHT: "RIGHT",
  5339. BACK: "BACK",
  5340. UP: "UP",
  5341. DOWN: "DOWN"
  5342. })
  5343. }
  5344. , {}],
  5345. 23: [function(e, t, i) {
  5346. "use strict";
  5347. t.exports = {
  5348. ActionInterrupted: "action.interrupted",
  5349. TourStart: "tour.start",
  5350. TourEnd: "tour.end",
  5351. StartModeChange: "mode.startChange"
  5352. }
  5353. }
  5354. , {}],
  5355. 24: [function(e, t, i) {
  5356. "use strict";
  5357. t.exports = Object.freeze({
  5358. None: 0,
  5359. Queued: 1,
  5360. ForceQueued: 2,
  5361. Downloading: 3,
  5362. Downloaded: 4,
  5363. DownloadFailed: 5
  5364. })
  5365. }
  5366. , {}],
  5367. 25: [function(e, t, i) {
  5368. "use strict";
  5369. t.exports = {
  5370. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5371. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5372. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5373. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5374. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5375. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5376. }
  5377. }
  5378. , {}],
  5379. 26: [function(e, t, i) {
  5380. "use strict";
  5381. t.exports = {
  5382. Texture2D: 0,
  5383. TextureCube: 1
  5384. }
  5385. }
  5386. , {}],
  5387. 27: [function(e, t, i) {
  5388. "use strict";
  5389. t.exports = {
  5390. SMALL: "small",
  5391. LARGE: "large"
  5392. }
  5393. }
  5394. , {}],
  5395. 28: [function(e, t, i) {
  5396. "use strict";
  5397. var n = e("./Viewmode")
  5398. , r = {
  5399. LANDING: {},
  5400. NAVIGATION: "navigation",
  5401. MORE_HELP: "moreHelp",
  5402. TOUR_INTERACTION: {}
  5403. };
  5404. r.LANDING[n.PANORAMA] = "panorama.landing",
  5405. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5406. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5407. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5408. r.TOUR_INTERACTION.standard = "standard.tour",
  5409. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5410. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5411. t.exports = r
  5412. }
  5413. , {
  5414. "./Viewmode": 51
  5415. }],
  5416. 29: [function(e, t, i) {
  5417. "use strict";
  5418. var n = {
  5419. UP: 1,
  5420. DOWN: -1,
  5421. LEFT: "L",
  5422. RIGHT: "R",
  5423. FORWARD: "F",
  5424. BACK: "B",
  5425. reverse: {},
  5426. opposite: function(e) {
  5427. return this.reverse[e.toString()]
  5428. }
  5429. };
  5430. !function() {
  5431. n.reverse[n.UP] = n.DOWN,
  5432. n.reverse[n.DOWN] = n.UP,
  5433. n.reverse[n.LEFT] = n.RIGHT,
  5434. n.reverse[n.RIGHT] = n.LEFT,
  5435. n.reverse[n.FORWARD] = n.BACK,
  5436. n.reverse[n.BACK] = n.FORWARD
  5437. }(),
  5438. t.exports = n
  5439. }
  5440. , {}],
  5441. 30: [function(e, t, i) {
  5442. "use strict";
  5443. var n = e("../util/browser")
  5444. , r = {
  5445. ZERO: 48,
  5446. ONE: 49,
  5447. TWO: 50,
  5448. THREE: 51,
  5449. FOUR: 52,
  5450. FIVE: 53,
  5451. SIX: 54,
  5452. SEVEN: 55,
  5453. EIGHT: 56,
  5454. NINE: 57,
  5455. LEFTARROW: 37,
  5456. UPARROW: 38,
  5457. RIGHTARROW: 39,
  5458. DOWNARROW: 40,
  5459. A: 65,
  5460. B: 66,
  5461. C: 67,
  5462. D: 68,
  5463. E: 69,
  5464. F: 70,
  5465. G: 71,
  5466. H: 72,
  5467. I: 73,
  5468. J: 74,
  5469. K: 75,
  5470. L: 76,
  5471. M: 77,
  5472. N: 78,
  5473. O: 79,
  5474. P: 80,
  5475. Q: 81,
  5476. R: 82,
  5477. S: 83,
  5478. T: 84,
  5479. U: 85,
  5480. V: 86,
  5481. W: 87,
  5482. X: 88,
  5483. Y: 89,
  5484. Z: 90,
  5485. SPACE: 32,
  5486. RETURN: 13,
  5487. SEMICOLON: 186,
  5488. PLUSEQUALS: 187,
  5489. DASHUNDERSCORE: 189,
  5490. OPENBRACKET: 219
  5491. };
  5492. n.detectFirefox() && (r.SEMICOLON = 59,
  5493. r.PLUSEQUALS = 61,
  5494. r.DASHUNDERSCORE = 173),
  5495. t.exports = r
  5496. }
  5497. , {
  5498. "../util/browser": 182
  5499. }],
  5500. 31: [function(e, t, i) {
  5501. "use strict";
  5502. t.exports = {
  5503. EN_US: "en-US",
  5504. ES_MX: "es-MX",
  5505. FR_FR: "fr-FR",
  5506. DE_DE: "de-DE",
  5507. RU_RU: "ru-RU",
  5508. CN_CN: "cn-CN",
  5509. JP_JP: "jp-JP"
  5510. }
  5511. }
  5512. , {}],
  5513. 32: [function(e, t, i) {
  5514. "use strict";
  5515. t.exports = {
  5516. TagActivated: "tag.activated",
  5517. TagDismissed: "tag.dismissed",
  5518. TagNavigation: "tag.navigation"
  5519. }
  5520. }
  5521. , {}],
  5522. 33: [function(e, t, i) {
  5523. "use strict";
  5524. t.exports = {
  5525. ModelAdded: "model-added",
  5526. ActiveModelChanged: "active-model-changed"
  5527. }
  5528. }
  5529. , {}],
  5530. 34: [function(e, t, i) {
  5531. "use strict";
  5532. t.exports = {
  5533. LEFT: 0,
  5534. MIDDLE: 1,
  5535. RIGHT: 2
  5536. }
  5537. }
  5538. , {}],
  5539. 35: [function(e, t, i) {
  5540. "use strict";
  5541. t.exports = {
  5542. PanoRenderComplete: "panorama.render.complete",
  5543. TileRenderFailure: "panorama.tile.render.failed",
  5544. TileRenderSuccess: "panorama.tile.render.success",
  5545. TileUploadAttempted: "panorama.tile.upload.attempted",
  5546. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5547. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5548. }
  5549. }
  5550. , {}],
  5551. 36: [function(e, t, i) {
  5552. "use strict";
  5553. t.exports = {
  5554. BASE: 1,
  5555. STANDARD: 2,
  5556. HIGH: 3,
  5557. ULTRAHIGH: 4
  5558. }
  5559. }
  5560. , {}],
  5561. 37: [function(e, t, i) {
  5562. "use strict";
  5563. t.exports = {
  5564. LoadComplete: "panorama.load.complete",
  5565. LoadFailed: "panorama.load.failed",
  5566. TileLoaded: "panorama.tile.loaded"
  5567. }
  5568. }
  5569. , {}],
  5570. 38: [function(e, t, i) {
  5571. "use strict";
  5572. t.exports = Object.freeze({
  5573. Standard: 0,
  5574. Slow: 1,
  5575. Retain: 2
  5576. })
  5577. }
  5578. , {}],
  5579. 39: [function(e, t, i) {
  5580. "use strict";
  5581. t.exports = Object.freeze({
  5582. Show: 0,
  5583. Hide: 1,
  5584. Retain: 2
  5585. })
  5586. }
  5587. , {}],
  5588. 40: [function(e, t, i) {
  5589. "use strict";
  5590. t.exports = {
  5591. Move: "move",
  5592. MoveComplete: "move.complete",
  5593. ModeChanged: "mode.changed",
  5594. ModeChanging: "mode.changing",
  5595. PanoChosen: "pano.chosen",
  5596. ClosestPanoChanging: "closest.pano.changing",
  5597. WarpStarted: "warp.started",
  5598. WarpInterrupted: "warp.interrupted",
  5599. WarpEnded: "warp.ended",
  5600. FlyinFinished: "flyin.finished",
  5601. FlyingStarted: "flying.started",
  5602. FlyingInterrupted: "flying.interrupted",
  5603. FlyingEnded: "flying.ended",
  5604. Ready: "ready",
  5605. StartInside: "start.inside",
  5606. StartOutside: "start.outside",
  5607. ViewChanged: "view.changed",
  5608. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5609. InputStart: "input.start"
  5610. }
  5611. }
  5612. , {}],
  5613. 41: [function(e, t, i) {
  5614. "use strict";
  5615. t.exports = Object.freeze({
  5616. DEFAULT: 0,
  5617. PANOMARKERS: 1,
  5618. RETICULE: 2,
  5619. TAG: 3
  5620. })
  5621. }
  5622. , {}],
  5623. 42: [function(e, t, i) {
  5624. "use strict";
  5625. t.exports = {
  5626. visibleFloor: 1,
  5627. ghostFloor: 3,
  5628. boundingSkybox: 1,
  5629. panoMarker: 2,
  5630. reticule: 3,
  5631. tagStem: 4,
  5632. tagDisc: 5,
  5633. ribbon: 100
  5634. }
  5635. }
  5636. , {}],
  5637. 43: [function(e, t, i) {
  5638. "use strict";
  5639. t.exports = {
  5640. ContextCreated: "scene-renderer-context-created",
  5641. AfterRender: "after-render",
  5642. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5643. }
  5644. }
  5645. , {}],
  5646. 44: [function(e, t, i) {
  5647. "use strict";
  5648. t.exports = {
  5649. IDLE: "idle",
  5650. BROWSE: "browse",
  5651. EXAMINE: "examine"
  5652. }
  5653. }
  5654. , {}],
  5655. 45: [function(e, t, i) {
  5656. "use strict";
  5657. t.exports = {
  5658. TileDownloadSuccess: "tiledownloader.download.success",
  5659. TileDownloadFailure: "tiledownloader.download.failure",
  5660. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5661. }
  5662. }
  5663. , {}],
  5664. 46: [function(e, t, i) {
  5665. "use strict";
  5666. t.exports = {
  5667. CardboardAndroid: "googlevr",
  5668. GearVR: "gearvr",
  5669. CardboardIOS: "googlevrios",
  5670. Cardboard: "googlevr"
  5671. }
  5672. }
  5673. , {}],
  5674. 47: [function(e, t, i) {
  5675. "use strict";
  5676. t.exports = {
  5677. NONE: 0,
  5678. CONTEXTUAL: 1,
  5679. ANDROID: 2
  5680. }
  5681. }
  5682. , {}],
  5683. 48: [function(e, t, i) {
  5684. "use strict";
  5685. var n = {
  5686. Title: 0,
  5687. Cardboard: 1
  5688. }
  5689. , r = {
  5690. Title: 0,
  5691. Cardboard: 1,
  5692. Gear: 2
  5693. };
  5694. !function() {
  5695. [n, r].forEach(function(e) {
  5696. e.pageCount = Object.keys(e).length
  5697. })
  5698. }(),
  5699. t.exports.ios = n,
  5700. t.exports.standard = r
  5701. }
  5702. , {}],
  5703. 49: [function(e, t, i) {
  5704. "use strict";
  5705. t.exports = {
  5706. Android: "android",
  5707. IOS: "ios",
  5708. Desktop: "desktop",
  5709. UnsupportedAndroid: "android-unsupported"
  5710. }
  5711. }
  5712. , {}],
  5713. 50: [function(e, t, i) {
  5714. "use strict";
  5715. var n = e("three");
  5716. t.exports = {
  5717. UP: new n.Vector3(0,1,0),
  5718. DOWN: new n.Vector3(0,-1,0),
  5719. LEFT: new n.Vector3(-1,0,0),
  5720. RIGHT: new n.Vector3(1,0,0),
  5721. FORWARD: new n.Vector3(0,0,-1),
  5722. BACK: new n.Vector3(0,0,1)
  5723. }
  5724. }
  5725. , {
  5726. three: 217
  5727. }],
  5728. 51: [function(e, t, i) {
  5729. "use strict";
  5730. var n = e("../exception/ViewmodeConvertException")
  5731. , r = e("./coreViewmodes")
  5732. , o = e("../util/common")
  5733. , a = {
  5734. MESH: "mesh",
  5735. OUTDOOR: "outdoor",
  5736. TRANSITIONING: "transitioning",
  5737. toInt: function(e) {
  5738. switch (e) {
  5739. case this.PANORAMA:
  5740. return 1;
  5741. case this.DOLLHOUSE:
  5742. return 2;
  5743. case this.FLOORPLAN:
  5744. return 3;
  5745. case this.OUTDOOR:
  5746. return 4;
  5747. case this.TRANSITIONING:
  5748. return -1
  5749. }
  5750. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5751. },
  5752. fromInt: function(e) {
  5753. switch (e) {
  5754. case "1":
  5755. case 1:
  5756. return this.PANORAMA;
  5757. case "2":
  5758. case 2:
  5759. return this.DOLLHOUSE;
  5760. case "3":
  5761. case 3:
  5762. return this.FLOORPLAN;
  5763. case "4":
  5764. case 4:
  5765. return this.OUTDOOR
  5766. }
  5767. throw new n("No known conversion for int to viewmode for int: " + e)
  5768. },
  5769. convertWorkshopModeInt: function(e) {
  5770. switch (e) {
  5771. case "0":
  5772. case 0:
  5773. case undefined: //xzw add
  5774. return this.PANORAMA;
  5775. case "1":
  5776. case 1:
  5777. return this.FLOORPLAN;
  5778. case "2":
  5779. case 2:
  5780. return this.DOLLHOUSE;
  5781. case "3":
  5782. case 3:
  5783. return this.MESH
  5784. }
  5785. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5786. }
  5787. };
  5788. o.extendObject(a, r),
  5789. t.exports = a
  5790. }
  5791. , {
  5792. "../exception/ViewmodeConvertException": 58,
  5793. "../util/common": 185,
  5794. "./coreViewmodes": 54
  5795. }],
  5796. 52: [function(e, t, i) {
  5797. "use strict";
  5798. t.exports = {
  5799. BLACK: "black",
  5800. STD: "std",
  5801. WALK: "walk"
  5802. }
  5803. }
  5804. , {}],
  5805. 53: [function(e, t, i) {
  5806. "use strict";
  5807. t.exports = {
  5808. ZoomIn: "zoom.in",
  5809. ZoomOut: "zoom.out",
  5810. ZoomMax: "zoom.max",
  5811. ZoomMin: "zoom.min"
  5812. }
  5813. }
  5814. , {}],
  5815. 54: [function(e, t, i) {
  5816. "use strict";
  5817. t.exports = {
  5818. PANORAMA: "panorama",
  5819. DOLLHOUSE: "dollhouse",
  5820. FLOORPLAN: "floorplan"
  5821. }
  5822. }
  5823. , {}],
  5824. 55: [function(e, t, i) {
  5825. "use strict";
  5826. function n(e) {
  5827. this.message = e
  5828. }
  5829. t.exports = n
  5830. }
  5831. , {}],
  5832. 56: [function(e, t, i) {
  5833. "use strict";
  5834. function n(e) {
  5835. r.call(this, e)
  5836. }
  5837. var r = e("./BasicException");
  5838. n.prototype = Object.create(r.prototype),
  5839. t.exports = n
  5840. }
  5841. , {
  5842. "./BasicException": 55
  5843. }],
  5844. 57: [function(e, t, i) {
  5845. "use strict";
  5846. function n(e) {
  5847. r.call(this, e)
  5848. }
  5849. var r = e("./BasicException");
  5850. n.prototype = Object.create(r.prototype),
  5851. t.exports = n
  5852. }
  5853. , {
  5854. "./BasicException": 55
  5855. }],
  5856. 58: [function(e, t, i) {
  5857. "use strict";
  5858. function n(e) {
  5859. r.call(this, e)
  5860. }
  5861. var r = e("./BasicException");
  5862. n.prototype = Object.create(r.prototype),
  5863. t.exports = n
  5864. }
  5865. , {
  5866. "./BasicException": 55
  5867. }],
  5868. 59: [function(e, t, i) {
  5869. (function(i) {
  5870. "use strict";
  5871. function n(e) {
  5872. var t = {};
  5873. if (e) {
  5874. var i = e.flags;
  5875. if (i)
  5876. for (var n in i)
  5877. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5878. return t
  5879. }
  5880. return l.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5881. null
  5882. }
  5883. var r = e("./util/ajax")
  5884. , o = e("./util/showcase")
  5885. , a = e("./util/logger")
  5886. , s = ""
  5887. , l = new a(i)
  5888. , c = {};
  5889. t.exports = {
  5890. loadFeatureFlags: function(e) {
  5891. var t = $.Deferred();
  5892. return r.get(e.urlBase + s, {
  5893. responseType: "json",
  5894. prefetchFrom: "user",
  5895. auth: o.getAuthorizationHeader()
  5896. }).done(function(e) {
  5897. c = n(e),
  5898. c ? t.resolve(c) : t.reject("loading-failed")
  5899. }).fail(function() {
  5900. l.debug("Retrieval of feature flags failed."),
  5901. t.reject("loading-failed")
  5902. }),
  5903. t.promise()
  5904. },
  5905. getFlags: function() {
  5906. return c
  5907. },
  5908. updateDependentSettings: function(e, t) {
  5909. e = e || c,
  5910. e.labels && (t.labels.enabled = !0),
  5911. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5912. e.showcase_sdk && (t.sdkInit = !0),
  5913. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5914. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5915. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5916. e.hide_sc_sharing && (t.share.enabled = !1)
  5917. }
  5918. }
  5919. }
  5920. ).call(this, "/js/featureflags.js")
  5921. }
  5922. , {
  5923. "./util/ajax": 181,
  5924. "./util/logger": 189,
  5925. "./util/showcase": 193
  5926. }],
  5927. 60: [function(e, t, i) {
  5928. "use strict";
  5929. var n = (e("../util/common"),
  5930. {
  5931. status: 0,
  5932. set: function(e) {
  5933. if (isNaN(e))
  5934. return !1;
  5935. var t = $('.progressbar');
  5936. 0 > e && (e = 0);
  5937. e > 100 && (e = 100);
  5938. var width = parseInt(t.css('width').replace("px",""))/100; //获取进度条总长度除以100
  5939. var barperc = e*width;
  5940. var perc = Math.round(e);
  5941. var labelpos = (parseInt(barperc)-15);
  5942. t.find('.bar').css('width',barperc); //已经再跑颜色的百分比
  5943. t.find('.label').css('left', labelpos); //上面跟着的字的百分比
  5944. t.find('.perc').text(perc+'%'); //具体数字的百分比
  5945. this.status = e
  5946. },
  5947. done: function(e) {
  5948. return e || this.status ? (this.status = null,
  5949. this.set(100)) : this
  5950. }
  5951. });
  5952. t.exports.circleLoader = n
  5953. }
  5954. , {
  5955. "../util/common": 185
  5956. }],
  5957. 61: [function(e, t, i) {
  5958. "use strict";
  5959. t.exports = Object.freeze({
  5960. CLOSE: "modal.closer.close"
  5961. })
  5962. }
  5963. , {}],
  5964. 62: [function(e, t, i) {
  5965. "use strict";
  5966. function n(e, t) {
  5967. t && (t.stopPropagation(),
  5968. t.preventDefault()),
  5969. e && this.emit(l.CLOSE, e),
  5970. g.reset()
  5971. }
  5972. function r(e, t) {
  5973. function i() {
  5974. var t = e.offsetHeight >= $("#player").height() && e.offsetWidth >= $("#player").width();
  5975. t !== f && (f = t,
  5976. t ? (e.classList.add("closeByFooter"),
  5977. h.classList.add("closeByFooter")) : (e.classList.remove("closeByFooter"),
  5978. h.classList.remove("closeByFooter")))
  5979. }
  5980. t ? setTimeout(i, o.guiAnimationSpeed) : i()
  5981. }
  5982. var o = e("../../settings")
  5983. , a = (e("../../tag/Media/MediaEvent"),
  5984. e("../../util/browser"))
  5985. , s = e("../../util/common")
  5986. , l = e("./ModalCloserEvent")
  5987. , c = e("events").EventEmitter
  5988. , h = document.getElementsByClassName("footer")[0]
  5989. , u = h.querySelectorAll(".close")[0]
  5990. , d = null
  5991. , p = null
  5992. , f = null
  5993. , g = (a.isMobile(),
  5994. {
  5995. open: function(e) {
  5996. e && (r(e),
  5997. d && u.removeEventListener("click", d, !0),
  5998. d = n.bind(this, e.id),
  5999. u.addEventListener("click", d, !0),
  6000. p && window.removeEventListener("resize", p, !0),
  6001. p = r.bind(this, e),
  6002. window.addEventListener("resize", p, !0))
  6003. },
  6004. reset: function() {
  6005. h.classList.remove("closeByFooter"),
  6006. u.removeEventListener("click", d, !0),
  6007. window.removeEventListener("resize", p, !0),
  6008. d = p = f = null
  6009. }
  6010. });
  6011. s.extendObject(g, c.prototype),
  6012. t.exports = g
  6013. }
  6014. , {
  6015. "../../tag/Media/MediaEvent": 131,
  6016. "../../settings": 166,
  6017. "../../util/browser": 182,
  6018. "../../util/common": 185,
  6019. "./ModalCloserEvent": 61,
  6020. events: 202
  6021. }],
  6022. 63: [function(e, t, i) {
  6023. "use strict";
  6024. function n(e, t, i) {
  6025. var n = new r.GUI({
  6026. width: 400
  6027. })
  6028. , u = n.addFolder("Flydown from Dollhouse");
  6029. u.add(h.flydown, "movementEasing", Object.keys(a)),
  6030. u.add(h.flydown, "movementDelay", 0, 1).step(.01),
  6031. u.add(h.flydown, "rotationEasing", Object.keys(a)),
  6032. u.add(h.flydown, "rotationDelay", 0, 1).step(.01),
  6033. u.add(h.flydown, "modelTextureDelay", 0, 1).step(.01),
  6034. u.add(h.flydown, "skyboxDelay", 0, 1).step(.01),
  6035. u.add(h.dollhouseDefault, "minPolarAngle", 0, o.Math.degToRad(50)),
  6036. u.add(h.dollhouseDefault, "maxPolarAngle", o.Math.degToRad(50), o.Math.degToRad(170));
  6037. var d = n.addFolder("Transition between panos");
  6038. d.add(h.transition, "blur", 0, 10).onFinishChange(function() {}),
  6039. d.add(h.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  6040. h.transition.flyTime = 0,
  6041. d.__controllers.forEach(function(e) {
  6042. e.updateDisplay()
  6043. })
  6044. }),
  6045. d.add(h.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  6046. h.transition.flySpeed = 0,
  6047. d.__controllers.forEach(function(e) {
  6048. e.updateDisplay()
  6049. })
  6050. }),
  6051. d.add(h.transition, "aimTime", 500, 2500).step(50),
  6052. d.add(h.transition, "aimSlowFactor", 1, 3).step(.1),
  6053. d.add(h.transition, "movementEasing", Object.keys(a));
  6054. var p = n.addFolder("Path Display");
  6055. p.add(h.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  6056. p.add(h.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  6057. p.add(h.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  6058. p.add(h.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  6059. p.add(h.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  6060. p.add(h.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  6061. p.add(h.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  6062. p.add(h.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  6063. p.add(h.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  6064. p.add(h.path, "color", Object.keys(l)).onFinishChange(function() {
  6065. h.path.color = l[h.path.color],
  6066. h.path.colorUp = l._desat(h.path.color),
  6067. h.path.colorDown = l.darken(h.path.color)
  6068. }),
  6069. p.add(h, "reticuleColor", Object.keys(l)).onFinishChange(function() {
  6070. h.reticuleColor = l[h.reticuleColor]
  6071. });
  6072. var f = n.addFolder("Warping")
  6073. , g = f.addFolder("Warp/Teleport");
  6074. g.add(h.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  6075. g.add(h.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  6076. g.add(h.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  6077. g.add(h.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  6078. g.add(h.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  6079. g.add(h.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  6080. g.add(h.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  6081. g.add(h.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  6082. g.add(h.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  6083. g.add(h.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  6084. g.add(h.path, "mapGuides").onFinishChange(function() {}),
  6085. g.add(h.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  6086. g.add(h.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  6087. g.add(h.path, "typ", Object.keys(c)).onFinishChange(function() {
  6088. h.path.typ = c[h.path.typ]
  6089. }),
  6090. g.add(h.warp, "loop").onChange(function() {}).onFinishChange(function() {
  6091. t.endlessLoop = h.warp.loop
  6092. }),
  6093. g.add(h.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  6094. g.add(h.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  6095. g.add(h.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  6096. var m = f.addFolder("Long Warp Only");
  6097. m.add(h.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  6098. h.warp.flySpeed = 0,
  6099. m.__controllers.forEach(function(e) {
  6100. e.updateDisplay()
  6101. })
  6102. }),
  6103. m.add(h.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  6104. m.add(h.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  6105. m.add(h.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  6106. m.add(h.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  6107. m.add(h.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  6108. m.add(h.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  6109. m.add(h.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  6110. m.add(h.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  6111. m.add(h.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  6112. var v = n.addFolder("Warp Esoterica");
  6113. v.add(h.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  6114. v.add(h.warp, "blur", .01, 1).onFinishChange(function() {}),
  6115. v.add(h.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  6116. h.warp.minWarpTime = 0,
  6117. v.__controllers.forEach(function(e) {
  6118. e.updateDisplay()
  6119. })
  6120. }),
  6121. v.add(h.warp, "showBunny").onFinishChange(function() {}),
  6122. v.add(h.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  6123. v.add(h.warp, "movementEasing", Object.keys(a));
  6124. var A = n.addFolder("Misc");
  6125. A.add(h, "dollhouseFOV", 10, 180).onChange(function() {
  6126. i.cameras[s.DOLLHOUSE].fov = h.dollhouseFOV
  6127. }),
  6128. A.add(h, "insideFOV", 10, 180).onChange(function() {
  6129. i.cameras[s.PANORAMA].fov = h.insideFOV
  6130. }),
  6131. A.add(h, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  6132. A.add(h, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  6133. A.add(h, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  6134. var y = n.addFolder("Navigation");
  6135. y.add(h.navigation, "panoScores").onFinishChange(function() {
  6136. h.navigation.panoScores || e.panos.forEach(function(e) {
  6137. e.floor.remove(e.text3d),
  6138. e.text3d = null
  6139. })
  6140. }),
  6141. y.add(h.navigation, "mouseDirection"),
  6142. y.add(h.navigation, "filterStrictness", 0, 1),
  6143. y.add(h.navigation, "angleFactor", -60, 0),
  6144. y.add(h.navigation, "directionFactor", 1, 20),
  6145. y.add(h.navigation, "distanceFactor", -5, 5),
  6146. y.add(h.navigation, "optionalityFactor", .1, 10);
  6147. var C = n.addFolder("tags")
  6148. , I = C.addFolder("Tag Creation");
  6149. I.add(h.tags.pole, "enabled").name("poleEnabled"),
  6150. I.add(h.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  6151. I.add(h.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  6152. I.add(h.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  6153. var E = C.addFolder("Visibility");
  6154. E.add(h.tags.visibility, "anyDistance"),
  6155. E.add(h.tags.visibility, "visibleDistance", .1, 30).step(.1),
  6156. E.add(h.tags.visibility, "cameraClearance", 0, 1).step(.01),
  6157. E.add(h.tags.visibility, "hideViaFloor"),
  6158. E.add(h.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  6159. E.add(h.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  6160. var b = C.addFolder("Disc Parameters");
  6161. b.add(h.tags.disc.scale, "nearBound", .1, 10).step(.1),
  6162. b.add(h.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  6163. b.add(h.tags.disc.scale, "linkFarBound").onChange(function(e) {
  6164. e && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - h.tags.disc.scale.linkPercent / 100))
  6165. }),
  6166. b.add(h.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  6167. h.tags.disc.scale.linkFarBound && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - e / 100))
  6168. }),
  6169. b.add(h.tags.disc.scale, "maxSize", 40, 200).step(1),
  6170. b.add(h.tags.disc.scale, "minSize", 20, 100).step(1),
  6171. b.add(h.tags.disc.scale, "responsiveness", 0, 100).step(1);
  6172. var w = C.addFolder("Navigate");
  6173. w.add(h.tags.navigate, "nearestPano").name("nearestPano"),
  6174. w.add(h.tags.navigate, "lineOfSight").name("lineOfSight"),
  6175. w.add(h.tags.navigate, "reactivate").name("reactivate"),
  6176. w.add(h.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  6177. w.add(h.tags.navigate, "tiltTolerance", 0, 50).step(1),
  6178. w.add(h.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  6179. var _ = n.addFolder("Debug");
  6180. _.add(h, "wireframe").onFinishChange(function() {
  6181. e.chunks.forEach(function(t) {
  6182. t.material && (t.wireframeTwin || (t.wireframeTwin = new o.WireframeHelper(t),
  6183. t.wireframeTwin.material.depthWrite = !1,
  6184. t.wireframeTwin.material.depthTest = !1,
  6185. t.wireframeTwin.material.opacity = .5,
  6186. t.wireframeTwin.material.transparent = !0),
  6187. h.wireframe ? e.add(t.wireframeTwin) : e.remove(t.wireframeTwin))
  6188. })
  6189. }),
  6190. _.add(h, "skyboxWireframe").onFinishChange(function() {
  6191. h.skyboxWireframe ? (e.skybox.wireframe = new o.WireframeHelper(e.skybox),
  6192. e.add(e.skybox.wireframe)) : (e.remove(e.skybox.wireframe),
  6193. e.skybox.wireframe = null)
  6194. }),
  6195. _.add(h, "showSweeps").onFinishChange(function() {
  6196. e.setSweepVisibility(h.showSweeps)
  6197. }),
  6198. _.add(h, "showMesh").onFinishChange(function() {
  6199. e.chunks.forEach(function(e) {
  6200. e.visible = h.showMesh
  6201. })
  6202. }),
  6203. _.add(h, "showFloors").onFinishChange(function() {
  6204. e.floors.forEach(function(e) {
  6205. e.collider.children.forEach(function(e) {
  6206. e.material.visible = h.showFloors
  6207. })
  6208. })
  6209. }),
  6210. _.add(h, "showSkyboxes").onFinishChange(function() {
  6211. e.panos.forEach(function(e) {
  6212. e.skyboxMesh.visible = h.showSkyboxes
  6213. })
  6214. }),
  6215. _.add(h, "showNeighbors").onChange(function() {}),
  6216. _.add(e, "alpha", 0, 1)
  6217. }
  6218. var r = e("../lib/dat.gui")
  6219. , o = e("three")
  6220. , a = e("../util/easing")
  6221. , s = e("../enum/Viewmode")
  6222. , l = e("../enum/Colors")
  6223. , c = e("../enum/WarpStyle")
  6224. , h = e("../settings");
  6225. e("../tag/tag");
  6226. r.GUI.prototype.removeFolder = function(e) {
  6227. var t = this.__folders[e];
  6228. t && (t.close(),
  6229. this.__ul.removeChild(t.domElement.parentNode),
  6230. delete this.__folders[e],
  6231. this.onResize())
  6232. }
  6233. ,
  6234. t.exports.toggle = n
  6235. }
  6236. , {
  6237. "../enum/Colors": 19,
  6238. "../enum/Viewmode": 51,
  6239. "../enum/WarpStyle": 52,
  6240. "../lib/dat.gui": 93,
  6241. "../tag/tag": 123,
  6242. "../settings": 166,
  6243. "../util/easing": 186,
  6244. three: 217
  6245. }],
  6246. 64: [function(e, t, i) {
  6247. (function(i) {
  6248. "use strict";
  6249. function n(e, t, i, n) {
  6250. $(".gui-error .error-problem-text").text(e),
  6251. $(".gui-error .error-solution-text").text(t),
  6252. $(".gui-error .error-explanation").text(i),
  6253. $(".gui-error .error-actions").html(n),
  6254. $(window).resize(),
  6255. $(".gui-error").fadeIn(),
  6256. $("#bottom-logo").fadeIn()
  6257. }
  6258. function r(e) {
  6259. 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("");
  6260. n(e, h.ERROR_BROWSER_SOLUTION, h.ERROR_BROWSER_EXPLANATION, t),
  6261. s.isMobile() || $("[rel=tiletip]").tooltip({
  6262. placement: "bottom",
  6263. delay: {
  6264. show: 50,
  6265. hide: 0
  6266. },
  6267. trigger: "hover",
  6268. viewport: {
  6269. selector: "body",
  6270. padding: 10
  6271. }
  6272. })
  6273. }
  6274. function o() {
  6275. var e = s.isMobile() ? "" : '<span class="link install-browser">' + h.ERROR_GENERIC_ACTIONS_2 + "</span>" + h.ERROR_GENERIC_ACTIONS_3
  6276. , t = [h.ERROR_GENERIC_ACTIONS_1, e,].join("");
  6277. n(h.ERROR_GENERIC_PROBLEM, h.ERROR_GENERIC_SOLUTION, "", t),
  6278. s.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  6279. e.preventDefault(),
  6280. e.stopPropagation(),
  6281. r(" ")
  6282. })
  6283. }
  6284. function a(e) {
  6285. if ($("head title").text(c.pageTitle),
  6286. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  6287. $("#gui-loading").fadeOut(250),
  6288. $("#quick-blackout").hide(),
  6289. l.track("showcase_error", {
  6290. error_key: e
  6291. }),
  6292. h.locale || h.init(),
  6293. "webgl-unsupported" === e)
  6294. s.isMobile() ? o() : r(h.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  6295. else if ("webgl-ios" === e)
  6296. 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>.");
  6297. else if ("webgl-safari" === e)
  6298. 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>.");
  6299. else if ("webgl-generic" === e)
  6300. o();
  6301. else if ("missing-urls" === e)
  6302. n(h.ERROR_MISSING_URLS_PROBLEM, "", h.ERROR_MISSING_URLS_EXPLANATION);
  6303. else if ("loading-failed" === e)
  6304. 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>.");
  6305. else {
  6306. if ("loading-failed-maintenance" !== e)
  6307. return void d.error("Unhandled error: " + e);
  6308. n(h.ERROR_MAINTENANCE_PROBLEM, h.ERROR_MAINTENANCE_SOLUTION)
  6309. }
  6310. }
  6311. var s = e("./../util/browser")
  6312. , l = e("./../analytics")
  6313. , c = e("./../settings")
  6314. , h = e("../localization/localize")
  6315. , u = e("./../util/logger")
  6316. , d = new u(i)
  6317. , p = '"https://support.port.com/hc/articles/208220058"';
  6318. t.exports.error = a
  6319. }
  6320. ).call(this, "/js/gui/error.js")
  6321. }
  6322. , {
  6323. "../localization/localize": 108,
  6324. "./../analytics": 4,
  6325. "./../settings": 166,
  6326. "./../util/browser": 182,
  6327. "./../util/logger": 189
  6328. }],
  6329. 65: [function(e, t, i) {
  6330. (function(i) {
  6331. "use strict";
  6332. function n() {
  6333. Ue = [],
  6334. je.floors.visible && Ue.push(".gui-floor", ".gui-floor-title"),
  6335. Ue.push(".hideTarget", ".pinTop.right")
  6336. }
  6337. function r() {
  6338. for (var e in je)
  6339. if (je.hasOwnProperty(e)) {
  6340. var t = je[e];
  6341. if (!t.visible)
  6342. for (var i = 0; i < t.elements.length; i++)
  6343. $(t.elements[i]).hide()
  6344. }
  6345. je.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  6346. je.tourControls.visible === !1 && $("#drawer").addClass("fullWidth"),
  6347. n()
  6348. }
  6349. function o(e, t) {
  6350. var i = !K.isMobile() && Q.zoom.enabled && t.mode === _e.PANORAMA && !e.tourIsPlaying;
  6351. $("#gui-zoomin").toggle(i),
  6352. $("#gui-zoomout").toggle(i)
  6353. }
  6354. function a() {
  6355. c(),
  6356. $(".pinBottom").toggleClass("open"),
  6357. $("#drawer").toggleClass("open"),
  6358. $(".footer").toggleClass("open"),
  6359. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", Re.CLOSE_HIGHLIGHTS),
  6360. Ze("highlights")) : ($("#pullTab .icon").attr("data-original-title", Re.OPEN_HIGHLIGHTS),
  6361. ie.resetDrawer()),
  6362. setTimeout(function() {
  6363. $("#pullTab").toggleClass("opened");
  6364. }, $("#drawer").hasClass("open") ? 0 : Q.highlightAnimationDuration),
  6365. $(".pinBottom").hasClass("open") && s($(".vr-popup")) && $(".vr-popup").is(":visible") && Ae.dismiss()
  6366. }
  6367. function s(e) {
  6368. var t;
  6369. "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  6370. t = e.position().top + e.outerHeight(),
  6371. e.attr("style", "display: none"));
  6372. var i = $("#player").outerHeight()
  6373. , n = i - 130;
  6374. return n < t + 25
  6375. }
  6376. function l(e) {
  6377. "touchstart" === e.type && e.preventDefault(),
  6378. e.stopPropagation()
  6379. }
  6380. function c() {
  6381. W && (W.reload(),
  6382. W.init())
  6383. }
  6384. function h(e) {
  6385. ne.show(e),
  6386. r()
  6387. }
  6388. function u(e) {
  6389. ne.progress(e)
  6390. }
  6391. function d(e, t, i) {
  6392. var n = t.player;
  6393. $("#gui-thumb").fadeOut(2500),
  6394. ne.hide(function() {
  6395. Ge = !1
  6396. }),
  6397. me.init(e, i),
  6398. de.finishSetup(Object.keys(e.tags).length),
  6399. i.on(Te.IMAGE_OPENED, Ze.bind(this, "tag"));
  6400. var s = function() {
  6401. i.dismissExaminedTag(),
  6402. i.disableHovering()
  6403. };
  6404. Ae.on(ye.OPENED, s),
  6405. Ce.on(Me.OPENED, s),
  6406. he.on(ue.OPENED, s),
  6407. fe.on(ge.OPENED, s);
  6408. var l = i.enableHovering.bind(i);
  6409. if (Ae.on(ye.CLOSED, l),
  6410. Ce.on(Me.CLOSED, l),
  6411. he.on(ue.CLOSED, l),
  6412. fe.on(ge.CLOSED, l),
  6413. Q.labels.enabled && Object.keys(e.labels).length,
  6414. (!settings.extractFloor || !settings.extractFloor[number]) && e.floors.length <= 1 || !je.floors.visible ? je.floors.visible = !1 : (y(e, t),
  6415. C(e.currentFloor, n.mode)),
  6416. getQueryVariable('m') === '372'&& (je.floors.visible = 1, y(e,t)),
  6417. r(),
  6418. o(t, t.player),
  6419. $("#gui").fadeIn(1500),
  6420. je.highlight.visible && (2 !== Q.startHighlights || e.has360Views) && setTimeout(function() {
  6421. a(),
  6422. (!e.has360Views && 1 !== Q.startHighlights || e.has360Views && 0 === Q.startHighlights) && setTimeout(a, 2e3)
  6423. }, 2e3),
  6424. !K.isMobile())
  6425. for (var c = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], h = 0; h < c.length; h++)
  6426. $(c[h]).addClass("hasHover");
  6427. O(e),
  6428. de.setupToggling();
  6429. //xzw:
  6430. window.editHotPanel && editHotPanel();
  6431. //czj
  6432. navBorderRadius(e);
  6433. //czj 编辑界面
  6434. //window.EditingInterface && new EditingInterface(n.sceneRenderer);
  6435. window.EditTools && new EditTools(n.sceneRenderer);
  6436. }
  6437. function navBorderRadius(e){
  6438. var pullTab = $("#pullTab"),
  6439. mobileRadius = {
  6440. "bottom":{"border-bottom-left-radius":"10px","border-bottom-right-radius":"10px"},
  6441. "top":{"border-top-left-radius":"10px","border-top-right-radius":"10px"}
  6442. },
  6443. topRadius = {
  6444. "bottom":{"border-top-right-radius":"10px","border-bottom-right-radius":"10px"},
  6445. "top":{"border-bottom-left-radius":"10px","border-top-left-radius":"10px"}
  6446. };
  6447. function BorderRadius(bottom,top){
  6448. $("#gui-modes-map > div:visible:last").css(bottom);
  6449. if(pullTab.is(':visible')){
  6450. $(".viewContainer > div:visible:first").css(top);
  6451. }else{
  6452. $("#gui-modes-map > div:visible:first").css(top);
  6453. }
  6454. }
  6455. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  6456. BorderRadius(mobileRadius.bottom,mobileRadius.top);
  6457. }else{
  6458. BorderRadius(topRadius.bottom,topRadius.top);
  6459. }
  6460. //判断someData里面是否有special字段,如果有就会处理这些特殊的大场景
  6461. if(window.DATA.model.special || window.DATA.special){
  6462. window.specialScene && specialScene.special().afterImplement();
  6463. }
  6464. }
  6465. function p(e) {
  6466. e || (e = 0),
  6467. We = !1,
  6468. window.setTimeout(function() {
  6469. We || (ze = !0,
  6470. $("#gui-spinner").stop(!0, !0).show())
  6471. }
  6472. .bind(this), e)
  6473. }
  6474. function f() {
  6475. $("#gui-spinner").stop(!0, !0),
  6476. $("#gui-spinner").fadeOut(1e3),
  6477. We = !0,
  6478. ze = !1
  6479. }
  6480. function g(e, t) {
  6481. var i = e.mode
  6482. , n = t || e.currentPano;
  6483. $("#gui-modes-dollhouse").toggleClass("active", i === _e.DOLLHOUSE),
  6484. $("#gui-modes-floorplan").toggleClass("active", i === _e.FLOORPLAN),
  6485. $("#gui-modes-inside").toggleClass("active", i === _e.PANORAMA),
  6486. i === _e.PANORAMA ? ($("#view-controllers").slideUp(500),
  6487. Q.show360Views.enabled && !n.isAligned() ? (
  6488. $(".gui-floor").addClass("hidden"),
  6489. $("#gui-modes-outside").addClass("desktop-only")) : (
  6490. $(".gui-floor").removeClass("hidden"),
  6491. $("#gui-modes-outside").removeClass("desktop-only")),
  6492. $("#gui-modes-outside").removeClass("hidden")) : i !== _e.TRANSITIONING && (f(),
  6493. Be = i,
  6494. $("#gui-modes-outside").addClass("hidden"),
  6495. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6496. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(Q.guiAnimationSpeed))
  6497. }
  6498. function m(e, t) {
  6499. var i = t.player;
  6500. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6501. l(e),
  6502. J.updateInteraction(Se.InteractionGui, "inside-button"),
  6503. J.track("USER", {
  6504. event_type: "showcase_gui",
  6505. gui_action: "click_inside_mode_button"
  6506. }),
  6507. t.changeMode(_e.PANORAMA);
  6508. }),
  6509. $("#gui-modes-outside").find("a").on("click", function(e) {
  6510. l(e),
  6511. J.track("showcase_gui", {
  6512. gui_action: "click_outside_mode_button"
  6513. }),
  6514. t.changeMode(Be)
  6515. }),
  6516. $("#gui-modes-floorplan").on("click", function(e) {
  6517. l(e),
  6518. i.mode !== _e.FLOORPLAN && (J.track("showcase_gui", {
  6519. gui_action: "click_floorplan_mode_button"
  6520. }),
  6521. t.changeMode(_e.FLOORPLAN));
  6522. }),
  6523. $("#gui-modes-dollhouse").on("click", function(e) {
  6524. l(e),
  6525. i.mode !== _e.DOLLHOUSE && (J.track("showcase_gui", {
  6526. gui_action: "click_dollhouse_mode_button"
  6527. }),
  6528. t.changeMode(_e.DOLLHOUSE));
  6529. })
  6530. }
  6531. function v(e, t) {
  6532. function i() {
  6533. document.getElementById("vr").classList.remove("hidden"),
  6534. Q.vr.allowWebVR ? K.getVRDisplay().then(function(e) {
  6535. K.supportsFullscreen() ? n(e) : (De.warn("Unable to use WebVR when full screen is not supported"),
  6536. $(".improper-embed").toggleClass("hidden", !1),
  6537. r())
  6538. }, function(e) {
  6539. r()
  6540. }) : r()
  6541. }
  6542. function n(i) {
  6543. De.info(i.displayName + " detected, VR button activates WebVR experience"),
  6544. Ie.init(e.data, t, i, q),
  6545. Ie.on(Ee.OPENED, Ze.bind(gui, "vr")),
  6546. Ie.on(Ee.SHOW_TERMS, fe.show.bind(fe))
  6547. }
  6548. function r() {
  6549. De.info("WebVR support not found, VR button activates native app VR modal"),
  6550. Ae.init(e.data, q),
  6551. Ae.on(ye.OPENED, function() {
  6552. var e = document.getElementById("vr-modal");
  6553. return function() {
  6554. Ze("vr"),
  6555. le.open(e)
  6556. }
  6557. }()),
  6558. Ae.on(ye.CLOSED, le.reset)
  6559. }
  6560. if (Q.vr.enabled && e.supportsVR && !K.valueFromHash("mls", 0)){
  6561. /*********************** 方奕卓 VR功能事件监听 ********************/
  6562. K.isMobile() && $('#vr').css('display', ''); // 显示vr功能按钮
  6563. switch (Q.vr.option) {
  6564. case Pe.CONTEXTUAL:
  6565. i();
  6566. break;
  6567. case Pe.ANDROID:
  6568. K.detectAndroid() && i();
  6569. break;
  6570. case Pe.NONE:
  6571. }
  6572. }
  6573. }
  6574. function A(e, t) {
  6575. $("#play").on("mousedown touchstart", function(e) {
  6576. l(e);
  6577. Ze("tour");
  6578. ve.play();
  6579. J.trackAlways("showcase_gui", {
  6580. gui_action: "play_highlights"
  6581. })
  6582. }),
  6583. window.startAndPlay = function(e) {
  6584. // l(e);
  6585. Ze("tour");
  6586. ve.play();
  6587. J.trackAlways("showcase_gui", {
  6588. gui_action: "play_highlights"
  6589. })
  6590. };
  6591. $("#pause").on("mousedown touchstart", function(e) {
  6592. l(e),
  6593. ve.pause(),
  6594. J.trackAlways("showcase_gui", {
  6595. gui_action: "pause_highlights"
  6596. })
  6597. }),
  6598. $("#gui-zoomin").find("a").on("click", function(e) {
  6599. l(e),
  6600. t.player.zoomInIncrementally()
  6601. }),
  6602. $("#gui-zoomout").find("a").on("click", function(e) {
  6603. l(e),
  6604. t.player.zoomOutIncrementally()
  6605. })
  6606. }
  6607. function y(e, t) {
  6608. for (var i = $(".gui-floor"), n = 0; n < e.floors.length; n++) {
  6609. if(getQueryVariable('m') === '372') continue;
  6610. var r = $('<div class="floorChoice" data-index="' + n + '"></div>').text(e.floors.get(n).name);
  6611. $(".gui-floor").find(".container").prepend(r)
  6612. //cxz 本来一开始是prepend 后来改了append 按顺序插入
  6613. }
  6614. i.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + Re.FLOOR_ALL + "</div>"),
  6615. i.on("click", function(e) {
  6616. l(e),
  6617. Ze("floor"),
  6618. i.toggleClass("open")
  6619. }),
  6620. $(".floorChoice").on("click", function(e) {
  6621. l(e);
  6622. var n = $(this).data("index");
  6623. "all" !== n ? (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6624. t.player.gotoFloor(n),
  6625. J.track("showcase_gui", {
  6626. gui_action: "click_floor_select_button",
  6627. interaction_source: "gui"
  6628. })) : (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6629. Ze("move"),
  6630. t.allFloors(),
  6631. J.track("showcase_gui", {
  6632. gui_action: "click_toggle_all_floors_button",
  6633. interaction_source: "gui"
  6634. })),
  6635. i.removeClass("open")
  6636. })
  6637. }
  6638. function C(e, t) {
  6639. 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()),
  6640. e.model.allFloorsVisible ? ($(".gui-floor-title").text(Re.FLOOR_ALL),
  6641. $(".gui-floor-number").text(Re.FLOOR_ALL),
  6642. $(".floorChoice").removeClass("active"),
  6643. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6644. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6645. $(".floorChoice").removeClass("active"),
  6646. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6647. }
  6648. function I(e) {
  6649. return e.describe().inTransition
  6650. }
  6651. function b(e, t, i) {
  6652. Fe = e.heroLocations.length;
  6653. var n = '<li class="thumbImg" data-index=""><img src=""></li>'
  6654. , r = 100 / Fe + "%"
  6655. , o = $("#thumb-container")
  6656. , a = $("#progressBar");
  6657. $("#status").find(".totalSteps").text(Fe);
  6658. for (var s = 0; s < Fe; s++) {
  6659. var c = e.heroLocations[s]
  6660. , h = $(n);
  6661. var thumbUrl
  6662. if(c.heroLocations){//有子项,选第一张截图
  6663. thumbUrl = manage.dealURL(c.heroLocations[0].thumbUrl)//.replace('https://','').replace('http://','')
  6664. }else{
  6665. thumbUrl = manage.dealURL(c.thumbUrl)//.replace('https://','').replace('http://','')
  6666. }
  6667. h.attr("data-index", s)
  6668. je.highlight.visible && h.find("img").attr("src", thumbUrl)
  6669. if (c.name) {
  6670. var u = $('<div class="overlay"></div>').text(c.name);
  6671. h.prepend(u)
  6672. }
  6673. if (e.has360Views && c.cameraMode === _e.PANORAMA) {
  6674. var d = e.panos.get(c.panoId)
  6675. , p = d && !d.isAligned()
  6676. , 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>';
  6677. h.prepend(f)
  6678. }
  6679. o.append(h),
  6680. a.append('<div class="step" data-idx="' + s + '" style="width:' + r + '"></div>')
  6681. }
  6682. j = 144 * Fe,
  6683. Y = 111 * Fe,
  6684. $(".thumbImg").on("mouseover", function() {
  6685. I(t) || i.showPathToHeroLocation([$(this).data("index"),0])//改
  6686. }),
  6687. $(".thumbImg").on("mouseout", function() {
  6688. t.clearPath()
  6689. }),
  6690. $(".thumbImg").on("click", function(e) {
  6691. l(e);
  6692. var i = $(this);
  6693. J.updateInteraction(Se.InteractionGui, "thumbnail"),
  6694. J.trackAlways("showcase_gui", {
  6695. gui_action: "click_highlight"
  6696. }),
  6697. t.goToHighlight([i.data("index"),0])//改
  6698. }),
  6699. $(".previous").find("a").on("click", function(e) {
  6700. l(e),
  6701. J.trackAlways("showcase_gui", {
  6702. gui_action: "prev_highlight"
  6703. }),
  6704. t.prevHighlight()
  6705. }),
  6706. $(".next").find("a").on("click", function(e) {
  6707. l(e),
  6708. J.trackAlways("showcase_gui", {
  6709. gui_action: "next_highlight"
  6710. }),
  6711. t.nextHighlight()
  6712. }),
  6713. $("#drawer").on("mouseleave", function(e) {
  6714. l(e);
  6715. var t;
  6716. try {
  6717. t = new MouseEvent("mouseup",{
  6718. clientX: e.clientX,
  6719. clientY: e.clientY,
  6720. screenX: e.screenX,
  6721. screenY: e.screenY
  6722. })
  6723. } catch (i) {
  6724. t = document.createEvent("MouseEvents"),
  6725. 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)
  6726. }
  6727. document.dispatchEvent(t)
  6728. }),
  6729. W = new Sly($("#scrollFrame"),{
  6730. horizontal: !0,
  6731. itemNav: "centered",
  6732. smart: !0,
  6733. scrollTrap: !0,
  6734. scrollBy: 1,
  6735. mouseDragging: !0,
  6736. touchDragging: !0,
  6737. speed: 300,
  6738. dragHandle: !0,
  6739. dynamicHandle: !0,
  6740. clickBar: !0,
  6741. scrollBar: $("#scroller"),
  6742. activateOn: null
  6743. }).init(),
  6744. W.on("active", function(e, t) {
  6745. Ve = t,
  6746. Ze("tour"),
  6747. $(".step").removeClass("active"),
  6748. $("#status").find(".curIdx").text(t + 1);
  6749. for (var i = 0; i <= t; i++)
  6750. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6751. }),
  6752. w()
  6753. //add :
  6754. let scrollFrame = $(W.frame)
  6755. scrollFrame.on("wheel.sly", function() {
  6756. lastMoveScrollTime = Date.now()
  6757. })
  6758. let dragstart
  6759. /* scrollFrame.on("pointerdown", function() {
  6760. dragstart = true
  6761. })
  6762. scrollFrame.on("pointerup", function() {
  6763. dragstart = false
  6764. }) */
  6765. scrollFrame.on("pointermove", function() {
  6766. //if(dragstart){
  6767. lastMoveScrollTime = Date.now()
  6768. //}
  6769. })
  6770. }
  6771. function w() {
  6772. var e = $("#player").width() - 20
  6773. , t = $("#scroller")
  6774. , i = $("#drawer")
  6775. , n = $(".pinBottom");
  6776. if ($("#player").width() < 488 || $("#player").height() < 488)
  6777. t.addClass("hidden"),
  6778. i.addClass("noScroll"),
  6779. n.addClass("noScroll");
  6780. else {
  6781. var r = j > e
  6782. , o = !i.hasClass("noScroll")
  6783. , a = r !== o;
  6784. a && (t.toggleClass("hidden"),
  6785. i.toggleClass("noScroll"),
  6786. n.toggleClass("noScroll"))
  6787. }
  6788. }
  6789. function _(e) {
  6790. je.tourControls.visible = true//e.tour_buttons && K.valueFromHash("gt", 1),
  6791. je.coBrand.visible = e.presented_by && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash("mls", !1),
  6792. je.highlight.visible = /* e.highlight_reel && */ 1 !== Q.specialEdition && Q.showHighlights
  6793. }
  6794. function T(e) {
  6795. function t(t, i) {
  6796. return !!e.player_options[t] && e[i || t]
  6797. }
  6798. $(".model-title").text(e.name);
  6799. var i = Q.pageTitle;
  6800. // 2 !== K.valueFromHash("mls", 0) && (i = e.name + " - " + i),
  6801. 2 !== K.valueFromHash("mls", 0) && e.name && (i = e.name),
  6802. document.title = i ,
  6803. K.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  6804. delay: {
  6805. show: 50,
  6806. hide: 0
  6807. },
  6808. trigger: "hover",
  6809. html: !1,
  6810. viewport: {
  6811. selector: "body",
  6812. padding: 10
  6813. }
  6814. }),
  6815. K.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  6816. // 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"),
  6817. de.populate({
  6818. name: t("model_name", "name"),
  6819. coBrand: t("presented_by"),
  6820. description: t("model_summary", "summary") || "暂无内容",
  6821. contactName: t("contact_name"),
  6822. address: t("address"),
  6823. phone: t("contact_phone"),
  6824. formattedPhone: e.formatted_contact_phone,
  6825. email: t("contact_email"),
  6826. url: t("external_url"),
  6827. socialSharing: e.enable_social_sharing && e.is_public
  6828. })
  6829. }
  6830. function x(e, t, i, n, r, o) {
  6831. function a() {
  6832. o.setLoadingStartTime(),
  6833. H(),
  6834. r ? (re.showMessage(t, i, je.coBrand.visible),
  6835. l()) : h(l)
  6836. }
  6837. var s = $.Deferred()
  6838. , l = s.resolve.bind(s);
  6839. return Ge = !0,
  6840. O(e),
  6841. e.data.player_options && _(e.data.player_options),
  6842. 1 === Q.specialEdition && $("body").addClass("specialEdition"),
  6843. Re.localizeGUI(),
  6844. T(e.data),
  6845. r || $(".quick").addClass("hidden"),
  6846. //e.data.image && !r && E(e.data.image),
  6847. n ? (J.impression(),
  6848. a()) : (o.setWaitingStartTime(),
  6849. oe.show(r, a)),
  6850. s
  6851. }
  6852. function S(e, t, i, n, r, a, s) {
  6853. q = s,
  6854. e.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6855. e.supportedModes[_e.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6856. ae.init(),
  6857. re.init(e, a),
  6858. Oe.init(e, t, n),
  6859. $(".icon").on("mouseover", function() {
  6860. t.player && t.player.reticule.hide()
  6861. }),
  6862. m(e, t),
  6863. A(e, t),
  6864. e.data.enable_social_sharing && e.data.is_public && Q.share.enabled && (Ce.init(window.DATA.name/* e.data.name */),
  6865. Ce.on(Me.OPENED, function() {
  6866. var e = document.getElementById("share-modal");
  6867. return function() {
  6868. Ze("share"),
  6869. le.open(e)
  6870. }
  6871. }()),
  6872. Ce.on(Me.CLOSED, le.reset)),
  6873. e.heroLocations.length > 0 ? b(e, t, i) : (je.highlight.visible = !1,
  6874. je.tourControls.visible = !1),
  6875. de.on(pe.OPEN_INFO, Ze.bind(this, "info")),
  6876. z(),
  6877. g(i),
  6878. v(e, r),
  6879. e.on("floor.changed", C),
  6880. e.on("waiting", R.bind(this, e)),
  6881. e.on("waiting-done", P.bind(this, e)),
  6882. i.on(xe.ModeChanged, function(e, n) {
  6883. g(i),
  6884. o(t, i),
  6885. n === _e.PANORAMA && i.currentPano && !i.currentPano.isAligned() && (n = _e.OUTDOOR),
  6886. he.updateMode(n)
  6887. }),
  6888. n.on(Se.Move, Ze.bind(this, "move")),
  6889. i.on(xe.Ready, function() {
  6890. ie.init(n, i, i.tagManager, t),
  6891. i.on(xe.ModeChanged, function(e, t) {
  6892. e !== t && $(".vr-popup").is(":visible") && Ae.dismiss()
  6893. })
  6894. }),
  6895. i.on(xe.PanoChosen, function(e, t) {
  6896. g(i, t),
  6897. he.updateMode(t && !t.isAligned() ? _e.OUTDOOR : _e.PANORAMA)
  6898. }),
  6899. le.on(ce.CLOSE, function(e) {
  6900. switch (e) {
  6901. case "vr-modal":
  6902. Ae.dismiss();
  6903. break;
  6904. case "share-modal":
  6905. Ce.hide();
  6906. break;
  6907. case "terms-modal":
  6908. fe.hide()
  6909. }
  6910. });
  6911. var l = $("#play").eq(0)
  6912. , c = $("#pause").eq(0)
  6913. , h = $(".pinBottom").toArray()
  6914. , u = $("#drawer").eq(0)
  6915. , d = $("#playHead").eq(0)
  6916. , p = $("#progressBar").eq(0)
  6917. , f = $("#thumb-container").eq(0)
  6918. , y = f.children()
  6919. , I = p.children();
  6920. t.on("update.controls", function() {//导览控制
  6921. var n = t.describe();
  6922. if(n.tourIsPlaying || i.isWarping()){
  6923. if(je.tourControls.visible){
  6924. l.hide() //play button
  6925. c.show() //pause button
  6926. }
  6927. if(n.tourInProgress){
  6928. h.forEach(function(e) {
  6929. e.classList.add("playing")
  6930. }),
  6931. u.addClass("playing"),
  6932. d.addClass("playing")
  6933. }
  6934. }else{
  6935. if(je.tourControls.visible){
  6936. l.show(),
  6937. c.hide()
  6938. }
  6939. if(!n.tourInProgress){
  6940. ve.stopTour(),
  6941. h.forEach(function(e) {
  6942. e.classList.remove("playing")
  6943. }),
  6944. u.removeClass("playing"),
  6945. d.removeClass("playing")
  6946. }
  6947. }
  6948. var r, a, s;
  6949. if (null !== n.currentItem) {
  6950. var p, f;
  6951. $("#status").find(".curIdx").text(n.currentItem[0] + 1),
  6952. n.onTheBus ? (p = "active",
  6953. f = "recent") : (f = "active",
  6954. p = "recent");
  6955. var g = null === n.destinationItem || n.currentItem[0] === n.destinationItem[0];
  6956. /* for (r = 0; r < e.heroLocations.length; r += 1)
  6957. s = y.eq(r),
  6958. a = I.eq(r),
  6959. s.removeClass(f),
  6960. a.removeClass(f),
  6961. n.onTheBus && r === n.destinationItem[0] ? (s.addClass(p),
  6962. a.addClass(p),
  6963. W.activate(r)) : n.onTheBus && g && r === n.currentItem[0] ? (s.addClass(p),
  6964. a.addClass(p)) : (s.removeClass(p),
  6965. a.removeClass(p)) */
  6966. for (r = 0; r < e.heroLocations.length; r += 1){
  6967. s = y.eq(r),
  6968. a = I.eq(r),
  6969. s.removeClass(f),
  6970. a.removeClass(f);
  6971. if(n.onTheBus && r === n.destinationItem[0]){
  6972. s.addClass(p)
  6973. a.addClass(p)
  6974. if(Date.now() - lastMoveScrollTime > 2000){ //add 如果一段时间内用户不操作scrollbar,才focus回这个item
  6975. W.activate(r) // scrollbar slide to this
  6976. }
  6977. }else{
  6978. n.onTheBus && g && r === n.currentItem[0] ?
  6979. (s.addClass(p), a.addClass(p)) :
  6980. (s.removeClass(p), a.removeClass(p))
  6981. }
  6982. }
  6983. } else
  6984. for (r = 0; r < e.heroLocations.length; r += 1)
  6985. s = y.eq(r),
  6986. a = I.eq(r),
  6987. s.removeClass("active recent"),
  6988. a.removeClass("active recent");
  6989. o(t, i)
  6990. }),
  6991. document.addEventListener("keydown", function(n) {
  6992. switch (J.updateInteraction(Se.InteractionKey),
  6993. n.which) {
  6994. case we.ZERO:
  6995. Q.debug && e.toggleAlpha();
  6996. break;
  6997. case we.NINE:
  6998. Q.debug && se.toggle();
  6999. break;
  7000. case we.ONE:
  7001. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.PANORAMA);
  7002. break;
  7003. case we.TWO:
  7004. e.outsideAllowed() && !i.isInMode(_e.DOLLHOUSE, _e.TRANSITIONING) && t.changeMode(_e.DOLLHOUSE);
  7005. break;
  7006. case we.THREE:
  7007. e.outsideAllowed() && !i.isInMode(_e.FLOORPLAN, _e.TRANSITIONING) && t.changeMode(_e.FLOORPLAN);
  7008. break;
  7009. case we.FOUR:
  7010. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.OUTDOOR);
  7011. break;
  7012. case we.SPACE:
  7013. je.tourControls.visible && ($("#playHead").hasClass("playing") || Ze("tour"));
  7014. break;
  7015. case we.RETURN:
  7016. Q.debug && e.toggleExplodeUp();
  7017. break;
  7018. case we.P:
  7019. k();
  7020. break;
  7021. case we.U:
  7022. B();
  7023. break;
  7024. case we.X:
  7025. Q.debug && e.toggleExplode();
  7026. break;
  7027. case we.PLUSEQUALS:
  7028. t.player.activatePersistentZooming(!0),
  7029. ie.hideUi();
  7030. break;
  7031. case we.DASHUNDERSCORE:
  7032. t.player.activatePersistentZooming(!1),
  7033. ie.hideUi();
  7034. break;
  7035. case we.SEVEN:
  7036. De.info("Zoom level: " + t.player.zoomLevel + ", FOV: " + t.player.zoomFov);
  7037. break;
  7038. case we.EIGHT:
  7039. t.player.decreaseZoomSpeed();
  7040. break;
  7041. case we.NINE:
  7042. t.player.increaseZoomSpeed()
  7043. }
  7044. return i && i.reticule.hide(),
  7045. !0
  7046. }
  7047. .bind(this)),
  7048. document.addEventListener("keyup", function(e) {
  7049. switch (e.which) {
  7050. case we.PLUSEQUALS:
  7051. t.player.deactivatePersistentZooming();
  7052. break;
  7053. case we.DASHUNDERSCORE:
  7054. t.player.deactivatePersistentZooming()
  7055. }
  7056. }
  7057. .bind(this)),
  7058. F(e),
  7059. L(e, t.player),
  7060. M(i),
  7061. te.setAutoPlay(e.heroCount()),
  7062. he.init(i, a.mode),
  7063. he.on(ue.OPENED, Ze.bind(this, "help")),
  7064. fe.init(),
  7065. fe.on(ge.OPENED, function() {
  7066. var e = document.getElementById("terms-modal");
  7067. return function() {
  7068. Ze("terms"),
  7069. le.open(e)
  7070. }
  7071. }()),
  7072. fe.on(ge.CLOSED, le.reset),
  7073. Q.quickstart.enabled || re.delayLanding(a.mode).then(re.showMessage.bind(this, i, t, je.coBrand.visible)),
  7074. (Q.quickstart.enabled || i.model.outsideAllowed()) && ie.init(n, i, i.tagManager, t),
  7075. Q.profiling.enabled && se.show(),
  7076. ve.init(t)
  7077. }
  7078. function M(e) {
  7079. var t = function(e, t) {
  7080. $(e).find("a").each(function(e, i) {
  7081. t ? $(i).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(i).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  7082. i.style.pointerEvents = t ? "auto" : "none"
  7083. })
  7084. }
  7085. , i = function() {
  7086. e.zoomLevel >= Q.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  7087. e.zoomLevel <= Q.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  7088. };
  7089. e.on(Ne.ZoomMax, function() {
  7090. t("#gui-zoomin", !1),
  7091. t("#gui-zoomout", !0)
  7092. }),
  7093. e.on(Ne.ZoomMin, function() {
  7094. t("#gui-zoomin", !0),
  7095. t("#gui-zoomout", !1)
  7096. }),
  7097. e.on(Ne.ZoomIn, function() {
  7098. t("#gui-zoomout", !0)
  7099. }),
  7100. e.on(Ne.ZoomOut, function() {
  7101. t("#gui-zoomin", !0)
  7102. }),
  7103. i()
  7104. }
  7105. function R(e) {
  7106. O(e)
  7107. }
  7108. function P(e) {
  7109. O(e)
  7110. }
  7111. function O(e) {
  7112. var t = e.waitQueue.length;
  7113. t <= 0 ? f() : Ge || p(Q.modelComponentLoadSpinnerDelay)
  7114. }
  7115. function L(e, t) {
  7116. He = {
  7117. gui: null,
  7118. visible: !1,
  7119. model: e,
  7120. player: t
  7121. }
  7122. }
  7123. function D(e, t) {
  7124. function i() {
  7125. var i = t.toJSON();
  7126. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + e.sid + "&start=" + be.serialize(i),
  7127. t.tagManager.activeTag && (n.linkToLocation += "&tag=" + t.tagManager.activeTag.sid)
  7128. }
  7129. var n = {}
  7130. , r = new Le.GUI({
  7131. autoPlace: !0,
  7132. width: "60%"
  7133. });
  7134. i(),
  7135. t.on(xe.ViewChanged, i),
  7136. r.add(n, "linkToLocation").name(Re.LINK_TO_LOCATION).listen(),
  7137. r.domElement.id = "datLinks";
  7138. var o = [].slice.call(r.domElement.querySelectorAll(".property-name"));
  7139. return o.forEach(function(e) {
  7140. if (!K.detectSafari()) {
  7141. var t = document.createElement("button");
  7142. t.classList.add("btn-deep-link"),
  7143. t.innerText = Re.MENU_COPY,
  7144. e.nextSibling.appendChild(t);
  7145. var i = function() {
  7146. alert(Re.LINK_ALERT_COPY),
  7147. t.hide()
  7148. };
  7149. t.addEventListener("click", function(e) {
  7150. try {
  7151. var t = e.target.parentNode.childNodes[0];
  7152. t.select();
  7153. var n = document.execCommand("copy");
  7154. t.blur(),
  7155. n || i()
  7156. } catch (e) {
  7157. i()
  7158. }
  7159. })
  7160. }
  7161. }),
  7162. $(r.__closeButton).hide(),
  7163. r
  7164. }
  7165. function N(e) {
  7166. He.gui || (He.gui = D(He.model, He.player)),
  7167. He.visible = e,
  7168. e ? $(He.gui.domElement).show() : $(He.gui.domElement).hide()
  7169. }
  7170. function B() {
  7171. N(!He.visible)
  7172. }
  7173. function F(e) {
  7174. ke = {
  7175. gui: null,
  7176. visible: !1,
  7177. model: e
  7178. }
  7179. }
  7180. function V(e) {
  7181. var t = new Le.GUI;
  7182. return t.add(Q, "showSweeps").name("Show sweeps").onFinishChange(function() {
  7183. e.setSweepVisibility(Q.showSweeps)
  7184. }),
  7185. t.add(Q, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  7186. t.add(Q.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  7187. Q.transition.flySpeed = 0,
  7188. t.__controllers.forEach(function(e) {
  7189. e.updateDisplay()
  7190. })
  7191. }),
  7192. t.add(Q.path, "opacity", 0, 1).name("Path opacity"),
  7193. $(t.__closeButton).hide(),
  7194. t
  7195. }
  7196. function U(e) {
  7197. ke.gui || (ke.gui = V(ke.model)),
  7198. ke.visible = e,
  7199. e ? $(ke.gui.domElement).show() : $(ke.gui.domElement).hide()
  7200. }
  7201. function k() {
  7202. U(!ke.visible)
  7203. }
  7204. function H() {
  7205. function e(e) {
  7206. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)/* || e.preventDefault()*/
  7207. }
  7208. $("body").css("touch-action", "none"),
  7209. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {
  7210. // e.preventDefault()
  7211. });
  7212. var t = document.getElementById("terms-text")
  7213. , i = document.getElementById("more-help-wrapper")
  7214. , n = (document.getElementById("navigation-help-wrapper"),
  7215. document.getElementById("help-dialog"),
  7216. document.getElementById("tag-billboards"));
  7217. Q.useWheel && (document.body.addEventListener("mousewheel", e, { passive: false }),
  7218. document.body.addEventListener("DOMMouseScroll", e)),
  7219. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  7220. e.stopPropagation()
  7221. })
  7222. }
  7223. function G(e, t) {
  7224. for (var i = []; e; )
  7225. i.push(e),
  7226. e = e.parentNode;
  7227. for (; t && i.indexOf(t) === -1; )
  7228. t = t.parentNode;
  7229. return t
  7230. }
  7231. function z() {
  7232. var e, t = function(t) {
  7233. e = 0 === t.button || 1 === t.which ? t.target : null
  7234. }, i = function(t) {
  7235. e !== t.target && (e = G(e, t.target));
  7236. var i = document.getElementById("gui-parent");
  7237. if (G(i, e) !== i && (e = null),
  7238. e) {
  7239. var n;
  7240. try {
  7241. n = new MouseEvent("click",t)
  7242. } catch (e) {
  7243. n = document.createEvent("MouseEvents"),
  7244. 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)
  7245. }
  7246. n.syntheticClick = !0,
  7247. e.dispatchEvent(n),
  7248. e = null
  7249. }
  7250. };
  7251. document.body.addEventListener("mousedown", t, !0),
  7252. document.body.addEventListener("mouseup", i, !0),
  7253. document.getElementById("gui-parent").addEventListener("click", function(e) {
  7254. e.syntheticClick || (e.stopPropagation(),
  7255. "A" === e.target.nodeName && e.preventDefault())
  7256. }, !0)
  7257. }
  7258. var lastMoveScrollTime = 0;//add
  7259. var W, j, Y, X, Z, q, K = (e("three"),
  7260. e("../util/ajax"),
  7261. e("../util/browser")), Q = e("../settings"), J = e("../analytics"), ee = (e("../util/transitions"),
  7262. e("../util/camera"),
  7263. e("../util/logger")), te = (e("../objects/Snapshot"),
  7264. 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"),
  7265. e("../tag/Media/MediaEvent")), xe = (e("../enum/PathDiscardMode"),
  7266. e("../enum/PathDisplayMode"),
  7267. e("../enum/DirectorEvents"),
  7268. e("../enum/PlayerEvents")), Se = e("../enum/ControlEvents"), Me = e("./sharing/ShareEvents"), Re = e("../localization/localize"), Pe = (e("../enum/Vectors"),
  7269. e("../enum/WarpStyle"),
  7270. e("../enum/AlignmentType"),
  7271. e("../enum/VROption")), Oe = e("./konami"), Le = e("../lib/dat.gui"), De = new ee(i), Ne = (e("../util/showcase"),
  7272. e("../enum/ZoomEvents")), Be = _e.DOLLHOUSE, Fe = 0, Ve = 0, Ue = [".hideTarget"], ke = null, He = null, Ge = !1, ze = !1, We = !1, je = {
  7273. coBrand: {
  7274. visible: !0,
  7275. elements: [".co-brand", "#loaderCoBrand"]
  7276. },
  7277. help: {
  7278. visible: !0,
  7279. elements: [".nav-help", "#nav-help"]
  7280. },
  7281. tourControls: {
  7282. visible: !0,
  7283. elements: [".next", ".previous", "#play"]
  7284. },
  7285. highlight: {
  7286. visible: !0,
  7287. elements: ["#drawer", "#pullTab"]
  7288. },
  7289. share: {
  7290. visible: !0,
  7291. elements: [".socialButton", "#share"]
  7292. },
  7293. fullScreen: {
  7294. visible: !0,
  7295. elements: ["#gui-fullscreen"]
  7296. },
  7297. floors: {
  7298. visible: !0,
  7299. elements: [".gui-floor"]
  7300. }
  7301. }, Ye = function() {
  7302. var e = document.getElementById("drawer");
  7303. return function() {
  7304. $("#player").height() < 400 && e.classList.contains("open") && a()
  7305. }
  7306. }(), Xe = function() {
  7307. var e = document.getElementById("meta-info");
  7308. return function() {
  7309. $("#player").height() < 400 && e.classList.contains("expand") && de.toggleMeta(!0)
  7310. }
  7311. }(), Ze = function(e) {
  7312. function t() {
  7313. u.classList.contains("expand") && de.toggleMeta(!0)
  7314. }
  7315. function i() {
  7316. fe.hide()
  7317. }
  7318. function n() {
  7319. he.close()
  7320. }
  7321. function r() {
  7322. Ae.dismiss()
  7323. }
  7324. function o() {
  7325. p.hasClass("open") && a(!0)
  7326. }
  7327. function l() {
  7328. Ce.hide()
  7329. }
  7330. function c() {
  7331. f.hasClass("open") && f.removeClass("open")
  7332. }
  7333. function h() {
  7334. d.classList.contains("fadeIn") && (d.classList.contains("landing") ? re.dismissModal() : d.classList.contains("tour") && ve.dismissModal())
  7335. }
  7336. var u = document.getElementById("meta-info")
  7337. , d = document.getElementById("interaction-modal")
  7338. , p = $("#drawer").eq(0)
  7339. , f = $(".gui-floor").eq(0)
  7340. , g = $(".vr-popup").eq(0);
  7341. return function(e) {
  7342. switch (e) {
  7343. case "info":
  7344. i(),
  7345. n(),
  7346. Ye(),
  7347. l(),
  7348. c(),
  7349. r(),
  7350. h();
  7351. break;
  7352. case "terms":
  7353. t(),
  7354. n(),
  7355. o(),
  7356. l(),
  7357. c(),
  7358. r(),
  7359. h();
  7360. break;
  7361. case "help":
  7362. t(),
  7363. i(),
  7364. l(),
  7365. c(),
  7366. r(),
  7367. h();
  7368. break;
  7369. case "vr":
  7370. t(),
  7371. i(),
  7372. l(),
  7373. c(),
  7374. n(),
  7375. h(),
  7376. s(g) && o();
  7377. break;
  7378. case "highlights":
  7379. Xe(),
  7380. i(),
  7381. l(),
  7382. c();
  7383. break;
  7384. case "share":
  7385. t(),
  7386. i(),
  7387. n(),
  7388. c(),
  7389. r(),
  7390. h();
  7391. break;
  7392. case "floor":
  7393. i(),
  7394. l(),
  7395. r();
  7396. break;
  7397. case "view":
  7398. c(),
  7399. l(),
  7400. i(),
  7401. r();
  7402. break;
  7403. case "tour":
  7404. i(),
  7405. l(),
  7406. c(),
  7407. r();
  7408. break;
  7409. case "move":
  7410. i(),
  7411. l(),
  7412. c(),
  7413. r();
  7414. break;
  7415. case "resize":
  7416. t(),
  7417. Ye(),
  7418. c();
  7419. break;
  7420. case "tag":
  7421. i(),
  7422. n(),
  7423. l(),
  7424. c(),
  7425. r()
  7426. }
  7427. }
  7428. }();
  7429. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  7430. $("#gui-fullscreen").toggle(!K.isFullscreen()),
  7431. $("#gui-fullscreen-exit").toggle(!!K.isFullscreen()),
  7432. setTimeout(function() {
  7433. $(".icon:visible").hide().show(0)
  7434. }, 100)
  7435. }),
  7436. $("#gui-fullscreen").find("a").on("click", function(e) {
  7437. l(e),
  7438. K.requestFullscreen($("body")[0]),
  7439. J.track("showcase_gui", {
  7440. gui_action: "click_enter_fullscreen",
  7441. interaction_source: "gui"
  7442. })
  7443. //czj
  7444. //W.reload()
  7445. }),
  7446. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  7447. l(e),
  7448. K.exitFullscreen(),
  7449. J.track("showcase_gui", {
  7450. gui_action: "click_exit_fullscreen",
  7451. interaction_source: "gui"
  7452. })
  7453. })
  7454. $(window).on("resize", function(e) {
  7455. var t = e.target.innerHeight
  7456. , i = e.target.innerWidth;
  7457. t === X && i === Z || (je.highlight.visible && w(),
  7458. Ze("resize"),
  7459. $(".pinTop.right").removeClass("hideUnderMeta"),
  7460. c(),
  7461. X = t,
  7462. Z = i)
  7463. }).resize(),
  7464. K.supportsFullscreen() || $("#gui-fullscreen").hide(),
  7465. $("#pullTab").on("click", function(e) {
  7466. l(e),
  7467. $("#drawer").hasClass("open") ? (J.trackAlways("showcase_gui", {
  7468. gui_action: "hide_highlight_reel"
  7469. }),
  7470. $(this).addClass("open").children("img").attr("src","images/auto.png")) : (J.trackAlways("showcase_gui", {
  7471. gui_action: "show_highlight_reel"
  7472. }),
  7473. $(this).removeClass("open").children("img").attr("src","images/auto-suspend.png"));
  7474. a()
  7475. });
  7476. /***********************方奕卓 热点列表事件监听 ************************/
  7477. if(window.DATA.showHotListSta) {
  7478. $('#hotList').css('display', '');
  7479. $('#hotList').on('click',function(e){
  7480. l(e);
  7481. var hotList = $('#hotListWrap')[0];
  7482. var isActive = hotList.classList.contains('hotListActive');
  7483. if(isActive){
  7484. hotList.classList.remove('hotListActive');
  7485. this.classList.remove('active')
  7486. }else{
  7487. hotList.classList.add('hotListActive');
  7488. this.classList.add('active')
  7489. }
  7490. }),
  7491. $('#hotListContent ul').on('mouseover', function(e){
  7492. l(e);
  7493. var target = e.target;
  7494. var hotList = document.getElementById('hotListWrap');
  7495. if(target.tagName === 'SPAN'){
  7496. var targetParent = target.parentElement.parentElement;
  7497. if(target.offsetWidth + 116 >= targetParent.clientWidth){
  7498. hotList.style.width = target.offsetWidth + 116 + 'px';
  7499. }else{
  7500. hotList.style.width = '';
  7501. }
  7502. }else if(target.tagName === 'LI'){
  7503. var targetParent = target.parentElement;
  7504. if(target.children[0].offsetWidth + 116 >= targetParent.clientWidth){
  7505. hotList.style.width = target.children[0].offsetWidth + 116 + 'px';
  7506. }else{
  7507. hotList.style.width = ''
  7508. }
  7509. }else {
  7510. hotList.style.width = '';
  7511. }
  7512. });
  7513. $('#hotListContent ul').on('click', function(e){
  7514. l(e);
  7515. this.preElem && this.preElem.classList.remove('active');
  7516. if(e.target.tagName === 'SPAN'){
  7517. e.target.parentElement.classList.add('active');
  7518. e.target.parentElement.hot && e.target.parentElement.hot.examine( ); // 打开热点
  7519. this.preElem = e.target.parentElement;
  7520. }else{
  7521. e.target.classList.add('active');
  7522. e.target.hot && e.target.hot.examine( ); // 打开热点
  7523. this.preElem = e.target;
  7524. }
  7525. })
  7526. $('#hotListClose').on('click', function(e){
  7527. l(e);
  7528. var hotList = $('#hotListWrap')[0];
  7529. hotList.classList.remove('hotListActive');
  7530. $('#hotListContent ul .active').removeClass('active');
  7531. $('#hotList')[0].classList.remove('active')
  7532. })
  7533. }
  7534. /*****************************************************************/
  7535. $("#more-menu-button").on("click", function(e) {
  7536. l(e);
  7537. var t = $("#more-menu");
  7538. t.toggleClass("open")
  7539. }),
  7540. t.exports.init = S,
  7541. t.exports.startLoading = x,
  7542. t.exports.endLoading = d,
  7543. t.exports.onProgress = u
  7544. }
  7545. ).call(this, "/js/gui/gui.js")
  7546. }
  7547. , {
  7548. "../analytics": 4,
  7549. "../controls/serializer": 14,
  7550. "../enum/AlignmentType": 17,
  7551. "../enum/BlackoutStyle": 18,
  7552. "../enum/ControlEvents": 21,
  7553. "../enum/DirectorEvents": 23,
  7554. "../enum/Keys": 30,
  7555. "../enum/PathDiscardMode": 38,
  7556. "../enum/PathDisplayMode": 39,
  7557. "../enum/PlayerEvents": 40,
  7558. "../enum/VROption": 47,
  7559. "../enum/Vectors": 50,
  7560. "../enum/Viewmode": 51,
  7561. "../enum/WarpStyle": 52,
  7562. "../enum/ZoomEvents": 53,
  7563. "../lib/dat.gui": 93,
  7564. "../localization/localize": 108,
  7565. "../tag/Media/MediaEvent": 131,
  7566. "../objects/Snapshot": 153,
  7567. "../settings": 166,
  7568. "../util/ajax": 181,
  7569. "../util/browser": 182,
  7570. "../util/camera": 183,
  7571. "../util/logger": 189,
  7572. "../util/showcase": 193,
  7573. "../util/transitions": 195,
  7574. "./closer/ModalCloserEvent": 61,
  7575. "./closer/modalCloser": 62,
  7576. "./help/HelpEvent": 66,
  7577. "./help/help": 67,
  7578. "./helpManager": 68,
  7579. "./immersiveMode": 69,
  7580. "./konami": 70,
  7581. "./landingScreen": 71,
  7582. "./loadingScreen": 72,
  7583. "./memoryUsage": 73,
  7584. "./playButton": 74,
  7585. "./populateModal": 75,
  7586. "./sharing/ShareEvents": 76,
  7587. "./sharing/modal": 77,
  7588. "./terms/TermsEvent": 78,
  7589. "./terms/terms": 79,
  7590. "./title/TitleEvents": 80,
  7591. "./title/tagToggle": 81,
  7592. "./title/titleBar": 82,
  7593. "./tourInteraction": 84,
  7594. "./vr/vrEvent": 85,
  7595. "./vr/vrModal": 87,
  7596. "./webvr/WebVrEvent": 88,
  7597. "./webvr/webVRgui": 89,
  7598. three: 217
  7599. }],
  7600. 66: [function(e, t, i) {
  7601. "use strict";
  7602. t.exports = Object.freeze({
  7603. OPENED: "help.opened",
  7604. CLOSED: "help.closed"
  7605. })
  7606. }
  7607. , {}],
  7608. 67: [function(e, t, i) {
  7609. "use strict";
  7610. function n() {
  7611. g.on("click", function(e) {
  7612. if (S && S !== l.TRANSITIONING) {
  7613. var t = window.getComputedStyle(y).getPropertyValue("opacity") > 0;
  7614. t && !M ? R.close() : r()
  7615. }
  7616. }),
  7617. w.on("click", function(e) {
  7618. R.close()
  7619. }),
  7620. E.on("click", function(e) {
  7621. S && S !== l.TRANSITIONING && (s(),
  7622. o())
  7623. }),
  7624. b.on("click", function(e) {
  7625. s(),
  7626. a()
  7627. })
  7628. }
  7629. function r() {
  7630. S && S !== l.TRANSITIONING && (M = !0,
  7631. setTimeout(function() {
  7632. M = !1
  7633. }, d.help.modalStayDuration),
  7634. R.emit(h.OPENED),
  7635. m.addClass("open " + S),
  7636. g.addClass("open"),
  7637. s(),
  7638. o(),
  7639. y.style.removeProperty ? y.style.removeProperty("display") : y.style.removeAttribute("display"),
  7640. y.classList.add("fadeIn"))
  7641. }
  7642. function o() {
  7643. E.addClass("underline-tab"),
  7644. u.fill(_, c.NAVIGATION, S),
  7645. m.addClass(S)
  7646. }
  7647. function a() {
  7648. b.addClass("underline-tab"),
  7649. u.fill(T, c.MORE_HELP),
  7650. m.addClass("more-help")
  7651. }
  7652. function s(e, t) {
  7653. m.removeClass("more-help " + l.PANORAMA + " " + l.DOLLHOUSE + " " + l.FLOORPLAN + " " + l.OUTDOOR),
  7654. I.forEach(function(e) {
  7655. e.classList.remove("underline-tab")
  7656. })
  7657. }
  7658. var l = e("../../enum/Viewmode")
  7659. , c = e("../../enum/HelpModalType")
  7660. , h = e("./HelpEvent")
  7661. , u = (e("../helpManager"),
  7662. e("./../populateModal"))
  7663. , d = e("../../settings")
  7664. , p = e("../../util/common")
  7665. , f = e("events").EventEmitter
  7666. , g = $(".footer-help").eq(0)
  7667. , m = $("#help-dialog").eq(0)
  7668. , v = document.querySelector("#quick-logo")
  7669. , A = document.querySelector("#loaderCoBrand")
  7670. , y = document.querySelector("#help-dialog")
  7671. , C = document.querySelector(".footer")
  7672. , I = $(".help-tabs").children().toArray()
  7673. , E = $(".navigation-tab").eq(0)
  7674. , b = $(".more-help-tab").eq(0)
  7675. , w = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7676. m.find(".close").eq(0))
  7677. , _ = m.find(".interactions").toArray()
  7678. , T = m.find(".ui-instructions").toArray()
  7679. , x = l.PANORAMA
  7680. , S = l.PANORAMA
  7681. , M = !1
  7682. , R = {
  7683. init: function(e, t) {
  7684. S = t,
  7685. x = t,
  7686. [y, A, v, C].forEach(function(e) {
  7687. e.classList.add(u.deviceType)
  7688. }),
  7689. n()
  7690. },
  7691. close: function() {
  7692. if (m.hasClass("open") && (this.emit(h.CLOSED),
  7693. g.removeClass("open"),
  7694. m.removeClass("open"),
  7695. y.classList.contains("fadeIn"))) {
  7696. y.classList.remove("fadeIn");
  7697. var e = S === l.TRANSITIONING ? x : S;
  7698. u.clear(_, c.NAVIGATION, e)
  7699. }
  7700. },
  7701. updateMode: function(e) {
  7702. x = S,
  7703. S = e
  7704. }
  7705. };
  7706. p.extendObject(R, f.prototype),
  7707. t.exports = R
  7708. }
  7709. , {
  7710. "../../enum/HelpModalType": 28,
  7711. "../../enum/Viewmode": 51,
  7712. "../../settings": 166,
  7713. "../../util/common": 185,
  7714. "../helpManager": 68,
  7715. "./../populateModal": 75,
  7716. "./HelpEvent": 66,
  7717. events: 202
  7718. }],
  7719. 68: [function(e, t, i) {
  7720. (function(i) {
  7721. "use strict";
  7722. var n = e("../util/browser")
  7723. , r = e("./../util/logger")
  7724. , o = e("./../settings")
  7725. , a = new r(i)
  7726. , s = function() {
  7727. var e;
  7728. try {
  7729. return e = window.localStorage.getItem("visitCount") || "0",
  7730. e = (parseFloat(e) + 1).toString(),
  7731. window.localStorage.setItem("visitCount", e),
  7732. a.debug("visitCount = " + e),
  7733. e
  7734. } catch (t) {
  7735. e = "1",
  7736. a.debug("couldn't set local storage")
  7737. }
  7738. }()
  7739. , l = !1;
  7740. t.exports = {
  7741. isHelpDisabled: function() {
  7742. return "0" === n.valueFromHash("help", null) || l
  7743. },
  7744. isLargeHelpEnabled: function() {
  7745. return ("1" === s || "1" === n.valueFromHash("help", null)) && !this.isHelpDisabled()
  7746. },
  7747. isSmallHelpEnabled: function() {
  7748. return "2" === n.valueFromHash("help", null) && !this.isHelpDisabled()
  7749. },
  7750. isHelpEnabled: function() {
  7751. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7752. },
  7753. setAutoPlay: function(e) {
  7754. l = o.warp.auto >= 0 && e > 1
  7755. }
  7756. }
  7757. }
  7758. ).call(this, "/js/gui/helpManager.js")
  7759. }
  7760. , {
  7761. "../util/browser": 182,
  7762. "./../settings": 166,
  7763. "./../util/logger": 189
  7764. }],
  7765. 69: [function(e, t, i) {
  7766. "use strict";
  7767. function n(e, t, i, n) {
  7768. F = n,
  7769. r(e, t, i, F),
  7770. o(),
  7771. N = t.mode
  7772. }
  7773. function r(e, t, i, n) {
  7774. [C.PANORAMA, C.DOLLHOUSE, C.FLOORPLAN].forEach(function(t) {
  7775. e.controls[t].on(v.Move, a),
  7776. e.controls[t].on(v.LongTap, c)
  7777. }),
  7778. M.on("mousewheel DOMMouseScroll", a),
  7779. i.on(m.TagActivated, a),
  7780. i.on(m.TagNavigation, a),
  7781. t.on(A.FlyingEnded, s),
  7782. t.on(A.ModeChanging, function(e, t) {
  7783. B = t !== C.PANORAMA && e !== C.PANORAMA
  7784. }),
  7785. t.on(A.ModeChanged, function(e, i) {
  7786. N = t.mode,
  7787. i !== C.TRANSITIONING ? l() : a("modeChange")
  7788. }),
  7789. n.on(y.TourStart, function() {
  7790. L = !0,
  7791. a()
  7792. }),
  7793. n.on(y.TourEnd, function() {
  7794. L = !1,
  7795. l()
  7796. }),
  7797. n.on(y.ActionInterrupted, function() {
  7798. L = !1
  7799. }),
  7800. R.addEventListener("touchend", function() {
  7801. $("#pullTab").hasClass("opened") && !L && l()
  7802. }, !0)
  7803. }
  7804. function o() {
  7805. p.isMobile() ? (b.forEach(function(e) {
  7806. e.classList.add("mobile")
  7807. }),
  7808. w.click(l)) : (b.forEach(function(e) {
  7809. e.addEventListener("mouseleave", function() {
  7810. !M.is(":hover") && b[0].classList.contains("detectHover") && l()
  7811. }, !0)
  7812. }),
  7813. M.mouseleave(function() {
  7814. b[0].classList.contains("detectHover") && l()
  7815. }))
  7816. }
  7817. function a(e) {
  7818. D || d(e) && _.hasClass("playing") || (clearTimeout(O),
  7819. P = !0,
  7820. g.close(),
  7821. h(e),
  7822. N !== C.DOLLHOUSE && N !== C.FLOORPLAN && (x.hasClass("expand") && !S.hasClass("closed") || 2 === p.valueFromHash("title", 1) ,
  7823. _.hasClass("playing") || (b.forEach(function(e) {
  7824. e.classList.add("detectHover")
  7825. }),
  7826. O = setTimeout(l, f.immersive.timeToShowAgain))))
  7827. }
  7828. function s() {
  7829. _.hasClass("playing") || (clearTimeout(O),
  7830. O = setTimeout(l, f.immersive.timeToShowAgain))
  7831. }
  7832. function l() {
  7833. clearTimeout(O),
  7834. P = !1,
  7835. I.forEach(function(e) {
  7836. e.classList.remove("drawerOpen")
  7837. }),
  7838. L || E.forEach(function(e) {
  7839. e.classList.remove("duringTour")
  7840. }),
  7841. b.forEach(function(e) {
  7842. e.classList.remove("detectHover")
  7843. })
  7844. }
  7845. function c() {
  7846. P ? l() : a(),
  7847. D = !0,
  7848. setTimeout(function() {
  7849. D = !1
  7850. }, f.immersive.uiStayDuration)
  7851. }
  7852. function h(e) {
  7853. !d(e) && L ? E.forEach(function(e) {
  7854. e.classList.remove("drawerOpen"),
  7855. e.classList.add("duringTour")
  7856. }) : _.hasClass("open") ? E.forEach(function(e) {
  7857. e.classList.remove("duringTour"),
  7858. e.classList.add("drawerOpen")
  7859. }) : B || N === C.FLOORPLAN || N === C.DOLLHOUSE || E.forEach(function(e) {
  7860. e.classList.add("fadeOut")
  7861. })
  7862. }
  7863. function u() {
  7864. T.hasClass("duringTour") || (L = !1,
  7865. a("gui"),
  7866. l())
  7867. }
  7868. function d(e) {
  7869. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7870. }
  7871. var p = e("../util/browser")
  7872. , f = e("../settings")
  7873. , g = e("./help/help")
  7874. , m = e("../enum/tagEvents")
  7875. , v = e("../enum/ControlEvents")
  7876. , A = e("../enum/PlayerEvents")
  7877. , y = e("../enum/DirectorEvents")
  7878. , A = e("../enum/PlayerEvents")
  7879. , C = e("../enum/Viewmode")
  7880. , I = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7881. , E = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7882. , b = $("#hover-bottom, #hover-top").toArray()
  7883. , w = ($("#pullTab").eq(0),
  7884. $("#playHead").eq(0),
  7885. $(".pinBottom-container").eq(0))
  7886. , _ = $("#drawer").eq(0)
  7887. , T = $("#drawer-container").eq(0)
  7888. , x = $("#meta-info").eq(0)
  7889. , S = $(".pinTop.left").eq(0)
  7890. , M = $("#player").eq(0)
  7891. , R = document.getElementById("pullTab")
  7892. , P = !1
  7893. , O = null
  7894. , L = !1
  7895. , D = !1
  7896. , N = null
  7897. , B = !1
  7898. , F = null;
  7899. t.exports.init = n,
  7900. t.exports.hideUi = a,
  7901. t.exports.resetDrawer = u
  7902. }
  7903. , {
  7904. "../enum/ControlEvents": 21,
  7905. "../enum/DirectorEvents": 23,
  7906. "../enum/tagEvents": 32,
  7907. "../enum/PlayerEvents": 40,
  7908. "../enum/Viewmode": 51,
  7909. "../settings": 166,
  7910. "../util/browser": 182,
  7911. "./help/help": 67
  7912. }],
  7913. 70: [function(e, t, i) {
  7914. (function(i) {
  7915. "use strict";
  7916. function n(e, t, i) {
  7917. l.debug("konami has the modelInstance");
  7918. var n = [];
  7919. $(window).on("keydown", function(e) {
  7920. n.push(e.which),
  7921. n.length > o.secretPanelWord.length && n.shift(),
  7922. s.equalLists(n, o.secretPanelWord) && (l.debug("Developer mode active."),
  7923. o.debug = !0)
  7924. }),
  7925. $(window).on("keydown", function n(r) {
  7926. o.debug && 72 === r.which && (e && i ? (a.toggle(e, t, i),
  7927. $(window).off("keydown", n)) : console.warn("sorry we're not ready yet"))
  7928. })
  7929. }
  7930. var r = e("./../util/logger")
  7931. , o = e("./../settings")
  7932. , a = e("./debug")
  7933. , s = e("./../util/common")
  7934. , l = (e("./gui"),
  7935. new r(i));
  7936. o.console && $("body").append('<div id="debug-console"></div>'),
  7937. t.exports.init = n
  7938. }
  7939. ).call(this, "/js/gui/konami.js")
  7940. }
  7941. , {
  7942. "./../settings": 166,
  7943. "./../util/common": 185,
  7944. "./../util/logger": 189,
  7945. "./debug": 63,
  7946. "./gui": 65
  7947. }],
  7948. 71: [function(e, t, i) {
  7949. "use strict";
  7950. function n(e, t) {
  7951. E = t.mode === p.PANORAMA && t.pano && !t.pano.isAligned() ? p.OUTDOOR : t.mode
  7952. }
  7953. function r(e) {
  7954. var t = $.Deferred();
  7955. e || t.resolve();
  7956. var i = c.startupFlyinDelay;
  7957. return e === p.PANORAMA && (i += c.dollhouse.transitionTime),
  7958. setTimeout(t.resolve.bind(t), i),
  7959. t
  7960. }
  7961. function o(e, t, i) {
  7962. var n = 0;
  7963. c.quickstart.enabled && (a(i),
  7964. n = c.quickstart.showTextDelay + c.quickstart.fadeOutDelay);
  7965. var r = function() {
  7966. e.once(g.Move, l),
  7967. t.once(f.TourStart, l)
  7968. };
  7969. s(n, r)
  7970. }
  7971. function a(e) {
  7972. return /* e && (y.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  7973. v.before(y),
  7974. A = $(".quick-brand").toArray()),*/
  7975. m.addClass("fadeOut"),
  7976. setTimeout(function() {
  7977. A.forEach(function(e) {
  7978. e.classList.add("fadeIn")
  7979. })
  7980. }, c.quickstart.showTextDelay),
  7981. setTimeout(function() {
  7982. A.forEach(function(e) {
  7983. e.classList.add("fadeOut")
  7984. })
  7985. }, c.quickstart.fadeOutDelay),
  7986. !0
  7987. }
  7988. function s(e, t) {
  7989. setTimeout(function() {
  7990. if (h.isHelpEnabled()) {
  7991. if (t(),
  7992. u.init(),
  7993. C.addClass("fadeIn landing " + u.deviceType),
  7994. h.isSmallHelpEnabled())
  7995. return void C.addClass("small");
  7996. u.fill(I, d.LANDING[E]),
  7997. C.addClass(E)
  7998. }
  7999. }, e)
  8000. //csz 用户引导界面
  8001. var helpData = {
  8002. "pc":["images/pc_step1.png","images/pc_step2.png","images/pc_step3.png"],
  8003. "mobile":["images/phone_step1.png","images/phone_step2.png","images/phone_step3.png"]
  8004. }
  8005. var navIcon = $(".nav-icon .icon");
  8006. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) navIcon.attr("src",helpData.mobile[0]);
  8007. function paging(id){
  8008. id.on("click",function(){
  8009. var navPage = null;
  8010. $(this).attr("data-id") == "plus" ? navPage = +navIcon.attr("data-page")+1 : navPage = +navIcon.attr("data-page")-1;
  8011. if(navPage > helpData.length || navPage < 1) return false
  8012. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  8013. navIcon.attr({"data-page":navPage,"src":helpData.mobile[navPage - 1]});
  8014. }else{
  8015. navIcon.attr({"data-page":navPage,"src":helpData.pc[navPage - 1]});
  8016. }
  8017. })
  8018. };
  8019. paging($(".next-button"));
  8020. paging($(".prev-button"));
  8021. }
  8022. function l() {
  8023. u.clear(I, d.LANDING[E]),
  8024. C.removeClass("fadeIn")
  8025. }
  8026. var c = e("../settings")
  8027. , h = (e("./help/help"),
  8028. e("./helpManager"))
  8029. , u = e("./populateModal")
  8030. , d = e("../enum/HelpModalType")
  8031. , p = e("../enum/Viewmode")
  8032. , f = e("../enum/DirectorEvents")
  8033. , g = e("../enum/PlayerEvents")
  8034. , m = $("#quick-blackout").eq(0)
  8035. , v = $("#quick-logo").eq(0)
  8036. , A = $(".quick-brand").toArray()
  8037. , y = $("#loaderCoBrand").eq(0)
  8038. , C = $("#interaction-modal").eq(0)
  8039. , I = C.find(".interaction").toArray()
  8040. , E = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  8041. "");
  8042. t.exports.delayLanding = r,
  8043. t.exports.showMessage = o,
  8044. t.exports.init = n,
  8045. t.exports.dismissModal = l
  8046. }
  8047. , {
  8048. "../enum/DirectorEvents": 23,
  8049. "../enum/HelpModalType": 28,
  8050. "../enum/PlayerEvents": 40,
  8051. "../enum/Viewmode": 51,
  8052. "../settings": 166,
  8053. "./help/help": 67,
  8054. "./helpManager": 68,
  8055. "./populateModal": 75
  8056. }],
  8057. 72: [function(e, t, i) {
  8058. "use strict";
  8059. var n = e("./circleLoader").circleLoader;
  8060. t.exports = {
  8061. element: $("#gui-loading"),
  8062. hide: function(e) {
  8063. n.done(),
  8064. this.element.fadeOut(1500, e)
  8065. },
  8066. show: function(e) {
  8067. this.element.fadeIn(500, function() {
  8068. this.element.css("display", "table"),
  8069. e && e()
  8070. }
  8071. .bind(this))
  8072. },
  8073. progress: function(e) {
  8074. n.set(e)
  8075. }
  8076. }
  8077. }
  8078. , {
  8079. "./circleLoader": 60
  8080. }],
  8081. 73: [function(e, t, i) {
  8082. "use strict";
  8083. var n = e("../settings")
  8084. , r = $("#memory-info")
  8085. , o = r.find("#memory-gpu")
  8086. , a = !1;
  8087. t.exports = {
  8088. show: function() {
  8089. n.profiling.enabled && (r.show(),
  8090. a = !0)
  8091. },
  8092. hide: function() {
  8093. r.hide(),
  8094. a = !1
  8095. },
  8096. toggle: function() {
  8097. a ? this.hide() : this.show()
  8098. },
  8099. update: function(e) {
  8100. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  8101. }
  8102. }
  8103. }
  8104. , {
  8105. "../settings": 166
  8106. }],
  8107. 74: [function(e, t, i) {
  8108. "use strict";
  8109. var n = e("../util/browser")
  8110. , r = e("../analytics");
  8111. e("../settings");
  8112. t.exports = {
  8113. show: function(e, t) {
  8114. $("#gui-message").fadeOut(500, function() {
  8115. t()
  8116. })
  8117. }
  8118. }
  8119. }
  8120. , {
  8121. "../analytics": 4,
  8122. "../settings": 166,
  8123. "../util/browser": 182
  8124. }],
  8125. 75: [function(e, t, i) {
  8126. "use strict";
  8127. function n(e, t, i, n) {
  8128. function r(e) {
  8129. return e.classList.contains(a)
  8130. }
  8131. var o = i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType];
  8132. //for (var a in o) {
  8133. //var s = e.find(r);
  8134. //for (var l in o[a]) {
  8135. //var c = o[a][l];
  8136. //if ("top-info" === l || "bottom-info" === l) {
  8137. //var h = n ? c : "";
  8138. //czj 注释掉第一次打开的用户引导
  8139. //s.querySelector("." + l).textContent = h
  8140. //} else {
  8141. //var u = n ? c : "";
  8142. //, d = s.querySelector("." + l);
  8143. //d.src = u,
  8144. //n ? d.classList.remove("hidden") : d.classList.add("hidden")
  8145. //}
  8146. //}
  8147. //}
  8148. //var p = Array.prototype.slice.call(e[0].parentElement.querySelectorAll("hr"));
  8149. // p.forEach(function(e) {
  8150. // n ? e.classList.remove("hidden") : e.classList.add("hidden")
  8151. // })
  8152. }
  8153. var r = e("../util/browser")
  8154. , o = e("../localization/localize")
  8155. , a = e("../enum/HelpModalType")
  8156. , s = (e("../enum/HelpModalSize"),
  8157. e("../enum/Viewmode"));
  8158. t.exports = {
  8159. init: function() {
  8160. if (!this.hasInitialized) {
  8161. this.hasInitialized = !0,
  8162. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  8163. this.assets = {},
  8164. this.assets[a.LANDING[s.PANORAMA]] = {
  8165. desktop: {
  8166. left: {
  8167. "top-info": o.ROTATE,
  8168. "big-image": "images/nav_help_mouse_drag_left.png",
  8169. keyboard: "images/nav_help_keyboard_left_right.png"
  8170. },
  8171. middle: {
  8172. "top-info": o.MOVE,
  8173. "big-image": "images/nav_help_mouse_click.png",
  8174. keyboard: "images/nav_help_keyboard_up_down.png"
  8175. },
  8176. right: {
  8177. "top-info": o.ZOOM,
  8178. "big-image": "images/nav_help_mouse_zoom.png",
  8179. keyboard: "images/nav_help_zoom_keys.png"
  8180. }
  8181. },
  8182. mobile: {
  8183. left: {
  8184. "top-info": o.ROTATE,
  8185. "big-image": "images/nav_help_gesture_drag.png"
  8186. },
  8187. middle: {
  8188. "top-info": o.MOVE,
  8189. "big-image": "images/nav_help_gesture_tap.png"
  8190. },
  8191. right: {
  8192. "top-info": o.ZOOM,
  8193. "big-image": "images/nav_help_gesture_pinch.png"
  8194. }
  8195. }
  8196. },
  8197. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  8198. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  8199. desktop: {
  8200. left: {
  8201. "top-info": o.ROTATE,
  8202. "big-image": "images/nav_help_mouse_drag_left.png",
  8203. keyboard: "images/nav_help_keyboard_left_right.png"
  8204. },
  8205. middle: {
  8206. "top-info": o.MOVE,
  8207. "big-image": "images/nav_help_mouse_position_right.png"
  8208. }
  8209. },
  8210. mobile: {
  8211. left: {
  8212. "top-info": o.ROTATE,
  8213. "big-image": "images/nav_help_gesture_drag.png"
  8214. },
  8215. middle: {
  8216. "top-info": o.MOVE,
  8217. "big-image": "images/nav_help_gesture_position_two_finger.png"
  8218. }
  8219. }
  8220. },
  8221. this.assets[a.LANDING[s.FLOORPLAN]] = {
  8222. desktop: {
  8223. left: {
  8224. "top-info": o.MOVE,
  8225. "big-image": "images/nav_help_mouse_position_left.png"
  8226. },
  8227. middle: {
  8228. "top-info": o.ROTATE,
  8229. "big-image": "images/nav_help_mouse_drag_right.png",
  8230. keyboard: "images/nav_help_keyboard_left_right.png"
  8231. }
  8232. },
  8233. mobile: {
  8234. left: {
  8235. "top-info": o.MOVE,
  8236. "big-image": "images/nav_help_gesture_position.png"
  8237. },
  8238. middle: {
  8239. "top-info": o.ROTATE,
  8240. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  8241. }
  8242. }
  8243. };
  8244. var e = {
  8245. "top-info": o.INSIDE,
  8246. "big-image": "images/nav_help_click_inside.png",
  8247. keyboard: "images/nav_help_inside_key.png"
  8248. };
  8249. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  8250. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  8251. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  8252. var t = {
  8253. "top-info": o.INSIDE,
  8254. "big-image": "images/nav_help_tap_inside.png"
  8255. };
  8256. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  8257. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  8258. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  8259. this.assets[a.NAVIGATION] = {},
  8260. this.assets[a.NAVIGATION][s.PANORAMA] = {
  8261. desktop: {
  8262. left: {
  8263. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  8264. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  8265. "big-image": "images/nav_help_mouse_drag_left.png",
  8266. keyboard: "images/nav_help_keyboard_left_right.png"
  8267. },
  8268. middle: {
  8269. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  8270. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  8271. "big-image": "images/nav_help_mouse_click.png",
  8272. keyboard: "images/nav_help_keyboard_up_down.png"
  8273. },
  8274. right: {
  8275. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  8276. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  8277. "big-image": "images/nav_help_mouse_zoom.png",
  8278. keyboard: "images/nav_help_zoom_keys.png"
  8279. }
  8280. },
  8281. mobile: {
  8282. left: {
  8283. "top-info": o.HELP_MOBILE_PANORAMA_1,
  8284. "big-image": "images/nav_help_gesture_drag.png"
  8285. },
  8286. middle: {
  8287. "top-info": o.HELP_MOBILE_PANORAMA_2,
  8288. "big-image": "images/nav_help_gesture_tap.png"
  8289. },
  8290. right: {
  8291. "top-info": o.HELP_MOBILE_3,
  8292. "big-image": "images/nav_help_gesture_pinch.png"
  8293. }
  8294. }
  8295. },
  8296. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  8297. desktop: {
  8298. left: {
  8299. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  8300. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  8301. "big-image": "images/nav_help_mouse_drag_left.png",
  8302. keyboard: "images/nav_help_keyboard_all.png"
  8303. },
  8304. middle: {
  8305. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  8306. "big-image": "images/nav_help_mouse_position_right.png"
  8307. },
  8308. right: {
  8309. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  8310. "big-image": "images/nav_help_mouse_zoom.png"
  8311. }
  8312. },
  8313. mobile: {
  8314. left: {
  8315. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  8316. "big-image": "images/nav_help_gesture_drag.png"
  8317. },
  8318. middle: {
  8319. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  8320. "big-image": "images/nav_help_gesture_position_two_finger.png"
  8321. },
  8322. right: {
  8323. "top-info": o.HELP_MOBILE_3,
  8324. "big-image": "images/nav_help_gesture_pinch.png"
  8325. }
  8326. }
  8327. },
  8328. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  8329. desktop: {
  8330. left: {
  8331. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  8332. "big-image": "images/nav_help_mouse_position_left.png"
  8333. },
  8334. middle: {
  8335. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  8336. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  8337. "big-image": "images/nav_help_mouse_drag_right.png",
  8338. keyboard: "images/nav_help_keyboard_left_right.png"
  8339. },
  8340. right: {
  8341. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  8342. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  8343. "big-image": "images/nav_help_mouse_zoom.png",
  8344. keyboard: "images/nav_help_keyboard_up_down.png"
  8345. }
  8346. },
  8347. mobile: {
  8348. left: {
  8349. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  8350. "big-image": "images/nav_help_gesture_position.png"
  8351. },
  8352. middle: {
  8353. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  8354. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  8355. },
  8356. right: {
  8357. "top-info": o.HELP_MOBILE_3,
  8358. "big-image": "images/nav_help_gesture_pinch.png"
  8359. }
  8360. }
  8361. },
  8362. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  8363. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  8364. "top-info": o.HELP_DESKTOP_360_2A,
  8365. "bottom-info": o.HELP_DESKTOP_360_2B,
  8366. "big-image": "images/nav_help_click_inside.png",
  8367. keyboard: "images/nav_help_inside_key.png"
  8368. },
  8369. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  8370. "top-info": o.HELP_MOBILE_360_2,
  8371. "big-image": "images/nav_help_tap_inside.png"
  8372. },
  8373. this.assets[a.MORE_HELP] = {
  8374. desktop: {
  8375. "more-help-hlr": {
  8376. "top-info": o.HELP_MORE_HLR_A,
  8377. "big-image": "images/nav_help_expand.svg",
  8378. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8379. },
  8380. "more-help-dollhouse": {
  8381. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8382. "big-image": "images/nav_help_dollhouse.svg",
  8383. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  8384. },
  8385. "more-help-floors": {
  8386. "top-info": o.HELP_MORE_FLOORS_A,
  8387. "big-image": "images/nav_help_floor picker.svg",
  8388. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8389. },
  8390. "more-help-tag": {
  8391. "top-info": o.HELP_MORE_TAG_A,
  8392. "big-image": "images/nav_help_tag.svg",
  8393. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  8394. },
  8395. "more-help-zoom": {
  8396. "top-info": o.HELP_MORE_ZOOM_A,
  8397. "big-image": "images/nav_help_zoom.svg",
  8398. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  8399. },
  8400. "more-help-tour": {
  8401. "top-info": o.HELP_MORE_TOUR_A,
  8402. "big-image": "images/nav_help_play.png",
  8403. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8404. },
  8405. "more-help-inside": {
  8406. "top-info": o.HELP_MORE_INSIDE_A,
  8407. "big-image": "images/nav_help_inside.svg",
  8408. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  8409. },
  8410. "more-help-vr": {
  8411. "top-info": o.HELP_MORE_VR_A,
  8412. "big-image": "images/nav_help_vr.svg",
  8413. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  8414. },
  8415. "more-help-360": {
  8416. "top-info": o.HELP_MORE_360_A,
  8417. "big-image": "images/nav_help_360.svg",
  8418. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  8419. },
  8420. "more-help-fullscreen": {
  8421. "top-info": o.HELP_MORE_FULLSCREEN_A,
  8422. "big-image": "images/nav_help_fullscreen.svg",
  8423. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  8424. }
  8425. },
  8426. mobile: {
  8427. "more-help-hlr": {
  8428. "top-info": o.HELP_MORE_HLR_A,
  8429. "big-image": "images/nav_help_expand.svg",
  8430. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8431. },
  8432. "more-help-dollhouse": {
  8433. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8434. "big-image": "images/nav_help_dollhouse.svg",
  8435. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  8436. },
  8437. "more-help-floors": {
  8438. "top-info": o.HELP_MORE_FLOORS_A,
  8439. "big-image": "images/nav_help_floor picker.svg",
  8440. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8441. },
  8442. "more-help-tag": {
  8443. "top-info": o.HELP_MORE_TAG_A,
  8444. "big-image": "images/nav_help_tag.svg",
  8445. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  8446. },
  8447. "more-help-tour": {
  8448. "top-info": o.HELP_MORE_TOUR_A,
  8449. "big-image": "images/nav_help_play.png",
  8450. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8451. },
  8452. "more-help-inside": {
  8453. "top-info": o.HELP_MORE_INSIDE_A,
  8454. "big-image": "images/nav_help_inside.svg",
  8455. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  8456. },
  8457. "more-help-vr": {
  8458. "top-info": o.HELP_MORE_VR_A,
  8459. "big-image": "images/webvr.svg",
  8460. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  8461. },
  8462. "more-help-360": {
  8463. "top-info": o.HELP_MORE_360_A,
  8464. "big-image": "images/nav_help_360.svg",
  8465. "bottom-info": o.HELP_MOBILE_MORE_360_B
  8466. }
  8467. }
  8468. },
  8469. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  8470. desktop: {
  8471. left: {
  8472. "top-info": o.ROTATE,
  8473. "big-image": "images/nav_help_mouse_drag_left.png",
  8474. keyboard: "images/nav_help_keyboard_left_right.png"
  8475. },
  8476. middle: {
  8477. "top-info": o.MOVE,
  8478. "big-image": "images/nav_help_mouse_click.png",
  8479. keyboard: "images/nav_help_keyboard_up_down.png"
  8480. },
  8481. right: {
  8482. "top-info": o.PLAY,
  8483. "big-image": "images/Desktop-help-play-button.svg",
  8484. keyboard: "images/Desktop-help-spacebar-2.svg"
  8485. }
  8486. },
  8487. mobile: {
  8488. left: {
  8489. "top-info": o.ROTATE,
  8490. "big-image": "images/nav_help_gesture_drag.png"
  8491. },
  8492. middle: {
  8493. "top-info": o.MOVE,
  8494. "big-image": "images/nav_help_gesture_tap.png"
  8495. },
  8496. right: {
  8497. "top-info": o.PLAY,
  8498. "big-image": "images/mobile-help-play-button.svg"
  8499. }
  8500. }
  8501. },
  8502. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  8503. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  8504. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  8505. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  8506. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  8507. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  8508. }
  8509. },
  8510. fill: function(e, t, i) {
  8511. n.call(this, e, t, i, !0)
  8512. },
  8513. clear: function(e, t, i) {
  8514. n.call(this, e, t, i, !1)
  8515. }
  8516. }
  8517. }
  8518. , {
  8519. "../enum/HelpModalSize": 27,
  8520. "../enum/HelpModalType": 28,
  8521. "../enum/Viewmode": 51,
  8522. "../localization/localize": 108,
  8523. "../util/browser": 182
  8524. }],
  8525. 76: [function(e, t, i) {
  8526. "use strict";
  8527. t.exports = Object.freeze({
  8528. OPENED: "share.open",
  8529. CLOSED: "share.closed",
  8530. LINK_CLICKED: "share.linked"
  8531. })
  8532. }
  8533. , {}],
  8534. 77: [function(e, t, i) {
  8535. "use strict";
  8536. function n(e) {
  8537. function t(t, i) {
  8538. var n = window.screenY + ($("#player").height() - i) / 2
  8539. , r = window.screenX + ($("#player").width() - t) / 2
  8540. , o = "top=" + n + ",left=" + r + ",width=" + t + ",height=" + i;
  8541. I.emit(l.LINK_CLICKED, {
  8542. channel: e
  8543. }),
  8544. window.open(C[e], "shareWindow", o)
  8545. }
  8546. switch (e) {
  8547. case y.FACEBOOK:
  8548. t(580, 420);
  8549. break;
  8550. case y.TWITTER:
  8551. t(550, 440);
  8552. break;
  8553. case y.MAIL:
  8554. I.emit(l.LINK_CLICKED, {
  8555. channel: "email"
  8556. }),
  8557. window.open(C[e], "_blank");
  8558. break;
  8559. case y.LINKEDIN:
  8560. }
  8561. }
  8562. function r(e) {
  8563. I.emit(l.LINK_CLICKED, {
  8564. channel: "copylink"
  8565. });
  8566. var t = document.createRange();
  8567. t.selectNodeContents(v);
  8568. var i = window.getSelection();
  8569. i.removeAllRanges(),
  8570. i.addRange(t),
  8571. document.execCommand("copy"),
  8572. A.classList.remove("hidden"),
  8573. v.classList.add("highlighted")
  8574. }
  8575. function o(e) {
  8576. e && (e.stopPropagation(),
  8577. e.target === v) || (window.getSelection().removeAllRanges(),
  8578. v.classList.remove("highlighted"),
  8579. A.classList.add("hidden"))
  8580. }
  8581. var a = e("../../util/browser")
  8582. , s = e("../../localization/localize")
  8583. , l = e("./ShareEvents")
  8584. , c = e("../../util/common")
  8585. , h = e("events").EventEmitter
  8586. , u = document.getElementById("sharing")
  8587. , d = document.getElementById("share-modal")
  8588. , p = document.getElementById("share-close")
  8589. , f = document.getElementById("facebook-share")
  8590. , g = document.getElementById("twitter-share")
  8591. , m = document.getElementById("mail-share")
  8592. , v = document.getElementById("share-url-text")
  8593. , A = document.getElementById("copy-success")
  8594. , y = Object.freeze({
  8595. FACEBOOK: "facebook",
  8596. TWITTER: "twitter",
  8597. MAIL: "mail",
  8598. LINKEDIN: "linkedin"
  8599. })
  8600. , C = {};
  8601. C[y.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8602. C[y.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8603. C[y.MAIL] = "mailto:?subject=";
  8604. var I = {
  8605. init: function(e) {
  8606. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8607. C[y.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8608. C[y.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8609. C[y.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8610. u.addEventListener("click", this.toggle.bind(this)),
  8611. p.addEventListener("click", this.hide.bind(this)),
  8612. v.addEventListener("click", r),
  8613. d.addEventListener("click", o),
  8614. f.addEventListener("click", n.bind(this, y.FACEBOOK)),
  8615. g.addEventListener("click", n.bind(this, y.TWITTER)),
  8616. m.addEventListener("click", n.bind(this, y.MAIL)),
  8617. v.textContent = window.location.href + "&utm_source=4",
  8618. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8619. u.classList.remove("hidden")
  8620. },
  8621. show: function() {
  8622. this.emit(l.OPENED),
  8623. d.classList.add("fadeIn")
  8624. },
  8625. hide: function() {
  8626. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8627. document.selection && document.selection.empty(),
  8628. window.getSelection().removeAllRanges(),
  8629. o(),
  8630. d.classList.remove("fadeIn"))
  8631. },
  8632. toggle: function() {
  8633. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8634. }
  8635. };
  8636. c.extendObject(I, h.prototype),
  8637. t.exports = I
  8638. }
  8639. , {
  8640. "../../localization/localize": 108,
  8641. "../../util/browser": 182,
  8642. "../../util/common": 185,
  8643. "./ShareEvents": 76,
  8644. events: 202
  8645. }],
  8646. 78: [function(e, t, i) {
  8647. "use strict";
  8648. t.exports = Object.freeze({
  8649. OPENED: "terms.opened",
  8650. CLOSED: "terms.closed"
  8651. })
  8652. }
  8653. , {}],
  8654. 79: [function(e, t, i) {
  8655. "use strict";
  8656. var n = e("./TermsEvent")
  8657. , r = e("../../localization/localize")
  8658. , o = e("../../analytics")
  8659. , a = e("../../util/ajax")
  8660. , s = e("../../util/common")
  8661. , l = e("events").EventEmitter
  8662. , c = document.getElementById("terms-modal")
  8663. , h = {
  8664. init: function() {
  8665. $(".footer-terms").on("click", function(e) {
  8666. e.preventDefault(),
  8667. this.show()
  8668. }
  8669. .bind(this)),
  8670. $("#terms-modal .close").on("click", this.hide.bind(this))
  8671. },
  8672. show: function() {
  8673. this.emit(n.OPENED),
  8674. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8675. var t = $("#terms-text").html(e);
  8676. o.track("showcase_gui", {
  8677. gui_action: "click_terms_button",
  8678. interaction_source: "gui"
  8679. }),
  8680. t.find("a").attr("target", "_blank")
  8681. }).fail(function() {
  8682. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8683. }),
  8684. c.classList.add("fadeIn")
  8685. },
  8686. hide: function(e) {
  8687. e && e.preventDefault(),
  8688. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8689. c.classList.remove("fadeIn")
  8690. }
  8691. };
  8692. s.extendObject(h, l.prototype),
  8693. t.exports = h
  8694. }
  8695. , {
  8696. "../../analytics": 4,
  8697. "../../localization/localize": 108,
  8698. "../../util/ajax": 181,
  8699. "../../util/common": 185,
  8700. "./TermsEvent": 78,
  8701. events: 202
  8702. }],
  8703. 80: [function(e, t, i) {
  8704. "use strict";
  8705. t.exports = Object.freeze({
  8706. OPEN_INFO: "title.open.info",
  8707. CLOSE_INFO: "title.close.info",
  8708. SHOW_INFO: "title.show.info",
  8709. HIDE_INFO: "title.hide.info",
  8710. LINK_CLICKED: "title.link.click",
  8711. CONTACT_LINK_CLICKED: "title.contact.click",
  8712. ORIGIN_LINK_CLICKED: "title.origin.click"
  8713. })
  8714. }
  8715. , {}],
  8716. 81: [function(e, t, i) {
  8717. "use strict";
  8718. function n(e, t) {
  8719. o.tags.enabled && 0 !== Object.keys(e.tags).length && r(e, t)
  8720. }
  8721. function r(e, t) {
  8722. function i(i) {
  8723. e.shouldShowtags = "show" === this.value,
  8724. e.shouldShowtags ? t.showAlltags(o.tags.startup.fadeInDuration) : t.hideAlltags(o.tags.startup.fadeInDuration)
  8725. }
  8726. document.getElementById("tag-toggles").classList.remove("hidden"),
  8727. document.getElementById("radio-tag-show").checked = !0;
  8728. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8729. n[r].addEventListener("change", i)
  8730. }
  8731. var o = e("../../settings");
  8732. t.exports.init = n
  8733. }
  8734. , {
  8735. "../../settings": 166
  8736. }],
  8737. 82: [function(e, t, i) {
  8738. (function(i) {
  8739. "use strict";
  8740. function n(e, t) {
  8741. return e && u.valueFromHash("title", 1) && 2 !== u.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e, g_weixinObj.title = e,
  8742. e.length > g.minTooltipCharacters && I.parentElement.setAttribute("data-original-title", e),
  8743. t && 1 !== m.specialEdition && m.brand && !m.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8744. document.getElementById("gui-name").classList.add("noCoBrand"),
  8745. document.getElementById("cobrandTitle").classList.add("hidden")),
  8746. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8747. !1)
  8748. }
  8749. function r(e) {
  8750. return e ? (L = !0,
  8751. void (_.innerHTML = e)) : void _.classList.add("hidden")
  8752. }
  8753. function o(e, t, i, n) {
  8754. if (!e && !t && !i || !m.brand || u.valueFromHash("mls", !1))
  8755. return void T.classList.add("hidden");
  8756. L = !0;
  8757. var r = []
  8758. , o = c(r, "<br>");
  8759. if (e && o('<span id="contactName">' + e + "</span>"),
  8760. t) {
  8761. var a = n || t
  8762. , s = u.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>";
  8763. o(s)
  8764. }
  8765. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8766. r[0] = "",
  8767. x.innerHTML = r.join("")
  8768. }
  8769. function a(e) {
  8770. if ("string" == typeof e)
  8771. try {
  8772. e = JSON.parse(e)
  8773. } catch (e) {
  8774. return y.warn("Unable to parse address data"),
  8775. void S.parentElement.classList.add("hidden")
  8776. }
  8777. if (!(e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)))
  8778. return void S.parentElement.classList.add("hidden");
  8779. L = !0;
  8780. var t = []
  8781. , i = c(t, " ");
  8782. e.address_1 && i(e.address_1),
  8783. e.address_2 && i(e.address_2),
  8784. e.city && i(e.city, ", "),
  8785. e.state && i(e.state, ", "),
  8786. e.zip && i(e.zip, e.state ? " " : ", "),
  8787. t[0] = "",
  8788. S.innerText = t.join("")
  8789. }
  8790. function s(e) {
  8791. var t = document.createElement("a");
  8792. return t.id = "url",
  8793. t.target = "_blank",
  8794. t.href = e,
  8795. t.innerText = e,
  8796. t.addEventListener("click", N.emit.bind(N, v.ORIGIN_LINK_CLICKED)),
  8797. t
  8798. }
  8799. function l(e) {
  8800. return !(!e || u.inIframe() && document.referrer === e) && (R.classList.remove("hidden"),
  8801. P.innerHTML = f.WEBVR_LEARN_MORE + ": ",
  8802. P.appendChild(s(e)),
  8803. O.forEach(function(e) {
  8804. e.classList.add("share-link")
  8805. }),
  8806. !0)
  8807. }
  8808. function c(e, t) {
  8809. var i = e
  8810. , n = t;
  8811. return function(e, t) {
  8812. i.push(t || n, e)
  8813. }
  8814. }
  8815. function h() {
  8816. document.getElementById("title-toggle").addEventListener("click", N.toggleTitle.bind(N)),
  8817. L && I.addEventListener("click", N.toggleMeta.bind(N, !1));
  8818. var e = [].slice.call(_.querySelectorAll("a"));
  8819. e.forEach(function(e) {
  8820. e.addEventListener("click", N.emit.bind(N, v.LINK_CLICKED))
  8821. });
  8822. var t = [].slice.call(T.querySelectorAll("a"));
  8823. t.forEach(function(e) {
  8824. e.addEventListener("click", N.emit.bind(N, v.CONTACT_LINK_CLICKED, {
  8825. contact_type: e.getAttribute("id")
  8826. }))
  8827. })
  8828. }
  8829. var u = e("../../util/browser")
  8830. , d = e("../../util/common")
  8831. , p = e("../../util/logger")
  8832. , f = e("../../localization/localize")
  8833. , g = e("./titleBarSettings")
  8834. , m = e("../../settings")
  8835. , v = e("./TitleEvents")
  8836. , A = e("events").EventEmitter
  8837. , y = new p(i)
  8838. , C = document.querySelector(".pinTop.left")
  8839. , I = document.getElementsByClassName("title-container")[0]
  8840. , E = document.getElementById("title-toggle").querySelector("i")
  8841. , b = document.getElementById("meta-info-wrapper")
  8842. , w = document.getElementById("meta-info")
  8843. , _ = document.getElementById("meta-description")
  8844. , T = document.getElementsByClassName("contact-info")[0]
  8845. , x = document.getElementById("contact-data")
  8846. , S = document.getElementById("addressTxt")
  8847. , M = document.getElementById("tag-toggles")
  8848. , R = document.getElementById("share-origin")
  8849. , P = document.getElementById("share-link-wrapper")
  8850. , O = [w, b, I]
  8851. , L = !1
  8852. , D = !1
  8853. , N = {
  8854. populate: function(e) {
  8855. if (n(window.DATA.name, e.coBrand)) {
  8856. if (r(e.description),
  8857. o(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8858. a(e.address),
  8859. L) {
  8860. var t = document.createElement("br");
  8861. M.insertBefore(t, M.firstElementChild)
  8862. }
  8863. e.socialSharing && m.share.enabled && (D = l(e.url))
  8864. }
  8865. },
  8866. finishSetup: function(e) {
  8867. L = L || !!e,
  8868. h(),
  8869. L || (D ? I.classList.add("share-only") : I.classList.add("no-meta"))
  8870. },
  8871. toggleMeta: function(e, t) {
  8872. var title = document.getElementById("model-title");
  8873. t && t.preventDefault();
  8874. var i = w.classList.contains("expand");
  8875. e && !i || (i ? (O.forEach(function(e) {
  8876. e.classList.remove("expand")
  8877. }),
  8878. this.emit(v.CLOSE_INFO),title.classList.remove("expand")) : (O.forEach(function(e) {
  8879. e.classList.add("expand");
  8880. }),
  8881. title.classList.add("expand"),
  8882. this.emit(v.OPEN_INFO)))
  8883. },
  8884. setupToggling: function() {
  8885. b.style.height = w.offsetHeight + "px",
  8886. w.addEventListener("transitionend", function() {
  8887. b.style.height = w.offsetHeight + "px"
  8888. })
  8889. },
  8890. toggleTitle: function(e) {
  8891. e && e.preventDefault(),
  8892. C.classList.contains("closed") ? (C.classList.add("open"),
  8893. E.classList.remove("icon-dpad-right"),
  8894. E.classList.add("icon-dpad-left"),
  8895. this.emit(v.SHOW_INFO),
  8896. setTimeout(function() {
  8897. C.classList.remove("closed"),
  8898. C.classList.remove("open")
  8899. }, g.removeAnimationClasses)) : (C.classList.add("closed"),
  8900. E.classList.remove("icon-dpad-left"),
  8901. E.classList.add("icon-dpad-right"),
  8902. this.emit(v.HIDE_INFO))
  8903. }
  8904. };
  8905. d.extendObject(N, A.prototype),
  8906. t.exports = N
  8907. }
  8908. ).call(this, "/js/gui/title/titleBar.js")
  8909. }
  8910. , {
  8911. "../../localization/localize": 108,
  8912. "../../settings": 166,
  8913. "../../util/browser": 182,
  8914. "../../util/common": 185,
  8915. "../../util/logger": 189,
  8916. "./TitleEvents": 80,
  8917. "./titleBarSettings": 83,
  8918. events: 202
  8919. }],
  8920. 83: [function(e, t, i) {
  8921. "use strict";
  8922. t.exports = Object.freeze({
  8923. minTooltipCharacters: 19,
  8924. removeAnimationClasses: 500
  8925. })
  8926. }
  8927. , {}],
  8928. 84: [function(e, t, i) {
  8929. "use strict";
  8930. function n(e) {
  8931. C = e,
  8932. P.forEach(function(e) {
  8933. b.addEventListener(e, u.bind(this, !1), !0),
  8934. w.addEventListener(e, u.bind(this, !0), !0),
  8935. E.addEventListener(e, stopTour2, !0)
  8936. S.forEach(function(t) {//会触发导览停止
  8937. t.addEventListener(e, stopTour, !0)
  8938. })
  8939. $("#drawer img").on(e, stopTour)
  8940. })
  8941. document.addEventListener("keydown", u.bind(this, !1), !0)
  8942. C.on(v.TourStart, function() {
  8943. E.classList.add("playing")
  8944. })
  8945. }
  8946. function play() {//r
  8947. settings.playTourNearBy ? C.playTourNearBy() : C.playTour()
  8948. I && clearTimeout(I),
  8949. d(),
  8950. _.removeClass("fadeIn")
  8951. }
  8952. function stopTour2() {//o
  8953. E.classList.contains("playing") && (C.stopTour(),
  8954. _.addClass("fadeIn"),
  8955. setTimeout(function() {
  8956. _.removeClass("fadeIn")
  8957. }, p.tourInteraction.showPauseButton),
  8958. O || (clearTimeout(I),
  8959. I = setTimeout(h, p.tourInteraction.showModal)),
  8960. setTimeout(function() {
  8961. E.classList.remove("playing")
  8962. }, p.tourInteraction.allowNextClick))
  8963. }
  8964. function stopTour() { //a
  8965. C.tourInProgress && (C.stopTour(),
  8966. C.endTourProgress(),
  8967. E.classList.remove("playing"))
  8968. }
  8969. function togglePlay() {//s
  8970. T.is(":visible") ? play() : stopTour2()
  8971. }
  8972. function l() {
  8973. x.hasClass("playing") && (clearTimeout(I),
  8974. C.atEndOfTour() ? c() : _.removeClass("fadeIn"))
  8975. }
  8976. function c() {
  8977. E.classList.remove("playing"),
  8978. h()
  8979. }
  8980. function h() {//去掉导览结束时的提示
  8981. /* if (!p.tourInteraction.disabled) {
  8982. M.removeClass("small landing " + g.FLOORPLAN + " " + g.OUTDOOR + " " + g.PANORAMA),
  8983. M.addClass("fadeIn tour " + m.deviceType);
  8984. var e = p.tourInteraction.smallModal ? y.SMALL : y.LARGE;
  8985. if (!p.tourInteraction.smallModal) {
  8986. var t;
  8987. 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,
  8988. m.fill(R, A.TOUR_INTERACTION[t]),
  8989. M.addClass(t)
  8990. }
  8991. M.addClass(e)
  8992. } */
  8993. }
  8994. function u(e, t) {
  8995. if (t) {
  8996. var i = "keydown" === t.type
  8997. , n = t.which === f.SPACE || C.tourIsPlaying;
  8998. i && n || e || (O = !0),
  8999. C.atEndOfTour() && d(),
  9000. !C.tourIsPlaying && C.tourInProgress && (_.removeClass("fadeIn"), d(), t.which !== f.SPACE && stopTour()),
  9001. i && n && togglePlay() //空格键播放或暂停
  9002. }
  9003. }
  9004. function d() {
  9005. M.removeClass("fadeIn")
  9006. }
  9007. var p = (e("../util/browser"),
  9008. e("../settings"))
  9009. , f = e("../enum/Keys")
  9010. , g = e("../enum/Viewmode")
  9011. , m = (e("./helpManager"),
  9012. e("./populateModal"))
  9013. , v = e("../enum/DirectorEvents")
  9014. , A = e("../enum/HelpModalType")
  9015. , y = e("../enum/HelpModalSize")
  9016. , C = null
  9017. , I = null
  9018. , E = document.getElementById("pause-overlay")
  9019. , b = document.getElementById("player")
  9020. , w = document.getElementById("gui")
  9021. , _ = $("#pause-icon").eq(0)
  9022. , T = $("#play").eq(0)
  9023. , x = $("#playHead").eq(0)
  9024. , S = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  9025. , M = $("#interaction-modal").eq(0)
  9026. , R = $("#interaction-modal .interaction").toArray()
  9027. , P = ["touchstart", "mousedown", "pointerdown"]
  9028. , O = !1;
  9029. t.exports.init = n,
  9030. t.exports.play = play,
  9031. t.exports.pause = stopTour2,
  9032. t.exports.pauseWithoutCTA = stopTour,
  9033. t.exports.togglePlay = togglePlay,
  9034. t.exports.stopTour = l,
  9035. t.exports.dismissModal = d
  9036. }
  9037. , {
  9038. "../enum/DirectorEvents": 23,
  9039. "../enum/HelpModalSize": 27,
  9040. "../enum/HelpModalType": 28,
  9041. "../enum/Keys": 30,
  9042. "../enum/Viewmode": 51,
  9043. "../settings": 166,
  9044. "../util/browser": 182,
  9045. "./helpManager": 68,
  9046. "./populateModal": 75
  9047. }],
  9048. 85: [function(e, t, i) {
  9049. "use strict";
  9050. t.exports = Object.freeze({
  9051. OPENED: "vr.modal.opened",
  9052. LAUNCH: "vr.modal.launch",
  9053. CLOSED: "vr.modal.closed",
  9054. NEXT: "vr.modal.next",
  9055. PREV: "vr.modal.prev",
  9056. STORE: "vr.modal.store",
  9057. falseICECHOSEN: "vr.modal.device"
  9058. })
  9059. }
  9060. , {}],
  9061. 86: [function(e, t, i) {
  9062. "use strict";
  9063. function n(e, t, i) {
  9064. function n(e, t, n, r) {
  9065. function o() {
  9066. return p + "&m=" + t + "&display=" + e
  9067. }
  9068. function s() {
  9069. var e = "&utm_medium=" + (a.inIframe() ? "embed" : "direct")
  9070. , t = "&utm_source=" + u
  9071. , n = "&utm_showcase_session_id=" + i;
  9072. return e + t + n
  9073. }
  9074. function l() {
  9075. return d + "&sids=" + t + "&lsid=" + t + "&ln=" + encodeURIComponent(n) + "&ld=" + encodeURIComponent(r) + "&display=" + e
  9076. }
  9077. return a.valueFromHash("vrcoll", !1) ? l() + s() : o() + s()
  9078. }
  9079. function r(e, t, i, r) {
  9080. var o = "https://api.branch.io/v1/url"
  9081. , a = n(e, t, i, r)
  9082. , s = {
  9083. responseType: "json",
  9084. data: {
  9085. branch_key: h.appConfig.branch_key,
  9086. data: {
  9087. m: t,
  9088. full_url: a,
  9089. $desktop_url: m,
  9090. $og_app_id: "331853976762864119",
  9091. $og_title: i,
  9092. $og_description: r,
  9093. $og_image_url: location.origin + "/api/v1/player/models/" + t + "/thumb",
  9094. $canonical_url: window.location.href
  9095. }
  9096. }
  9097. };
  9098. c.post(o, s).done(function(t) {
  9099. f[e] = t.url
  9100. }).fail(function(t) {
  9101. f[e] = t
  9102. }
  9103. .bind(this, a))
  9104. }
  9105. function o(e, t, i) {
  9106. for (var r in s) {
  9107. var o = s[r]
  9108. , a = n(o, e, t, i);
  9109. f[o] = a
  9110. }
  9111. }
  9112. var u = a.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  9113. , d = g + "/vr/dlist/?ret=" + u
  9114. , p = g + "/vr/show/?ret=" + u
  9115. , m = "";
  9116. switch (e) {
  9117. case l.IOS:
  9118. r(s.CardboardIOS, t.sid, t.name, t.summary);
  9119. break;
  9120. default:
  9121. o(t.sid, t.name, t.summary)
  9122. }
  9123. }
  9124. function r(e) {
  9125. var t = f[e];
  9126. window.open(t, "_blank")
  9127. }
  9128. function o(e) {
  9129. var t = u[e];
  9130. window.open(t, "_blank")
  9131. }
  9132. var a = e("../../util/browser")
  9133. , s = e("../../enum/VRApps")
  9134. , l = e("../../enum/VRPlatforms")
  9135. , c = e("../../util/ajax")
  9136. , h = e("../../settings")
  9137. , u = {};
  9138. u[s.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  9139. u[s.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  9140. u[s.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=";
  9141. for (var d in s) {
  9142. var p = s[d];
  9143. u[p] += encodeURIComponent(document.referrer + "&display=" + p)
  9144. }
  9145. var f = {}
  9146. , g = function() {
  9147. var e = window.location.host;
  9148. return e.indexOf(".port.com") === -1 && e.indexOf("localhost") === -1 && (e = "my.port.com"),
  9149. "https://" + e
  9150. }();
  9151. t.exports.init = n,
  9152. t.exports.launch = r,
  9153. t.exports.launchStore = o
  9154. }
  9155. , {
  9156. "../../enum/VRApps": 46,
  9157. "../../enum/VRPlatforms": 49,
  9158. "../../settings": 166,
  9159. "../../util/ajax": 181,
  9160. "../../util/browser": 182
  9161. }],
  9162. 87: [function(e, t, i) {
  9163. "use strict";
  9164. function n(e) {
  9165. var t;
  9166. switch (e) {
  9167. case m.IOS:
  9168. return t = p.iosVersion(),
  9169. t.major > 9 || 9 === t.major && t.minor >= 1;
  9170. case m.Android:
  9171. return t = p.androidVersion(),
  9172. t.major > 4 || 4 === t.major && t.minor > 4 || 4 === t.major && 4 === t.minor && t.patch >= 4
  9173. }
  9174. return !1
  9175. }
  9176. function r(e, t) {
  9177. function i(e) {
  9178. K.emit(A.STORE, {
  9179. type: e
  9180. }),
  9181. f.launchStore(e)
  9182. }
  9183. function r(e) {
  9184. switch (e !== _.pageCount && (a(e),
  9185. N.text(e + 1 + " / " + _.pageCount)),
  9186. e) {
  9187. case _.Title:
  9188. O.css("display", "none"),
  9189. L.text(u[e]),
  9190. o(s);
  9191. break;
  9192. case _.Cardboard:
  9193. O.css("display", "block"),
  9194. L.text(u[e]),
  9195. M.filter(".cardboard").off(),
  9196. M.filter(".gearvr").off(),
  9197. c(e, s),
  9198. h(H, X, Z);
  9199. break;
  9200. case _.Gear:
  9201. L.text(u[e]),
  9202. c(e, s),
  9203. T.addClass("lastPage"),
  9204. h(G, X, Z);
  9205. break;
  9206. case _.pageCount:
  9207. T.removeClass("fadeIn"),
  9208. K.emit(A.CLOSED)
  9209. }
  9210. B.filter("[src='']").hide()
  9211. }
  9212. var s = function() {
  9213. return p.detectAndroid() ? p.detectAndroidMobile() && n(m.Android) ? (T.addClass("supported"),
  9214. w = ".show-supported",
  9215. m.Android) : (T.addClass("unsupported"),
  9216. w = ".show-unsupported",
  9217. m.UnsupportedAndroid) : p.detectIPhone() || p.detectIPod() ? (T.addClass("ios"),
  9218. w = ".show-ios",
  9219. _ = v.ios,
  9220. m.IOS) : (T.addClass("desktop"),
  9221. w = ".show-desktop",
  9222. m.Desktop)
  9223. }();
  9224. f.init(s, e, t),
  9225. s !== m.Desktop && T.addClass("mobile");
  9226. var l = function(e) {
  9227. K.emit(A.LAUNCH, {
  9228. vr_platform: s,
  9229. vr_app: e
  9230. }),
  9231. f.launch(e)
  9232. };
  9233. q.cardboardAndroid = l.bind(this, g.CardboardAndroid),
  9234. q.gear = l.bind(this, g.GearVR),
  9235. q.cardboardIOS = l.bind(this, g.CardboardIOS),
  9236. d(),
  9237. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  9238. $(w).show();
  9239. var u = [C.VR_LEARN_MORE_CAPS, C.VR_NEXT_CAPS, C.VR_GOT_IT_CAPS]
  9240. , y = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  9241. s === m.IOS && (u.splice(1, 1),
  9242. y.splice(1, 1)),
  9243. $("#vr").on("click", function(e) {
  9244. e.preventDefault();
  9245. player.FlyToMode("panorama", ()=>{
  9246. if(!window.vrEnabled) { // 开启VR
  9247. window.vrEnabled = true;
  9248. this.classList.add('active');
  9249. $('#gui div').not('#vrOff').addClass('vrHide');
  9250. $('#vrOffImg').css({'display':'inline-block'});
  9251. }else{
  9252. }
  9253. })
  9254. });
  9255. let exitVR = function(){
  9256. $('#gui div').not('#vrOff').removeClass('vrHide');
  9257. $('#vrOffImg').css({'display':'none'});
  9258. $('#player canvas').css({width:'', 'height': ''}); // 清楚vr下给canvas设置的宽高, 避免横竖屏切换的时候出现宽高错误的现象
  9259. $('#vr').removeClass('active'); // 清除vr按钮的激活样式
  9260. }
  9261. $('#vrOff').on('click', function(){
  9262. window.vrEnabled = false;
  9263. exitVR()
  9264. })
  9265. window.bus.addEventListener('exitWebXR',(e)=>{
  9266. exitVR()
  9267. })
  9268. var I = "https://my.port.com/vr/show/?m=" + e.sid;
  9269. s === m.IOS ? $(".cardboardLink").on("click", i.bind(this, g.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, g.CardboardAndroid)),
  9270. $(".gearLink").on("click", i.bind(this, g.GearVR)),
  9271. $("span.modelLink").text(I),
  9272. O.on("click", function(e) {
  9273. K.emit(A.PREV),
  9274. b--,
  9275. r(b)
  9276. }),
  9277. L.on("click", function(e) {
  9278. L.text();
  9279. K.emit(A.NEXT, {
  9280. nextAction: y[b]
  9281. }),
  9282. b++,
  9283. r(b)
  9284. }),
  9285. T.find(".close").on("click", K.dismiss)
  9286. }
  9287. function o(e) {
  9288. switch (e) {
  9289. case m.Android:
  9290. M.filter(".cardboard").off().on("click", q.cardboardAndroid),
  9291. M.filter(".gearvr").off().on("click", q.gear),
  9292. s(H, G, "logo-button", "same-line");
  9293. break;
  9294. case m.UnsupportedAndroid:
  9295. s("", z, "", "");
  9296. break;
  9297. case m.IOS:
  9298. M.filter(".cardboard").off().on("click", q.cardboardIOS),
  9299. s(H, "", "logo-button", "");
  9300. break;
  9301. case m.Desktop:
  9302. M.filter(".cardboard").off().on("click", l.bind(this, null, F, U)),
  9303. M.filter(".gearvr").off().on("click", l.bind(this, G, V, null)),
  9304. s(H, G, "logo-button", "same-line"),
  9305. Q.cardboard()
  9306. }
  9307. }
  9308. function a(e) {
  9309. $(".p1, .p2, .p3").hide(),
  9310. x.insertAfter(S),
  9311. T.removeClass("front-page"),
  9312. T.removeClass("details-page"),
  9313. T.removeClass("lastPage"),
  9314. M.removeClass("logo-button"),
  9315. M.removeClass("same-line"),
  9316. S.removeClass("headsetOptions"),
  9317. R.attr("src", ""),
  9318. R.filter(".second").removeClass("gear"),
  9319. R.css("display", "inline-block"),
  9320. R.off(),
  9321. P.filter(".second").css("display", ""),
  9322. D.css("display", "none"),
  9323. $(".p" + (e + 1) + w).show(),
  9324. R.filter(".third").insertBefore(P.filter(".third"))
  9325. }
  9326. function s(e, t, i, n) {
  9327. T.addClass("front-page"),
  9328. R.filter(".first").attr("src", e),
  9329. R.filter(".second").attr("src", t),
  9330. M.filter(".first").addClass(i),
  9331. M.filter(".second").addClass(i),
  9332. M.addClass(n),
  9333. ".show-desktop" === w && S.insertAfter(x)
  9334. }
  9335. function l(e, t, i) {
  9336. S.addClass("headsetOptions"),
  9337. M.off(),
  9338. R.filter(".second").attr("src", t),
  9339. D.css("display", "block"),
  9340. P.filter(".second").css("display", "none"),
  9341. D.on("click", function() {
  9342. a(_.Title),
  9343. o(m.Desktop)
  9344. }),
  9345. e && (K.emit(A.falseICECHOSEN, {
  9346. name: g.GearVR
  9347. }),
  9348. R.filter(".first").attr("src", e),
  9349. R.filter(".second").addClass("gear"),
  9350. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  9351. Q.gearvr()),
  9352. i && (K.emit(A.falseICECHOSEN, {
  9353. name: g.Cardboard
  9354. }),
  9355. R.filter(".third").attr("src", i),
  9356. R.filter(".third").show(),
  9357. R.filter(".third").insertAfter(R.filter(".second")),
  9358. R.filter(".third").addClass("link"),
  9359. R.filter(".second").addClass("link"),
  9360. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  9361. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid)),
  9362. Q.cardboard())
  9363. }
  9364. function c(e, t) {
  9365. switch (t) {
  9366. case m.IOS:
  9367. X = Y,
  9368. Z = j;
  9369. break;
  9370. case m.Desktop:
  9371. e === _.Cardboard ? (X = F,
  9372. Z = U,
  9373. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  9374. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid))) : (X = V,
  9375. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  9376. Z = "");
  9377. break;
  9378. default:
  9379. e === _.Cardboard ? (X = z,
  9380. Z = j) : (X = k,
  9381. Z = W)
  9382. }
  9383. }
  9384. function h(e, t, i) {
  9385. T.find(".inner").addClass("details-page"),
  9386. T.addClass("details-page"),
  9387. R.filter(".first").attr("src", e),
  9388. R.filter(".second").attr("src", t),
  9389. R.filter(".third").attr("src", i)
  9390. }
  9391. function u() {
  9392. T.hasClass("fadeIn") && (T.removeClass("fadeIn"),
  9393. K.emit(A.CLOSED))
  9394. }
  9395. function d() {
  9396. var e = p.aspectRatio() > 1 && p.isMobile();
  9397. T.toggleClass("landscape", e).toggleClass("portrait", !e),
  9398. T.toggleClass("tiny", $("#player").height() <= y.narrowLandscapeHeight),
  9399. T.toggleClass("tinier", $("#player").height() <= y.reallyNarrowLandscapeHeight)
  9400. }
  9401. var p = e("../../util/browser")
  9402. , f = e("./vrLink")
  9403. , g = e("../../enum/VRApps")
  9404. , m = e("../../enum/VRPlatforms")
  9405. , v = e("../../enum/VRPages")
  9406. , A = e("./vrEvent")
  9407. , y = (e("../../settings"),
  9408. e("../../constants"))
  9409. , C = e("../../localization/localize")
  9410. , I = e("../../util/common")
  9411. , E = e("events").EventEmitter
  9412. , b = 0
  9413. , w = null
  9414. , _ = v.standard
  9415. , T = $(".vr-popup")
  9416. , x = T.find(".vr-popup-body")
  9417. , S = T.find(".vr-images")
  9418. , M = T.find(".img-container")
  9419. , R = T.find(".vr-sm-image")
  9420. , P = M.find(".vr-img-caption")
  9421. , O = $(".vr-buttons").find(".prev-button")
  9422. , L = $(".vr-buttons").find(".next-button")
  9423. , D = S.find(".front-close")
  9424. , N = $(".vr-page")
  9425. , B = T.find("img")
  9426. , F = "images/apple-store.png"
  9427. , V = "images/badge-oculus.png"
  9428. , U = "images/badge-cardboard.png"
  9429. , k = "images/logo-samsung.png"
  9430. , H = "images/headset-cardboard.png"
  9431. , G = "images/headset-gearvr.png"
  9432. , z = "images/ico-android-robot.png"
  9433. , W = "images/ico-gearvr.png"
  9434. , j = "images/ico-vr.png"
  9435. , Y = "images/apple-logo-white.svg"
  9436. , X = null
  9437. , Z = null
  9438. , q = {}
  9439. , K = {
  9440. init: r,
  9441. dismiss: u,
  9442. isDeviceSupported: n
  9443. };
  9444. I.extendObject(K, E.prototype),
  9445. $(window).resize(d);
  9446. var Q = function() {
  9447. var e = P.filter(".first").find(".cardboard")
  9448. , t = P.filter(".first").find(".gearvr");
  9449. return {
  9450. cardboard: function() {
  9451. t.addClass("hidden"),
  9452. e.removeClass("hidden")
  9453. },
  9454. gearvr: function() {
  9455. e.addClass("hidden"),
  9456. t.removeClass("hidden")
  9457. }
  9458. }
  9459. }();
  9460. t.exports = K
  9461. }
  9462. , {
  9463. "../../constants": 8,
  9464. "../../enum/VRApps": 46,
  9465. "../../enum/VRPages": 48,
  9466. "../../enum/VRPlatforms": 49,
  9467. "../../localization/localize": 108,
  9468. "../../settings": 166,
  9469. "../../util/browser": 182,
  9470. "../../util/common": 185,
  9471. "./vrEvent": 85,
  9472. "./vrLink": 86,
  9473. events: 202
  9474. }],
  9475. 88: [function(e, t, i) {
  9476. "use strict";
  9477. t.exports = Object.freeze({
  9478. OPENED: "webvr.modal.opened",
  9479. SHOW_TERMS: "webvr.footer.show.terms"
  9480. })
  9481. }
  9482. , {}],
  9483. 89: [function(e, t, i) {
  9484. (function(i) {
  9485. "use strict";
  9486. function n(e, t, i, n) {
  9487. function r(e) {
  9488. e.preventDefault(),
  9489. a(e.currentTarget.id)
  9490. }
  9491. function a(e) {
  9492. ne[e](),
  9493. Object.keys(ne).map(function(t, i) {
  9494. $("#" + t).toggleClass("tabs-underlined", t === e)
  9495. })
  9496. }
  9497. y = i,
  9498. v = t,
  9499. w.init(E.Android, e, n),
  9500. m();
  9501. var l = new RegExp("daydream","i")
  9502. , c = l.test(y.displayName);
  9503. c ? (a("tabdaydream"),
  9504. B.filter(".device-headset-side").attr("src", H),
  9505. D.find(".title").text(x.localizeText("WEBVR_FOR_DAYDREAM"))) : (a("tabcardboard"),
  9506. B.filter(".device-headset-side").attr("src", Y),
  9507. D.find(".title").text(x.localizeText("WEBVR_FOR_CARDBOARD"))),
  9508. $("#vr").on("click", function(e) {
  9509. e.preventDefault(),
  9510. g("click_webvr_button"),
  9511. L.is(":hidden") && (ie.emit(_.OPENED),
  9512. o())
  9513. }),
  9514. $(".webvr-popup .close").on("click", function(e) {
  9515. e.preventDefault(),
  9516. D.hasClass("hidden") ? (g("webvr_help_close"),
  9517. p()) : s()
  9518. }),
  9519. $("#tabcardboard").on("click", r),
  9520. $("#tabdaydream").on("click", r),
  9521. $("#tabnative").on("click", r),
  9522. $(".webvr-popup .open-with-app").on("click", function(e) {
  9523. e.preventDefault(),
  9524. g("webvr_learn_more"),
  9525. a("tabnative"),
  9526. p()
  9527. }),
  9528. $(".webvr-popup .help").on("click", function(e) {
  9529. e.preventDefault(),
  9530. g(D.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  9531. p()
  9532. }),
  9533. $(".webvr-popup .terms").on("click", function(e) {
  9534. e.preventDefault(),
  9535. g("webvr_click_terms"),
  9536. s(),
  9537. ie.emit(_.SHOW_TERMS)
  9538. }),
  9539. F.on("click", function(e) {
  9540. e.preventDefault(),
  9541. g(ee),
  9542. window.open(J, "_blank")
  9543. }),
  9544. V.on("click", function(e) {
  9545. e.preventDefault(),
  9546. g("webvr_phone_link"),
  9547. window.open(te, "_blank")
  9548. }),
  9549. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  9550. e.preventDefault(),
  9551. g("webvr_cardboard_link"),
  9552. w.launch(b.CardboardAndroid)
  9553. }),
  9554. $(".webvr-popup .badge-oculus").on("click", function(e) {
  9555. e.preventDefault(),
  9556. g("webvr_oculus_link"),
  9557. w.launch(b.GearVR)
  9558. })
  9559. }
  9560. function r() {
  9561. function e() {
  9562. y.isPresenting || (f(),
  9563. window.removeEventListener("vrdisplaypresentchange", e))
  9564. }
  9565. R.info("Headset mounted"),
  9566. v.suspend();
  9567. var t = document.createElement("canvas");
  9568. for (t.getContext("webgl"),
  9569. t.className = "webvr-canvas",
  9570. document.bgColor = "#000",
  9571. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  9572. document.body.removeChild(document.body.firstChild);
  9573. document.body.appendChild(t),
  9574. g("webvr_enter_app"),
  9575. y.requestPresent([{
  9576. source: t,
  9577. predistorted: !0
  9578. }]).catch(function(t) {
  9579. R.error("Failed to present: " + t),
  9580. g("webvr_exit_calibrate"),
  9581. e()
  9582. }),
  9583. A.then(function() {
  9584. window.dispatchEvent(new Event("vrapp-start"))
  9585. }),
  9586. window.addEventListener("vrdisplaypresentchange", e)
  9587. }
  9588. function o() {
  9589. O.fadeOut(I.guiAnimationSpeed),
  9590. L.fadeIn(I.guiAnimationSpeed),
  9591. a()
  9592. }
  9593. function a() {
  9594. if (!A) {
  9595. var e = C.valueFromHash("webvr") || I.appConfig.webvr_version
  9596. , t = "https://static.port.com/webvr/" + e + "/js/main.js";
  9597. A = new Promise(function(e, i) {
  9598. var n = document.createElement("script");
  9599. n.type = "text/javascript",
  9600. n.src = t,
  9601. n.onload = e,
  9602. document.head.appendChild(n)
  9603. }
  9604. )
  9605. }
  9606. D.find(".enter-button").on("click", r)
  9607. }
  9608. function s() {
  9609. g("webvr_modal_close"),
  9610. D.find(".enter-button").off("click", r),
  9611. L.fadeOut(I.guiAnimationSpeed, function() {
  9612. D.toggleClass("hidden", !1),
  9613. N.toggleClass("hidden", !0),
  9614. C.exitFullscreen()
  9615. }),
  9616. O.fadeIn(I.guiAnimationSpeed)
  9617. }
  9618. function l() {
  9619. k.toggleClass("hidden", !1),
  9620. U.toggleClass("hidden", !0)
  9621. }
  9622. function c() {
  9623. k.toggleClass("hidden", !0),
  9624. U.toggleClass("hidden", !1)
  9625. }
  9626. function h() {
  9627. B.filter(".device-headset").attr("src", G),
  9628. B.filter(".device-phone").attr("src", z),
  9629. J = Z,
  9630. ee = K,
  9631. F.text(x.localizeText("WEBVR_DAYDREAM_VIEW")),
  9632. V.text(x.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9633. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9634. c()
  9635. }
  9636. function u() {
  9637. B.filter(".badge-cardboard").attr("src", j),
  9638. B.filter(".badge-oculus").attr("src", X),
  9639. l()
  9640. }
  9641. function d() {
  9642. B.filter(".device-headset").attr("src", Y),
  9643. B.filter(".device-phone").attr("src", W),
  9644. J = q,
  9645. ee = Q,
  9646. F.text(x.localizeText("VR_GOOGLE_CARDBOARD")),
  9647. V.text(x.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9648. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9649. c()
  9650. }
  9651. function p() {
  9652. D.toggleClass("hidden"),
  9653. N.toggleClass("hidden")
  9654. }
  9655. function f() {
  9656. R.info("exiting webVR"),
  9657. g("webvr_exit_app"),
  9658. window.location.search.indexOf("&qs=1") === -1 ? window.location = window.location + "&qs=1" : window.location = window.location
  9659. }
  9660. function g(e) {
  9661. var t = C.isLandscape() ? "landscape" : "portrait";
  9662. T.trackAlways("showcase_gui", {
  9663. gui_action: e,
  9664. orientation: t
  9665. })
  9666. }
  9667. function m() {
  9668. var e = C.isLandscape();
  9669. L.toggleClass("landscape", e).toggleClass("portrait", !e)
  9670. }
  9671. var v, A, y, C = e("../../util/browser"), I = e("../../settings"), E = (e("./../gui"),
  9672. e("../../enum/VRPlatforms")), b = e("../../enum/VRApps"), w = e("./../vr/vrLink"), _ = e("./WebVrEvent"), T = e("../../analytics"), x = (e("../../constants"),
  9673. 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 = {
  9674. init: n
  9675. }, ne = {
  9676. tabcardboard: d,
  9677. tabdaydream: h,
  9678. tabnative: u
  9679. };
  9680. S.extendObject(ie, P.prototype),
  9681. $(window).resize(m),
  9682. t.exports = ie
  9683. }
  9684. ).call(this, "/js/gui/webvr/webVRgui.js")
  9685. }
  9686. , {
  9687. "../../analytics": 4,
  9688. "../../constants": 8,
  9689. "../../enum/VRApps": 46,
  9690. "../../enum/VRPlatforms": 49,
  9691. "../../localization/localize": 108,
  9692. "../../settings": 166,
  9693. "../../util/browser": 182,
  9694. "../../util/common": 185,
  9695. "../../util/logger": 189,
  9696. "./../gui": 65,
  9697. "./../vr/vrLink": 86,
  9698. "./WebVrEvent": 88,
  9699. events: 202
  9700. }],
  9701. 90: [function(e, t, i) {
  9702. "use strict";
  9703. function n(e, t, i, n, o) {
  9704. n || 0 === n ? this.floorId = n : this.floorId = -1,
  9705. this.roomId = o || "",
  9706. this.labelId = e,
  9707. this.position = (new r.Vector3).copy(t),
  9708. this.text = i
  9709. }
  9710. var r = e("three")
  9711. , o = e("../util/browser");
  9712. n.prototype.build = function() {
  9713. var e = window.document.createElement("div");
  9714. o.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9715. var t = window.document.createElement("div");
  9716. t.setAttribute("class", "gui-floorplan-label-text");
  9717. var i = window.document.createTextNode(this.text);
  9718. t.appendChild(i),
  9719. e.appendChild(t),
  9720. window.document.body.appendChild(e),
  9721. this.labelGui = e,
  9722. this.textBlock = t,
  9723. $(this.labelGui).hide();
  9724. var n = window.getComputedStyle(this.labelGui);
  9725. this.initialTransform = n.transform || n.webkitTransform
  9726. }
  9727. ,
  9728. t.exports = n
  9729. }
  9730. , {
  9731. "../util/browser": 182,
  9732. three: 217
  9733. }],
  9734. 91: [function(e, t, i) {
  9735. "use strict";
  9736. function n() {
  9737. this.player = null,
  9738. this.modelManager = null,
  9739. this.container = null
  9740. }
  9741. var r = e("three")
  9742. , o = (e("../util/common"),
  9743. e("../enum/PlayerEvents"))
  9744. , a = (e("../enum/DirectorEvents"),
  9745. e("../enum/ModelManagerEvents"))
  9746. , s = e("../settings")
  9747. , l = e("../enum/Viewmode")
  9748. , c = (e("../enum/WarpStyle"),
  9749. e("../util/transitions"),
  9750. e("../util/lerp"),
  9751. e("../util/browser"));
  9752. //场景初始化
  9753. n.prototype.init = function(e, t, i) {
  9754. this.player = e,
  9755. this.modelManager = t,
  9756. this.container = i,
  9757. this.updateModel(),
  9758. this.bindEvents()
  9759. }
  9760. ,
  9761. n.prototype.bindEvents = function() {
  9762. this.modelManager.on(a.ActiveModelChanged, this.updateModel.bind(this)),
  9763. this.player.on(o.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9764. this.player.on(o.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9765. this.player.on(o.StartInside, this.handleStartInside.bind(this)),
  9766. this.player.on(o.StartOutside, this.handleStartOutside.bind(this))
  9767. }
  9768. ,
  9769. n.prototype.updateModel = function() {
  9770. this.model = this.modelManager.getActiveModel()
  9771. }
  9772. ,
  9773. n.prototype.handlePlayerViewChanged = function() {
  9774. this.updateLabelVisibility(),
  9775. this.updateLabelDisplay()
  9776. }
  9777. ,
  9778. n.prototype.getLabelsForFloor = function(e, t) {
  9779. return t = t || [],
  9780. t.length = 0,
  9781. this.model.labels.forEach(function(i) {
  9782. this.labelVisibleForFloor(i, e) && t.push(i)
  9783. }
  9784. .bind(this)),
  9785. t
  9786. }
  9787. ,
  9788. n.prototype.getLabelsForCurrentFloor = function(e) {
  9789. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9790. }
  9791. ,
  9792. n.prototype.labelVisibleForFloor = function(e, t) {
  9793. var i = c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.mobile || !c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.desktop;
  9794. if (!this.model.showingLabels || !e.labelGui || !i)
  9795. return !1;
  9796. var n = e.floorId === this.model.floors.size() - 1;
  9797. return this.model.allFloorsVisible ? n : e.floorId === t
  9798. }
  9799. ,
  9800. n.prototype.updateLabelVisibility = function(e) {
  9801. this.model.labels.forEach(function(e) {
  9802. 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)
  9803. }
  9804. .bind(this))
  9805. }
  9806. ,
  9807. n.prototype.showAllLabels = function(e, t) {
  9808. this.model.labels.forEach(function(i) {
  9809. this.showLabel(i, e, t)
  9810. }
  9811. .bind(this))
  9812. }
  9813. ,
  9814. n.prototype.hideAllLabels = function(e, t) {
  9815. this.model.labels.forEach(function(i) {
  9816. this.hideLabel(i, e, t)
  9817. }
  9818. .bind(this))
  9819. }
  9820. ,
  9821. n.prototype.showLabel = function(e, t, i) {
  9822. this.model.showingLabels && (e.visible || (e.visible = !0,
  9823. e.labelGui.style.display = "block",
  9824. e.labelGui.style.opacity = 0,
  9825. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9826. }
  9827. ,
  9828. n.prototype.hideLabel = function(e, t, i) {
  9829. e.visible && (e.visible = !1,
  9830. c.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9831. }
  9832. ,
  9833. n.prototype.supportedMode = function() {
  9834. return this.player.mode === l.FLOORPLAN
  9835. }
  9836. ,
  9837. n.prototype.updateLabelDisplay = function() {
  9838. var e = (new r.Vector3,
  9839. new r.Vector3,
  9840. []);
  9841. return function() {
  9842. var t = this.player.getLabelScaleFactor()
  9843. , i = .6
  9844. , n = 1.2
  9845. , r = (1 - t) * n + i
  9846. , o = c.isMobile() ? s.labels.zoomTruncateThreshhold.mobile : s.labels.zoomTruncateThreshhold.desktop;
  9847. this.getLabelsForCurrentFloor(e);
  9848. for (var a = 0; a < e.length; a++) {
  9849. var l = e[a];
  9850. this.supportedMode() && l.labelGui && (this.updateProjectedGuiElement(l.labelGui, l.textBlock, l.position, r, r),
  9851. 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)
  9852. }
  9853. }
  9854. }(),
  9855. n.prototype.updateProjectedGuiElement = function() {
  9856. var e = new r.Vector3;
  9857. new r.Vector3;
  9858. return function(t, i, n, r, o) {
  9859. i.style.fontSize = 100 * o + "%";
  9860. var a = $("#player").width()
  9861. , s = $("#player").height()
  9862. , l = .5 * a
  9863. , c = .5 * s;
  9864. e.copy(n),
  9865. e.project(this.player.camera);
  9866. var h = e.x * l + l
  9867. , u = -(e.y * c) + c;
  9868. h -= t.offsetWidth / 2,
  9869. u -= t.offsetHeight / 2,
  9870. t.style.left = h + "px",
  9871. t.style.top = u + "px"
  9872. }
  9873. }(),
  9874. n.prototype.handleStartInside = function(e) {
  9875. this.updateLabelVisibility()
  9876. }
  9877. ,
  9878. n.prototype.handleStartOutside = function() {
  9879. this.updateLabelVisibility()
  9880. }
  9881. ,
  9882. t.exports = n
  9883. }
  9884. , {
  9885. "../enum/DirectorEvents": 23,
  9886. "../enum/ModelManagerEvents": 33,
  9887. "../enum/PlayerEvents": 40,
  9888. "../enum/Viewmode": 51,
  9889. "../enum/WarpStyle": 52,
  9890. "../settings": 166,
  9891. "../util/browser": 182,
  9892. "../util/common": 185,
  9893. "../util/lerp": 188,
  9894. "../util/transitions": 195,
  9895. three: 217
  9896. }],
  9897. 92: [function(e, t, i) {
  9898. "use strict";
  9899. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9900. if (null == this)
  9901. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9902. if ("function" != typeof e)
  9903. throw new TypeError("predicate must be a function");
  9904. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9905. if (t = i[o],
  9906. e.call(r, t, o, i))
  9907. return o;
  9908. return -1
  9909. }
  9910. ),
  9911. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9912. value: function(e) {
  9913. if (null == this)
  9914. throw new TypeError('"this" is null or not defined');
  9915. var t = Object(this)
  9916. , i = t.length >>> 0;
  9917. if ("function" != typeof e)
  9918. throw new TypeError("predicate must be a function");
  9919. for (var n = arguments[1], r = 0; r < i; ) {
  9920. var o = t[r];
  9921. if (e.call(n, o, r, t))
  9922. return o;
  9923. r++
  9924. }
  9925. }
  9926. })
  9927. }
  9928. , {}],
  9929. 93: [function(e, t, i) {
  9930. "use strict";
  9931. var n = n || {};
  9932. t.exports = n,
  9933. n.gui = n.gui || {},
  9934. n.utils = n.utils || {},
  9935. n.controllers = n.controllers || {},
  9936. n.dom = n.dom || {},
  9937. n.color = n.color || {},
  9938. n.utils.css = function() {
  9939. return {
  9940. load: function(e, t) {
  9941. t = t || document;
  9942. var i = t.createElement("link");
  9943. i.type = "text/css",
  9944. i.rel = "stylesheet",
  9945. i.href = e,
  9946. t.getElementsByTagName("head")[0].appendChild(i)
  9947. },
  9948. inject: function(e, t) {
  9949. t = t || document;
  9950. var i = document.createElement("style");
  9951. i.type = "text/css",
  9952. i.innerHTML = e,
  9953. t.getElementsByTagName("head")[0].appendChild(i)
  9954. }
  9955. }
  9956. }(),
  9957. n.utils.common = function() {
  9958. var e = Array.prototype.forEach
  9959. , t = Array.prototype.slice;
  9960. return {
  9961. BREAK: {},
  9962. extend: function(e) {
  9963. return this.each(t.call(arguments, 1), function(t) {
  9964. for (var i in t)
  9965. this.isUndefined(t[i]) || (e[i] = t[i])
  9966. }, this),
  9967. e
  9968. },
  9969. defaults: function(e) {
  9970. return this.each(t.call(arguments, 1), function(t) {
  9971. for (var i in t)
  9972. this.isUndefined(e[i]) && (e[i] = t[i])
  9973. }, this),
  9974. e
  9975. },
  9976. compose: function() {
  9977. var e = t.call(arguments);
  9978. return function() {
  9979. for (var i = t.call(arguments), n = e.length - 1; n >= 0; n--)
  9980. i = [e[n].apply(this, i)];
  9981. return i[0]
  9982. }
  9983. },
  9984. each: function(t, i, n) {
  9985. if (t)
  9986. if (e && t.forEach && t.forEach === e)
  9987. t.forEach(i, n);
  9988. else if (t.length === t.length + 0) {
  9989. for (var r = 0, o = t.length; r < o; r++)
  9990. if (r in t && i.call(n, t[r], r) === this.BREAK)
  9991. return
  9992. } else
  9993. for (var r in t)
  9994. if (i.call(n, t[r], r) === this.BREAK)
  9995. return
  9996. },
  9997. defer: function(e) {
  9998. setTimeout(e, 0)
  9999. },
  10000. toArray: function(e) {
  10001. return e.toArray ? e.toArray() : t.call(e)
  10002. },
  10003. isUndefined: function(e) {
  10004. return void 0 === e
  10005. },
  10006. isNull: function(e) {
  10007. return null === e
  10008. },
  10009. isNaN: function(e) {
  10010. return e !== e
  10011. },
  10012. isArray: Array.isArray || function(e) {
  10013. return e.constructor === Array
  10014. }
  10015. ,
  10016. isObject: function(e) {
  10017. return e === Object(e)
  10018. },
  10019. isNumber: function(e) {
  10020. return e === e + 0
  10021. },
  10022. isString: function(e) {
  10023. return e === e + ""
  10024. },
  10025. isBoolean: function(e) {
  10026. return e === !1 || e === !0
  10027. },
  10028. isFunction: function(e) {
  10029. return "[object Function]" === Object.prototype.toString.call(e)
  10030. }
  10031. }
  10032. }(),
  10033. n.controllers.Controller = function(e) {
  10034. var t = function(e, t) {
  10035. this.initialValue = e[t],
  10036. this.domElement = document.createElement("div"),
  10037. this.object = e,
  10038. this.property = t,
  10039. this.__onChange = void 0,
  10040. this.__onFinishChange = void 0
  10041. };
  10042. return e.extend(t.prototype, {
  10043. onChange: function(e) {
  10044. return this.__onChange = e,
  10045. this
  10046. },
  10047. onFinishChange: function(e) {
  10048. return this.__onFinishChange = e,
  10049. this
  10050. },
  10051. setValue: function(e) {
  10052. return this.object[this.property] = e,
  10053. this.__onChange && this.__onChange.call(this, e),
  10054. this.updateDisplay(),
  10055. this
  10056. },
  10057. getValue: function() {
  10058. return this.object[this.property]
  10059. },
  10060. updateDisplay: function() {
  10061. return this
  10062. },
  10063. isModified: function() {
  10064. return this.initialValue !== this.getValue()
  10065. }
  10066. }),
  10067. t
  10068. }(n.utils.common),
  10069. n.dom.dom = function(e) {
  10070. function t(t) {
  10071. if ("0" === t || e.isUndefined(t))
  10072. return 0;
  10073. var i = t.match(r);
  10074. return e.isNull(i) ? 0 : parseFloat(i[1])
  10075. }
  10076. var i = {
  10077. HTMLEvents: ["change"],
  10078. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  10079. KeyboardEvents: ["keydown"]
  10080. }
  10081. , n = {};
  10082. e.each(i, function(t, i) {
  10083. e.each(t, function(e) {
  10084. n[e] = i
  10085. })
  10086. });
  10087. var r = /(\d+(\.\d+)?)px/
  10088. , o = {
  10089. makeSelectable: function(e, t) {
  10090. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  10091. return !1
  10092. }
  10093. : function() {}
  10094. ,
  10095. e.style.MozUserSelect = t ? "auto" : "none",
  10096. e.style.KhtmlUserSelect = t ? "auto" : "none",
  10097. e.unselectable = t ? "on" : "off")
  10098. },
  10099. makeFullscreen: function(t, i, n) {
  10100. e.isUndefined(i) && (i = !0),
  10101. e.isUndefined(n) && (n = !0),
  10102. t.style.position = "absolute",
  10103. i && (t.style.left = 0,
  10104. t.style.right = 0),
  10105. n && (t.style.top = 0,
  10106. t.style.bottom = 0)
  10107. },
  10108. fakeEvent: function(t, i, r, o) {
  10109. r = r || {};
  10110. var a = n[i];
  10111. if (!a)
  10112. throw new Error("Event type " + i + " not supported.");
  10113. var s = document.createEvent(a);
  10114. switch (a) {
  10115. case "MouseEvents":
  10116. var l = r.x || r.clientX || 0
  10117. , c = r.y || r.clientY || 0;
  10118. s.initMouseEvent(i, r.bubbles || !1, r.cancelable || !0, window, r.clickCount || 1, 0, 0, l, c, !1, !1, !1, !1, 0, null);
  10119. break;
  10120. case "KeyboardEvents":
  10121. var h = s.initKeyboardEvent || s.initKeyEvent;
  10122. e.defaults(r, {
  10123. cancelable: !0,
  10124. ctrlKey: !1,
  10125. altKey: !1,
  10126. shiftKey: !1,
  10127. metaKey: !1,
  10128. keyCode: void 0,
  10129. charCode: void 0
  10130. }),
  10131. h(i, r.bubbles || !1, r.cancelable, window, r.ctrlKey, r.altKey, r.shiftKey, r.metaKey, r.keyCode, r.charCode);
  10132. break;
  10133. default:
  10134. s.initEvent(i, r.bubbles || !1, r.cancelable || !0)
  10135. }
  10136. e.defaults(s, o),
  10137. t.dispatchEvent(s)
  10138. },
  10139. bind: function(e, t, i, n) {
  10140. return n = n || !1,
  10141. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  10142. o
  10143. },
  10144. unbind: function(e, t, i, n) {
  10145. return n = n || !1,
  10146. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  10147. o
  10148. },
  10149. addClass: function(e, t) {
  10150. if (void 0 === e.className)
  10151. e.className = t;
  10152. else if (e.className !== t) {
  10153. var i = e.className.split(/ +/);
  10154. i.indexOf(t) == -1 && (i.push(t),
  10155. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  10156. }
  10157. return o
  10158. },
  10159. removeClass: function(e, t) {
  10160. if (t)
  10161. if (void 0 === e.className)
  10162. ;
  10163. else if (e.className === t)
  10164. e.removeAttribute("class");
  10165. else {
  10166. var i = e.className.split(/ +/)
  10167. , n = i.indexOf(t);
  10168. n != -1 && (i.splice(n, 1),
  10169. e.className = i.join(" "))
  10170. }
  10171. else
  10172. e.className = void 0;
  10173. return o
  10174. },
  10175. hasClass: function(e, t) {
  10176. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  10177. },
  10178. getWidth: function(e) {
  10179. var i = getComputedStyle(e);
  10180. return t(i["border-left-width"]) + t(i["border-right-width"]) + t(i["padding-left"]) + t(i["padding-right"]) + t(i.width)
  10181. },
  10182. getHeight: function(e) {
  10183. var i = getComputedStyle(e);
  10184. return t(i["border-top-width"]) + t(i["border-bottom-width"]) + t(i["padding-top"]) + t(i["padding-bottom"]) + t(i.height)
  10185. },
  10186. getOffset: function(e) {
  10187. var t = {
  10188. left: 0,
  10189. top: 0
  10190. };
  10191. if (e.offsetParent)
  10192. do
  10193. t.left += e.offsetLeft,
  10194. t.top += e.offsetTop;
  10195. while (e = e.offsetParent);return t
  10196. },
  10197. isActive: function(e) {
  10198. return e === document.activeElement && (e.type || e.href)
  10199. }
  10200. };
  10201. return o
  10202. }(n.utils.common),
  10203. n.controllers.OptionController = function(e, t, i) {
  10204. var n = function(e, r, o) {
  10205. n.superclass.call(this, e, r);
  10206. var a = this;
  10207. if (this.__select = document.createElement("select"),
  10208. i.isArray(o)) {
  10209. var s = {};
  10210. i.each(o, function(e) {
  10211. s[e] = e
  10212. }),
  10213. o = s
  10214. }
  10215. i.each(o, function(e, t) {
  10216. var i = document.createElement("option");
  10217. i.innerHTML = t,
  10218. i.setAttribute("value", e),
  10219. a.__select.appendChild(i)
  10220. }),
  10221. this.updateDisplay(),
  10222. t.bind(this.__select, "change", function() {
  10223. var e = this.options[this.selectedIndex].value;
  10224. a.setValue(e)
  10225. }),
  10226. this.domElement.appendChild(this.__select)
  10227. };
  10228. return n.superclass = e,
  10229. i.extend(n.prototype, e.prototype, {
  10230. setValue: function(e) {
  10231. var t = n.superclass.prototype.setValue.call(this, e);
  10232. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10233. t
  10234. },
  10235. updateDisplay: function() {
  10236. return this.__select.value = this.getValue(),
  10237. n.superclass.prototype.updateDisplay.call(this)
  10238. }
  10239. }),
  10240. n
  10241. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10242. n.controllers.NumberController = function(e, t) {
  10243. function i(e) {
  10244. return e = e.toString(),
  10245. e.indexOf(".") > -1 ? e.length - e.indexOf(".") - 1 : 0
  10246. }
  10247. var n = function(e, r, o) {
  10248. n.superclass.call(this, e, r),
  10249. o = o || {},
  10250. this.__min = o.min,
  10251. this.__max = o.max,
  10252. this.__step = o.step,
  10253. 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,
  10254. this.__precision = i(this.__impliedStep)
  10255. };
  10256. return n.superclass = e,
  10257. t.extend(n.prototype, e.prototype, {
  10258. setValue: function(e) {
  10259. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  10260. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  10261. n.superclass.prototype.setValue.call(this, e)
  10262. },
  10263. min: function(e) {
  10264. return this.__min = e,
  10265. this
  10266. },
  10267. max: function(e) {
  10268. return this.__max = e,
  10269. this
  10270. },
  10271. step: function(e) {
  10272. return this.__step = e,
  10273. this.__impliedStep = e,
  10274. this.__precision = i(e),
  10275. this
  10276. }
  10277. }),
  10278. n
  10279. }(n.controllers.Controller, n.utils.common),
  10280. n.controllers.NumberControllerBox = function(e, t, i) {
  10281. function n(e, t) {
  10282. var i = Math.pow(10, t);
  10283. return Math.round(e * i) / i
  10284. }
  10285. var r = function(e, n, o) {
  10286. function a() {
  10287. var e = parseFloat(d.__input.value);
  10288. i.isNaN(e) || d.setValue(e)
  10289. }
  10290. function s() {
  10291. a(),
  10292. d.__onFinishChange && d.__onFinishChange.call(d, d.getValue())
  10293. }
  10294. function l(e) {
  10295. t.bind(window, "mousemove", c),
  10296. t.bind(window, "mouseup", h),
  10297. u = e.clientY
  10298. }
  10299. function c(e) {
  10300. var t = u - e.clientY;
  10301. d.setValue(d.getValue() + t * d.__impliedStep),
  10302. u = e.clientY
  10303. }
  10304. function h() {
  10305. t.unbind(window, "mousemove", c),
  10306. t.unbind(window, "mouseup", h)
  10307. }
  10308. this.__truncationSuspended = !1,
  10309. r.superclass.call(this, e, n, o);
  10310. var u, d = this;
  10311. this.__input = document.createElement("input"),
  10312. this.__input.setAttribute("type", "text"),
  10313. t.bind(this.__input, "change", a),
  10314. t.bind(this.__input, "blur", s),
  10315. t.bind(this.__input, "mousedown", l),
  10316. t.bind(this.__input, "keydown", function(e) {
  10317. 13 === e.keyCode && (d.__truncationSuspended = !0,
  10318. this.blur(),
  10319. d.__truncationSuspended = !1)
  10320. }),
  10321. this.updateDisplay(),
  10322. this.domElement.appendChild(this.__input)
  10323. };
  10324. return r.superclass = e,
  10325. i.extend(r.prototype, e.prototype, {
  10326. updateDisplay: function() {
  10327. return this.__input.value = this.__truncationSuspended ? this.getValue() : n(this.getValue(), this.__precision),
  10328. r.superclass.prototype.updateDisplay.call(this)
  10329. }
  10330. }),
  10331. r
  10332. }(n.controllers.NumberController, n.dom.dom, n.utils.common),
  10333. n.controllers.NumberControllerSlider = function(e, t, i, n, r) {
  10334. function o(e, t, i, n, r) {
  10335. return n + (r - n) * ((e - t) / (i - t))
  10336. }
  10337. var a = function(e, i, n, r, s) {
  10338. function l(e) {
  10339. t.bind(window, "mousemove", c),
  10340. t.bind(window, "mouseup", h),
  10341. c(e)
  10342. }
  10343. function c(e) {
  10344. e.preventDefault();
  10345. var i = t.getOffset(u.__background)
  10346. , n = t.getWidth(u.__background);
  10347. return u.setValue(o(e.clientX, i.left, i.left + n, u.__min, u.__max)),
  10348. !1
  10349. }
  10350. function h() {
  10351. t.unbind(window, "mousemove", c),
  10352. t.unbind(window, "mouseup", h),
  10353. u.__onFinishChange && u.__onFinishChange.call(u, u.getValue())
  10354. }
  10355. a.superclass.call(this, e, i, {
  10356. min: n,
  10357. max: r,
  10358. step: s
  10359. });
  10360. var u = this;
  10361. this.__background = document.createElement("div"),
  10362. this.__foreground = document.createElement("div"),
  10363. t.bind(this.__background, "mousedown", l),
  10364. t.addClass(this.__background, "slider"),
  10365. t.addClass(this.__foreground, "slider-fg"),
  10366. this.updateDisplay(),
  10367. this.__background.appendChild(this.__foreground),
  10368. this.domElement.appendChild(this.__background)
  10369. };
  10370. return a.superclass = e,
  10371. a.useDefaultStyles = function() {
  10372. i.inject(r)
  10373. }
  10374. ,
  10375. n.extend(a.prototype, e.prototype, {
  10376. updateDisplay: function() {
  10377. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  10378. return this.__foreground.style.width = 100 * e + "%",
  10379. a.superclass.prototype.updateDisplay.call(this)
  10380. }
  10381. }),
  10382. a
  10383. }(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}"),
  10384. n.controllers.FunctionController = function(e, t, i) {
  10385. var n = function(e, i, r) {
  10386. n.superclass.call(this, e, i);
  10387. var o = this;
  10388. this.__button = document.createElement("div"),
  10389. this.__button.innerHTML = void 0 === r ? "Fire" : r,
  10390. t.bind(this.__button, "click", function(e) {
  10391. return e.preventDefault(),
  10392. o.fire(),
  10393. !1
  10394. }),
  10395. t.addClass(this.__button, "button"),
  10396. this.domElement.appendChild(this.__button)
  10397. };
  10398. return n.superclass = e,
  10399. i.extend(n.prototype, e.prototype, {
  10400. fire: function() {
  10401. this.__onChange && this.__onChange.call(this),
  10402. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10403. this.getValue().call(this.object)
  10404. }
  10405. }),
  10406. n
  10407. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10408. n.controllers.BooleanController = function(e, t, i) {
  10409. var n = function(e, i) {
  10410. function r() {
  10411. o.setValue(!o.__prev)
  10412. }
  10413. n.superclass.call(this, e, i);
  10414. var o = this;
  10415. this.__prev = this.getValue(),
  10416. this.__checkbox = document.createElement("input"),
  10417. this.__checkbox.setAttribute("type", "checkbox"),
  10418. t.bind(this.__checkbox, "change", r, !1),
  10419. this.domElement.appendChild(this.__checkbox),
  10420. this.updateDisplay()
  10421. };
  10422. return n.superclass = e,
  10423. i.extend(n.prototype, e.prototype, {
  10424. setValue: function(e) {
  10425. var t = n.superclass.prototype.setValue.call(this, e);
  10426. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10427. this.__prev = this.getValue(),
  10428. t
  10429. },
  10430. updateDisplay: function() {
  10431. return this.getValue() === !0 ? (this.__checkbox.setAttribute("checked", "checked"),
  10432. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  10433. n.superclass.prototype.updateDisplay.call(this)
  10434. }
  10435. }),
  10436. n
  10437. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10438. n.color.toString = function(e) {
  10439. return function(t) {
  10440. if (1 == t.a || e.isUndefined(t.a)) {
  10441. for (var i = t.hex.toString(16); i.length < 6; )
  10442. i = "0" + i;
  10443. return "#" + i
  10444. }
  10445. return "rgba(" + Math.round(t.r) + "," + Math.round(t.g) + "," + Math.round(t.b) + "," + t.a + ")"
  10446. }
  10447. }(n.utils.common),
  10448. n.color.interpret = function(e, t) {
  10449. var i, n, r = function() {
  10450. n = !1;
  10451. var e = arguments.length > 1 ? t.toArray(arguments) : arguments[0];
  10452. return t.each(o, function(r) {
  10453. if (r.litmus(e))
  10454. return t.each(r.conversions, function(r, o) {
  10455. if (i = r.read(e),
  10456. n === !1 && i !== !1)
  10457. return n = i,
  10458. i.conversionName = o,
  10459. i.conversion = r,
  10460. t.BREAK
  10461. }),
  10462. t.BREAK
  10463. }),
  10464. n
  10465. }, o = [{
  10466. litmus: t.isString,
  10467. conversions: {
  10468. THREE_CHAR_HEX: {
  10469. read: function(e) {
  10470. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  10471. return null !== t && {
  10472. space: "HEX",
  10473. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  10474. }
  10475. },
  10476. write: e
  10477. },
  10478. SIX_CHAR_HEX: {
  10479. read: function(e) {
  10480. var t = e.match(/^#([A-F0-9]{6})$/i);
  10481. return null !== t && {
  10482. space: "HEX",
  10483. hex: parseInt("0x" + t[1].toString())
  10484. }
  10485. },
  10486. write: e
  10487. },
  10488. CSS_RGB: {
  10489. read: function(e) {
  10490. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  10491. return null !== t && {
  10492. space: "RGB",
  10493. r: parseFloat(t[1]),
  10494. g: parseFloat(t[2]),
  10495. b: parseFloat(t[3])
  10496. }
  10497. },
  10498. write: e
  10499. },
  10500. CSS_RGBA: {
  10501. read: function(e) {
  10502. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  10503. return null !== t && {
  10504. space: "RGB",
  10505. r: parseFloat(t[1]),
  10506. g: parseFloat(t[2]),
  10507. b: parseFloat(t[3]),
  10508. a: parseFloat(t[4])
  10509. }
  10510. },
  10511. write: e
  10512. }
  10513. }
  10514. }, {
  10515. litmus: t.isNumber,
  10516. conversions: {
  10517. HEX: {
  10518. read: function(e) {
  10519. return {
  10520. space: "HEX",
  10521. hex: e,
  10522. conversionName: "HEX"
  10523. }
  10524. },
  10525. write: function(e) {
  10526. return e.hex
  10527. }
  10528. }
  10529. }
  10530. }, {
  10531. litmus: t.isArray,
  10532. conversions: {
  10533. RGB_ARRAY: {
  10534. read: function(e) {
  10535. return 3 == e.length && {
  10536. space: "RGB",
  10537. r: e[0],
  10538. g: e[1],
  10539. b: e[2]
  10540. }
  10541. },
  10542. write: function(e) {
  10543. return [e.r, e.g, e.b]
  10544. }
  10545. },
  10546. RGBA_ARRAY: {
  10547. read: function(e) {
  10548. return 4 == e.length && {
  10549. space: "RGB",
  10550. r: e[0],
  10551. g: e[1],
  10552. b: e[2],
  10553. a: e[3]
  10554. }
  10555. },
  10556. write: function(e) {
  10557. return [e.r, e.g, e.b, e.a]
  10558. }
  10559. }
  10560. }
  10561. }, {
  10562. litmus: t.isObject,
  10563. conversions: {
  10564. RGBA_OBJ: {
  10565. read: function(e) {
  10566. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b) && t.isNumber(e.a)) && {
  10567. space: "RGB",
  10568. r: e.r,
  10569. g: e.g,
  10570. b: e.b,
  10571. a: e.a
  10572. }
  10573. },
  10574. write: function(e) {
  10575. return {
  10576. r: e.r,
  10577. g: e.g,
  10578. b: e.b,
  10579. a: e.a
  10580. }
  10581. }
  10582. },
  10583. RGB_OBJ: {
  10584. read: function(e) {
  10585. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b)) && {
  10586. space: "RGB",
  10587. r: e.r,
  10588. g: e.g,
  10589. b: e.b
  10590. }
  10591. },
  10592. write: function(e) {
  10593. return {
  10594. r: e.r,
  10595. g: e.g,
  10596. b: e.b
  10597. }
  10598. }
  10599. },
  10600. HSVA_OBJ: {
  10601. read: function(e) {
  10602. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v) && t.isNumber(e.a)) && {
  10603. space: "HSV",
  10604. h: e.h,
  10605. s: e.s,
  10606. v: e.v,
  10607. a: e.a
  10608. }
  10609. },
  10610. write: function(e) {
  10611. return {
  10612. h: e.h,
  10613. s: e.s,
  10614. v: e.v,
  10615. a: e.a
  10616. }
  10617. }
  10618. },
  10619. HSV_OBJ: {
  10620. read: function(e) {
  10621. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v)) && {
  10622. space: "HSV",
  10623. h: e.h,
  10624. s: e.s,
  10625. v: e.v
  10626. }
  10627. },
  10628. write: function(e) {
  10629. return {
  10630. h: e.h,
  10631. s: e.s,
  10632. v: e.v
  10633. }
  10634. }
  10635. }
  10636. }
  10637. }];
  10638. return r
  10639. }(n.color.toString, n.utils.common),
  10640. n.GUI = n.gui.GUI = function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f) {
  10641. function g(e, t, i, o) {
  10642. if (void 0 === t[i])
  10643. throw new Error("Object " + t + ' has no property "' + i + '"');
  10644. var a;
  10645. if (o.color)
  10646. a = new h(t,i);
  10647. else {
  10648. var s = [t, i].concat(o.factoryArgs);
  10649. a = n.apply(e, s)
  10650. }
  10651. o.before instanceof r && (o.before = o.before.__li),
  10652. A(e, a),
  10653. p.addClass(a.domElement, "c");
  10654. var l = document.createElement("span");
  10655. p.addClass(l, "property-name"),
  10656. l.innerHTML = a.property;
  10657. var c = document.createElement("div");
  10658. c.appendChild(l),
  10659. c.appendChild(a.domElement);
  10660. var u = m(e, c, o.before);
  10661. return p.addClass(u, V.CLASS_CONTROLLER_ROW),
  10662. p.addClass(u, typeof a.getValue()),
  10663. v(e, u, a),
  10664. e.__controllers.push(a),
  10665. a
  10666. }
  10667. function m(e, t, i) {
  10668. var n = document.createElement("li");
  10669. return t && n.appendChild(t),
  10670. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10671. e.onResize(),
  10672. n
  10673. }
  10674. function v(e, t, i) {
  10675. if (i.__li = t,
  10676. i.__gui = e,
  10677. f.extend(i, {
  10678. options: function(t) {
  10679. return arguments.length > 1 ? (i.remove(),
  10680. g(e, i.object, i.property, {
  10681. before: i.__li.nextElementSibling,
  10682. factoryArgs: [f.toArray(arguments)]
  10683. })) : f.isArray(t) || f.isObject(t) ? (i.remove(),
  10684. g(e, i.object, i.property, {
  10685. before: i.__li.nextElementSibling,
  10686. factoryArgs: [t]
  10687. })) : void 0
  10688. },
  10689. name: function(e) {
  10690. return i.__li.firstElementChild.firstElementChild.innerHTML = e,
  10691. i
  10692. },
  10693. listen: function() {
  10694. return i.__gui.listen(i),
  10695. i
  10696. },
  10697. remove: function() {
  10698. return i.__gui.remove(i),
  10699. i
  10700. }
  10701. }),
  10702. i instanceof l) {
  10703. var n = new s(i.object,i.property,{
  10704. min: i.__min,
  10705. max: i.__max,
  10706. step: i.__step
  10707. });
  10708. f.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10709. var t = i[e]
  10710. , r = n[e];
  10711. i[e] = n[e] = function() {
  10712. var e = Array.prototype.slice.call(arguments);
  10713. return t.apply(i, e),
  10714. r.apply(n, e)
  10715. }
  10716. }),
  10717. p.addClass(t, "has-slider"),
  10718. i.domElement.insertBefore(n.domElement, i.domElement.firstElementChild)
  10719. } else if (i instanceof s) {
  10720. var r = function(t) {
  10721. return f.isNumber(i.__min) && f.isNumber(i.__max) ? (i.remove(),
  10722. g(e, i.object, i.property, {
  10723. before: i.__li.nextElementSibling,
  10724. factoryArgs: [i.__min, i.__max, i.__step]
  10725. })) : t
  10726. };
  10727. i.min = f.compose(r, i.min),
  10728. i.max = f.compose(r, i.max)
  10729. } else
  10730. i instanceof o ? (p.bind(t, "click", function() {
  10731. p.fakeEvent(i.__checkbox, "click")
  10732. }),
  10733. p.bind(i.__checkbox, "click", function(e) {
  10734. e.stopPropagation()
  10735. })) : i instanceof a ? (p.bind(t, "click", function() {
  10736. p.fakeEvent(i.__button, "click")
  10737. }),
  10738. p.bind(t, "mouseover", function() {
  10739. p.addClass(i.__button, "hover")
  10740. }),
  10741. p.bind(t, "mouseout", function() {
  10742. p.removeClass(i.__button, "hover")
  10743. })) : i instanceof h && (p.addClass(t, "color"),
  10744. i.updateDisplay = f.compose(function(e) {
  10745. return t.style.borderLeftColor = i.__color.toString(),
  10746. e
  10747. }, i.updateDisplay),
  10748. i.updateDisplay());
  10749. i.setValue = f.compose(function(t) {
  10750. return e.getRoot().__preset_select && i.isModified() && T(e.getRoot(), !0),
  10751. t
  10752. }, i.setValue)
  10753. }
  10754. function A(e, t) {
  10755. var i = e.getRoot()
  10756. , n = i.__rememberedObjects.indexOf(t.object);
  10757. if (n != -1) {
  10758. var r = i.__rememberedObjectIndecesToControllers[n];
  10759. if (void 0 === r && (r = {},
  10760. i.__rememberedObjectIndecesToControllers[n] = r),
  10761. r[t.property] = t,
  10762. i.load && i.load.remembered) {
  10763. var o, a = i.load.remembered;
  10764. if (a[e.preset])
  10765. o = a[e.preset];
  10766. else {
  10767. if (!a[L])
  10768. return;
  10769. o = a[L]
  10770. }
  10771. if (o[n] && void 0 !== o[n][t.property]) {
  10772. var s = o[n][t.property];
  10773. t.initialValue = s,
  10774. t.setValue(s)
  10775. }
  10776. }
  10777. }
  10778. }
  10779. function y(e, t) {
  10780. return document.location.href + "." + t
  10781. }
  10782. function C(e) {
  10783. var t = e.__save_row = document.createElement("li");
  10784. p.addClass(e.domElement, "has-save"),
  10785. e.__ul.insertBefore(t, e.__ul.firstChild),
  10786. p.addClass(t, "save-row");
  10787. var i = document.createElement("span");
  10788. i.innerHTML = "&nbsp;",
  10789. p.addClass(i, "button gears");
  10790. var n = document.createElement("span");
  10791. n.innerHTML = "Save",
  10792. p.addClass(n, "button"),
  10793. p.addClass(n, "save");
  10794. var r = document.createElement("span");
  10795. r.innerHTML = "New",
  10796. p.addClass(r, "button"),
  10797. p.addClass(r, "save-as");
  10798. var o = document.createElement("span");
  10799. o.innerHTML = "Revert",
  10800. p.addClass(o, "button"),
  10801. p.addClass(o, "revert");
  10802. var a = e.__preset_select = document.createElement("select");
  10803. if (e.load && e.load.remembered ? f.each(e.load.remembered, function(t, i) {
  10804. w(e, i, i == e.preset)
  10805. }) : w(e, L, !1),
  10806. p.bind(a, "change", function() {
  10807. for (var t = 0; t < e.__preset_select.length; t++)
  10808. e.__preset_select[t].innerHTML = e.__preset_select[t].value;
  10809. e.preset = this.value
  10810. }),
  10811. t.appendChild(a),
  10812. t.appendChild(i),
  10813. t.appendChild(n),
  10814. t.appendChild(r),
  10815. t.appendChild(o),
  10816. D) {
  10817. var s = document.getElementById("dg-save-locally")
  10818. , l = document.getElementById("dg-local-explain");
  10819. s.style.display = "block";
  10820. var c = document.getElementById("dg-local-storage");
  10821. "true" === localStorage.getItem(y(e, "isLocal")) && c.setAttribute("checked", "checked");
  10822. var h = function() {
  10823. l.style.display = e.useLocalStorage ? "block" : "none"
  10824. };
  10825. h(),
  10826. p.bind(c, "change", function() {
  10827. e.useLocalStorage = !e.useLocalStorage,
  10828. h()
  10829. })
  10830. }
  10831. var u = document.getElementById("dg-new-constructor");
  10832. p.bind(u, "keydown", function(e) {
  10833. !e.metaKey || 67 !== e.which && 67 != e.keyCode || S.hide()
  10834. }),
  10835. p.bind(i, "click", function() {
  10836. u.innerHTML = JSON.stringify(e.getSaveObject(), void 0, 2),
  10837. S.show(),
  10838. u.focus(),
  10839. u.select()
  10840. }),
  10841. p.bind(n, "click", function() {
  10842. e.save()
  10843. }),
  10844. p.bind(r, "click", function() {
  10845. var t = prompt("Enter a new preset name.");
  10846. t && e.saveAs(t)
  10847. }),
  10848. p.bind(o, "click", function() {
  10849. e.revert()
  10850. })
  10851. }
  10852. function I(e) {
  10853. function t(t) {
  10854. return t.preventDefault(),
  10855. r = t.clientX,
  10856. p.addClass(e.__closeButton, V.CLASS_DRAG),
  10857. p.bind(window, "mousemove", i),
  10858. p.bind(window, "mouseup", n),
  10859. !1
  10860. }
  10861. function i(t) {
  10862. return t.preventDefault(),
  10863. e.width += r - t.clientX,
  10864. e.onResize(),
  10865. r = t.clientX,
  10866. !1
  10867. }
  10868. function n() {
  10869. p.removeClass(e.__closeButton, V.CLASS_DRAG),
  10870. p.unbind(window, "mousemove", i),
  10871. p.unbind(window, "mouseup", n)
  10872. }
  10873. e.__resize_handle = document.createElement("div"),
  10874. f.extend(e.__resize_handle.style, {
  10875. width: "6px",
  10876. marginLeft: "-3px",
  10877. height: "200px",
  10878. cursor: "ew-resize",
  10879. position: "absolute"
  10880. });
  10881. var r;
  10882. p.bind(e.__resize_handle, "mousedown", t),
  10883. p.bind(e.__closeButton, "mousedown", t),
  10884. e.domElement.insertBefore(e.__resize_handle, e.domElement.firstElementChild)
  10885. }
  10886. function E(e, t) {
  10887. e.domElement.style.width = t + "px",
  10888. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10889. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10890. }
  10891. function b(e, t) {
  10892. var i = {};
  10893. return f.each(e.__rememberedObjects, function(n, r) {
  10894. var o = {}
  10895. , a = e.__rememberedObjectIndecesToControllers[r];
  10896. f.each(a, function(e, i) {
  10897. o[i] = t ? e.initialValue : e.getValue()
  10898. }),
  10899. i[r] = o
  10900. }),
  10901. i
  10902. }
  10903. function w(e, t, i) {
  10904. var n = document.createElement("option");
  10905. n.innerHTML = t,
  10906. n.value = t,
  10907. e.__preset_select.appendChild(n),
  10908. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10909. }
  10910. function _(e) {
  10911. for (var t = 0; t < e.__preset_select.length; t++)
  10912. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10913. }
  10914. function T(e, t) {
  10915. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10916. t ? i.innerHTML = i.value + "*" : i.innerHTML = i.value
  10917. }
  10918. function x(e) {
  10919. 0 != e.length && u(function() {
  10920. x(e)
  10921. }),
  10922. f.each(e, function(e) {
  10923. e.updateDisplay()
  10924. })
  10925. }
  10926. e.inject(i);
  10927. var S, M, R = "dg", P = 72, O = 20, L = "Default", D = function() {
  10928. try {
  10929. return "localStorage"in window && null !== window.localStorage
  10930. } catch (e) {
  10931. return !1
  10932. }
  10933. }(), N = !0, B = !1, F = [], V = function(e) {
  10934. function t() {
  10935. var e = i.getRoot();
  10936. e.width += 1,
  10937. f.defer(function() {
  10938. e.width -= 1
  10939. })
  10940. }
  10941. var i = this;
  10942. this.domElement = document.createElement("div"),
  10943. this.__ul = document.createElement("ul"),
  10944. this.domElement.appendChild(this.__ul),
  10945. p.addClass(this.domElement, R),
  10946. this.__folders = {},
  10947. this.__controllers = [],
  10948. this.__rememberedObjects = [],
  10949. this.__rememberedObjectIndecesToControllers = [],
  10950. this.__listening = [],
  10951. e = e || {},
  10952. e = f.defaults(e, {
  10953. autoPlace: !0,
  10954. width: V.DEFAULT_WIDTH
  10955. }),
  10956. e = f.defaults(e, {
  10957. resizable: e.autoPlace,
  10958. hideable: e.autoPlace
  10959. }),
  10960. f.isUndefined(e.load) ? e.load = {
  10961. preset: L
  10962. } : e.preset && (e.load.preset = e.preset),
  10963. f.isUndefined(e.parent) && e.hideable && F.push(this),
  10964. e.resizable = f.isUndefined(e.parent) && e.resizable,
  10965. e.autoPlace && f.isUndefined(e.scrollable) && (e.scrollable = !0);
  10966. var n, r = D && "true" === localStorage.getItem(y(this, "isLocal"));
  10967. if (Object.defineProperties(this, {
  10968. parent: {
  10969. get: function() {
  10970. return e.parent
  10971. }
  10972. },
  10973. scrollable: {
  10974. get: function() {
  10975. return e.scrollable
  10976. }
  10977. },
  10978. autoPlace: {
  10979. get: function() {
  10980. return e.autoPlace
  10981. }
  10982. },
  10983. preset: {
  10984. get: function() {
  10985. return i.parent ? i.getRoot().preset : e.load.preset
  10986. },
  10987. set: function(t) {
  10988. i.parent ? i.getRoot().preset = t : e.load.preset = t,
  10989. _(this),
  10990. i.revert()
  10991. }
  10992. },
  10993. width: {
  10994. get: function() {
  10995. return e.width
  10996. },
  10997. set: function(t) {
  10998. e.width = t,
  10999. E(i, t)
  11000. }
  11001. },
  11002. name: {
  11003. get: function() {
  11004. return e.name
  11005. },
  11006. set: function(t) {
  11007. e.name = t,
  11008. a && (a.innerHTML = e.name)
  11009. }
  11010. },
  11011. closed: {
  11012. get: function() {
  11013. return e.closed
  11014. },
  11015. set: function(t) {
  11016. e.closed = t,
  11017. e.closed ? p.addClass(i.__ul, V.CLASS_CLOSED) : p.removeClass(i.__ul, V.CLASS_CLOSED),
  11018. this.onResize(),
  11019. i.__closeButton && (i.__closeButton.innerHTML = t ? V.TEXT_OPEN : V.TEXT_CLOSED)
  11020. }
  11021. },
  11022. load: {
  11023. get: function() {
  11024. return e.load
  11025. }
  11026. },
  11027. useLocalStorage: {
  11028. get: function() {
  11029. return r
  11030. },
  11031. set: function(e) {
  11032. D && (r = e,
  11033. e ? p.bind(window, "unload", n) : p.unbind(window, "unload", n),
  11034. localStorage.setItem(y(i, "isLocal"), e))
  11035. }
  11036. }
  11037. }),
  11038. f.isUndefined(e.parent)) {
  11039. if (e.closed = !1,
  11040. p.addClass(this.domElement, V.CLASS_MAIN),
  11041. p.makeSelectable(this.domElement, !1),
  11042. D && r) {
  11043. i.useLocalStorage = !0;
  11044. var o = localStorage.getItem(y(this, "gui"));
  11045. o && (e.load = JSON.parse(o))
  11046. }
  11047. this.__closeButton = document.createElement("div"),
  11048. this.__closeButton.innerHTML = V.TEXT_CLOSED,
  11049. p.addClass(this.__closeButton, V.CLASS_CLOSE_BUTTON),
  11050. this.domElement.appendChild(this.__closeButton),
  11051. p.bind(this.__closeButton, "click", function() {
  11052. i.closed = !i.closed
  11053. })
  11054. } else {
  11055. void 0 === e.closed && (e.closed = !0);
  11056. var a = document.createTextNode(e.name);
  11057. p.addClass(a, "controller-name");
  11058. var s = m(i, a)
  11059. , l = function(e) {
  11060. return e.preventDefault(),
  11061. i.closed = !i.closed,
  11062. !1
  11063. };
  11064. p.addClass(this.__ul, V.CLASS_CLOSED),
  11065. p.addClass(s, "title"),
  11066. p.bind(s, "click", l),
  11067. e.closed || (this.closed = !1)
  11068. }
  11069. e.autoPlace && (f.isUndefined(e.parent) && (N && (M = document.createElement("div"),
  11070. p.addClass(M, R),
  11071. p.addClass(M, V.CLASS_AUTO_PLACE_CONTAINER),
  11072. document.body.appendChild(M),
  11073. N = !1),
  11074. M.appendChild(this.domElement),
  11075. p.addClass(this.domElement, V.CLASS_AUTO_PLACE)),
  11076. this.parent || E(i, e.width)),
  11077. p.bind(window, "resize", function() {
  11078. i.onResize()
  11079. }),
  11080. p.bind(this.__ul, "webkitTransitionEnd", function() {
  11081. i.onResize()
  11082. }),
  11083. p.bind(this.__ul, "transitionend", function() {
  11084. i.onResize()
  11085. }),
  11086. p.bind(this.__ul, "oTransitionEnd", function() {
  11087. i.onResize()
  11088. }),
  11089. this.onResize(),
  11090. e.resizable && I(this),
  11091. n = function() {
  11092. D && "true" === localStorage.getItem(y(i, "isLocal")) && localStorage.setItem(y(i, "gui"), JSON.stringify(i.getSaveObject()))
  11093. }
  11094. ,
  11095. this.saveToLocalStorageIfPossible = n;
  11096. i.getRoot();
  11097. e.parent || t()
  11098. };
  11099. return V.toggleHide = function() {
  11100. B = !B,
  11101. f.each(F, function(e) {
  11102. e.domElement.style.zIndex = B ? -999 : 999,
  11103. e.domElement.style.opacity = B ? 0 : 1
  11104. })
  11105. }
  11106. ,
  11107. V.CLASS_AUTO_PLACE = "a",
  11108. V.CLASS_AUTO_PLACE_CONTAINER = "ac",
  11109. V.CLASS_MAIN = "main",
  11110. V.CLASS_CONTROLLER_ROW = "cr",
  11111. V.CLASS_TOO_TALL = "taller-than-window",
  11112. V.CLASS_CLOSED = "closed",
  11113. V.CLASS_CLOSE_BUTTON = "close-button",
  11114. V.CLASS_DRAG = "drag",
  11115. V.DEFAULT_WIDTH = 245,
  11116. V.TEXT_CLOSED = "Close Controls",
  11117. V.TEXT_OPEN = "Open Controls",
  11118. p.bind(window, "keydown", function(e) {
  11119. "text" === document.activeElement.type || e.which !== P && e.keyCode != P || V.toggleHide()
  11120. }, !1),
  11121. f.extend(V.prototype, {
  11122. add: function(e, t) {
  11123. return g(this, e, t, {
  11124. factoryArgs: Array.prototype.slice.call(arguments, 2)
  11125. })
  11126. },
  11127. addColor: function(e, t) {
  11128. return g(this, e, t, {
  11129. color: !0
  11130. })
  11131. },
  11132. remove: function(e) {
  11133. this.__ul.removeChild(e.__li),
  11134. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  11135. var t = this;
  11136. f.defer(function() {
  11137. t.onResize()
  11138. })
  11139. },
  11140. destroy: function() {
  11141. this.autoPlace && M.removeChild(this.domElement)
  11142. },
  11143. addFolder: function(e) {
  11144. if (void 0 !== this.__folders[e])
  11145. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  11146. var t = {
  11147. name: e,
  11148. parent: this
  11149. };
  11150. t.autoPlace = this.autoPlace,
  11151. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  11152. t.load = this.load.folders[e]);
  11153. var i = new V(t);
  11154. this.__folders[e] = i;
  11155. var n = m(this, i.domElement);
  11156. return p.addClass(n, "folder"),
  11157. i
  11158. },
  11159. open: function() {
  11160. this.closed = !1
  11161. },
  11162. close: function() {
  11163. this.closed = !0
  11164. },
  11165. onResize: function() {
  11166. var e = this.getRoot();
  11167. if (e.scrollable) {
  11168. var t = p.getOffset(e.__ul).top
  11169. , i = 0;
  11170. f.each(e.__ul.childNodes, function(t) {
  11171. e.autoPlace && t === e.__save_row || (i += p.getHeight(t))
  11172. }),
  11173. $("#player").height() - t - O < i ? (p.addClass(e.domElement, V.CLASS_TOO_TALL),
  11174. e.__ul.style.height = $("#player").height() - t - O + "px") : (p.removeClass(e.domElement, V.CLASS_TOO_TALL),
  11175. e.__ul.style.height = "auto")
  11176. }
  11177. e.__resize_handle && f.defer(function() {
  11178. e.__resize_handle.style.height = e.__ul.offsetHeight + "px"
  11179. }),
  11180. e.__closeButton && (e.__closeButton.style.width = e.width + "px")
  11181. },
  11182. remember: function() {
  11183. if (f.isUndefined(S) && (S = new d,
  11184. S.domElement.innerHTML = t),
  11185. this.parent)
  11186. throw new Error("You can only call remember on a top level GUI.");
  11187. var e = this;
  11188. f.each(Array.prototype.slice.call(arguments), function(t) {
  11189. 0 == e.__rememberedObjects.length && C(e),
  11190. e.__rememberedObjects.indexOf(t) == -1 && e.__rememberedObjects.push(t)
  11191. }),
  11192. this.autoPlace && E(this, this.width)
  11193. },
  11194. getRoot: function() {
  11195. for (var e = this; e.parent; )
  11196. e = e.parent;
  11197. return e
  11198. },
  11199. getSaveObject: function() {
  11200. var e = this.load;
  11201. return e.closed = this.closed,
  11202. this.__rememberedObjects.length > 0 && (e.preset = this.preset,
  11203. e.remembered || (e.remembered = {}),
  11204. e.remembered[this.preset] = b(this)),
  11205. e.folders = {},
  11206. f.each(this.__folders, function(t, i) {
  11207. e.folders[i] = t.getSaveObject()
  11208. }),
  11209. e
  11210. },
  11211. save: function() {
  11212. this.load.remembered || (this.load.remembered = {}),
  11213. this.load.remembered[this.preset] = b(this),
  11214. T(this, !1),
  11215. this.saveToLocalStorageIfPossible()
  11216. },
  11217. saveAs: function(e) {
  11218. this.load.remembered || (this.load.remembered = {},
  11219. this.load.remembered[L] = b(this, !0)),
  11220. this.load.remembered[e] = b(this),
  11221. this.preset = e,
  11222. w(this, e, !0),
  11223. this.saveToLocalStorageIfPossible()
  11224. },
  11225. revert: function(e) {
  11226. f.each(this.__controllers, function(t) {
  11227. this.getRoot().load.remembered ? A(e || this.getRoot(), t) : t.setValue(t.initialValue)
  11228. }, this),
  11229. f.each(this.__folders, function(e) {
  11230. e.revert(e)
  11231. }),
  11232. e || T(this.getRoot(), !1)
  11233. },
  11234. listen: function(e) {
  11235. var t = 0 == this.__listening.length;
  11236. this.__listening.push(e),
  11237. t && x(this.__listening)
  11238. }
  11239. }),
  11240. V
  11241. }(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) {
  11242. return function(s, l) {
  11243. var c = s[l];
  11244. 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,{
  11245. min: arguments[2],
  11246. max: arguments[3]
  11247. }) : a.isString(c) ? new n(s,l) : a.isFunction(c) ? new r(s,l,"") : a.isBoolean(c) ? new o(s,l) : void 0
  11248. }
  11249. }(n.controllers.OptionController, n.controllers.NumberControllerBox, n.controllers.NumberControllerSlider, n.controllers.StringController = function(e, t, i) {
  11250. var n = function(e, i) {
  11251. function r() {
  11252. a.setValue(a.__input.value)
  11253. }
  11254. function o() {
  11255. a.__onFinishChange && a.__onFinishChange.call(a, a.getValue())
  11256. }
  11257. n.superclass.call(this, e, i);
  11258. var a = this;
  11259. this.__input = document.createElement("input"),
  11260. this.__input.setAttribute("type", "text"),
  11261. t.bind(this.__input, "keyup", r),
  11262. t.bind(this.__input, "change", r),
  11263. t.bind(this.__input, "blur", o),
  11264. t.bind(this.__input, "keydown", function(e) {
  11265. 13 === e.keyCode && this.blur()
  11266. }),
  11267. this.updateDisplay(),
  11268. this.domElement.appendChild(this.__input)
  11269. };
  11270. return n.superclass = e,
  11271. i.extend(n.prototype, e.prototype, {
  11272. updateDisplay: function() {
  11273. return t.isActive(this.__input) || (this.__input.value = this.getValue()),
  11274. n.superclass.prototype.updateDisplay.call(this)
  11275. }
  11276. }),
  11277. n
  11278. }(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) {
  11279. function o(e, t, i, n) {
  11280. e.style.background = "",
  11281. r.each(l, function(r) {
  11282. e.style.cssText += "background: " + r + "linear-gradient(" + t + ", " + i + " 0%, " + n + " 100%); "
  11283. })
  11284. }
  11285. function a(e) {
  11286. e.style.background = "",
  11287. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  11288. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11289. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11290. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11291. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  11292. }
  11293. var s = function(e, l) {
  11294. function c(e) {
  11295. p(e),
  11296. t.bind(window, "mousemove", p),
  11297. t.bind(window, "mouseup", h)
  11298. }
  11299. function h() {
  11300. t.unbind(window, "mousemove", p),
  11301. t.unbind(window, "mouseup", h)
  11302. }
  11303. function u() {
  11304. var e = n(this.value);
  11305. e !== !1 ? (g.__color.__state = e,
  11306. g.setValue(g.__color.toOriginal())) : this.value = g.__color.toString()
  11307. }
  11308. function d() {
  11309. t.unbind(window, "mousemove", f),
  11310. t.unbind(window, "mouseup", d)
  11311. }
  11312. function p(e) {
  11313. e.preventDefault();
  11314. var i = t.getWidth(g.__saturation_field)
  11315. , n = t.getOffset(g.__saturation_field)
  11316. , r = (e.clientX - n.left + document.body.scrollLeft) / i
  11317. , o = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  11318. return o > 1 ? o = 1 : o < 0 && (o = 0),
  11319. r > 1 ? r = 1 : r < 0 && (r = 0),
  11320. g.__color.v = o,
  11321. g.__color.s = r,
  11322. g.setValue(g.__color.toOriginal()),
  11323. !1
  11324. }
  11325. function f(e) {
  11326. e.preventDefault();
  11327. var i = t.getHeight(g.__hue_field)
  11328. , n = t.getOffset(g.__hue_field)
  11329. , r = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  11330. return r > 1 ? r = 1 : r < 0 && (r = 0),
  11331. g.__color.h = 360 * r,
  11332. g.setValue(g.__color.toOriginal()),
  11333. !1
  11334. }
  11335. s.superclass.call(this, e, l),
  11336. this.__color = new i(this.getValue()),
  11337. this.__temp = new i(0);
  11338. var g = this;
  11339. this.domElement = document.createElement("div"),
  11340. t.makeSelectable(this.domElement, !1),
  11341. this.__selector = document.createElement("div"),
  11342. this.__selector.className = "selector",
  11343. this.__saturation_field = document.createElement("div"),
  11344. this.__saturation_field.className = "saturation-field",
  11345. this.__field_knob = document.createElement("div"),
  11346. this.__field_knob.className = "field-knob",
  11347. this.__field_knob_border = "2px solid ",
  11348. this.__hue_knob = document.createElement("div"),
  11349. this.__hue_knob.className = "hue-knob",
  11350. this.__hue_field = document.createElement("div"),
  11351. this.__hue_field.className = "hue-field",
  11352. this.__input = document.createElement("input"),
  11353. this.__input.type = "text",
  11354. this.__input_textShadow = "0 1px 1px ",
  11355. t.bind(this.__input, "keydown", function(e) {
  11356. 13 === e.keyCode && u.call(this)
  11357. }),
  11358. t.bind(this.__input, "blur", u),
  11359. t.bind(this.__selector, "mousedown", function(e) {
  11360. t.addClass(this, "drag").bind(window, "mouseup", function(e) {
  11361. t.removeClass(g.__selector, "drag")
  11362. })
  11363. });
  11364. var m = document.createElement("div");
  11365. r.extend(this.__selector.style, {
  11366. width: "122px",
  11367. height: "102px",
  11368. padding: "3px",
  11369. backgroundColor: "#222",
  11370. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  11371. }),
  11372. r.extend(this.__field_knob.style, {
  11373. position: "absolute",
  11374. width: "12px",
  11375. height: "12px",
  11376. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  11377. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  11378. borderRadius: "12px",
  11379. zIndex: 1
  11380. }),
  11381. r.extend(this.__hue_knob.style, {
  11382. position: "absolute",
  11383. width: "15px",
  11384. height: "2px",
  11385. borderRight: "4px solid #fff",
  11386. zIndex: 1
  11387. }),
  11388. r.extend(this.__saturation_field.style, {
  11389. width: "100px",
  11390. height: "100px",
  11391. border: "1px solid #555",
  11392. marginRight: "3px",
  11393. display: "inline-block",
  11394. cursor: "pointer"
  11395. }),
  11396. r.extend(m.style, {
  11397. width: "100%",
  11398. height: "100%",
  11399. background: "none"
  11400. }),
  11401. o(m, "top", "rgba(0,0,0,0)", "#000"),
  11402. r.extend(this.__hue_field.style, {
  11403. width: "15px",
  11404. height: "100px",
  11405. display: "inline-block",
  11406. border: "1px solid #555",
  11407. cursor: "ns-resize"
  11408. }),
  11409. a(this.__hue_field),
  11410. r.extend(this.__input.style, {
  11411. outline: "none",
  11412. textAlign: "center",
  11413. color: "#fff",
  11414. border: 0,
  11415. fontWeight: "bold",
  11416. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  11417. }),
  11418. t.bind(this.__saturation_field, "mousedown", c),
  11419. t.bind(this.__field_knob, "mousedown", c),
  11420. t.bind(this.__hue_field, "mousedown", function(e) {
  11421. f(e),
  11422. t.bind(window, "mousemove", f),
  11423. t.bind(window, "mouseup", d)
  11424. }),
  11425. this.__saturation_field.appendChild(m),
  11426. this.__selector.appendChild(this.__field_knob),
  11427. this.__selector.appendChild(this.__saturation_field),
  11428. this.__selector.appendChild(this.__hue_field),
  11429. this.__hue_field.appendChild(this.__hue_knob),
  11430. this.domElement.appendChild(this.__input),
  11431. this.domElement.appendChild(this.__selector),
  11432. this.updateDisplay()
  11433. };
  11434. s.superclass = e,
  11435. r.extend(s.prototype, e.prototype, {
  11436. updateDisplay: function() {
  11437. var e = n(this.getValue());
  11438. if (e !== !1) {
  11439. var t = !1;
  11440. r.each(i.COMPONENTS, function(i) {
  11441. if (!r.isUndefined(e[i]) && !r.isUndefined(this.__color.__state[i]) && e[i] !== this.__color.__state[i])
  11442. return t = !0,
  11443. {}
  11444. }, this),
  11445. t && r.extend(this.__color.__state, e)
  11446. }
  11447. r.extend(this.__temp.__state, this.__color.__state),
  11448. this.__temp.a = 1;
  11449. var a = this.__color.v < .5 || this.__color.s > .5 ? 255 : 0
  11450. , s = 255 - a;
  11451. r.extend(this.__field_knob.style, {
  11452. marginLeft: 100 * this.__color.s - 7 + "px",
  11453. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  11454. backgroundColor: this.__temp.toString(),
  11455. border: this.__field_knob_border + "rgb(" + a + "," + a + "," + a + ")"
  11456. }),
  11457. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  11458. this.__temp.s = 1,
  11459. this.__temp.v = 1,
  11460. o(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  11461. r.extend(this.__input.style, {
  11462. backgroundColor: this.__input.value = this.__color.toString(),
  11463. color: "rgb(" + a + "," + a + "," + a + ")",
  11464. textShadow: this.__input_textShadow + "rgba(" + s + "," + s + "," + s + ",.7)"
  11465. })
  11466. }
  11467. });
  11468. var l = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  11469. return s
  11470. }(n.controllers.Controller, n.dom.dom, n.color.Color = function(e, t, i, n) {
  11471. function r(e, t, i) {
  11472. Object.defineProperty(e, t, {
  11473. get: function() {
  11474. return "RGB" === this.__state.space ? this.__state[t] : (a(this, t, i),
  11475. this.__state[t])
  11476. },
  11477. set: function(e) {
  11478. "RGB" !== this.__state.space && (a(this, t, i),
  11479. this.__state.space = "RGB"),
  11480. this.__state[t] = e
  11481. }
  11482. })
  11483. }
  11484. function o(e, t) {
  11485. Object.defineProperty(e, t, {
  11486. get: function() {
  11487. return "HSV" === this.__state.space ? this.__state[t] : (s(this),
  11488. this.__state[t])
  11489. },
  11490. set: function(e) {
  11491. "HSV" !== this.__state.space && (s(this),
  11492. this.__state.space = "HSV"),
  11493. this.__state[t] = e
  11494. }
  11495. })
  11496. }
  11497. function a(e, i, r) {
  11498. if ("HEX" === e.__state.space)
  11499. e.__state[i] = t.component_from_hex(e.__state.hex, r);
  11500. else {
  11501. if ("HSV" !== e.__state.space)
  11502. throw "Corrupted color state";
  11503. n.extend(e.__state, t.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  11504. }
  11505. }
  11506. function s(e) {
  11507. var i = t.rgb_to_hsv(e.r, e.g, e.b);
  11508. n.extend(e.__state, {
  11509. s: i.s,
  11510. v: i.v
  11511. }),
  11512. n.isNaN(i.h) ? n.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = i.h
  11513. }
  11514. var l = function() {
  11515. if (this.__state = e.apply(this, arguments),
  11516. this.__state === !1)
  11517. throw "Failed to interpret color arguments";
  11518. this.__state.a = this.__state.a || 1
  11519. };
  11520. return l.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  11521. n.extend(l.prototype, {
  11522. toString: function() {
  11523. return i(this)
  11524. },
  11525. toOriginal: function() {
  11526. return this.__state.conversion.write(this)
  11527. }
  11528. }),
  11529. r(l.prototype, "r", 2),
  11530. r(l.prototype, "g", 1),
  11531. r(l.prototype, "b", 0),
  11532. o(l.prototype, "h"),
  11533. o(l.prototype, "s"),
  11534. o(l.prototype, "v"),
  11535. Object.defineProperty(l.prototype, "a", {
  11536. get: function() {
  11537. return this.__state.a
  11538. },
  11539. set: function(e) {
  11540. this.__state.a = e
  11541. }
  11542. }),
  11543. Object.defineProperty(l.prototype, "hex", {
  11544. get: function() {
  11545. return "HEX" !== !this.__state.space && (this.__state.hex = t.rgb_to_hex(this.r, this.g, this.b)),
  11546. this.__state.hex
  11547. },
  11548. set: function(e) {
  11549. this.__state.space = "HEX",
  11550. this.__state.hex = e
  11551. }
  11552. }),
  11553. l
  11554. }(n.color.interpret, n.color.math = function() {
  11555. var e;
  11556. return {
  11557. hsv_to_rgb: function(e, t, i) {
  11558. var n = Math.floor(e / 60) % 6
  11559. , r = e / 60 - Math.floor(e / 60)
  11560. , o = i * (1 - t)
  11561. , a = i * (1 - r * t)
  11562. , s = i * (1 - (1 - r) * t)
  11563. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  11564. return {
  11565. r: 255 * l[0],
  11566. g: 255 * l[1],
  11567. b: 255 * l[2]
  11568. }
  11569. },
  11570. rgb_to_hsv: function(e, t, i) {
  11571. var n, r, o = Math.min(e, t, i), a = Math.max(e, t, i), s = a - o;
  11572. return 0 == a ? {
  11573. h: NaN,
  11574. s: 0,
  11575. v: 0
  11576. } : (r = s / a,
  11577. n = e == a ? (t - i) / s : t == a ? 2 + (i - e) / s : 4 + (e - t) / s,
  11578. n /= 6,
  11579. n < 0 && (n += 1),
  11580. {
  11581. h: 360 * n,
  11582. s: r,
  11583. v: a / 255
  11584. })
  11585. },
  11586. rgb_to_hex: function(e, t, i) {
  11587. var n = this.hex_with_component(0, 2, e);
  11588. return n = this.hex_with_component(n, 1, t),
  11589. n = this.hex_with_component(n, 0, i)
  11590. },
  11591. component_from_hex: function(e, t) {
  11592. return e >> 8 * t & 255
  11593. },
  11594. hex_with_component: function(t, i, n) {
  11595. return n << (e = 8 * i) | t & ~(255 << e)
  11596. }
  11597. }
  11598. }(), n.color.toString, n.utils.common), n.color.interpret, n.utils.common), n.utils.requestAnimationFrame = function() {
  11599. return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  11600. window.setTimeout(e, 1e3 / 60)
  11601. }
  11602. }(), n.dom.CenteredDiv = function(e, t) {
  11603. var i = function() {
  11604. this.backgroundElement = document.createElement("div"),
  11605. t.extend(this.backgroundElement.style, {
  11606. backgroundColor: "rgba(0,0,0,0.8)",
  11607. top: 0,
  11608. left: 0,
  11609. display: "none",
  11610. zIndex: "1000",
  11611. opacity: 0,
  11612. WebkitTransition: "opacity 0.2s linear"
  11613. }),
  11614. e.makeFullscreen(this.backgroundElement),
  11615. this.backgroundElement.style.position = "fixed",
  11616. this.domElement = document.createElement("div"),
  11617. t.extend(this.domElement.style, {
  11618. position: "fixed",
  11619. display: "none",
  11620. zIndex: "1001",
  11621. opacity: 0,
  11622. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  11623. }),
  11624. document.body.appendChild(this.backgroundElement),
  11625. document.body.appendChild(this.domElement);
  11626. var i = this;
  11627. e.bind(this.backgroundElement, "click", function() {
  11628. i.hide()
  11629. })
  11630. };
  11631. return i.prototype.show = function() {
  11632. var e = this;
  11633. this.backgroundElement.style.display = "block",
  11634. this.domElement.style.display = "block",
  11635. this.domElement.style.opacity = 0,
  11636. this.domElement.style.webkitTransform = "scale(1.1)",
  11637. this.layout(),
  11638. t.defer(function() {
  11639. e.backgroundElement.style.opacity = 1,
  11640. e.domElement.style.opacity = 1,
  11641. e.domElement.style.webkitTransform = "scale(1)"
  11642. })
  11643. }
  11644. ,
  11645. i.prototype.hide = function() {
  11646. var t = this
  11647. , i = function() {
  11648. t.domElement.style.display = "none",
  11649. t.backgroundElement.style.display = "none",
  11650. e.unbind(t.domElement, "webkitTransitionEnd", i),
  11651. e.unbind(t.domElement, "transitionend", i),
  11652. e.unbind(t.domElement, "oTransitionEnd", i)
  11653. };
  11654. e.bind(this.domElement, "webkitTransitionEnd", i),
  11655. e.bind(this.domElement, "transitionend", i),
  11656. e.bind(this.domElement, "oTransitionEnd", i),
  11657. this.backgroundElement.style.opacity = 0,
  11658. this.domElement.style.opacity = 0,
  11659. this.domElement.style.webkitTransform = "scale(1.1)"
  11660. }
  11661. ,
  11662. i.prototype.layout = function() {
  11663. this.domElement.style.left = $("#player").width() / 2 - e.getWidth(this.domElement) / 2 + "px",
  11664. this.domElement.style.top = $("#player").height() / 2 - e.getHeight(this.domElement) / 2 + "px"
  11665. }
  11666. ,
  11667. i
  11668. }(n.dom.dom, n.utils.common), n.dom.dom, n.utils.common)
  11669. }
  11670. , {}],
  11671. 94: [function(e, t, i) {
  11672. (function(e) {
  11673. "use strict";
  11674. function i(t) {
  11675. function i(e) {
  11676. 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++) {
  11677. var n = _((t[i] * e + 50) / 100);
  11678. n < 1 ? n = 1 : n > 255 && (n = 255),
  11679. T[G[i]] = n
  11680. }
  11681. 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++) {
  11682. var a = _((r[o] * e + 50) / 100);
  11683. a < 1 ? a = 1 : a > 255 && (a = 255),
  11684. x[G[o]] = a
  11685. }
  11686. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11687. for (var h = 0; h < 8; h++)
  11688. S[l] = 1 / (T[G[l]] * s[c] * s[h] * 8),
  11689. M[l] = 1 / (x[G[l]] * s[c] * s[h] * 8),
  11690. l++
  11691. }
  11692. function n(e, t) {
  11693. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  11694. for (var a = 1; a <= e[o]; a++)
  11695. r[t[n]] = [],
  11696. r[t[n]][0] = i,
  11697. r[t[n]][1] = o,
  11698. n++,
  11699. i++;
  11700. i *= 2
  11701. }
  11702. return r
  11703. }
  11704. function r() {
  11705. C = n(z, W),
  11706. I = n(X, Z),
  11707. E = n(j, Y),
  11708. b = n(q, K)
  11709. }
  11710. function o() {
  11711. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11712. for (var n = e; n < t; n++)
  11713. P[32767 + n] = i,
  11714. R[32767 + n] = [],
  11715. R[32767 + n][1] = i,
  11716. R[32767 + n][0] = n;
  11717. for (var r = -(t - 1); r <= -e; r++)
  11718. P[32767 + r] = i,
  11719. R[32767 + r] = [],
  11720. R[32767 + r][1] = i,
  11721. R[32767 + r][0] = t - 1 + r;
  11722. e <<= 1,
  11723. t <<= 1
  11724. }
  11725. }
  11726. function a() {
  11727. for (var e = 0; e < 256; e++)
  11728. H[e] = 19595 * e,
  11729. H[e + 256 >> 0] = 38470 * e,
  11730. H[e + 512 >> 0] = 7471 * e + 32768,
  11731. H[e + 768 >> 0] = -11059 * e,
  11732. H[e + 1024 >> 0] = -21709 * e,
  11733. H[e + 1280 >> 0] = 32768 * e + 8421375,
  11734. H[e + 1536 >> 0] = -27439 * e,
  11735. H[e + 1792 >> 0] = -5329 * e
  11736. }
  11737. function s(e) {
  11738. for (var t = e[0], i = e[1] - 1; i >= 0; )
  11739. t & 1 << i && (N |= 1 << B),
  11740. i--,
  11741. B--,
  11742. B < 0 && (255 == N ? (l(255),
  11743. l(0)) : l(N),
  11744. B = 7,
  11745. N = 0)
  11746. }
  11747. function l(e) {
  11748. D.push(e)
  11749. }
  11750. function c(e) {
  11751. l(e >> 8 & 255),
  11752. l(255 & e)
  11753. }
  11754. function h(e, t) {
  11755. var i, n, r, o, a, s, l, c, h, u = 0, d = 8, p = 64;
  11756. for (h = 0; h < d; ++h) {
  11757. i = e[u],
  11758. n = e[u + 1],
  11759. r = e[u + 2],
  11760. o = e[u + 3],
  11761. a = e[u + 4],
  11762. s = e[u + 5],
  11763. l = e[u + 6],
  11764. c = e[u + 7];
  11765. var f = i + c
  11766. , g = i - c
  11767. , m = n + l
  11768. , v = n - l
  11769. , A = r + s
  11770. , y = r - s
  11771. , C = o + a
  11772. , I = o - a
  11773. , E = f + C
  11774. , b = f - C
  11775. , w = m + A
  11776. , _ = m - A;
  11777. e[u] = E + w,
  11778. e[u + 4] = E - w;
  11779. var T = .707106781 * (_ + b);
  11780. e[u + 2] = b + T,
  11781. e[u + 6] = b - T,
  11782. E = I + y,
  11783. w = y + v,
  11784. _ = v + g;
  11785. var x = .382683433 * (E - _)
  11786. , S = .5411961 * E + x
  11787. , M = 1.306562965 * _ + x
  11788. , R = .707106781 * w
  11789. , P = g + R
  11790. , L = g - R;
  11791. e[u + 5] = L + S,
  11792. e[u + 3] = L - S,
  11793. e[u + 1] = P + M,
  11794. e[u + 7] = P - M,
  11795. u += 8
  11796. }
  11797. for (u = 0,
  11798. h = 0; h < d; ++h) {
  11799. i = e[u],
  11800. n = e[u + 8],
  11801. r = e[u + 16],
  11802. o = e[u + 24],
  11803. a = e[u + 32],
  11804. s = e[u + 40],
  11805. l = e[u + 48],
  11806. c = e[u + 56];
  11807. var D = i + c
  11808. , N = i - c
  11809. , B = n + l
  11810. , F = n - l
  11811. , V = r + s
  11812. , U = r - s
  11813. , k = o + a
  11814. , H = o - a
  11815. , G = D + k
  11816. , z = D - k
  11817. , W = B + V
  11818. , j = B - V;
  11819. e[u] = G + W,
  11820. e[u + 32] = G - W;
  11821. var Y = .707106781 * (j + z);
  11822. e[u + 16] = z + Y,
  11823. e[u + 48] = z - Y,
  11824. G = H + U,
  11825. W = U + F,
  11826. j = F + N;
  11827. var X = .382683433 * (G - j)
  11828. , Z = .5411961 * G + X
  11829. , q = 1.306562965 * j + X
  11830. , K = .707106781 * W
  11831. , Q = N + K
  11832. , J = N - K;
  11833. e[u + 40] = J + Z,
  11834. e[u + 24] = J - Z,
  11835. e[u + 8] = Q + q,
  11836. e[u + 56] = Q - q,
  11837. u++
  11838. }
  11839. var $;
  11840. for (h = 0; h < p; ++h)
  11841. $ = e[h] * t[h],
  11842. O[h] = $ > 0 ? $ + .5 | 0 : $ - .5 | 0;
  11843. return O
  11844. }
  11845. function u() {
  11846. c(65504),
  11847. c(16),
  11848. l(74),
  11849. l(70),
  11850. l(73),
  11851. l(70),
  11852. l(0),
  11853. l(1),
  11854. l(1),
  11855. l(0),
  11856. c(1),
  11857. c(1),
  11858. l(0),
  11859. l(0)
  11860. }
  11861. function d(e, t) {
  11862. c(65472),
  11863. c(17),
  11864. l(8),
  11865. c(t),
  11866. c(e),
  11867. l(3),
  11868. l(1),
  11869. l(17),
  11870. l(0),
  11871. l(2),
  11872. l(17),
  11873. l(1),
  11874. l(3),
  11875. l(17),
  11876. l(1)
  11877. }
  11878. function p() {
  11879. c(65499),
  11880. c(132),
  11881. l(0);
  11882. for (var e = 0; e < 64; e++)
  11883. l(T[e]);
  11884. l(1);
  11885. for (var t = 0; t < 64; t++)
  11886. l(x[t])
  11887. }
  11888. function f() {
  11889. c(65476),
  11890. c(418),
  11891. l(0);
  11892. for (var e = 0; e < 16; e++)
  11893. l(z[e + 1]);
  11894. for (var t = 0; t <= 11; t++)
  11895. l(W[t]);
  11896. l(16);
  11897. for (var i = 0; i < 16; i++)
  11898. l(j[i + 1]);
  11899. for (var n = 0; n <= 161; n++)
  11900. l(Y[n]);
  11901. l(1);
  11902. for (var r = 0; r < 16; r++)
  11903. l(X[r + 1]);
  11904. for (var o = 0; o <= 11; o++)
  11905. l(Z[o]);
  11906. l(17);
  11907. for (var a = 0; a < 16; a++)
  11908. l(q[a + 1]);
  11909. for (var s = 0; s <= 161; s++)
  11910. l(K[s])
  11911. }
  11912. function g() {
  11913. c(65498),
  11914. c(12),
  11915. l(3),
  11916. l(1),
  11917. l(0),
  11918. l(2),
  11919. l(17),
  11920. l(3),
  11921. l(17),
  11922. l(0),
  11923. l(63),
  11924. l(0)
  11925. }
  11926. function m(e, t, i, n, r) {
  11927. for (var o, a = r[0], l = r[240], c = 16, u = 63, d = 64, p = h(e, t), f = 0; f < d; ++f)
  11928. L[G[f]] = p[f];
  11929. var g = L[0] - i;
  11930. i = L[0],
  11931. 0 == g ? s(n[0]) : (o = 32767 + g,
  11932. s(n[P[o]]),
  11933. s(R[o]));
  11934. for (var m = 63; m > 0 && 0 == L[m]; m--)
  11935. ;
  11936. if (0 == m)
  11937. return s(a),
  11938. i;
  11939. for (var v, A = 1; A <= m; ) {
  11940. for (var y = A; 0 == L[A] && A <= m; ++A)
  11941. ;
  11942. var C = A - y;
  11943. if (C >= c) {
  11944. v = C >> 4;
  11945. for (var I = 1; I <= v; ++I)
  11946. s(l);
  11947. C &= 15
  11948. }
  11949. o = 32767 + L[A],
  11950. s(r[(C << 4) + P[o]]),
  11951. s(R[o]),
  11952. A++
  11953. }
  11954. return m != u && s(a),
  11955. i
  11956. }
  11957. function v() {
  11958. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11959. k[t] = e(t)
  11960. }
  11961. function A(e) {
  11962. if (e <= 0 && (e = 1),
  11963. e > 100 && (e = 100),
  11964. w != e) {
  11965. var t = 0;
  11966. t = e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e),
  11967. i(t),
  11968. w = e
  11969. }
  11970. }
  11971. function y() {
  11972. var e = (new Date).getTime();
  11973. t || (t = 50),
  11974. v(),
  11975. r(),
  11976. o(),
  11977. a(),
  11978. A(t);
  11979. (new Date).getTime() - e
  11980. }
  11981. var C, I, E, b, w, _ = (Math.round,
  11982. 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];
  11983. this.encode = function(t, i) {
  11984. var n = ((new Date).getTime(),
  11985. i.quality);
  11986. n && A(n),
  11987. D = new Array,
  11988. N = 0,
  11989. B = 7,
  11990. c(65496),
  11991. u(),
  11992. p(),
  11993. d(t.width, t.height),
  11994. f(),
  11995. g();
  11996. var r = 0
  11997. , o = 0
  11998. , a = 0;
  11999. N = 0,
  12000. B = 7,
  12001. this.encode.displayName = "_encode_";
  12002. 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; ) {
  12003. for (l = 0; l < G; ) {
  12004. for (w = G * z + l,
  12005. _ = w,
  12006. T = -1,
  12007. x = 0,
  12008. R = 0; R < 64; R++)
  12009. x = (k ? 63 - R : R) >> 3,
  12010. T = 4 * (7 & R),
  12011. _ = w + x * G + T,
  12012. z + x >= L && (_ -= G * (z + 1 + x - L)),
  12013. l + T >= G && (_ -= l + T - G + 4),
  12014. h = P[_++],
  12015. v = P[_++],
  12016. y = P[_++],
  12017. F[R] = (H[h] + H[v + 256 >> 0] + H[y + 512 >> 0] >> 16) - 128,
  12018. V[R] = (H[h + 768 >> 0] + H[v + 1024 >> 0] + H[y + 1280 >> 0] >> 16) - 128,
  12019. U[R] = (H[h + 1280 >> 0] + H[v + 1536 >> 0] + H[y + 1792 >> 0] >> 16) - 128;
  12020. r = m(F, S, r, C, E),
  12021. o = m(V, M, o, I, b),
  12022. a = m(U, M, a, I, b),
  12023. l += 32
  12024. }
  12025. z += W
  12026. }
  12027. if (B >= 0) {
  12028. var j = [];
  12029. j[1] = B + 1,
  12030. j[0] = (1 << B + 1) - 1,
  12031. s(j)
  12032. }
  12033. return c(65497),
  12034. new e(D)
  12035. }
  12036. ,
  12037. y()
  12038. }
  12039. function n(e, t) {
  12040. t = t || {},
  12041. t.quality = t.quality || 50;
  12042. var n = t.quality
  12043. , r = new i(n)
  12044. , o = r.encode(e, t);
  12045. return {
  12046. data: o,
  12047. width: e.width,
  12048. height: e.height
  12049. }
  12050. }
  12051. t.exports.encode = n
  12052. }
  12053. ).call(this, e("buffer").Buffer)
  12054. }
  12055. , {
  12056. buffer: 198
  12057. }],
  12058. 95: [function(e, t, i) {
  12059. "use strict";
  12060. !function() {
  12061. if ("performance"in window == !1 && (window.performance = {}),
  12062. Date.now = Date.now || function() {
  12063. return (new Date).getTime()
  12064. }
  12065. ,
  12066. "now"in window.performance == !1) {
  12067. var e = Date.now();
  12068. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  12069. window.performance.now = function() {
  12070. return Date.now() - e
  12071. }
  12072. }
  12073. }()
  12074. }
  12075. , {}],
  12076. 96: [function(e, t, i) {
  12077. "use strict";
  12078. var n = e("three");
  12079. n.EffectComposer = function(e, t) {
  12080. if (this.renderer = e,
  12081. void 0 === t) {
  12082. var i = {
  12083. minFilter: n.LinearFilter,
  12084. magFilter: n.LinearFilter,
  12085. format: n.RGBAFormat,
  12086. stencilBuffer: !1
  12087. }
  12088. , r = e.getSize();
  12089. t = new n.WebGLRenderTarget(r.width,r.height,i)
  12090. }
  12091. this.renderTarget1 = t,
  12092. this.renderTarget2 = t.clone(),
  12093. this.writeBuffer = this.renderTarget1,
  12094. this.readBuffer = this.renderTarget2,
  12095. this.passes = [],
  12096. void 0 === n.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  12097. this.copyPass = new n.ShaderPass(n.CopyShader)
  12098. }
  12099. ,
  12100. n.EffectComposer.prototype = {
  12101. swapBuffers: function() {
  12102. var e = this.readBuffer;
  12103. this.readBuffer = this.writeBuffer,
  12104. this.writeBuffer = e
  12105. },
  12106. addPass: function(e) {
  12107. this.passes.push(e)
  12108. },
  12109. insertPass: function(e, t) {
  12110. this.passes.splice(t, 0, e)
  12111. },
  12112. render: function(e) {
  12113. this.writeBuffer = this.renderTarget1,
  12114. this.readBuffer = this.renderTarget2;
  12115. var t, i, r = !1, o = this.passes.length;
  12116. for (i = 0; i < o; i++)
  12117. if (t = this.passes[i],
  12118. t.enabled) {
  12119. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, r),
  12120. t.needsSwap) {
  12121. if (r) {
  12122. var a = this.renderer.context;
  12123. a.stencilFunc(a.NOTEQUAL, 1, 4294967295),
  12124. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  12125. a.stencilFunc(a.EQUAL, 1, 4294967295)
  12126. }
  12127. this.swapBuffers()
  12128. }
  12129. t instanceof n.MaskPass ? r = !0 : t instanceof n.ClearMaskPass && (r = !1)
  12130. }
  12131. },
  12132. reset: function(e) {
  12133. if (void 0 === e) {
  12134. var t = this.renderer.getSize();
  12135. e = this.renderTarget1.clone(),
  12136. e.setSize(t.width, t.height)
  12137. }
  12138. this.renderTarget1.dispose(),
  12139. this.renderTarget2.dispose(),
  12140. this.renderTarget1 = e,
  12141. this.renderTarget2 = e.clone(),
  12142. this.writeBuffer = this.renderTarget1,
  12143. this.readBuffer = this.renderTarget2
  12144. },
  12145. setSize: function(e, t) {
  12146. this.renderTarget1.setSize(e, t),
  12147. this.renderTarget2.setSize(e, t)
  12148. this.passes.forEach(a=>{//add for TransitionPass
  12149. a.setSize && a.setSize(e, t)
  12150. })
  12151. }
  12152. }
  12153. }
  12154. , {
  12155. three: 217
  12156. }],
  12157. 97: [function(e, t, i) {
  12158. "use strict";
  12159. var n = e("three");
  12160. n.MaskPass = function(e, t) {
  12161. this.scene = e,
  12162. this.camera = t,
  12163. this.enabled = !0,
  12164. this.clear = !0,
  12165. this.needsSwap = !1,
  12166. this.inverse = !1
  12167. }
  12168. ,
  12169. n.MaskPass.prototype = {
  12170. render: function(e, t, i, n) {
  12171. var r = e.context;
  12172. r.colorMask(!1, !1, !1, !1),
  12173. r.depthMask(!1);
  12174. var o, a;
  12175. this.inverse ? (o = 0,
  12176. a = 1) : (o = 1,
  12177. a = 0),
  12178. r.enable(r.STENCIL_TEST),
  12179. r.stencilOp(r.REPLACE, r.REPLACE, r.REPLACE),
  12180. r.stencilFunc(r.ALWAYS, o, 4294967295),
  12181. r.clearStencil(a),
  12182. e.render(this.scene, this.camera, i, this.clear),
  12183. e.render(this.scene, this.camera, t, this.clear),
  12184. r.colorMask(!0, !0, !0, !0),
  12185. r.depthMask(!0),
  12186. r.stencilFunc(r.EQUAL, 1, 4294967295),
  12187. r.stencilOp(r.KEEP, r.KEEP, r.KEEP)
  12188. }
  12189. },
  12190. n.ClearMaskPass = function() {
  12191. this.enabled = !0
  12192. }
  12193. ,
  12194. n.ClearMaskPass.prototype = {
  12195. render: function(e, t, i, n) {
  12196. var r = e.context;
  12197. r.disable(r.STENCIL_TEST)
  12198. }
  12199. }
  12200. }
  12201. , {
  12202. three: 217
  12203. }],
  12204. 98: [function(e, t, i) {
  12205. "use strict";
  12206. var n = e("three");
  12207. n.RenderPass = function(e, t, i, r, o) {
  12208. this.scene = e,
  12209. this.camera = t,
  12210. this.overrideMaterial = i,
  12211. this.clearColor = r,
  12212. this.clearAlpha = void 0 !== o ? o : 1,
  12213. this.oldClearColor = new n.Color,
  12214. this.oldClearAlpha = 1,
  12215. this.enabled = !0,
  12216. this.clear = !0,
  12217. this.needsSwap = !1
  12218. }
  12219. ,
  12220. n.RenderPass.prototype = {
  12221. render: function(e, t, i, n) {
  12222. this.scene.overrideMaterial = this.overrideMaterial,
  12223. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  12224. this.oldClearAlpha = e.getClearAlpha(),
  12225. e.setClearColor(this.clearColor, this.clearAlpha)),
  12226. e.render(this.scene, this.camera, i, this.clear),
  12227. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  12228. this.scene.overrideMaterial = null
  12229. }
  12230. }
  12231. }
  12232. , {
  12233. three: 217
  12234. }],
  12235. 99: [function(e, t, i) {
  12236. "use strict";
  12237. var n = e("three");
  12238. n.ShaderPass = function(e, t) {
  12239. this.textureID = void 0 !== t ? t : "tDiffuse",
  12240. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  12241. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  12242. this.material = new n.ShaderMaterial({
  12243. defines: e.defines || {},
  12244. uniforms: this.uniforms,
  12245. vertexShader: e.vertexShader,
  12246. fragmentShader: e.fragmentShader
  12247. })),
  12248. this.renderToScreen = !1,
  12249. this.enabled = !0,
  12250. this.needsSwap = !0,
  12251. this.clear = !1,
  12252. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  12253. this.scene = new n.Scene,
  12254. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  12255. this.scene.add(this.quad)
  12256. }
  12257. ,
  12258. n.ShaderPass.prototype = {
  12259. render: function(e, t, i, n) {
  12260. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  12261. this.quad.material = this.material,
  12262. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  12263. }
  12264. }
  12265. }
  12266. , {
  12267. three: 217
  12268. }],
  12269. 100: [function(e, t, i) {
  12270. "use strict";
  12271. var n = e("three");
  12272. n.CopyShader = {
  12273. uniforms: {
  12274. tDiffuse: {
  12275. type: "t",
  12276. value: null
  12277. },
  12278. opacity: {
  12279. type: "f",
  12280. value: 1
  12281. }
  12282. },
  12283. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12284. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  12285. }
  12286. }
  12287. , {
  12288. three: 217
  12289. }],
  12290. 101: [function(e, t, i) {
  12291. "use strict";
  12292. var n = e("three");
  12293. n.HorizontalBlurShader = {
  12294. uniforms: {
  12295. tDiffuse: {
  12296. type: "t",
  12297. value: null
  12298. },
  12299. h: {
  12300. type: "f",
  12301. value: 1 / 512
  12302. }
  12303. },
  12304. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12305. 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")
  12306. }
  12307. }
  12308. , {
  12309. three: 217
  12310. }],
  12311. 102: [function(e, t, i) {
  12312. "use strict";
  12313. var n = e("three");
  12314. n.VerticalBlurShader = {
  12315. uniforms: {
  12316. tDiffuse: {
  12317. type: "t",
  12318. value: null
  12319. },
  12320. v: {
  12321. type: "f",
  12322. value: 1 / 512
  12323. }
  12324. },
  12325. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12326. 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")
  12327. }
  12328. }
  12329. , {
  12330. three: 217
  12331. }],
  12332. 103: [function(e, t, i) {
  12333. "use strict";
  12334. var n = e("three");
  12335. !function() {
  12336. if ("performance"in window == 0 && (window.performance = {}),
  12337. "now"in window.performance == 0) {
  12338. var e = Date.now();
  12339. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  12340. window.performance.now = function() {
  12341. return Date.now() - e
  12342. }
  12343. }
  12344. }(),
  12345. n.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  12346. var t, i = this.extensions, r = this.context;
  12347. if (e === n.RepeatWrapping)
  12348. return r.REPEAT;
  12349. if (e === n.ClampToEdgeWrapping)
  12350. return r.CLAMP_TO_EDGE;
  12351. if (e === n.MirroredRepeatWrapping)
  12352. return r.MIRRORED_REPEAT;
  12353. if (e === n.NearestFilter)
  12354. return r.NEAREST;
  12355. if (e === n.NearestMipMapNearestFilter)
  12356. return r.NEAREST_MIPMAP_NEAREST;
  12357. if (e === n.NearestMipMapLinearFilter)
  12358. return r.NEAREST_MIPMAP_LINEAR;
  12359. if (e === n.LinearFilter)
  12360. return r.LINEAR;
  12361. if (e === n.LinearMipMapNearestFilter)
  12362. return r.LINEAR_MIPMAP_NEAREST;
  12363. if (e === n.LinearMipMapLinearFilter)
  12364. return r.LINEAR_MIPMAP_LINEAR;
  12365. if (e === n.UnsignedByteType)
  12366. return r.UNSIGNED_BYTE;
  12367. if (e === n.UnsignedShort4444Type)
  12368. return r.UNSIGNED_SHORT_4_4_4_4;
  12369. if (e === n.UnsignedShort5551Type)
  12370. return r.UNSIGNED_SHORT_5_5_5_1;
  12371. if (e === n.UnsignedShort565Type)
  12372. return r.UNSIGNED_SHORT_5_6_5;
  12373. if (e === n.ByteType)
  12374. return r.BYTE;
  12375. if (e === n.ShortType)
  12376. return r.SHORT;
  12377. if (e === n.UnsignedShortType)
  12378. return r.UNSIGNED_SHORT;
  12379. if (e === n.IntType)
  12380. return r.INT;
  12381. if (e === n.UnsignedIntType)
  12382. return r.UNSIGNED_INT;
  12383. if (e === n.FloatType)
  12384. return r.FLOAT;
  12385. if (t = i.get("OES_texture_half_float"),
  12386. null !== t && e === n.HalfFloatType)
  12387. return t.HALF_FLOAT_OES;
  12388. if (e === n.AlphaFormat)
  12389. return r.ALPHA;
  12390. if (e === n.RGBFormat)
  12391. return r.RGB;
  12392. if (e === n.RGBAFormat)
  12393. return r.RGBA;
  12394. if (e === n.LuminanceFormat)
  12395. return r.LUMINANCE;
  12396. if (e === n.LuminanceAlphaFormat)
  12397. return r.LUMINANCE_ALPHA;
  12398. if (e === n.AddEquation)
  12399. return r.FUNC_ADD;
  12400. if (e === n.SubtractEquation)
  12401. return r.FUNC_SUBTRACT;
  12402. if (e === n.ReverseSubtractEquation)
  12403. return r.FUNC_REVERSE_SUBTRACT;
  12404. if (e === n.ZeroFactor)
  12405. return r.ZERO;
  12406. if (e === n.OneFactor)
  12407. return r.ONE;
  12408. if (e === n.SrcColorFactor)
  12409. return r.SRC_COLOR;
  12410. if (e === n.OneMinusSrcColorFactor)
  12411. return r.ONE_MINUS_SRC_COLOR;
  12412. if (e === n.SrcAlphaFactor)
  12413. return r.SRC_ALPHA;
  12414. if (e === n.OneMinusSrcAlphaFactor)
  12415. return r.ONE_MINUS_SRC_ALPHA;
  12416. if (e === n.DstAlphaFactor)
  12417. return r.DST_ALPHA;
  12418. if (e === n.OneMinusDstAlphaFactor)
  12419. return r.ONE_MINUS_DST_ALPHA;
  12420. if (e === n.DstColorFactor)
  12421. return r.DST_COLOR;
  12422. if (e === n.OneMinusDstColorFactor)
  12423. return r.ONE_MINUS_DST_COLOR;
  12424. if (e === n.SrcAlphaSaturateFactor)
  12425. return r.SRC_ALPHA_SATURATE;
  12426. if (t = i.get("WEBGL_compressed_texture_s3tc"),
  12427. null !== t) {
  12428. if (e === n.RGB_S3TC_DXT1_Format)
  12429. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  12430. if (e === n.RGBA_S3TC_DXT1_Format)
  12431. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  12432. if (e === n.RGBA_S3TC_DXT3_Format)
  12433. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  12434. if (e === n.RGBA_S3TC_DXT5_Format)
  12435. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  12436. }
  12437. if (t = i.get("WEBGL_compressed_texture_pvrtc"),
  12438. null !== t) {
  12439. if (e === n.RGB_PVRTC_4BPPV1_Format)
  12440. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  12441. if (e === n.RGB_PVRTC_2BPPV1_Format)
  12442. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  12443. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  12444. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  12445. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  12446. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  12447. }
  12448. if (t = i.get("WEBGL_compressed_texture_etc1"),
  12449. null !== t && e === n.RGB_ETC1_Format)
  12450. return t.COMPRESSED_RGB_ETC1_WEBGL;
  12451. if (t = i.get("EXT_blend_minmax"),
  12452. null !== t) {
  12453. if (e === n.MinEquation)
  12454. return t.MIN_EXT;
  12455. if (e === n.MaxEquation)
  12456. return t.MAX_EXT
  12457. }
  12458. return 0
  12459. }
  12460. ,
  12461. n.WebGLState = function(e, t, i) {
  12462. var r = this
  12463. , o = new n.Vector4
  12464. , a = e.getParameter(e.MAX_VERTEX_ATTRIBS)
  12465. , s = new Uint8Array(a)
  12466. , l = new Uint8Array(a)
  12467. , c = new Uint8Array(a)
  12468. , h = {}
  12469. , u = null
  12470. , d = null
  12471. , p = null
  12472. , f = null
  12473. , g = null
  12474. , m = null
  12475. , v = null
  12476. , A = null
  12477. , y = !1
  12478. , C = null
  12479. , I = null
  12480. , E = null
  12481. , b = null
  12482. , w = null
  12483. , _ = null
  12484. , T = null
  12485. , x = null
  12486. , S = null
  12487. , M = null
  12488. , R = null
  12489. , P = null
  12490. , O = null
  12491. , L = null
  12492. , D = null
  12493. , N = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  12494. , B = void 0
  12495. , F = {}
  12496. , V = new n.Vector4
  12497. , U = null
  12498. , k = null
  12499. , H = new n.Vector4
  12500. , G = new n.Vector4;
  12501. this.init = function() {
  12502. this.clearColor(0, 0, 0, 1),
  12503. this.clearDepth(1),
  12504. this.clearStencil(0),
  12505. this.enable(e.DEPTH_TEST),
  12506. e.depthFunc(e.LEQUAL),
  12507. e.frontFace(e.CCW),
  12508. e.cullFace(e.BACK),
  12509. this.enable(e.CULL_FACE),
  12510. this.enable(e.BLEND),
  12511. e.blendEquation(e.FUNC_ADD),
  12512. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  12513. }
  12514. ,
  12515. this.initAttributes = function() {
  12516. for (var e = 0, t = s.length; e < t; e++)
  12517. s[e] = 0
  12518. }
  12519. ,
  12520. this.enableAttribute = function(i) {
  12521. if (s[i] = 1,
  12522. 0 === l[i] && (e.enableVertexAttribArray(i),
  12523. l[i] = 1),
  12524. 0 !== c[i]) {
  12525. var n = t.get("ANGLE_instanced_arrays");
  12526. n.vertexAttribDivisorANGLE(i, 0),
  12527. c[i] = 0
  12528. }
  12529. }
  12530. ,
  12531. this.enableAttributeAndDivisor = function(t, i, n) {
  12532. s[t] = 1,
  12533. 0 === l[t] && (e.enableVertexAttribArray(t),
  12534. l[t] = 1),
  12535. c[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  12536. c[t] = i)
  12537. }
  12538. ,
  12539. this.disableUnusedAttributes = function() {
  12540. for (var t = 0, i = l.length; t < i; t++)
  12541. l[t] !== s[t] && (e.disableVertexAttribArray(t),
  12542. l[t] = 0)
  12543. }
  12544. ,
  12545. this.enable = function(t) {
  12546. h[t] !== !0 && (e.enable(t),
  12547. h[t] = !0)
  12548. }
  12549. ,
  12550. this.disable = function(t) {
  12551. h[t] !== !1 && (e.disable(t),
  12552. h[t] = !1)
  12553. }
  12554. ,
  12555. this.getCompressedTextureFormats = function() {
  12556. if (null === u && (u = [],
  12557. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  12558. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  12559. u.push(i[n]);
  12560. return u
  12561. }
  12562. ,
  12563. this.setBlending = function(t, r, o, a, s, l, c, h) {
  12564. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  12565. t === d && h === y || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12566. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  12567. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12568. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12569. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12570. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12571. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12572. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12573. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  12574. d = t,
  12575. y = h),
  12576. t === n.CustomBlending ? (s = s || r,
  12577. l = l || o,
  12578. c = c || a,
  12579. r === p && s === m || (e.blendEquationSeparate(i(r), i(s)),
  12580. p = r,
  12581. m = s),
  12582. o === f && a === g && l === v && c === A || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  12583. f = o,
  12584. g = a,
  12585. v = l,
  12586. A = c)) : (p = null,
  12587. f = null,
  12588. g = null,
  12589. m = null,
  12590. v = null,
  12591. A = null)
  12592. }
  12593. ,
  12594. this.setDepthFunc = function(t) {
  12595. if (C !== t) {
  12596. if (t)
  12597. switch (t) {
  12598. case n.NeverDepth:
  12599. e.depthFunc(e.NEVER);
  12600. break;
  12601. case n.AlwaysDepth:
  12602. e.depthFunc(e.ALWAYS);
  12603. break;
  12604. case n.LessDepth:
  12605. e.depthFunc(e.LESS);
  12606. break;
  12607. case n.LessEqualDepth:
  12608. e.depthFunc(e.LEQUAL);
  12609. break;
  12610. case n.EqualDepth:
  12611. e.depthFunc(e.EQUAL);
  12612. break;
  12613. case n.GreaterEqualDepth:
  12614. e.depthFunc(e.GEQUAL);
  12615. break;
  12616. case n.GreaterDepth:
  12617. e.depthFunc(e.GREATER);
  12618. break;
  12619. case n.NotEqualDepth:
  12620. e.depthFunc(e.NOTEQUAL);
  12621. break;
  12622. default:
  12623. e.depthFunc(e.LEQUAL)
  12624. }
  12625. else
  12626. e.depthFunc(e.LEQUAL);
  12627. C = t
  12628. }
  12629. }
  12630. ,
  12631. this.setDepthTest = function(t) {
  12632. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  12633. }
  12634. ,
  12635. this.setDepthWrite = function(t) {
  12636. I !== t && (e.depthMask(t),
  12637. I = t)
  12638. }
  12639. ,
  12640. this.setColorWrite = function(t) {
  12641. E !== t && (e.colorMask(t, t, t, t),
  12642. E = t)
  12643. }
  12644. ,
  12645. this.setStencilFunc = function(t, i, n) {
  12646. w === t && _ === i && T === n || (e.stencilFunc(t, i, n),
  12647. w = t,
  12648. _ = i,
  12649. T = n)
  12650. }
  12651. ,
  12652. this.setStencilOp = function(t, i, n) {
  12653. x === t && S === i && M === n || (e.stencilOp(t, i, n),
  12654. x = t,
  12655. S = i,
  12656. M = n)
  12657. }
  12658. ,
  12659. this.setStencilTest = function(t) {
  12660. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  12661. }
  12662. ,
  12663. this.setStencilWrite = function(t) {
  12664. b !== t && (e.stencilMask(t),
  12665. b = t)
  12666. }
  12667. ,
  12668. this.setFlipSided = function(t) {
  12669. R !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  12670. R = t)
  12671. }
  12672. ,
  12673. this.setLineWidth = function(t) {
  12674. t !== P && (e.lineWidth(t),
  12675. P = t)
  12676. }
  12677. ,
  12678. this.setPolygonOffset = function(t, i, n) {
  12679. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  12680. !t || O === i && L === n || (e.polygonOffset(i, n),
  12681. O = i,
  12682. L = n)
  12683. }
  12684. ,
  12685. this.getScissorTest = function() {
  12686. return D
  12687. }
  12688. ,
  12689. this.setScissorTest = function(t) {
  12690. D = t,
  12691. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  12692. }
  12693. ,
  12694. this.activeTexture = function(t) {
  12695. void 0 === t && (t = e.TEXTURE0 + N - 1),
  12696. B !== t && (e.activeTexture(t),
  12697. B = t)
  12698. }
  12699. ,
  12700. this.bindTexture = function(t, i) {
  12701. void 0 === B && r.activeTexture();
  12702. var n = F[B];
  12703. void 0 === n && (n = {
  12704. type: void 0,
  12705. texture: void 0
  12706. },
  12707. F[B] = n),
  12708. n.type === t && n.texture === i || (e.bindTexture(t, i),
  12709. n.type = t,
  12710. n.texture = i)
  12711. }
  12712. ,
  12713. this.compressedTexImage2D = function() {
  12714. try {
  12715. e.compressedTexImage2D.apply(e, arguments)
  12716. } catch (e) {
  12717. console.error(e)
  12718. }
  12719. }
  12720. ,
  12721. this.texImage2D = function() {
  12722. try {
  12723. e.texImage2D.apply(e, arguments)
  12724. } catch (e) {
  12725. console.error(e)
  12726. }
  12727. }
  12728. ,
  12729. this.clearColor = function(t, i, n, r) {
  12730. o.set(t, i, n, r),
  12731. V.equals(o) === !1 && (e.clearColor(t, i, n, r),
  12732. V.copy(o))
  12733. }
  12734. ,
  12735. this.clearDepth = function(t) {
  12736. U !== t && (e.clearDepth(t),
  12737. U = t)
  12738. }
  12739. ,
  12740. this.clearStencil = function(t) {
  12741. k !== t && (e.clearStencil(t),
  12742. k = t)
  12743. }
  12744. ,
  12745. this.scissor = function(t) {
  12746. H.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  12747. H.copy(t))
  12748. }
  12749. ,
  12750. this.viewport = function(t) {
  12751. G.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  12752. G.copy(t))
  12753. }
  12754. ,
  12755. this.reset = function() {
  12756. for (var t = 0; t < l.length; t++)
  12757. 1 === l[t] && (e.disableVertexAttribArray(t),
  12758. l[t] = 0);
  12759. h = {},
  12760. u = null,
  12761. B = void 0,
  12762. F = {},
  12763. d = null,
  12764. E = null,
  12765. I = null,
  12766. b = null,
  12767. R = null
  12768. }
  12769. }
  12770. }
  12771. , {
  12772. three: 217
  12773. }],
  12774. 104: [function(e, t, i) {
  12775. (function(i, n) {
  12776. "use strict";
  12777. function r(e) {
  12778. this.urls = e;
  12779. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12780. this.builder = a.loadProto(t),
  12781. this.decoder = this.builder.build("binary_mesh")
  12782. }
  12783. var o = e("three")
  12784. , a = e("protobufjs")
  12785. , s = e("../util/logger")
  12786. , l = (e("../util/common"),
  12787. e("../util/ajax"))
  12788. , c = e("../objects/Chunk")
  12789. , h = new s(n);
  12790. r.prototype = {
  12791. constructor: r,
  12792. load: function(e, t, i, n) {
  12793. return h.time("download"),
  12794. l.get(e, {
  12795. responseType: "arraybuffer"
  12796. }).done(function(r) {
  12797. h.timeEnd("download"),
  12798. this.parse(r, e, t, i, n)
  12799. }
  12800. .bind(this)).fail(n)
  12801. },
  12802. parse: function(e, t, i, n, r) {
  12803. var o = this.readProtobuf(e);
  12804. if (!o)
  12805. return r();
  12806. try {
  12807. h.time("convert to webgl"),
  12808. this.convertProtobufToSceneObject(o, t, i, n, r),
  12809. h.timeEnd("convert to webgl")
  12810. } catch (e) {
  12811. return h.error("failed parsing .dam"),
  12812. h.error(e.message),
  12813. r()
  12814. }
  12815. },
  12816. readProtobuf: function(e) {
  12817. var t;
  12818. try {
  12819. h.time("parse proto"),
  12820. t = this.decoder.decode(e),
  12821. h.timeEnd("parse proto")
  12822. } catch (e) {
  12823. return h.error("failed parsing proto for .dam"),
  12824. h.error(e.message),
  12825. null
  12826. }
  12827. return t
  12828. },
  12829. convertProtobufToSceneObject: function(e, t, i, n, r) {
  12830. function a(e) {
  12831. var i = new o.BufferGeometry;
  12832. return i.addAttribute("position", new o.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12833. e.vertices.uv.length > 0 && i.addAttribute("uv", new o.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12834. i.setIndex(new o.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12835. i.applyMatrix(s),
  12836. i.computeBoundingBox(),
  12837. new c({
  12838. geometry: i,
  12839. textureName: e.material_name,
  12840. name: e.chunk_name,
  12841. meshUrl: t
  12842. })
  12843. }
  12844. if (0 === e.chunk.length)
  12845. return h.warn("No chunks in damfile..."),
  12846. i([]);
  12847. var s = new o.Matrix4;
  12848. s.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12849. var l = e.chunk.map(a);
  12850. return l ? i(l) : (h.error(".dam protobuf came out with no chunks..."),
  12851. r())
  12852. }
  12853. },
  12854. t.exports = r
  12855. }
  12856. ).call(this, e("buffer").Buffer, "/js/loaders/DamLoader.js")
  12857. }
  12858. , {
  12859. "../objects/Chunk": 144,
  12860. "../util/ajax": 181,
  12861. "../util/common": 185,
  12862. "../util/logger": 189,
  12863. buffer: 198,
  12864. protobufjs: 214,
  12865. three: 217
  12866. }],
  12867. 105: [function(e, t, i) {
  12868. (function(i) {
  12869. "use strict";
  12870. var n = (e("three"),
  12871. e("../settings"),
  12872. e("../util/browser"),
  12873. e("./DamLoader"))
  12874. , r = e("../util/logger")
  12875. , o = (e("../ab"),
  12876. new r(i));
  12877. t.exports = {
  12878. getLoaders: function() {
  12879. return [["_50k", ".dam", n], ["", ".dam", n]]
  12880. },
  12881. load: function(e, t, i, n, r, a) {
  12882. var s = this.getLoaders();
  12883. a = a || 0;
  12884. var l = s[a];
  12885. if (!l)
  12886. return void (r && r("No suitable model file found..."));
  12887. var c = l[0]
  12888. , h = l[1]
  12889. , u = new l[2](t)
  12890. , d = t.get(e + c + h);
  12891. d ? (o.debug("Trying " + c + h),
  12892. u.load(d, i, n, function() {
  12893. this.load(e, t, i, n, r, ++a)
  12894. }
  12895. .bind(this))) : (o.debug("Skipping " + h + ", not available"),
  12896. this.load(e, t, i, n, r, ++a))
  12897. }
  12898. }
  12899. }
  12900. ).call(this, "/js/loaders/ModelLoader.js")
  12901. }
  12902. , {
  12903. "../ab": 3,
  12904. "../settings": 166,
  12905. "../util/browser": 182,
  12906. "../util/logger": 189,
  12907. "./DamLoader": 104,
  12908. three: 217
  12909. }],
  12910. 106: [function(e, t, i) {
  12911. (function(i) {
  12912. "use strict";
  12913. var n = e("../util/common")
  12914. , r = e("../util/texture")
  12915. , o = e("../util/browser")
  12916. , a = e("../util/logger")
  12917. , s = e("../settings")
  12918. , l = new a(i);
  12919. t.exports = {
  12920. load: function(e, t) {
  12921. function i(e, i) {
  12922. e || (t.push(i),
  12923. p++,
  12924. d.notify(p, a),
  12925. p === a && d.resolve())
  12926. }
  12927. if (!e.chunks[0] || !e.chunks[0].meshUrl)
  12928. return $.when();
  12929. var a = n.countUnique(e.chunks.map(function(e) {
  12930. return e.textureName
  12931. }))
  12932. , c = e.chunks[0].meshUrl.indexOf("_50k") !== -1 ? "_50k" : ""
  12933. , h = "_50k" === c ? "high" : "low";
  12934. s.minimalMemoryMode && "high" === h && (o.detectSamsungS6() ? (l.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12935. h = "low") : a > s.maxMobileTextures && (l.warn("Model probably too large for mobile, turning down quality."),
  12936. h = "low"));
  12937. //经常没有low的贴图,这里要不要去掉转low的?? xzw
  12938. var u = e.data.job.uuid + c + "_texture_jpg_" + h + "/"
  12939. , d = $.Deferred()
  12940. , p = 0;
  12941. return e.chunks.forEach(function(t) {
  12942. if (!t.material.map && t.textureName) {
  12943. var n = e.urls.get(u + t.textureName);
  12944. t.setTextureMap(r.load(n, i.bind(this, r.isLoaded(n))))
  12945. }
  12946. }),
  12947. d.promise()
  12948. }
  12949. }
  12950. }
  12951. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12952. }
  12953. , {
  12954. "../settings": 166,
  12955. "../util/browser": 182,
  12956. "../util/common": 185,
  12957. "../util/logger": 189,
  12958. "../util/texture": 194
  12959. }],
  12960. 107: [function(e, t, i) {
  12961. (function(i, n) {
  12962. "use strict";
  12963. function r(e) {
  12964. this.model = e,
  12965. this.modelDataPath = this.model.urls.get("vision.modeldata")+"?m="+new Date().getTime(),
  12966. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12967. var t = i("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12968. , n = o.loadProto(t);
  12969. this.decoder = n.build("VisionModeldata")
  12970. }
  12971. var o = e("protobufjs")
  12972. , a = e("../util/ajax")
  12973. , s = (e("../util/common"),
  12974. e("../util/math"))
  12975. , l = e("../util/logger")
  12976. , c = new l(n);
  12977. r.prototype.load = function() {
  12978. return this.modelDataPath ? (c.info("Using vision.modeldata"),
  12979. this.loadVisionModelData()) : this.sweepLocationsPath ? (c.warn("Using sweep_locations.csv"),
  12980. this.loadSweepLocationsCSV()) : (c.warn("No sweep file found"),
  12981. $.when([]))
  12982. }
  12983. ,
  12984. r.prototype.loadVisionModelData = function() {
  12985. return a.get(this.modelDataPath, {
  12986. responseType: "arraybuffer"
  12987. }).then(function(e) {
  12988. var t;
  12989. try {
  12990. t = this.decoder.decode(e)
  12991. } catch (e) {
  12992. return c.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12993. this.loadSweepLocationsCSV()
  12994. }
  12995. var i = t.sweepLocations.map(function(e) {
  12996. return {
  12997. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  12998. position: {
  12999. x: e.pose.translation.x,
  13000. y: e.pose.translation.y,
  13001. z: e.pose.translation.z
  13002. },
  13003. quaternion: {
  13004. x: e.pose.rotation.x,
  13005. y: e.pose.rotation.y,
  13006. z: e.pose.rotation.z,
  13007. w: e.pose.rotation.w
  13008. },
  13009. puck: {
  13010. x: e.puck.x,
  13011. y: e.puck.y,
  13012. z: e.puck.z
  13013. },
  13014. floor: window.sceneFrom == 'kankan' ? e.subgroup : e.group,
  13015. neighbours: e.visibles,
  13016. alignmentType: e.alignment_type
  13017. }
  13018. }).map(function(e) {
  13019. return e.position = s.convertVisionVector(e.position),
  13020. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  13021. e.puck = s.convertVisionVector(e.puck),
  13022. e
  13023. });
  13024. return i.forEach(function(e) {
  13025. e.neighbours = e.neighbours.map(function(e) {
  13026. return i[e].uuid
  13027. })
  13028. }),
  13029. i
  13030. }
  13031. .bind(this), function() {
  13032. return c.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  13033. this.loadSweepLocationsCSV()
  13034. }
  13035. .bind(this))
  13036. }
  13037. ,
  13038. r.prototype.loadSweepLocationsCSV = function() {
  13039. return a.get(this.sweepLocationsPath).then(function(e) {
  13040. var t = e.split("\n").map(function(e) {
  13041. return e.split(", ")
  13042. }).filter(function(e) {
  13043. return e.length > 1
  13044. }).map(function(e) {
  13045. return {
  13046. uuid: e[0],
  13047. position: {
  13048. x: parseFloat(e[1]),
  13049. y: parseFloat(e[2]),
  13050. z: parseFloat(e[3])
  13051. },
  13052. quaternion: {
  13053. x: parseFloat(e[4]),
  13054. y: parseFloat(e[5]),
  13055. z: parseFloat(e[6]),
  13056. w: parseFloat(e[7])
  13057. }
  13058. }
  13059. }).map(function(e) {
  13060. return e.position = s.convertVisionVector(e.position),
  13061. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  13062. e
  13063. });
  13064. return t
  13065. }).fail(function() {
  13066. c.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  13067. })
  13068. }
  13069. ,
  13070. t.exports = r
  13071. }
  13072. ).call(this, e("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  13073. }
  13074. , {
  13075. "../util/ajax": 181,
  13076. "../util/common": 185,
  13077. "../util/logger": 189,
  13078. "../util/math": 190,
  13079. buffer: 198,
  13080. protobufjs: 214
  13081. }],
  13082. 108: [function(e, t, i) {
  13083. (function(i) {
  13084. "use strict";
  13085. function n() {
  13086. this.locale = null
  13087. }
  13088. var r = e("../settings")
  13089. , o = e("../util/common")
  13090. , a = e("../util/logger")
  13091. , s = e("../enum/Locale")
  13092. , l = new a(i);
  13093. n.prototype.init = function() {
  13094. var t;
  13095. switch (r.languageTag) {
  13096. case null:
  13097. case "en":
  13098. case s.EN_US:
  13099. this.locale = s.EN_US,
  13100. t = e("./strings-en-US");
  13101. break;
  13102. case "es":
  13103. case s.ES_MX:
  13104. this.locale = s.ES_MX,
  13105. t = e("./strings-es-MX");
  13106. break;
  13107. case "fr":
  13108. case s.FR_FR:
  13109. this.locale = s.FR_FR,
  13110. t = e("./strings-fr-FR");
  13111. break;
  13112. case "de":
  13113. case s.DE_DE:
  13114. this.locale = s.DE_DE,
  13115. t = e("./strings-de-DE");
  13116. break;
  13117. case "ru":
  13118. case s.RU_RU:
  13119. this.locale = s.RU_RU,
  13120. t = e("./strings-ru-RU");
  13121. break;
  13122. case "cn":
  13123. case s.CN_CN:
  13124. this.locale = s.CN_CN,
  13125. t = e("./strings-cn-CN");
  13126. break;
  13127. case "jp":
  13128. case s.JP_JP:
  13129. this.locale = s.JP_JP,
  13130. t = e("./strings-jp-JP");
  13131. break;
  13132. default:
  13133. l.info("Unsupported language tag, defaulting to 'en-US'"),
  13134. this.locale = s.EN_US,
  13135. t = e("./strings-en-US")
  13136. }
  13137. l.info("Using locale '" + this.locale + "'"),
  13138. o.extendObject(this, t)
  13139. }
  13140. ,
  13141. n.prototype.localizeGUI = function() {
  13142. var e = document.querySelector("#gui-parent");
  13143. this.localizeTree(e),
  13144. this.localizeLoadingText()
  13145. }
  13146. ,
  13147. n.prototype.localizeLoadingText = function() {
  13148. // var e = document.querySelector("#loader-cont")
  13149. // , t = e.getAttribute("title");
  13150. // e.removeAttribute("title"),
  13151. // e.setAttribute("data-status", t),
  13152. // e.classList.add(this.locale),
  13153. document.querySelector("#help-dialog").classList.add(this.locale),
  13154. document.querySelector("#interaction-modal").classList.add(this.locale),
  13155. document.querySelector("#gui").classList.add(this.locale);
  13156. }
  13157. ,
  13158. n.prototype.localizeTree = function(e) {
  13159. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  13160. if (e.nodeType === Node.TEXT_NODE)
  13161. t = e.data.match(n),
  13162. t && (i = t[1],
  13163. e.data = this.localizeText(i) || i);
  13164. else if (e.nodeType === Node.ELEMENT_NODE) {
  13165. var r = e.getAttribute("title");
  13166. r && (t = r.match(n),
  13167. t && (i = t[1],
  13168. e.setAttribute("title", this.localizeText(i) || i)))
  13169. }
  13170. for (e = e.firstChild; e; )
  13171. this.localizeTree(e),
  13172. e = e.nextSibling
  13173. }
  13174. ,
  13175. n.prototype.localizeText = function(t) {
  13176. var i = this[t];
  13177. return i || this.locale === s.EN_US || (l.warn("Localization key '" + t + "' not available for locale '" + this.locale + "', defaulting to English."),
  13178. i = e("./strings-en-US")[t]),
  13179. i || l.warn("Localization key '" + t + "' not available for locale 'en-US'"),
  13180. i
  13181. }
  13182. ,
  13183. t.exports = new n
  13184. }
  13185. ).call(this, "/js/localization/localize.js")
  13186. }
  13187. , {
  13188. "../enum/Locale": 31,
  13189. "../settings": 166,
  13190. "../util/common": 185,
  13191. "../util/logger": 189,
  13192. "./strings-cn-CN": 109,
  13193. "./strings-de-DE": 110,
  13194. "./strings-en-US": 111,
  13195. "./strings-es-MX": 112,
  13196. "./strings-fr-FR": 113,
  13197. "./strings-jp-JP": 114,
  13198. "./strings-ru-RU": 115
  13199. }],
  13200. 109: [function(e, t, i) {
  13201. "use strict";
  13202. t.exports = {
  13203. PAGE_TITLE: "",
  13204. LOADING: "正在加载",
  13205. PRESENTED_BY_CAPS: "呈现者:",
  13206. POWERED_BY: "技术支持:",
  13207. POWERED_BY_CAPS: "技术支持:",
  13208. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  13209. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  13210. PRESENTED_BY: "呈现者:",
  13211. MORE: "更多 ",
  13212. LESS: "更少 ",
  13213. TAG_CONTENT: "tag™ 内容",
  13214. SHOW: "显示",
  13215. HIDE: "隐藏",
  13216. DOLLHOUSE: "场景屋",
  13217. FLOOR_PLAN: "楼层平面图",
  13218. OPEN_HIGHLIGHTS: "打开精彩片段",
  13219. CLOSE_HIGHLIGHTS: "关闭",
  13220. PREVIOUS: "上一个",
  13221. PLAY: "播放",
  13222. PAUSE: "暂停",
  13223. NEXT: "下一个",
  13224. EXPLORE_3D_SPACE: "探索 3D 空间",
  13225. VIEW_DOLLHOUSE: "观看场景屋",
  13226. SOCIAL_SHARING: "分享这个空间",
  13227. VIEW_IN_VR: "以 VR 观看",
  13228. VIEW_FULLSCREEN: "全屏观看",
  13229. EXIT_FULLSCREEN: " 退出全屏",
  13230. ZOOM_IN: "放大",
  13231. ZOOM_OUT: "缩小",
  13232. FLOOR_NAME: "楼层",
  13233. FLOOR_ALL: "ALL",
  13234. FLOOR_Lang: ["Floor",""],
  13235. TERMS: "条款",
  13236. PORT_TERMS: "port 条款",
  13237. TERMS_OF_USE: "使用条款",
  13238. CLOSE_TERMS: "关闭",
  13239. TERMS_TEXT_FILE: "terms-cn-CN.html",
  13240. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  13241. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  13242. WEBVR_ENTER_WEBVR: "进入 VR",
  13243. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  13244. WEBVR_LEARN_MORE: "了解更多",
  13245. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  13246. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  13247. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  13248. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  13249. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  13250. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  13251. VR_LEARN_MORE_CAPS: "了解更多",
  13252. VR_PREVIOUS_CAPS: "上一个’,",
  13253. VR_NEXT_CAPS: "下一个",
  13254. VR_GOT_IT_CAPS: "明白了",
  13255. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  13256. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  13257. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  13258. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  13259. VR_WHAT_YOU_NEED: "关于...您需要什么",
  13260. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  13261. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  13262. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  13263. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  13264. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13265. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13266. VR_APP: "port VR 应用程序",
  13267. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13268. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13269. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  13270. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  13271. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  13272. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  13273. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  13274. VR_ANDROID_DVICES: "Android 设备",
  13275. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  13276. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  13277. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  13278. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  13279. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  13280. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  13281. VR_DOWNLOAD_HERE: "在此下载",
  13282. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  13283. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  13284. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  13285. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  13286. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  13287. SHARE_TO: "分享到",
  13288. SHARE_LINK: "直接链接",
  13289. SHARE_EXPLORE: "探索",
  13290. SHARE_AT: "在",
  13291. SHARE_WITH: "使用",
  13292. SHARE_3D: "以 3D",
  13293. SHARE_COPIED: "已复制!",
  13294. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  13295. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  13296. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  13297. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  13298. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  13299. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  13300. ERROR_GENERIC_ACTIONS_3: " 或",
  13301. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  13302. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  13303. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  13304. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  13305. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  13306. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  13307. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  13308. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  13309. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  13310. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  13311. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  13312. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  13313. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  13314. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  13315. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  13316. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  13317. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  13318. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  13319. LINK_TO_LOCATION: "地点链接",
  13320. MENU_COPY: "复制",
  13321. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  13322. ROTATE: "旋转",
  13323. MOVE: "移动",
  13324. INSIDE: "内部",
  13325. ZOOM: "缩放",
  13326. HELP: "小帮手",
  13327. HELP_NAVIGATION_TAB: "导航",
  13328. HELP_MORE_HELP_TAB: "更多帮助",
  13329. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  13330. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  13331. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  13332. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  13333. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  13334. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  13335. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  13336. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  13337. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  13338. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  13339. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  13340. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  13341. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  13342. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  13343. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  13344. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  13345. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  13346. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  13347. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  13348. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  13349. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  13350. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  13351. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  13352. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  13353. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  13354. HELP_MORE_HLR_A: "精彩片段集锦",
  13355. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  13356. HELP_MORE_DOLLHOUSE_A: "场景屋",
  13357. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  13358. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  13359. HELP_MORE_FLOORS_A: "楼层选择器",
  13360. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  13361. HELP_MORE_TAG_A: "tag™ 贴文",
  13362. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  13363. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  13364. HELP_MORE_ZOOM_A: "缩放控件",
  13365. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  13366. HELP_MORE_TOUR_A: "导览控件",
  13367. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  13368. HELP_MORE_INSIDE_A: "内部视图",
  13369. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  13370. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  13371. HELP_MORE_VR_A: "VR 模式",
  13372. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  13373. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  13374. HELP_MORE_360_A: "360° 视图",
  13375. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  13376. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  13377. HELP_MORE_FULLSCREEN_A: "全屏",
  13378. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  13379. CLOSE: "关闭"
  13380. }
  13381. }
  13382. , {}],
  13383. 110: [function(e, t, i) {
  13384. "use strict";
  13385. t.exports = {
  13386. PAGE_TITLE: "",
  13387. LOADING: "Lädt",
  13388. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  13389. POWERED_BY: "Angetrieben von",
  13390. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  13391. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  13392. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  13393. PRESENTED_BY: "Präsentiert von ",
  13394. MORE: "Mehr ",
  13395. LESS: "Weniger ",
  13396. TAG_CONTENT: "tag™ Inhalt",
  13397. SHOW: "Anzeigen",
  13398. HIDE: "Verbergen",
  13399. DOLLHOUSE: "Puppenhaus",
  13400. FLOOR_PLAN: "Grundriss",
  13401. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  13402. CLOSE_HIGHLIGHTS: "Schließen",
  13403. PREVIOUS: "Vorheriges",
  13404. PLAY: "Abspielen",
  13405. PAUSE: "Pausieren",
  13406. NEXT: "Nächstes",
  13407. EXPLORE_3D_SPACE: "Innenraum betreten",
  13408. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  13409. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  13410. VIEW_IN_VR: "In VR ansehen",
  13411. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  13412. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  13413. ZOOM_IN: "Vergrößern",
  13414. ZOOM_OUT: "Verkleinern",
  13415. FLOOR_NAME: "Etage ",
  13416. FLOOR_ALL: "Alle",
  13417. TERMS: "Bedingungen",
  13418. PORT_TERMS: "port Bedingungen",
  13419. TERMS_OF_USE: "Nutzungsbedingungen",
  13420. TERMS_TEXT_FILE: "terms-de-DE.html",
  13421. CLOSE_TERMS: "Schließen",
  13422. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  13423. HELP: "Hilfe",
  13424. HELP_NAVIGATION_TAB: "Navigation",
  13425. HELP_MORE_HELP_TAB: "Hilfe-Details",
  13426. CLOSE: "Schließen",
  13427. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  13428. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  13429. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13430. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  13431. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  13432. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  13433. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  13434. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  13435. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  13436. 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.",
  13437. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13438. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  13439. 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.",
  13440. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  13441. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13442. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  13443. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  13444. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  13445. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  13446. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  13447. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  13448. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  13449. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  13450. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  13451. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  13452. HELP_MORE_HLR_A: "Liste das Highlight",
  13453. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  13454. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  13455. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13456. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13457. HELP_MORE_FLOORS_A: "Etage auswählen",
  13458. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  13459. HELP_MORE_TAG_A: "tag™ Posts",
  13460. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  13461. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  13462. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  13463. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  13464. HELP_MORE_TOUR_A: "Tour Steuerung",
  13465. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  13466. HELP_MORE_INSIDE_A: "Innenansicht",
  13467. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  13468. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  13469. HELP_MORE_VR_A: "VR Modus",
  13470. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  13471. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  13472. HELP_MORE_360_A: "360° Views Ansicht ",
  13473. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13474. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13475. HELP_MORE_FULLSCREEN_A: "Vollbild",
  13476. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  13477. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  13478. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  13479. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  13480. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  13481. WEBVR_LEARN_MORE: "Mehr Infos",
  13482. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13483. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13484. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13485. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  13486. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  13487. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13488. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13489. VR_APP: "port VR App",
  13490. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  13491. 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",
  13492. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  13493. VR_APP_FOR_ANDROID: "port VR app für Android",
  13494. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  13495. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13496. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  13497. VR_PREVIOUS_CAPS: "ZURÜCK",
  13498. VR_NEXT_CAPS: "WEITER",
  13499. VR_GOT_IT_CAPS: "VERSTANDEN",
  13500. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  13501. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  13502. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  13503. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  13504. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  13505. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  13506. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13507. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13508. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13509. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  13510. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  13511. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  13512. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  13513. VR_ANDROID_DVICES: "Android Geräte",
  13514. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  13515. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  13516. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  13517. VR_DOWNLOAD_HERE: "Hier runterladen",
  13518. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  13519. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  13520. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  13521. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  13522. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  13523. SHARE_TO: "Teilen auf",
  13524. SHARE_LINK: "Direkter Link",
  13525. SHARE_EXPLORE: "Umsehen",
  13526. SHARE_AT: "auf",
  13527. SHARE_WITH: "mit",
  13528. SHARE_3D: "in 3D",
  13529. SHARE_COPIED: "Kopiert!",
  13530. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  13531. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  13532. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  13533. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  13534. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13535. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  13536. ERROR_GENERIC_ACTIONS_3: " oder ",
  13537. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13538. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  13539. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  13540. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  13541. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  13542. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  13543. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  13544. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  13545. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  13546. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  13547. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  13548. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  13549. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  13550. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  13551. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13552. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13553. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  13554. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  13555. LINK_TO_LOCATION: "Link zu",
  13556. MENU_COPY: "Kopieren",
  13557. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  13558. ROTATE: "Drehen",
  13559. INSIDE: "Drinnen",
  13560. MOVE: "Bewegen",
  13561. ZOOM: "Vergrößern"
  13562. }
  13563. }
  13564. , {}],
  13565. 111: [function(e, t, i) {
  13566. "use strict";
  13567. t.exports = {
  13568. PAGE_TITLE: "",
  13569. LOADING: "Loading",
  13570. PRESENTED_BY_CAPS: "PRESENTED BY",
  13571. POWERED_BY: "powered by ",
  13572. POWERED_BY_CAPS: "POWERED BY",
  13573. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  13574. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  13575. PRESENTED_BY: "Presented by ",
  13576. MORE: "More ",
  13577. LESS: "Less ",
  13578. TAG_CONTENT: "tag™ Content",
  13579. SHOW: "Show",
  13580. HIDE: "Hide",
  13581. DOLLHOUSE: "Dollhouse",
  13582. FLOOR_PLAN: "Floor plan",
  13583. OPEN_HIGHLIGHTS: "Open Highlights",
  13584. CLOSE_HIGHLIGHTS: "Close",
  13585. PREVIOUS: "Previous",
  13586. PLAY: "Play",
  13587. PAUSE: "Pause",
  13588. NEXT: "Next",
  13589. EXPLORE_3D_SPACE: "Explore 3D Space",
  13590. VIEW_DOLLHOUSE: "View dollhouse",
  13591. SOCIAL_SHARING: "Share this Space",
  13592. VIEW_IN_VR: "View in VR",
  13593. VIEW_FULLSCREEN: "全屏",
  13594. EXIT_FULLSCREEN: "退出全屏",
  13595. ZOOM_IN: "Zoom in",
  13596. ZOOM_OUT: "Zoom out",
  13597. FLOOR_NAME: "Floor ",
  13598. FLOOR_ALL: "全部",
  13599. TERMS: "Terms",
  13600. PORT_TERMS: "port terms",
  13601. TERMS_OF_USE: "Terms of Use",
  13602. TERMS_TEXT_FILE: "terms-en-US.html",
  13603. CLOSE_TERMS: "Close",
  13604. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  13605. HELP: "Help",
  13606. HELP_NAVIGATION_TAB: "Navigation",
  13607. HELP_MORE_HELP_TAB: "More Help",
  13608. CLOSE: "Close",
  13609. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  13610. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  13611. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  13612. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  13613. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  13614. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  13615. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  13616. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  13617. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  13618. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  13619. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  13620. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  13621. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  13622. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  13623. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  13624. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  13625. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  13626. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  13627. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  13628. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  13629. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  13630. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  13631. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  13632. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  13633. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  13634. HELP_MORE_HLR_A: "Highlight Reel",
  13635. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  13636. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  13637. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  13638. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  13639. HELP_MORE_FLOORS_A: "Floor Selector",
  13640. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  13641. HELP_MORE_TAG_A: "tag™ Posts",
  13642. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  13643. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  13644. HELP_MORE_ZOOM_A: "Zoom Controls",
  13645. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  13646. HELP_MORE_TOUR_A: "Tour Controls",
  13647. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  13648. HELP_MORE_INSIDE_A: "Inside View",
  13649. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  13650. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  13651. HELP_MORE_VR_A: "VR Mode",
  13652. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  13653. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  13654. HELP_MORE_360_A: "360° Views",
  13655. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  13656. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  13657. HELP_MORE_FULLSCREEN_A: "Full screen",
  13658. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  13659. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  13660. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  13661. WEBVR_FOR_DAYDREAM: "For Daydream View",
  13662. WEBVR_ENTER_WEBVR: "ENTER VR",
  13663. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  13664. WEBVR_LEARN_MORE: "Learn more",
  13665. WEBVR_VIEW_SPACE: "View Space in VR",
  13666. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13667. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  13668. VR_VIEW_SPACE: "View Space in Virtual Reality",
  13669. VR_LEARN_MORE_CAPS: "LEARN MORE",
  13670. VR_PREVIOUS_CAPS: "PREVIOUS",
  13671. VR_NEXT_CAPS: "NEXT",
  13672. VR_GOT_IT_CAPS: "GOT IT",
  13673. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  13674. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13675. VR_SHOW_IOS_1: "Tap to view the space in VR",
  13676. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  13677. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13678. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13679. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13680. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  13681. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  13682. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13683. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13684. VR_APP: "port VR App",
  13685. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13686. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13687. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  13688. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  13689. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  13690. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13691. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13692. VR_ANDROID_DVICES: "Android Devices",
  13693. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  13694. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  13695. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  13696. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  13697. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  13698. VR_APP_OPEN: "Open with the port VR app instead",
  13699. VR_DOWNLOAD_HERE: "Download here",
  13700. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  13701. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  13702. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  13703. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  13704. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  13705. SHARE_TO: "Share to",
  13706. SHARE_LINK: "Direct Link",
  13707. SHARE_EXPLORE: "Explore ",
  13708. SHARE_AT: "at",
  13709. SHARE_WITH: "with",
  13710. SHARE_3D: " in 3D",
  13711. SHARE_COPIED: "Copied!",
  13712. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  13713. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  13714. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  13715. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  13716. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  13717. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  13718. ERROR_GENERIC_ACTIONS_3: " or ",
  13719. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  13720. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  13721. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  13722. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  13723. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  13724. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  13725. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  13726. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  13727. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  13728. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  13729. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  13730. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  13731. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  13732. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  13733. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  13734. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  13735. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  13736. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  13737. LINK_TO_LOCATION: "Link to location",
  13738. MENU_COPY: "Copy",
  13739. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  13740. ROTATE: "Rotate",
  13741. INSIDE: "Inside",
  13742. MOVE: "Move",
  13743. ZOOM: "Zoom"
  13744. }
  13745. }
  13746. , {}],
  13747. 112: [function(e, t, i) {
  13748. "use strict";
  13749. t.exports = {
  13750. PAGE_TITLE: "",
  13751. LOADING: "Cargando",
  13752. PRESENTED_BY_CAPS: "PRESENTADO POR",
  13753. POWERED_BY: "potenciando por ",
  13754. POWERED_BY_CAPS: "POTENCIADO POR ",
  13755. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  13756. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  13757. PRESENTED_BY: "Presentado por ",
  13758. MORE: "Más ",
  13759. LESS: "Menos ",
  13760. TAG_CONTENT: "Contenido de tag™",
  13761. SHOW: "Mostrar",
  13762. HIDE: "Ocultar",
  13763. DOLLHOUSE: "Dollhouse",
  13764. FLOOR_PLAN: "Planos",
  13765. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  13766. CLOSE_HIGHLIGHTS: "Cerrar",
  13767. PREVIOUS: "Anterior",
  13768. PLAY: "Play",
  13769. PAUSE: "Pausa",
  13770. NEXT: "Siguiente",
  13771. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  13772. VIEW_DOLLHOUSE: "Ver dollhouse",
  13773. SOCIAL_SHARING: "Compartir este espacio",
  13774. VIEW_IN_VR: "Ver en realidad virtual",
  13775. VIEW_FULLSCREEN: "Ver en pantalla completa",
  13776. EXIT_FULLSCREEN: "Salir de pantalla completa",
  13777. ZOOM_IN: "Acercar",
  13778. ZOOM_OUT: "Alejar",
  13779. FLOOR_NAME: "Piso ",
  13780. FLOOR_ALL: "Todas",
  13781. TERMS: "Condiciones",
  13782. PORT_TERMS: "port términos de uso",
  13783. TERMS_OF_USE: "Términos de uso",
  13784. TERMS_TEXT_FILE: "terms-es-MX.html",
  13785. CLOSE_TERMS: "Cerrar",
  13786. 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.",
  13787. HELP: "Ayuda",
  13788. HELP_NAVIGATION_TAB: "Navegación",
  13789. HELP_MORE_HELP_TAB: "Más Ayuda",
  13790. CLOSE: "Cerrar",
  13791. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13792. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13793. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13794. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13795. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13796. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13797. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13798. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13799. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13800. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13801. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13802. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13803. 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.",
  13804. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13805. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13806. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13807. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13808. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13809. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13810. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13811. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13812. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13813. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13814. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13815. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13816. HELP_MORE_HLR_A: "Galería destacada",
  13817. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13818. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13819. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13820. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13821. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13822. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13823. HELP_MORE_TAG_A: "tag™ Posts",
  13824. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13825. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13826. HELP_MORE_ZOOM_A: "Controles de zoom",
  13827. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13828. HELP_MORE_TOUR_A: "Controles de recorrido",
  13829. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13830. HELP_MORE_INSIDE_A: "Vista interior",
  13831. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13832. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13833. HELP_MORE_VR_A: "Modo de realidad virtual",
  13834. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13835. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13836. HELP_MORE_360_A: "360° Views",
  13837. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13838. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13839. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13840. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13841. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13842. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13843. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13844. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13845. WEBVR_LEARN_MORE: "Más información",
  13846. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13847. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13848. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13849. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13850. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13851. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13852. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13853. VR_APP: "port VR App",
  13854. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13855. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13856. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13857. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13858. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13859. VR_PREVIOUS_CAPS: "ANTERIOR",
  13860. VR_NEXT_CAPS: "SIGUIENTE",
  13861. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13862. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13863. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13864. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13865. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13866. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13867. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13868. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13869. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13870. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13871. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13872. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13873. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13874. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13875. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13876. VR_ANDROID_DVICES: "Dispositivos Android",
  13877. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13878. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13879. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13880. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13881. VR_DOWNLOAD_HERE: "Descargar aquí",
  13882. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13883. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13884. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13885. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13886. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13887. SHARE_TO: "Compartir en",
  13888. SHARE_LINK: "Enlace directo",
  13889. SHARE_EXPLORE: "Explorar ",
  13890. SHARE_AT: "en",
  13891. SHARE_WITH: "con",
  13892. SHARE_3D: " en 3D",
  13893. SHARE_COPIED: "¡Copiado!",
  13894. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13895. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13896. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13897. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13898. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13899. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13900. ERROR_GENERIC_ACTIONS_3: " o ",
  13901. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13902. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13903. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13904. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13905. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13906. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13907. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13908. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13909. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13910. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13911. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13912. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13913. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13914. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13915. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13916. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13917. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13918. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13919. LINK_TO_LOCATION: "Enlace a la ubicación",
  13920. MENU_COPY: "Copiar",
  13921. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13922. ROTATE: "Girar",
  13923. INSIDE: "Interior",
  13924. MOVE: "Moverse",
  13925. ZOOM: "Acercar o alejar"
  13926. }
  13927. }
  13928. , {}],
  13929. 113: [function(e, t, i) {
  13930. "use strict";
  13931. t.exports = {
  13932. PAGE_TITLE: "",
  13933. LOADING: "Chargement",
  13934. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13935. POWERED_BY: "alimenté par ",
  13936. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13937. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13938. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13939. PRESENTED_BY: "Présenté par ",
  13940. MORE: "Plus ",
  13941. LESS: "Moins ",
  13942. TAG_CONTENT: "Contenu tag™",
  13943. SHOW: "Montrer",
  13944. HIDE: "Cacher",
  13945. DOLLHOUSE: "Dollhouse",
  13946. FLOOR_PLAN: "Plan de sol",
  13947. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13948. CLOSE_HIGHLIGHTS: "Fermer",
  13949. PREVIOUS: "Précédent",
  13950. PLAY: "Lecture",
  13951. PAUSE: "Pause",
  13952. NEXT: "Suivant",
  13953. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13954. VIEW_DOLLHOUSE: "Voir dollhouse",
  13955. SOCIAL_SHARING: "Partager cet espace",
  13956. VIEW_IN_VR: "Voir en VR",
  13957. VIEW_FULLSCREEN: "Plein écran",
  13958. EXIT_FULLSCREEN: "Fermer plein écran",
  13959. ZOOM_IN: "Zoom avant",
  13960. ZOOM_OUT: "Zoom arrière",
  13961. FLOOR_NAME: "Étage ",
  13962. FLOOR_ALL: "Tous",
  13963. TERMS: "Mentions légales",
  13964. PORT_TERMS: "port mentions légales",
  13965. TERMS_OF_USE: "Conditions d'utilisation",
  13966. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13967. CLOSE_TERMS: "Fermer",
  13968. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13969. HELP: "Aide",
  13970. HELP_NAVIGATION_TAB: "Navigation",
  13971. HELP_MORE_HELP_TAB: "Aide",
  13972. CLOSE: "Fermer",
  13973. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13974. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13975. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13976. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13977. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13978. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13979. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13980. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13981. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13982. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13983. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13984. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13985. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13986. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13987. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13988. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13989. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13990. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13991. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13992. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13993. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13994. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13995. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13996. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  13997. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  13998. HELP_MORE_HLR_A: "Carrousel",
  13999. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  14000. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  14001. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  14002. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  14003. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  14004. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  14005. HELP_MORE_TAG_A: "tag™ Posts",
  14006. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  14007. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  14008. HELP_MORE_ZOOM_A: "Commandes de zoom",
  14009. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  14010. HELP_MORE_TOUR_A: "Commandes de la visite",
  14011. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  14012. HELP_MORE_INSIDE_A: "Vue intérieure",
  14013. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  14014. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  14015. HELP_MORE_VR_A: "Mode RV",
  14016. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  14017. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  14018. HELP_MORE_360_A: "Vues 360°",
  14019. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  14020. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  14021. HELP_MORE_FULLSCREEN_A: "Plein écran",
  14022. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  14023. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  14024. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  14025. WEBVR_ENTER_WEBVR: "ENTRER VR",
  14026. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  14027. WEBVR_LEARN_MORE: "En savoir plus",
  14028. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  14029. WEBVR_DAYDREAM_VIEW: "Daydream View",
  14030. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  14031. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  14032. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  14033. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  14034. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  14035. VR_NEXT_CAPS: "SUIVANT",
  14036. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  14037. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  14038. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  14039. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  14040. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  14041. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  14042. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  14043. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  14044. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  14045. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  14046. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  14047. VR_GOOGLE_DAYDREAM: "Google Daydream",
  14048. VR_APP: "port VR App",
  14049. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  14050. VR_COMPATIBLE_IPHONES_1: "iPhones",
  14051. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  14052. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  14053. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  14054. 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",
  14055. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  14056. VR_ANDROID_DVICES: "Appareils Android",
  14057. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  14058. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  14059. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  14060. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  14061. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  14062. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  14063. VR_DOWNLOAD_HERE: "Télécharger ici",
  14064. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  14065. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  14066. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  14067. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  14068. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  14069. SHARE_TO: "Partager sur",
  14070. SHARE_LINK: "Lien direct",
  14071. SHARE_EXPLORE: "Explorer ",
  14072. SHARE_AT: "à",
  14073. SHARE_WITH: "avec",
  14074. SHARE_3D: " en 3D",
  14075. SHARE_COPIED: "Copié!",
  14076. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  14077. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  14078. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  14079. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  14080. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  14081. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  14082. ERROR_GENERIC_ACTIONS_3: " ou ",
  14083. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  14084. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  14085. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  14086. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  14087. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  14088. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  14089. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  14090. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  14091. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  14092. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  14093. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  14094. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  14095. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  14096. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  14097. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  14098. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  14099. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  14100. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  14101. LINK_TO_LOCATION: "Lien vers l'emplacement",
  14102. MENU_COPY: "Copie",
  14103. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  14104. ROTATE: "Faire pivoter",
  14105. INSIDE: "Intérieure",
  14106. MOVE: "Se déplacer",
  14107. ZOOM: "Zoom"
  14108. }
  14109. }
  14110. , {}],
  14111. 114: [function(e, t, i) {
  14112. "use strict";
  14113. t.exports = {
  14114. PAGE_TITLE: "",
  14115. LOADING: "読み込み中",
  14116. PRESENTED_BY_CAPS: "PRESENTED BY",
  14117. POWERED_BY: "powered by",
  14118. POWERED_BY_CAPS: "POWERED BY",
  14119. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  14120. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  14121. PRESENTED_BY: "Presented by ",
  14122. MORE: "全て表示 ",
  14123. LESS: "閉じる ",
  14124. TAG_CONTENT: "tag™コンテンツ ",
  14125. SHOW: "表示",
  14126. HIDE: "非表示",
  14127. DOLLHOUSE: "ドールハウス",
  14128. FLOOR_PLAN: "フロアプラン",
  14129. OPEN_HIGHLIGHTS: "ハイライトを開く",
  14130. CLOSE_HIGHLIGHTS: "閉じる",
  14131. PREVIOUS: "前へ",
  14132. PLAY: "再生",
  14133. PAUSE: "一時停止",
  14134. NEXT: "次へ",
  14135. EXPLORE_3D_SPACE: "3DSpaceの探索",
  14136. VIEW_DOLLHOUSE: "ドールハウスの表示",
  14137. SOCIAL_SHARING: "このSpaceを共有する",
  14138. VIEW_IN_VR: "VRで表示",
  14139. VIEW_FULLSCREEN: "フルスクリーン表示",
  14140. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  14141. ZOOM_IN: "ズームイン",
  14142. ZOOM_OUT: "ズームアウト",
  14143. FLOOR_NAME: "フロア ",
  14144. FLOOR_ALL: "すべて",
  14145. TERMS: "規約",
  14146. PORT_TERMS: "port規約",
  14147. TERMS_OF_USE: "利用規約",
  14148. CLOSE_TERMS: "閉じる",
  14149. TERMS_TEXT_FILE: "terms-jp-JP.html",
  14150. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  14151. WEBVR_FOR_DAYDREAM: "Daydream View用",
  14152. WEBVR_ENTER_WEBVR: "VRに入る",
  14153. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  14154. WEBVR_LEARN_MORE: "もっと詳しく",
  14155. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  14156. WEBVR_DAYDREAM_VIEW: "Daydream View",
  14157. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  14158. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  14159. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  14160. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  14161. VR_LEARN_MORE_CAPS: "もっと詳しく",
  14162. VR_PREVIOUS_CAPS: "前へ",
  14163. VR_NEXT_CAPS: "次へ",
  14164. VR_GOT_IT_CAPS: "了解",
  14165. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  14166. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  14167. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  14168. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  14169. VR_WHAT_YOU_NEED: "必要なもの",
  14170. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  14171. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  14172. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  14173. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  14174. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  14175. VR_GOOGLE_DAYDREAM: "Google Daydream",
  14176. VR_APP: "port VRアプリ",
  14177. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  14178. VR_COMPATIBLE_IPHONES_1: "iPhone",
  14179. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  14180. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  14181. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  14182. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  14183. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  14184. VR_ANDROID_DVICES: "Androidデバイス",
  14185. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  14186. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  14187. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  14188. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  14189. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  14190. VR_APP_OPEN: "port VRアプリで開く",
  14191. VR_DOWNLOAD_HERE: "ここからダウンロード",
  14192. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  14193. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  14194. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  14195. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  14196. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  14197. SHARE_TO: "共有先",
  14198. SHARE_LINK: "ダイレクトリンク",
  14199. SHARE_EXPLORE: "探索",
  14200. SHARE_AT: "場所",
  14201. SHARE_WITH: "使用アプリ",
  14202. SHARE_3D: "3Dで",
  14203. SHARE_COPIED: "コピーされました!",
  14204. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  14205. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  14206. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  14207. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  14208. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  14209. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  14210. ERROR_GENERIC_ACTIONS_3: "または",
  14211. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  14212. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  14213. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  14214. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  14215. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  14216. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  14217. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  14218. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  14219. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  14220. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  14221. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  14222. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  14223. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  14224. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  14225. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  14226. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  14227. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  14228. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  14229. LINK_TO_LOCATION: "ロケーションへのリンク",
  14230. MENU_COPY: "コピー",
  14231. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  14232. ROTATE: "回転",
  14233. MOVE: "移動",
  14234. INSIDE: "内側",
  14235. ZOOM: "ズーム",
  14236. HELP: "ヘルプ",
  14237. HELP_NAVIGATION_TAB: "ナビゲーション",
  14238. HELP_MORE_HELP_TAB: "その他のヘルプ",
  14239. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  14240. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  14241. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  14242. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  14243. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  14244. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  14245. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  14246. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  14247. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  14248. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  14249. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  14250. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  14251. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  14252. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  14253. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  14254. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  14255. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  14256. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  14257. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  14258. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  14259. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  14260. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  14261. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  14262. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  14263. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  14264. HELP_MORE_HLR_A: "ハイライト",
  14265. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  14266. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  14267. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  14268. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  14269. HELP_MORE_FLOORS_A: "フロアセレクター",
  14270. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  14271. HELP_MORE_TAG_A: "tag™ Posts",
  14272. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  14273. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  14274. HELP_MORE_ZOOM_A: "ズームコントロール",
  14275. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  14276. HELP_MORE_TOUR_A: "ツアーコントロール",
  14277. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  14278. HELP_MORE_INSIDE_A: "内側ビュー",
  14279. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  14280. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  14281. HELP_MORE_VR_A: "VRモード",
  14282. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  14283. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  14284. HELP_MORE_360_A: "360° Views",
  14285. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  14286. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  14287. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  14288. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  14289. CLOSE: "閉じる"
  14290. }
  14291. }
  14292. , {}],
  14293. 115: [function(e, t, i) {
  14294. "use strict";
  14295. t.exports = {
  14296. PAGE_TITLE: "",
  14297. LOADING: "Загрузка",
  14298. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  14299. POWERED_BY: "разработано на платформе ",
  14300. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  14301. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  14302. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  14303. PRESENTED_BY: "Представлено ",
  14304. MORE: "Больше ",
  14305. LESS: "Меньше ",
  14306. TAG_CONTENT: "tag™ Контент",
  14307. SHOW: "Показать",
  14308. HIDE: "Скрыть",
  14309. DOLLHOUSE: "Dollhouse",
  14310. FLOOR_PLAN: "Планировка",
  14311. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  14312. CLOSE_HIGHLIGHTS: "Закрыть",
  14313. PREVIOUS: "Предыдущий",
  14314. PLAY: "Воспроизвести",
  14315. PAUSE: "Пауза",
  14316. NEXT: "Следующий",
  14317. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  14318. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  14319. SOCIAL_SHARING: "Поделиться этой моделью",
  14320. VIEW_IN_VR: "Посмотреть в VR",
  14321. VIEW_FULLSCREEN: "Полный экран",
  14322. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  14323. ZOOM_IN: "Увеличить",
  14324. ZOOM_OUT: "Уменьшить",
  14325. FLOOR_NAME: "Этаж ",
  14326. FLOOR_ALL: "Все",
  14327. TERMS: "Условия",
  14328. PORT_TERMS: "Правила пользования",
  14329. TERMS_OF_USE: "Условия использования",
  14330. TERMS_TEXT_FILE: "terms-ru-RU.html",
  14331. CLOSE_TERMS: "Закрыть",
  14332. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  14333. HELP: "Помощь",
  14334. HELP_NAVIGATION_TAB: "Навигация",
  14335. HELP_MORE_HELP_TAB: "Доп. Помощь",
  14336. CLOSE: "Закрыть",
  14337. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  14338. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  14339. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  14340. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  14341. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  14342. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  14343. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  14344. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  14345. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  14346. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  14347. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  14348. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  14349. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  14350. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  14351. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  14352. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  14353. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  14354. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  14355. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  14356. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  14357. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  14358. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  14359. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  14360. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  14361. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  14362. HELP_MORE_HLR_A: "Фотоколлаж",
  14363. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  14364. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  14365. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  14366. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  14367. HELP_MORE_FLOORS_A: "Выбор Этажа",
  14368. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  14369. HELP_MORE_TAG_A: "tag™ Posts",
  14370. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  14371. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  14372. HELP_MORE_ZOOM_A: "Масштаб",
  14373. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  14374. HELP_MORE_TOUR_A: "Управление Туром",
  14375. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  14376. HELP_MORE_INSIDE_A: "Вид Изнутри",
  14377. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  14378. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  14379. HELP_MORE_VR_A: "Режим VR",
  14380. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  14381. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  14382. HELP_MORE_360_A: "360° Views",
  14383. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  14384. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  14385. HELP_MORE_FULLSCREEN_A: "Полный экран",
  14386. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  14387. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  14388. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  14389. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  14390. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  14391. WEBVR_LEARN_MORE: "Узнать больше",
  14392. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  14393. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  14394. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  14395. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  14396. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  14397. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  14398. VR_GOOGLE_DAYDREAM: "Google Daydream",
  14399. VR_APP: "port VR App",
  14400. VR_APP_OPEN: "Или открыть через приложение port VR",
  14401. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  14402. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  14403. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  14404. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  14405. VR_VIEW_SPACE: "Запустить модель в VR",
  14406. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  14407. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  14408. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  14409. VR_GOT_IT_CAPS: "ЯСНО",
  14410. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  14411. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  14412. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  14413. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  14414. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  14415. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  14416. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  14417. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  14418. VR_COMPATIBLE_IPHONES_1: "iPhones",
  14419. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  14420. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  14421. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  14422. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  14423. VR_ANDROID_DVICES: "Android устройства",
  14424. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  14425. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  14426. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  14427. VR_DOWNLOAD_HERE: "Скачать здесь",
  14428. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  14429. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  14430. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  14431. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  14432. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  14433. SHARE_TO: "Поделиться",
  14434. SHARE_LINK: "Прямая ссылка",
  14435. SHARE_EXPLORE: "просмотреть",
  14436. SHARE_AT: "на",
  14437. SHARE_WITH: "с",
  14438. SHARE_3D: "в 3D",
  14439. SHARE_COPIED: "Скопировано!",
  14440. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  14441. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  14442. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  14443. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  14444. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  14445. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  14446. ERROR_GENERIC_ACTIONS_3: " или ",
  14447. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  14448. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  14449. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  14450. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  14451. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  14452. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  14453. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  14454. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  14455. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  14456. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  14457. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  14458. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  14459. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  14460. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  14461. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  14462. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  14463. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  14464. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  14465. LINK_TO_LOCATION: "Ссылка на местоположение",
  14466. MENU_COPY: "Копировать",
  14467. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  14468. ROTATE: "Вращать",
  14469. MOVE: "Передвигаться",
  14470. INSIDE: "Вид изнутри",
  14471. ZOOM: "Масштаб"
  14472. }
  14473. }
  14474. , {}],
  14475. 116: [function(e, t, i) {//main.js
  14476. (function(t) {
  14477. "use strict";
  14478. var modelProgressBase = 0.4;
  14479. var progressUpdate = function(e){ // 0 <= e <= 1
  14480. console.log('e1:'+e)
  14481. e = Math.round(modelProgressBase * e * 100);
  14482. console.log('e2:'+e)
  14483. var t = $('.progressbar');
  14484. t.find('.bar').css('width',e+'%');
  14485. t.find('.label').css('left', t.width() * e / 100 - 15 + 'px' ); //上面跟着的字的百分比
  14486. t.find('.perc').text(e +'%'); //具体数字的百分比
  14487. }
  14488. $('#gui-loading').fadeIn(200);
  14489. progressUpdate(0.1)
  14490. var fileName = g_version ? 'modeldata.js' : 'someData.json' ;
  14491. $.ajax(g_Prefix + "data/"+window.number+"/"+fileName+"?"+randomTime().getTime(),{dataType: "json"}).done( function(e){ //改
  14492. var data = matcher(e);
  14493. data.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}",window.number);
  14494. data.user = {
  14495. "is_authenticated": false,
  14496. "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"]
  14497. }
  14498. try{//处理一下导览数据
  14499. data.model.images = data.model.images.filter(e=>{
  14500. if(!e.locations && !e.thumbnail_signed_src)return; //旧的曾有导览数据是错误的,将它删除
  14501. if(e.locations)e.locations = e.locations.filter(e=>e)
  14502. if(e.locations && e.locations.length == 0)return;
  14503. return e
  14504. })
  14505. }catch(e){console.log(e) }
  14506. window.DATA = data;
  14507. data.model.summary = data.summary
  14508. data.model.name = data.name
  14509. for(let i in data){
  14510. data[i] == "false" && (data[i] = false)
  14511. }
  14512. progressUpdate(0.7);
  14513. StartLoad(); //xzw someData.js是我整合的 原本在html里 但这样每个场景的html都不一样了
  14514. if(data.weixinDesc){
  14515. g_weixinObj.desc = data.weixinDesc;
  14516. }
  14517. if(data.shareImgUrl){
  14518. g_weixinObj.imgUrl = data.shareImgUrl
  14519. }
  14520. window.wx && manage.weixinShare();
  14521. //初始画面
  14522. data.camera_start && data.camera_start.thumbImg && E(manage.dealURL(data.camera_start.thumbImg))
  14523. function E(e) {
  14524. $("<img/>").attr("src", e).on("load", function() {
  14525. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  14526. $(this).remove()
  14527. })
  14528. }
  14529. //背景
  14530. settings.transparentBg = settings.transparentBg || data.transparentBg || false,
  14531. settings.bgImg = settings.bgImg || data.bgImg || null
  14532. if(settings.bgImg){
  14533. $("#player").css({'background-image': "url("+settings.bgImg+")",
  14534. "background-position": "center center"
  14535. })
  14536. }
  14537. {//初始化导览时间
  14538. if(DATA.tourBlackSpeed == void 0)DATA.tourBlackSpeed = 100
  14539. window._settings.warp.teleportTime = settings.teleportTime / DATA.tourBlackSpeed * 100;
  14540. if(DATA.tourWalkSpeed == void 0)DATA.tourWalkSpeed = 100
  14541. if(DATA.tourRotTime == '' || DATA.tourRotTime == void 0){
  14542. DATA.tourRotTime = settings.tourRotTime; //默认停留2秒
  14543. }
  14544. settings.playTourNearBy = !DATA.tourFromStart
  14545. }
  14546. {//其他
  14547. _settings.floorPlanAngle = DATA.floorPlanAngle || 0
  14548. _settings.angleShift2d = DATA.angleShift2d || 0
  14549. if(DATA.insideLookLimit){
  14550. _settings.insideLookLimitDown = DATA.insideLookLimit[0]
  14551. _settings.insideLookLimitUp = DATA.insideLookLimit[1]
  14552. }
  14553. /* _settings.upDownAngleLimitPanos = {
  14554. 25:{up:30},
  14555. 26:{up:30},
  14556. 27:{up:30},
  14557. 28:{up:30},
  14558. 29:{up:30},
  14559. 30:{up:30},
  14560. 31:{up:30},
  14561. 32:{up:30},
  14562. 33:{up:24},
  14563. 34:{up:30},
  14564. 35:{up:30},
  14565. 36:{up:30},
  14566. 37:{up:30},
  14567. 38:{up:30},
  14568. 39:{up:30}
  14569. } */
  14570. }
  14571. if (data.showCad){
  14572. $.ajax({
  14573. url: '//super.4dage.com/data/'+ window.number +'/floor.json',
  14574. method: 'GET',
  14575. success(res) {
  14576. grendCAD(res, document.documentElement, data.cadSignColor, data.cadBorderColor, data.cadBorderWidth)
  14577. }
  14578. })
  14579. }
  14580. }).fail(e=>{
  14581. alert("缺少someData文件,请检查场景码是否正确。")
  14582. })
  14583. function StartLoad(){//当加载完data后
  14584. function i() {
  14585. var e = window.number//Y.getModelIDFromQueryString();
  14586. if (!e)
  14587. return b(null, "loading-failed");
  14588. var t = Y.parseSidUrl(e)
  14589. , i = l()
  14590. , a = c()
  14591. , s = o()
  14592. , u = V.quickstart.enabled
  14593. , g = null
  14594. , m = null
  14595. , v = null
  14596. , w = null
  14597. , T = null
  14598. , x = null
  14599. , S = null
  14600. , M = null
  14601. , R = null
  14602. , P = null
  14603. , O = null
  14604. , L = null
  14605. , N = new ue;
  14606. r(s);
  14607. h({ //MP开头写法
  14608. urlBase: t.urlBase
  14609. }).then(function() {
  14610. return re.init(),
  14611. d(t, e) //getModel and load
  14612. }).then(function(e) {
  14613. progressUpdate(0.9)
  14614. return P = e,
  14615. p(P, V.appConfig.segment_key, V.appConfig.keen_write_key, V.appConfig.keen_project_id, {
  14616. startSource: i,
  14617. autoplay: V.autoplay,
  14618. quickstart: u
  14619. }),
  14620. P.urls.init()
  14621. }).then(function() {
  14622. return P.loadPanos()
  14623. }).then(function() {
  14624. m = X.getStartCameraOptions(P, P.panos),
  14625. S = A(P),
  14626. O = y(u, m.mode),
  14627. v = O.controls,
  14628. w = O.player,
  14629. T = O.director,
  14630. x = O.tagManager,
  14631. M = O.tileDownloader,
  14632. R = O.qualityManager,
  14633. L = O.panoRenderer,
  14634. C(P, S, O, s),
  14635. w.director = T,//xzw add
  14636. P.supportsTiles && M.start(),
  14637. !u || m.mode === D.PANORAMA && m.pano || (de.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14638. u = !1);
  14639. var e = null;
  14640. if (u) {
  14641. de.warn("Quickstart engaged. Hold on to your knickers.");
  14642. var t = v.controls[D.PANORAMA];
  14643. g = new ie(R,S.scene,S.camera,t,s),
  14644. _(S, s, P),
  14645. e = g.load(m).then(function() {
  14646. S.addComponent(g),
  14647. S.once(le.AfterRender, function() {
  14648. de.warn("First render after quickstart load finished.")
  14649. })
  14650. })
  14651. }
  14652. window.flyToFirst = function(){//xzw add
  14653. var pano = w.model.panos.get("8d778e19657f433fb9cf8947d823bb70");
  14654. var q = new _x.Quaternion(0.7099827027821568,-0.07708150183830938,0.6958985789714591,0.07555241737970636);
  14655. var lookAtPoint = new _x.Vector3(0,0,-1).applyQuaternion(q).add(pano.position);
  14656. w.flyToPano({pano:pano, lookAtPoint:lookAtPoint})
  14657. };
  14658. return $.when(e, U.startLoading(P, w, T, V.autoplay, u, N))
  14659. }).then(function() {
  14660. return f(P, U.onProgress, i, !u, a)
  14661. }).then(function() {
  14662. if (m.quickstart = u,
  14663. I(P, S, O, s),
  14664. S.started || _(S, s, P),
  14665. H.modelLoaded(P, w, v, V.autoplay),
  14666. E(w, P, m, V.autoplay).done(function() {
  14667. T.autoTour()
  14668. }),
  14669. !P.supportsTiles) {
  14670. var e = new Z(P,w);
  14671. e.start()
  14672. }
  14673. u && (S.removeComponent(g),
  14674. g.destroy(),
  14675. m.pano.enter()),
  14676. U.init(P, T, w, v, S, m, H.getSessionId()),
  14677. U.endLoading(P, T, x),
  14678. S.once(le.AfterRender, function() {
  14679. N.setAppReadyTime();
  14680. var e = N.calcFullLoadingTime();
  14681. de.warn("Total load time: " + e / 1e3),
  14682. H.loadComplete(e),
  14683. de.warn("First render after model load finished.")
  14684. try {
  14685. window.evt && window.dispatchEvent(window.evt);
  14686. parent.postMessage({
  14687. cmd: "loaded",
  14688. }, "*")
  14689. } catch (err) {}
  14690. }),
  14691. S.on(le.MemoryUsageUpdated, n)
  14692. }).fail(b.bind(this, e))
  14693. }
  14694. function n(e) {
  14695. ce.update(e)
  14696. }
  14697. function r(e) {
  14698. de.info("Version", "2.25.6-0-gd87e5b1"),
  14699. q.defaultMaxListeners = 1e3,
  14700. a(e),
  14701. s()
  14702. }
  14703. function o() {
  14704. return document.getElementById("player")
  14705. }
  14706. function a(e) {
  14707. e.addEventListener("dragenter", T, !1),
  14708. e.addEventListener("dragover", T, !1)
  14709. }
  14710. function s() {
  14711. F.valueFromHash("title", !0) || $(document).ready(function() {
  14712. var e = $(".model-title");
  14713. e.hide()
  14714. })
  14715. }
  14716. function l() {
  14717. return F.valueFromHash("play", !1) ? "autoplay" : F.inIframe() ? "click" : "fullpage"
  14718. }
  14719. function c() {
  14720. return {
  14721. panoElementsToLoad: 6,
  14722. modelElementsToLoad: 0,
  14723. totalElementsLoaded: 0,
  14724. totalElementsToLoad: 0,
  14725. totalPercentageLoaded: 0,
  14726. progressCallback: null
  14727. }
  14728. }
  14729. function h(e) {
  14730. return K.loadFeatureFlags(e).done(function(e) {
  14731. K.updateDependentSettings(e, V)
  14732. })
  14733. }
  14734. // function u(e) {
  14735. // return Q.get(e.urlBase + "/api/v1/config/showcase", {
  14736. // responseType: "json",
  14737. // prefetchFrom: "config"
  14738. // }).then(function(e) {
  14739. // return e ? void j.extendObject(V.appConfig, e) : {}
  14740. // }, function(e) {
  14741. // return de.warn("Failed loading runtime config, using defaults."),
  14742. // $.when({})
  14743. // })
  14744. // }
  14745. function d(e, t) {
  14746. var i = B.getModel({
  14747. url: t,
  14748. floors: F.valueFromHash("f", !0),
  14749. autoload: !1
  14750. })
  14751. ;
  14752. return $.when(i, n).then(null, function(e) {
  14753. return this
  14754. })
  14755. }
  14756. function p(e, t, i, n, r) {
  14757. de.info("Model data loaded"),
  14758. de.debug("UUID: " + e.data.job.uuid),
  14759. J.init(K.getFlags()),
  14760. i && H.initKeen({
  14761. token: i,
  14762. appId: n
  14763. }),
  14764. H.initSegment({
  14765. model: e.sid,
  14766. version: "2.25.6-0-gd87e5b1",
  14767. startSource: r.startSource,
  14768. token: t,
  14769. autoplay: r.autoplay,
  14770. quickstart: r.quickstart
  14771. })
  14772. }
  14773. function f(e, t, i, n, r) {
  14774. return r.progressCallback = t,
  14775. H.sessionStart(),
  14776. e.load(n).progress(g.bind(this, r))
  14777. }
  14778. function g(e, t) {
  14779. e.modelElementsToLoad = t[1],
  14780. v(e),
  14781. m(e)
  14782. }
  14783. function m(e) {
  14784. e.totalElementsLoaded++,
  14785. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14786. //----许钟文-----------------模型进度条向后调整
  14787. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0);
  14788. e.totalPercentageLoaded = modelProgressBase + (1-modelProgressBase)*e.totalPercentageLoaded;
  14789. //console.log('pro:'+e.totalPercentageLoaded)
  14790. //---------------------------
  14791. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14792. }
  14793. function v(e) {
  14794. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14795. }
  14796. function A(e) {
  14797. var t = new x.PerspectiveCamera;
  14798. t.layers.enable(he.PANOMARKERS),
  14799. t.layers.enable(he.RETICULE),
  14800. t.layers.enable(he.TAG);
  14801. var i = new x.Scene
  14802. , n = new x.AmbientLight(16777215);
  14803. i.add(n),
  14804. i.plane = new x.Mesh(new x.PlaneBufferGeometry(1e5,1e5),new x.RawShaderMaterial({
  14805. side: x.DoubleSide
  14806. })),
  14807. i.plane.position.y = 0,
  14808. i.plane.rotateX(-Math.PI / 2),
  14809. i.plane.material.visible = !1,
  14810. i.add(i.plane),
  14811. i.updateMatrixWorld(),
  14812. V.showScreenshotLocations && e.data.images.forEach(function(e) {
  14813. if (e.metadata && e.metadata.camera_position) {
  14814. var t = e.metadata.camera_position
  14815. , n = new x.Mesh(new x.BoxGeometry(.3,.3,.3));
  14816. n.position = t.clone(),
  14817. i.add(n);
  14818. var r = e.metadata.camera_quaternion
  14819. , o = new x.Vector3(0,0,-1).applyQuaternion(r);
  14820. i.add(new x.ArrowHelper(o,t.clone(),1,16711680))
  14821. }
  14822. }),
  14823. V.showAxis && (i.add(new x.ArrowHelper(new x.Vector3(0,1,0),new x.Vector3(0,0,0),1,255)),
  14824. i.add(new x.ArrowHelper(new x.Vector3(0,0,1),new x.Vector3(0,0,0),1,16711680)),
  14825. i.add(new x.ArrowHelper(new x.Vector3(1,0,0),new x.Vector3(0,0,0),1,65280)));
  14826. //背景
  14827. if(!settings.transparentBg && !settings.bgImg){
  14828. i.skybox = new W
  14829. i.add(i.skybox)
  14830. }
  14831. var r = new te(i,t,z);
  14832. return r
  14833. }
  14834. function y(e, t) {
  14835. var i = e ? 1 : 1e3
  14836. , n = J.tilegen || J.imgopt ? 6 : 2;
  14837. n = F.valueFromHash("tileconc", n);
  14838. var r = new ne
  14839. , o = new ae({
  14840. concurrentDownloads: n
  14841. })
  14842. , a = new se
  14843. , s = new P
  14844. , l = new M
  14845. , c = new S(t)
  14846. , h = new R
  14847. , u = new O(i)
  14848. , d = new L
  14849. , p = new oe;
  14850. return {
  14851. qualityManager: r,
  14852. panoRenderer: a,
  14853. tileDownloader: o,
  14854. player: c,
  14855. director: l,
  14856. modelManager: s,
  14857. tagManager: p,
  14858. displayController: u,
  14859. labelDisplayController: d,
  14860. controls: h
  14861. }
  14862. }
  14863. function C(e, t, i, n) {
  14864. var r = i.controls
  14865. , o = i.qualityManager
  14866. , a = i.panoRenderer
  14867. , s = i.tileDownloader
  14868. , l = i.modelManager;
  14869. r.init(n, l),
  14870. ee.init(i.director, r, i.player, l, t),
  14871. o.init(l),
  14872. s.init(o),
  14873. a.init(t, s, o),
  14874. l.init(s, a, o),
  14875. l.addModel(e),
  14876. t.addComponent(G)
  14877. }
  14878. function I(e, t, i, n) {
  14879. var r = i.qualityManager
  14880. , o = i.panoRenderer
  14881. , a = i.tileDownloader
  14882. , s = i.modelManager
  14883. , l = i.player
  14884. , c = i.director
  14885. , h = i.tagManager
  14886. , u = i.displayController
  14887. , d = i.labelDisplayController
  14888. , p = i.controls;
  14889. t.scene.add(e),
  14890. t.qualityManager = r;
  14891. var f = {
  14892. camera: t.camera,
  14893. director: c,
  14894. modelManager: s,
  14895. tileDownloader: a,
  14896. panoRenderer: o,
  14897. qualityManager: r,
  14898. tagManager: h,
  14899. container: n,
  14900. controls: p
  14901. };
  14902. l.init(f),
  14903. l.setScene(t.scene),
  14904. h.init(s, l),
  14905. c.init(l, s),
  14906. u.init(c, l, s, h, n),
  14907. d.init(l, s, n),
  14908. z.bindEvents(l),
  14909. t.addComponent(h),
  14910. t.addComponent(l),
  14911. t.addComponent(o),
  14912. l.sceneRenderer = t; //xzw add 方便resize
  14913. }
  14914. function E(e, t, i, n) {
  14915. return de.info("Starting player in " + i.mode),
  14916. H.report(t.sid, "started-playing", n, i.quickstart),
  14917. e.start(i)
  14918. }
  14919. function b(e, t) {
  14920. de.error(t),
  14921. k.error(t),
  14922. H.report(e, "error-" + t)
  14923. }
  14924. function w(e) {
  14925. var t = F.details();
  14926. t && "Safari" === t.name && t.version > 500 && t.version < 600 ? (k.error("webgl-safari"),
  14927. H.report(e, "error-webgl-safari")) : (k.error("webgl-generic"),
  14928. H.report(e, "error-webgl-generic"))
  14929. }
  14930. function _(e, t, i) {
  14931. try {
  14932. e.start(t)
  14933. } catch (e) {
  14934. throw de.warn(e.message),
  14935. w(i.sid),
  14936. e
  14937. }
  14938. }
  14939. function T(e) {
  14940. e.stopPropagation(),
  14941. e.preventDefault()
  14942. }
  14943. //czj 判断someData 有没有hoticon字段 修改热点的样式
  14944. if (window.DATA.hoticon){
  14945. g_HotImage = {
  14946. point: window.DATA.hoticon.default || "https://super.4dage.com/images/4dagePoint2.png",
  14947. point2: window.DATA.hoticon.higt || "https://super.4dage.com/images/4dagePoint.png"
  14948. } ;
  14949. }
  14950. //czj 判断someData 有没有backgroundMusic 添加音乐
  14951. if (window.DATA.backgroundMusic && window.isLocal) {
  14952. window.DATA.backgroundMusic = manage.dealURL(window.DATA.backgroundMusic)
  14953. }else if (g_version === "one"){
  14954. window.DATA.backgroundMusic = manage.dealURL( g_Prefix+"/audio/"+"audio"+window.number + "/background.mp3")
  14955. }
  14956. if (window.DATA.backgroundMusic) {
  14957. SoundManager.setSrc('bgm', window.DATA.backgroundMusic )
  14958. $("#volume").show();
  14959. }
  14960. //隐藏公司logo
  14961. if(window.DATA.loadlogo){
  14962. showLogo();
  14963. }
  14964. e("./lib/three75-shim"),
  14965. e("./lib/array-polyfill"),
  14966. e("./lib/performance-polyfill"),
  14967. e("./lib/shaders/CopyShader.js"),
  14968. e("./lib/shaders/HorizontalBlurShader.js"),
  14969. e("./lib/shaders/VerticalBlurShader.js"),
  14970. e("./lib/postprocessing/EffectComposer.js"),
  14971. e("./lib/postprocessing/RenderPass.js"),
  14972. e("./lib/postprocessing/MaskPass.js"),
  14973. e("./lib/postprocessing/ShaderPass.js"),
  14974. window.Promise || (window.Promise = e("promise-polyfill"));
  14975. var x = e("three")
  14976. , _x = e("three")
  14977. , S = (e("./util/sentry"),
  14978. e("./player"))
  14979. , M = e("./director")
  14980. , R = e("./controls/CameraControls")
  14981. , P = e("./model/ModelManager")
  14982. , O = e("./DisplayController")
  14983. , L = e("./label/LabelDisplayController")
  14984. , D = e("./enum/Viewmode")
  14985. , N = e("./util/logger")
  14986. , B = e("./showcase")
  14987. , F = e("./util/browser")
  14988. , V = e("./settings")
  14989. , U = e("./gui/gui")
  14990. , k = e("./gui/error")
  14991. , H = e("./analytics")
  14992. , G = e("./util/transitions")
  14993. , z = e("./effects")
  14994. , W = e("./objects/Skybox")
  14995. , j = e("./util/common")
  14996. , Y = (e("./util/PanoramaCollection"),
  14997. e("./util/math"),
  14998. e("./util/showcase"))
  14999. , X = e("./util/camera")
  15000. , Z = (e("./objects/Panorama"),
  15001. e("./cameras/PanoramaCamera"),
  15002. e("./preloaders"))
  15003. , q = e("events").EventEmitter
  15004. , K = e("./featureflags")
  15005. , Q = (e("./util/lerp"),
  15006. e("./util/ajax"))
  15007. , J = e("./ab")
  15008. , ee = e("./sdk/automation.js")
  15009. , te = e("./scene/SceneRenderer")
  15010. , ie = e("./scene/QuickstartManager")
  15011. , ne = e("./tile/QualityManager.js")
  15012. , re = e("./localization/localize")
  15013. , oe = e("./tag/tagManager")
  15014. , ae = e("./tile/TileDownloader")
  15015. , se = e("./tile/PanoRenderer")
  15016. , le = (e("./enum/PanoSizeClass"),
  15017. e("./enum/PanoramaEvents"),
  15018. e("./enum/SceneRendererEvents"))
  15019. , ce = e("./gui/memoryUsage")
  15020. , he = e("./enum/RenderLayers")
  15021. , ue = e("./TimingData")
  15022. , de = new N(t);
  15023. N.level = V.logLevel,
  15024. N.consoleEnabled = V.console,
  15025. i()
  15026. }
  15027. }
  15028. ).call(this, "/js/main.js")
  15029. }
  15030. , {
  15031. "./DisplayController": 1,
  15032. "./TimingData": 2,
  15033. "./ab": 3,
  15034. "./analytics": 4,
  15035. "./cameras/PanoramaCamera": 7,
  15036. "./controls/CameraControls": 9,
  15037. "./director": 15,
  15038. "./effects": 16,
  15039. "./enum/PanoSizeClass": 36,
  15040. "./enum/PanoramaEvents": 37,
  15041. "./enum/RenderLayers": 41,
  15042. "./enum/SceneRendererEvents": 43,
  15043. "./enum/Viewmode": 51,
  15044. "./featureflags": 59,
  15045. "./gui/error": 64,
  15046. "./gui/gui": 65,
  15047. "./gui/memoryUsage": 73,
  15048. "./label/LabelDisplayController": 91,
  15049. "./lib/array-polyfill": 92,
  15050. "./lib/performance-polyfill": 95,
  15051. "./lib/postprocessing/EffectComposer.js": 96,
  15052. "./lib/postprocessing/MaskPass.js": 97,
  15053. "./lib/postprocessing/RenderPass.js": 98,
  15054. "./lib/postprocessing/ShaderPass.js": 99,
  15055. "./lib/shaders/CopyShader.js": 100,
  15056. "./lib/shaders/HorizontalBlurShader.js": 101,
  15057. "./lib/shaders/VerticalBlurShader.js": 102,
  15058. "./lib/three75-shim": 103,
  15059. "./localization/localize": 108,
  15060. "./tag/tagManager": 124,
  15061. "./model/ModelManager": 140,
  15062. "./objects/Panorama": 148,
  15063. "./objects/Skybox": 152,
  15064. "./player": 155,
  15065. "./preloaders": 156,
  15066. "./scene/QuickstartManager": 157,
  15067. "./scene/SceneRenderer": 158,
  15068. "./sdk/automation.js": 164,
  15069. "./settings": 166,
  15070. "./showcase": 168,
  15071. "./tile/PanoRenderer": 169,
  15072. "./tile/QualityManager.js": 170,
  15073. "./tile/TileDownloader": 171,
  15074. "./util/PanoramaCollection": 178,
  15075. "./util/ajax": 181,
  15076. "./util/browser": 182,
  15077. "./util/camera": 183,
  15078. "./util/common": 185,
  15079. "./util/lerp": 188,
  15080. "./util/logger": 189,
  15081. "./util/math": 190,
  15082. "./util/sentry": 192,
  15083. "./util/showcase": 193,
  15084. "./util/transitions": 195,
  15085. events: 202,
  15086. "promise-polyfill": 213,
  15087. three: 217
  15088. }],
  15089. 117: [function(e, t, i) {
  15090. "use strict";
  15091. function n(e) {
  15092. e = e || {}
  15093. r.RawShaderMaterial.call(this, a.extendObject({
  15094. fragmentShader: o.cube.fragmentShader,
  15095. vertexShader: o.cube.vertexShader,
  15096. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  15097. name: "CubemapMaterial",
  15098. }, e))
  15099. }
  15100. var r = e("three")
  15101. , o = e("../shaders")
  15102. , a = e("../util/common");
  15103. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  15104. n.prototype.constructor = n,
  15105. t.exports = n
  15106. }
  15107. , {
  15108. "../shaders": 167,
  15109. "../util/common": 185,
  15110. three: 217
  15111. }],
  15112. 118: [function(e, t, i) {
  15113. "use strict";
  15114. function n(e) {
  15115. e = e || {}
  15116. r.RawShaderMaterial.call(this, a.extendObject({
  15117. fragmentShader: o.model.fragmentShader,
  15118. vertexShader: o.model.vertexShader,
  15119. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  15120. name: "ModelTextureMaterial",
  15121. }, e))
  15122. }
  15123. var r = e("three")
  15124. , o = e("../shaders")
  15125. , a = e("../util/common");
  15126. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  15127. n.prototype.constructor = n,
  15128. n.prototype.setProjectedPanos = function(e, t, i) {
  15129. i && (this.uniforms.progress.value = 0),
  15130. e.ensureSkyboxReadyForRender(),
  15131. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  15132. this.uniforms.pano0Position.value.copy(e.position),
  15133. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  15134. t.ensureSkyboxReadyForRender(),
  15135. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  15136. this.uniforms.pano1Position.value.copy(t.position),
  15137. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  15138. }
  15139. /* n.prototype.setEyeDir = function(dir, pos) {//加
  15140. this.uniforms.eyeDir.value.copy(dir)
  15141. this.uniforms.eyePos.value.copy(pos)
  15142. }
  15143. n.prototype.setBendCameraQua = function(matrix) {//加
  15144. this.uniforms.cameraDeltaMatrix.value.copy(matrix)
  15145. } */
  15146. ,
  15147. t.exports = n
  15148. }
  15149. , {
  15150. "../shaders": 167,
  15151. "../util/common": 185,
  15152. three: 217
  15153. }],
  15154. 119: [function(e, t, i) {
  15155. (function(i) {
  15156. "use strict";
  15157. function n(e, t, i, n) {
  15158. this.div = null,
  15159. this.body = null,
  15160. this.label = e,
  15161. this.description = t,
  15162. this.parsedDescription = [],
  15163. this.media = i || {
  15164. type: null
  15165. },
  15166. this.loadingSpinner = null,
  15167. this.parser = new r({
  15168. supportLinks: !u.valueFromHash("mls"),
  15169. keepLinkLabels: !0
  15170. }),
  15171. this.state = I.CLOSED,
  15172. this.orientation = "",
  15173. this.initialTransform = "",
  15174. this.hovering = !1,
  15175. this.openTransition = null,
  15176. this.closeTransition = null,
  15177. this.openPromise = null,
  15178. this.closePromise = null,
  15179. this.animationTransition = null,
  15180. this.animationScale = 0
  15181. }
  15182. var r = e("../Parser/DescriptionParser")
  15183. , o = e("../Media/Link")
  15184. , a = e("../Media/Image")
  15185. , s = e("../Media/EmbedlyPlayer")
  15186. , l = e("../Media/EmbedlyEmbed")
  15187. , c = e("../../util/transitions")
  15188. , h = e("../../util/lerp")
  15189. , u = e("../../util/browser")
  15190. , d = e("./BillboardEvent")
  15191. , p = e("../Media/MediaEvent")
  15192. , f = e("../Parser/DescriptionChunkType")
  15193. , g = e("events").EventEmitter
  15194. , m = e("./billboardSettings")
  15195. , v = e("./overlaySettings")
  15196. , A = e("../../util/logger")
  15197. , y = new A(i)
  15198. , C = document.getElementById("tag-billboards");
  15199. C.addEventListener("touchend", function(e) {
  15200. C.style.pointerEvents = "none"
  15201. }),
  15202. C.addEventListener("touchcancel", function(e) {
  15203. C.style.pointerEvents = "none"
  15204. });
  15205. var I = {
  15206. CLOSED: "closed",
  15207. OPENING: "opening",
  15208. OPEN: "open",
  15209. CLOSING: "closing",
  15210. ACTIVE: "active"
  15211. };
  15212. n.prototype = Object.create(g.prototype),
  15213. n.prototype.build = function(e) {
  15214. this.parsedDescription = this.parser.parse(this.description);
  15215. var t = document.createElement("div");
  15216. t.className = "tag-container has-hotzone",
  15217. this.div = t,
  15218. this.body = document.createElement("div"),
  15219. this.body.className = "tag-body";
  15220. var i = document.createElement("div");
  15221. i.classList.add("tag-content");
  15222. var n = document.createElement("div");
  15223. n.classList.add("tag-text-content");
  15224. var r = document.createElement("div");
  15225. r.className = "tag-label",
  15226. r.textContent = this.label,
  15227. n.appendChild(r);
  15228. var o = document.createElement("div");
  15229. o.className = "tag-desc",
  15230. n.appendChild(o),
  15231. i.appendChild(n),
  15232. this.body.appendChild(i),
  15233. this.appendDescriptionElements(this.parsedDescription, o),
  15234. this.appendMedia(),
  15235. t.appendChild(this.body),
  15236. C.appendChild(t),
  15237. this.bindEvents(t, this.body)
  15238. }
  15239. ,
  15240. n.prototype.bindEvents = function(e, t) {
  15241. var i = function(e) {
  15242. return function(t) {
  15243. if (!this.div.classList.contains("overlay")) {
  15244. var i, n = document.getElementById("player");
  15245. try {
  15246. i = new MouseEvent(e,t)
  15247. } catch (n) {
  15248. i = document.createEvent("MouseEvents"),
  15249. 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)
  15250. }
  15251. n.dispatchEvent(i)
  15252. }
  15253. }
  15254. };
  15255. t.addEventListener("mousedown", function(e) {
  15256. e.stopPropagation()
  15257. }),
  15258. t.addEventListener("mouseup", function(e) {
  15259. e.stopPropagation()
  15260. }),
  15261. e.addEventListener("touchstart", function(e) {
  15262. C.style.pointerEvents = "auto"
  15263. }),
  15264. e.addEventListener("mousedown", i("mousedown").bind(this)),
  15265. e.addEventListener("mouseup", i("mouseup").bind(this)),
  15266. t.addEventListener("mouseover", function(t) {
  15267. this.state === I.OPEN && e.classList.remove("has-hotzone")
  15268. }
  15269. .bind(this)),
  15270. e.addEventListener("mouseenter", function(e) {
  15271. this.state !== I.CLOSING && (this.hovering = !0,
  15272. this.emit(d.ENTER))
  15273. }
  15274. .bind(this)),
  15275. e.addEventListener("mouseleave", function(e) {
  15276. this.hovering = !1,
  15277. this.emit(d.LEAVE)
  15278. }
  15279. .bind(this)),
  15280. e.addEventListener("gesturestart", function(e) {
  15281. e.preventDefault()
  15282. });
  15283. var n = e.querySelector(".tag-text-content")
  15284. , r = 0;
  15285. n.addEventListener("touchstart", function(e) {
  15286. r = e.changedTouches[0].clientY
  15287. }),
  15288. n.addEventListener("touchmove", function(t) {
  15289. function i(e) {
  15290. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight === 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  15291. }
  15292. return e.classList.contains("overlay") ? i(this.querySelector(".tag-desc")) : void i(this)
  15293. }),
  15294. e.addEventListener("touchmove", function(e) {
  15295. 0 === (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  15296. })
  15297. }
  15298. ,
  15299. n.prototype.appendDescriptionElements = function(e, t) {
  15300. e.length > 0 && this.div.classList.add("has-text"),
  15301. e.forEach(function(e, i) {
  15302. switch (e.type) {
  15303. case f.TEXT:
  15304. t.appendChild(this.createTextElement(e.text));
  15305. break;
  15306. case f.LINK:
  15307. t.appendChild(this.createLinkElement(e.link))
  15308. }
  15309. }
  15310. .bind(this))
  15311. }
  15312. ,
  15313. n.prototype.appendLoadingSpinner = function() {
  15314. this.loadingSpinner = document.createElement("div"),
  15315. this.loadingSpinner.classList.add("loading-spinner");
  15316. var e = document.createElement("div");
  15317. e.classList.add("gui-spinner-icon"),
  15318. this.loadingSpinner.appendChild(e),
  15319. this.body.appendChild(this.loadingSpinner)
  15320. }
  15321. ,
  15322. n.prototype.onMediaLoadFinished = function() {
  15323. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  15324. this.applyOrientation(this.orientation),
  15325. this.loadingSpinner = null)
  15326. }
  15327. ,
  15328. n.prototype.appendMedia = function() {
  15329. if (this.media && this.media.type && "error" !== this.media.type && (!u.valueFromHash("mls", 0) || this.media.type === f.IMAGE)) {
  15330. this.appendLoadingSpinner();
  15331. var e = document.createElement("div");
  15332. e.classList.add("tag-media-content");
  15333. var t = document.createElement("i");
  15334. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  15335. t.classList.add(e)
  15336. }),
  15337. this.body.appendChild(t),
  15338. this.body.appendChild(e),
  15339. this.media.type) {
  15340. case f.IMAGE:
  15341. e.appendChild(this.createImageElement(this.media, this.body));
  15342. break;
  15343. case f.VIDEO:
  15344. e.appendChild(this.createVideoElement(this.media, this.body));
  15345. break;
  15346. case f.RICH:
  15347. e.appendChild(this.createEmbedElement(this.media, this.body))
  15348. }
  15349. }
  15350. }
  15351. ,
  15352. n.prototype.createTextElement = function(e) {
  15353. var t = document.createElement("span");
  15354. return t.textContent = e,
  15355. t
  15356. }
  15357. ;
  15358. n.prototype.createLinkElement = function(e) {
  15359. var t = new o(e);
  15360. return t.on(p.LINK_CLICK, this.emit.bind(this, p.LINK_CLICK)),
  15361. t.createDomElement()
  15362. }
  15363. ,
  15364. n.prototype.createImageElement = function(e, t) {
  15365. function i() {
  15366. function e() {
  15367. m || (r.classList.remove("view-image"),
  15368. c.classList.add("overlay"),
  15369. i(),
  15370. window.addEventListener("resize", b),
  15371. c.addEventListener("click", a),
  15372. g.addEventListener("click", l),
  15373. f.addEventListener("click", s),
  15374. m = !0,
  15375. o.emit(p.IMAGE_OPENED))
  15376. }
  15377. function i() {
  15378. t.classList.add("show-info"),
  15379. h.classList.remove("collapsible"),
  15380. h.style.height = "";
  15381. var e = parseFloat(getComputedStyle(I).lineHeight)
  15382. , i = y + e
  15383. , r = c.clientWidth - 2 * v.boundaryWidth - C
  15384. , a = c.clientHeight - 2 * v.boundaryHeight - C - i
  15385. , s = a
  15386. , l = s * n.aspect;
  15387. l > r && (l = r,
  15388. s = l / n.aspect),
  15389. s > a && (s = a,
  15390. l = s * n.aspect),
  15391. l += C,
  15392. s += C + i,
  15393. t.style.width = l + "px",
  15394. t.style.height = s + "px",
  15395. u.style.paddingTop = e + C + "px",
  15396. o.description.length > 0 && (h.classList.add("collapsible"),
  15397. h.style.height = h.clientHeight + 12 + "px",
  15398. E.style.height = "calc(100% - " + I.clientHeight + "px)")
  15399. }
  15400. function a(e) {
  15401. e.target === c && s()
  15402. }
  15403. function s() {
  15404. m && (m = !1,
  15405. r.classList.add("view-image"),
  15406. c.classList.remove("overlay"),
  15407. h.style.height = "",
  15408. u.style.paddingTop = "",
  15409. t.style.width = "",
  15410. t.style.height = "",
  15411. window.removeEventListener("resize", b),
  15412. c.removeEventListener("click", a),
  15413. g.removeEventListener("click", l),
  15414. f.removeEventListener("click", s),
  15415. o.emit(p.IMAGE_CLOSED),
  15416. o.close(!0))
  15417. }
  15418. function l(e) {
  15419. t.classList.toggle("show-info")
  15420. }
  15421. var c = o.div
  15422. , h = c.getElementsByClassName("tag-content")[0]
  15423. , u = c.getElementsByClassName("tag-media-content")[0]
  15424. , f = t.getElementsByClassName("close")[0]
  15425. , g = h.getElementsByClassName("tag-label")[0];
  15426. c.classList.add("has-image"),
  15427. r.classList.add("view-image"),
  15428. c.classList.add(n.aspect >= 1 ? "image-landscape" : "image-portrait"),
  15429. o.applyOrientation(o.orientation);
  15430. var m = !1
  15431. , A = getComputedStyle(h)
  15432. , y = parseFloat(A.paddingTop) + parseFloat(A.paddingBottom)
  15433. , C = 2 * parseFloat(getComputedStyle(u).paddingLeft)
  15434. , I = h.querySelector(".tag-label")
  15435. , E = h.querySelector(".tag-desc")
  15436. , b = function() {
  15437. var e, t, n = 0;
  15438. return function() {
  15439. clearInterval(e),
  15440. clearTimeout(t),
  15441. e = setInterval(function() {
  15442. var e = c.clientHeight;
  15443. n !== e && (i(),
  15444. n = e)
  15445. }, 100),
  15446. t = setTimeout(clearInterval.bind(this, e), 1e3)
  15447. }
  15448. }();
  15449. n.on(p.IMAGE_OPENING, e),
  15450. o.on(d.ACTIVATE, e),
  15451. o.on(p.IMAGE_CLOSED, n.onClosed.bind(n)),
  15452. o.on(d.CLOSING, s)
  15453. }
  15454. var n = new a
  15455. , r = n.createDomElement();
  15456. this.once(d.OPENED, function() {
  15457. n.load(e.src).then(i).catch(function(t) {
  15458. y.warn("Failed to load image:", e.src),
  15459. y.warn("with error:", t)
  15460. }).then(this.onMediaLoadFinished.bind(this))
  15461. });
  15462. var o = this;
  15463. return r
  15464. }
  15465. ,
  15466. n.prototype.createVideoElement = function(e, t) {
  15467. var i = new s({
  15468. autoPlay: !0,
  15469. autoResume: !0,
  15470. startMuted: !1,
  15471. loop: !1
  15472. })
  15473. , n = i.createDomElement();
  15474. return this.once(d.OPENED, function() {
  15475. i.load(e.src).then(function() {
  15476. this.div.classList.add("has-video"),
  15477. this.state !== I.OPEN && this.state !== I.ACTIVE || (i.show(),
  15478. i.play()),
  15479. this.on(d.OPENING, i.show.bind(i)),
  15480. this.on(d.OPENED, i.play.bind(i)),
  15481. this.on(d.CLOSING, i.pause.bind(i)),
  15482. this.on(d.CLOSED, i.hide.bind(i))
  15483. }
  15484. .bind(this)).catch(function(t) {
  15485. y.warn("Failed to embed video:", e.src),
  15486. y.warn("with error:", t)
  15487. }).then(this.onMediaLoadFinished.bind(this))
  15488. }
  15489. .bind(this)),
  15490. n
  15491. }
  15492. ,
  15493. n.prototype.createEmbedElement = function(e, t) {
  15494. var i = new l
  15495. , n = i.createDomElement();
  15496. return this.once(d.OPENED, function() {
  15497. i.load(e.src).then(function() {
  15498. this.div.classList.add("has-embed"),
  15499. this.state !== I.OPEN && this.state !== I.ACTIVE || i.show(),
  15500. this.applyOrientation(this.orientation),
  15501. this.on(d.OPENING, i.show.bind(i)),
  15502. this.on(d.CLOSED, i.hide.bind(i))
  15503. }
  15504. .bind(this)).catch(function(t) {
  15505. y.warn("Failed to embed:", e.src),
  15506. y.warn("with error:", t)
  15507. }).then(this.onMediaLoadFinished.bind(this))
  15508. }
  15509. .bind(this)),
  15510. n
  15511. }
  15512. ,
  15513. n.prototype.open = function(e) {
  15514. return this.openPromise = $.Deferred(),
  15515. this.state === I.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  15516. this.openTransition ? e && this.setActiveState() : this.openTransition = c.setTimeout(function() {
  15517. this.state !== I.OPEN && (this.emit(d.OPENING),
  15518. e && this.emit(d.ACTIVATING),
  15519. this.state = I.OPENING,
  15520. this.animateOpen(function() {
  15521. e && this.setActiveState(),
  15522. this.openPromise.resolve()
  15523. }
  15524. .bind(this)))
  15525. }
  15526. .bind(this), m.animation.openDelay),
  15527. c.cancel(this.closeTransition),
  15528. this.closePromise && this.closePromise.reject(),
  15529. this.closeTransition = void 0,
  15530. this.openPromise.promise())
  15531. }
  15532. ,
  15533. n.prototype.close = function(e) {
  15534. return this.closePromise = $.Deferred(),
  15535. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = c.setTimeout(function() {
  15536. this.state !== I.CLOSED && (this.emit(d.CLOSING),
  15537. this.state = I.CLOSING,
  15538. this.animateClose())
  15539. }
  15540. .bind(this), m.animation.closeDelay)),
  15541. c.cancel(this.openTransition),
  15542. this.openPromise && this.openPromise.reject(),
  15543. this.openTransition = void 0,
  15544. this.closePromise.resolve(),
  15545. this.closePromise.promise())
  15546. }
  15547. ,
  15548. n.prototype.setActiveState = function() {
  15549. this.state !== I.CLOSED && (this.state = I.ACTIVE,
  15550. this.emit(d.ACTIVATE),
  15551. this.div.classList.remove("has-hotzone"))
  15552. }
  15553. ,
  15554. n.prototype.animateOpen = function(e) {
  15555. if (this.state === I.OPENING) {
  15556. if (c.cancel(this.animationTransition),
  15557. u.detectSamsungNative())
  15558. return this.boardOrientation = null,
  15559. this.div.style.visibility = "visible",
  15560. this.emit(d.OPENED),
  15561. this.state = I.OPEN,
  15562. void (e && e());
  15563. this.div.style.webkitTransform = "scale(0)",
  15564. this.div.style.transform = "scale(0)",
  15565. this.div.style.visibility = "visible",
  15566. this.animationTransition = c.start(h.property(this, "animationScale", 1), m.animation.openDuration, function() {
  15567. this.emit(d.OPENED),
  15568. this.state = I.OPEN,
  15569. e && e()
  15570. }
  15571. .bind(this))
  15572. }
  15573. }
  15574. ,
  15575. n.prototype.animateClose = function(e) {
  15576. this.state === I.CLOSING && (c.cancel(this.animationTransition),
  15577. this.animationTransition = c.start(h.property(this, "animationScale", 0), m.animation.closeDuration, function() {
  15578. this.emit(d.CLOSED),
  15579. this.state = I.CLOSED,
  15580. this.div.style.visibility = "hidden",
  15581. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  15582. e && e()
  15583. }
  15584. .bind(this)))
  15585. }
  15586. ,
  15587. n.prototype.needsUpdate = function() {
  15588. return this.state !== I.CLOSED
  15589. }
  15590. ,
  15591. n.prototype.update = function(e, t) {
  15592. if (this.needsUpdate()) {
  15593. var i = (this.updateOrientation(e),
  15594. this.calcScale(t))
  15595. , n = {
  15596. x: (e.x + 1) * $("#player").width() / 2,
  15597. y: (e.y + 1) * $("#player").height() / 2
  15598. };
  15599. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  15600. this.div.style.webkitTransform = this.div.screenTransform,
  15601. this.div.style.transform = this.div.screenTransform
  15602. }
  15603. }
  15604. ,
  15605. n.prototype.getDimensions = function() {
  15606. return this.div.getBoundingClientRect()
  15607. }
  15608. ,
  15609. n.prototype.calcScale = function(e) {
  15610. return Math.sqrt(e / 40) * m.boardToDiscRatio
  15611. }
  15612. ,
  15613. n.prototype.updateOrientation = function(e) {
  15614. if (this.state !== I.ACTIVE) {
  15615. var t = 1 / 3
  15616. , i = e.y < -t ? 0 : e.y < t ? 1 : 2
  15617. , n = e.x < -t ? 0 : e.x < t ? 1 : 2
  15618. , r = "";
  15619. r += 0 === n ? "right" : 2 === n ? "left" : "",
  15620. r += 0 === i ? "-down" : 2 === i ? "-up" : "",
  15621. 1 === n && (r = 0 === i ? "bottom" : 2 === i ? "top" : "",
  15622. 1 === i && (r = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  15623. 1 === n && 1 === i && r === this.orientation || this.applyOrientation(r)
  15624. }
  15625. }
  15626. ,
  15627. n.prototype.applyOrientation = function(e) {
  15628. this.div.style.transform = this.div.style.webkitTransform = "",
  15629. this.div.classList.remove("tag-container-" + this.orientation),
  15630. this.div.classList.add("tag-container-" + e);
  15631. var t = window.getComputedStyle(this.div);
  15632. this.initialTransform = t.transform || t.webkitTransform,
  15633. "none" === this.initialTransform && (this.initialTransform = "");
  15634. var i = t.transform.slice(7, -1).split(",")
  15635. , n = -i[4]
  15636. , r = -i[5];
  15637. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  15638. this.div.style.transformOrigin = n + "px " + r + "px",
  15639. this.orientation = e
  15640. }
  15641. ,
  15642. t.exports = n
  15643. }
  15644. ).call(this, "/js/tag/Billboard/Billboard.js")
  15645. }
  15646. , {
  15647. "../../util/browser": 182,
  15648. "../../util/lerp": 188,
  15649. "../../util/logger": 189,
  15650. "../../util/transitions": 195,
  15651. "../Media/EmbedlyEmbed": 125,
  15652. "../Media/EmbedlyPlayer": 126,
  15653. "../Media/Image": 128,
  15654. "../Media/Link": 129,
  15655. "../Media/MediaEvent": 131,
  15656. "../Parser/DescriptionChunkType": 133,
  15657. "../Parser/DescriptionParser": 134,
  15658. "./BillboardEvent": 120,
  15659. "./billboardSettings": 121,
  15660. "./overlaySettings": 122,
  15661. events: 202
  15662. }],
  15663. 120: [function(e, t, i) {
  15664. "use strict";
  15665. t.exports = Object.freeze({
  15666. ENTER: "billboard.enter",
  15667. LEAVE: "billboard.leave",
  15668. OPENING: "billboard.opening",
  15669. OPENED: "billboard.open",
  15670. CLOSING: "billboard.closing",
  15671. CLOSED: "billboard.closed",
  15672. ACTIVATING: "billboard.activating",
  15673. ACTIVATE: "billboard.activate"
  15674. })
  15675. }
  15676. , {}],
  15677. 121: [function(e, t, i) {
  15678. "use strict";
  15679. t.exports = Object.freeze({
  15680. animation: Object.freeze({
  15681. hoverOnClosing: !1,
  15682. openDelay: 100,
  15683. closeDelay: 50,
  15684. openDuration: 200,
  15685. closeDuration: 100
  15686. }),
  15687. boardToDiscRatio: 1.2
  15688. })
  15689. }
  15690. , {}],
  15691. 122: [function(e, t, i) {
  15692. "use strict";
  15693. t.exports = Object.freeze({
  15694. boundaryWidth: 30,
  15695. boundaryHeight: 0
  15696. })
  15697. }
  15698. , {}],
  15699. 123: [function(e, t, i) {//tag
  15700. (function(i) {
  15701. "use strict";
  15702. function n(e, t, i) {
  15703. var n = i.version || "0";
  15704. "0" !== n && I.info("tag defined using version " + n),
  15705. this.model = e,
  15706. this.sid = t,
  15707. this.color = (new r.Color).set(i.color || l.tagDefault),
  15708. this.hoverColor = l._darken(this.color, .2),
  15709. this.floor = null,
  15710. this.floorIndex = i.floor,
  15711. this.mode = s.PANORAMA,
  15712. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  15713. this.obj3d = null,
  15714. this.disc = null,
  15715. this.materials = {
  15716. disc: null,
  15717. pole: null
  15718. },
  15719. this.position = (new r.Vector3).copy(i.position),
  15720. this.discPosition = (new r.Vector3).copy(i.stem.direction),
  15721. this.discWorldPosition = null,
  15722. this.discScale = .05,
  15723. this.poleEnabled = i.stem.enabled,
  15724. this.billboard = new o(i.label,i.description,i.media,this),
  15725. this.visibleTransition = null,
  15726. this.hoveringDisc = !1
  15727. }
  15728. var r = e("three")
  15729. , o = e("./Billboard/Billboard")
  15730. , a = e("../settings")
  15731. , s = e("../enum/Viewmode")
  15732. , l = e("../enum/Colors")
  15733. , c = e("../enum/RenderLayers")
  15734. , h = e("../enum/RenderOrder")
  15735. , u = (e("../util/common"),
  15736. e("../util/math"))
  15737. , d = e("../util/texture")
  15738. , p = e("../objects/Panorama")
  15739. , f = e("../shaders")
  15740. , g = e("../util/transitions")
  15741. , m = e("../util/lerp")
  15742. , v = e("../util/easing")
  15743. , A = e("./Billboard/BillboardEvent")
  15744. , y = e("events").EventEmitter
  15745. , C = e("../util/logger")
  15746. , I = new C(i)
  15747. , 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==")
  15748. , 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")
  15749. , w = new r.PlaneBufferGeometry(1,1);
  15750. n.prototype = Object.create(y.prototype),
  15751. n.raycaster = new r.Raycaster,
  15752. n.prototype.bindEvents = function() {
  15753. this.billboard.on(A.ENTER, this.setHoverState.bind(this)),
  15754. this.billboard.on(A.LEAVE, this.setFreeState.bind(this))
  15755. }
  15756. ,
  15757. n.prototype.build = function() {
  15758. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  15759. this.floor && (this.billboard.build(this.model.sid),
  15760. this.obj3d = this.buildObject3D(),
  15761. this.floor.add(this.obj3d)),
  15762. this
  15763. }
  15764. ,
  15765. n.prototype.buildObject3D = function() {
  15766. var e = new r.Object3D;
  15767. e.position.copy(this.position);
  15768. var t = r.UniformsUtils.clone(f.tagDisc.uniforms);
  15769. t.bg.value = b,
  15770. t.mask.value = E,
  15771. t.color.value.copy(this.color),
  15772. this.materials.disc = new r.RawShaderMaterial({
  15773. transparent: !0,
  15774. vertexShader: f.tagDisc.vertexShader,
  15775. fragmentShader: f.tagDisc.fragmentShader,
  15776. uniforms: t
  15777. }),
  15778. this.disc = new r.Mesh(w,this.materials.disc),
  15779. this.disc.layers.set(c.TAG),
  15780. this.disc.position.copy(this.discPosition),
  15781. this.disc.renderOrder = h.tagDisc,
  15782. this.disc.tag = this;
  15783. var i = this.buildPole();
  15784. return i.layers.set(c.TAG),
  15785. i.renderOrder = h.tagStem,
  15786. e.add(i),
  15787. e.layers.set(c.TAG),
  15788. e.add(this.disc)
  15789. }
  15790. ,
  15791. n.prototype.buildPole = function() {
  15792. var e = new r.BufferGeometry
  15793. , t = new Float32Array(6);
  15794. return t[0] = t[1] = t[2] = 0,
  15795. t[3] = this.discPosition.x,
  15796. t[4] = this.discPosition.y,
  15797. t[5] = this.discPosition.z,
  15798. e.addAttribute("position", new r.BufferAttribute(t,3)),
  15799. this.materials.pole = new r.LineBasicMaterial({
  15800. linewidth: a.tags.pole.width,
  15801. color: a.tags.pole.color,
  15802. opacity: 0,
  15803. visible: this.poleEnabled,
  15804. transparent: !0,
  15805. depthWrite: !1
  15806. }),
  15807. new r.Line(e,this.materials.pole)
  15808. }
  15809. ,
  15810. n.prototype.setFreeState = function(e) {
  15811. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  15812. this.materials.disc.uniforms.color.value = this.color
  15813. }
  15814. .bind(this))
  15815. }
  15816. ,
  15817. n.prototype.setHoverState = function(e) {
  15818. this.billboard.open(e),
  15819. this.materials.disc.uniforms.color.value = this.hoverColor
  15820. }
  15821. ,
  15822. n.prototype.hide = function(e, t) {
  15823. var i = $.Deferred();
  15824. if (0 === this.materials.disc.uniforms.opacity.value && !g.isRunning(this.visibleTransition))
  15825. return i.resolve().promise();
  15826. e = e || 0,
  15827. t = t || 0,
  15828. g.cancel(this.visibleTransition);
  15829. var n = this.materials.disc.uniforms.opacity.value / a.tags.disc.opacity
  15830. , r = t + e
  15831. , o = t / r;
  15832. return this.visibleTransition = g.start(function(e) {
  15833. var t = m.property(e.materials.disc.uniforms.opacity, "value", 0)
  15834. , i = m.property(e.materials.pole, "opacity", 0);
  15835. return function(n) {
  15836. t(n),
  15837. e.materials.pole && i(n)
  15838. }
  15839. }(this), r * n, function() {
  15840. i.resolve()
  15841. }, o, v[a.warp.blendEasing]),
  15842. i.promise()
  15843. }
  15844. ,
  15845. n.prototype.show = function(e, t) {
  15846. var i = $.Deferred();
  15847. if (this.materials.disc.uniforms.opacity.value === a.tags.disc.opacity && !g.isRunning(this.visibleTransition))
  15848. return i.resolve().promise();
  15849. e = e || 0,
  15850. t = t || 0,
  15851. g.cancel(this.visibleTransition);
  15852. var n = (a.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) / a.tags.disc.opacity
  15853. , r = t + e
  15854. , o = t / r;
  15855. return this.visibleTransition = g.start(function(e) {
  15856. var t = m.property(e.materials.disc.uniforms.opacity, "value", a.tags.disc.opacity)
  15857. , i = m.property(e.materials.pole, "opacity", a.tags.pole.opacity);
  15858. return function(n) {
  15859. t(n),
  15860. e.materials.pole && i(n)
  15861. }
  15862. }(this), r * n, function() {
  15863. i.resolve()
  15864. }, o, v[a.warp.blendEasing]),
  15865. i.promise()
  15866. }
  15867. ,
  15868. n.prototype.closestPanoTowardTag = function(e, t) {
  15869. var i = []
  15870. , o = []
  15871. , l = this.disc.getWorldPosition();
  15872. if (e === s.PANORAMA) {
  15873. var c = .5
  15874. , h = t.position.clone().sub(l).normalize();
  15875. i.push(p.filters.isPanoAligned()),
  15876. i.push(p.filters.isNeighbourPanoTo(t)),
  15877. i.push(p.filters.inPanoDirection(l, h, c)),
  15878. o.push(p.scoreFunctions.direction(l, h))
  15879. }
  15880. var u = new r.Vector3
  15881. , d = function(e) {
  15882. u.copy(l).sub(e.position);
  15883. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
  15884. , i = a.tags.navigate.tiltTolerance;
  15885. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  15886. }
  15887. , f = function(e) {
  15888. return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  15889. };
  15890. i.push(f, d),
  15891. o.push(p.scoreFunctions.distanceSquared(this, -2));
  15892. var g = this.model.panos.sortByScore(i, o);
  15893. if (a.tags.navigate.lineOfSight) {
  15894. for (var m = 0; m < g.length; m++) {
  15895. var v = g[m].item
  15896. , A = v.position.distanceTo(l);
  15897. if (!a.tags.visibility.anyDistance && A > a.tags.visibility.visibleDistance)
  15898. return null;
  15899. n.raycaster.set(v.position, l.clone().sub(v.position).normalize());
  15900. var y = n.raycaster.intersectObjects(this.model.colliders);
  15901. if (0 === y.length || y[0].distance > A)
  15902. return v
  15903. }
  15904. return null
  15905. }
  15906. return g.length > 0 && g[0].item
  15907. }
  15908. ,
  15909. n.prototype.examine = function(e) {
  15910. var t = e.mode
  15911. , i = a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano) || e.currentPano
  15912. , n = this.disc.getWorldPosition();
  15913. this.billboard.setActiveState();
  15914. var o = function() {
  15915. var t = this.billboard.getDimensions()
  15916. , n = new r.Vector3;
  15917. u.convertScreenPositionToNDC(t.left + t.width / 2, t.top + t.height / 2, n),
  15918. n.unproject(e.camera),
  15919. e.flyToPano({
  15920. pano: i,
  15921. lookAtPoint: n
  15922. })
  15923. }
  15924. .bind(this);
  15925. if (t === s.PANORAMA)
  15926. if (i !== e.currentPano) {
  15927. var l = {
  15928. pano: i,
  15929. lookAtPoint: n,
  15930. duration: null,
  15931. maxDistanceOverride: null,
  15932. skipWarpingCheck: !1
  15933. };
  15934. e.flyToPano(l, o)
  15935. } else
  15936. setTimeout(function() {
  15937. this.billboard.open().then(function() {
  15938. o()
  15939. })
  15940. }
  15941. .bind(this), 0);
  15942. else {
  15943. var c = {
  15944. pano: i
  15945. };
  15946. if (n) {
  15947. var h = (new r.Matrix4).lookAt(i.position, n, new r.Vector3(0,1,0));
  15948. c.quaternion = (new r.Quaternion).setFromRotationMatrix(h)
  15949. }
  15950. c.callback = o,
  15951. c.duration = 1500,
  15952. c.mode = s.PANORAMA,
  15953. e.flyToNewMode(c)
  15954. }
  15955. }
  15956. ,
  15957. n.prototype.update = function(e, t) {
  15958. var i = new r.Vector3;
  15959. return function(e, t) {
  15960. this.discWorldPosition = this.disc.getWorldPosition(),
  15961. this.updateDisc(e, t),
  15962. this.billboard.needsUpdate() && (i.copy(this.discWorldPosition).project(t),
  15963. i.z < 1 && (i.y *= -1,
  15964. this.billboard.update(i, this.getDiscRadius(i, t))))
  15965. }
  15966. }(),
  15967. n.prototype.updateDisc = function(e, t) {
  15968. var i = new r.Vector3
  15969. , o = new r.Vector3
  15970. , l = new r.Vector3
  15971. , c = new r.Vector3
  15972. , h = new r.Vector3;
  15973. return function(e, t) {
  15974. var u = a.tags.visibility
  15975. , d = a.tags.disc.scale
  15976. , p = e === s.DOLLHOUSE || e === s.FLOORPLAN ? a.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  15977. 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)),
  15978. this.obj3d.visible) {
  15979. this.disc.quaternion.copy(t.quaternion);
  15980. var f = d.maxSize - (d.maxSize - d.minSize) * r.Math.smoothstep(p, d.nearBound, d.farBound);
  15981. i.copy(this.discWorldPosition).project(t),
  15982. o.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(i),
  15983. l.set(f / 2, 0, 0).add(o),
  15984. c.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(l),
  15985. h.copy(c).unproject(t);
  15986. var g = h.distanceTo(this.discWorldPosition)
  15987. , m = 1 + a.tags.disc.scale.responsiveness / 100 * (n.viewportScale() - 1);
  15988. this.discScale = g * m,
  15989. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15990. }
  15991. }
  15992. }(),
  15993. n.prototype.getDiscRadius = function(e, t) {
  15994. var i = new r.Vector3;
  15995. return function(e, t) {
  15996. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  15997. Math.abs(e.x - i.x) * $("#player").width()
  15998. }
  15999. }(),
  16000. n.prototype.tagVisibleOnCurrentFloor = function(e) {
  16001. return !(e === s.DOLLHOUSE || e === s.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  16002. }
  16003. ,
  16004. n.prototype.offScreen = function(e, t) {
  16005. var i = e.getWorldPosition().project(t);
  16006. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  16007. }
  16008. ,
  16009. n.viewportScale = function() {
  16010. return n.viewportWidth === $("#player").width() && n.viewportHeight === $("#player").height() || (n.viewportWidth = $("#player").width(),
  16011. n.viewportHeight = $("#player").height(),
  16012. n.currentViewportScale = Math.sqrt(Math.min(n.viewportWidth, n.viewportHeight) / a.tags.disc.scale.baseViewportSize)),
  16013. n.currentViewportScale
  16014. }
  16015. ,
  16016. t.exports = n
  16017. }
  16018. ).call(this, "/js/tag/tag.js")
  16019. }
  16020. , {
  16021. "../enum/Colors": 19,
  16022. "../enum/RenderLayers": 41,
  16023. "../enum/RenderOrder": 42,
  16024. "../enum/Viewmode": 51,
  16025. "../objects/Panorama": 148,
  16026. "../settings": 166,
  16027. "../shaders": 167,
  16028. "../util/common": 185,
  16029. "../util/easing": 186,
  16030. "../util/lerp": 188,
  16031. "../util/logger": 189,
  16032. "../util/math": 190,
  16033. "../util/texture": 194,
  16034. "../util/transitions": 195,
  16035. "./Billboard/Billboard": 119,
  16036. "./Billboard/BillboardEvent": 120,
  16037. events: 202,
  16038. three: 217
  16039. }],
  16040. 124: [function(e, t, i) {
  16041. (function(i) {
  16042. "use strict";
  16043. function n() {
  16044. this.tagState = y.IDLE,
  16045. this.intersectTag = null,
  16046. this.hoveredTag = null,
  16047. this.activeTag = null,
  16048. this.tagDiscs = [],
  16049. this.raycaster = new r.Raycaster,
  16050. this.modelManager = null,
  16051. this.player = null,
  16052. this.totaltags = 0,
  16053. this.navigatingViaTag = !1,
  16054. this.enabled = !1
  16055. }
  16056. var r = e("three")
  16057. , o = e("../util/logger")
  16058. , a = e("../util/common")
  16059. , s = e("../controls/serializer")
  16060. , l = e("../objects/Snapshot")
  16061. , c = e("../settings")
  16062. , h = e("./Billboard/BillboardEvent")
  16063. , u = e("./Media/MediaEvent")
  16064. , d = e("./Media/LinkType")
  16065. , p = e("../enum/Viewmode")
  16066. , f = e("../enum/WarpStyle")
  16067. , g = e("../enum/BlackoutStyle")
  16068. , m = e("../enum/ModelManagerEvents")
  16069. , v = e("../enum/tagEvents")
  16070. , A = e("../enum/PlayerEvents")
  16071. , y = (e("../util/lerp"),
  16072. e("../enum/TagStates"))
  16073. , C = e("events").EventEmitter
  16074. , I = new o(i);
  16075. a.extend(n, C),
  16076. n.prototype.init = function(e, t) {
  16077. this.modelManager = e,
  16078. this.player = t,
  16079. this.updateModel(),
  16080. this.bindEvents()
  16081. }
  16082. ,
  16083. n.prototype.update = function(e) {
  16084. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  16085. }
  16086. ,
  16087. n.prototype.updateTags = function(e, t, i, n) {
  16088. for (var r in this.model.tags)
  16089. this.model.tags[r].update(e, t, i, n)
  16090. }
  16091. ,
  16092. n.prototype.updateModel = function() {
  16093. this.model = this.modelManager.getActiveModel(),
  16094. this.gettagsFromModel(),
  16095. this.totaltags = Object.keys(this.model.tags).length
  16096. }
  16097. ,
  16098. n.prototype.gettagsFromModel = function() {
  16099. this.tagDiscs = [];
  16100. for (var e in this.model.tags) {
  16101. var t = this.model.tags[e].disc;
  16102. t && this.tagDiscs.push(t)
  16103. }
  16104. }
  16105. ,
  16106. n.prototype.bindEvents = function() {
  16107. function e() {
  16108. Object.keys(this.model.tags).forEach(function(e) {
  16109. var t = this.model.tags[e];
  16110. t.bindEvents(),
  16111. t.billboard.on(u.LINK_CLICK, function(e) {
  16112. e.type === d.NAVIGATION && this.navigateViaLink(e.url)
  16113. }
  16114. .bind(this)),
  16115. t.billboard.on(u.IMAGE_OPENED, function() {
  16116. this.tagState = y.EXAMINE,
  16117. this.emit(u.IMAGE_OPENED)
  16118. }
  16119. .bind(this)),
  16120. t.billboard.on(h.CLOSING, this.dismissExaminedTag.bind(this))
  16121. }
  16122. .bind(this))
  16123. }
  16124. this.modelManager.on(m.ActiveModelChanged, this.updateModel.bind(this)),
  16125. this.modelManager.on(m.ActiveModelChanged, e.bind(this)),
  16126. this.player.on(A.ModeChanging, this.onPlayerModeChanging.bind(this)),
  16127. this.player.on(A.PanoChosen, this.onPanoChange.bind(this)),
  16128. this.player.on(A.Ready, this.onPlayerReady.bind(this)),
  16129. this.player.on(A.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  16130. this.player.on(A.WarpStarted, this.handleWarpStart.bind(this)),
  16131. this.player.on(A.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  16132. e.call(this)
  16133. }
  16134. ,
  16135. n.prototype.navigateViaLink = function(e) {
  16136. var t = s.deserialize(e);
  16137. if (t)
  16138. if (t.mode === p.PANORAMA) {
  16139. try {
  16140. this.player.model.panos.get(t.panoId)
  16141. } catch (e) {
  16142. return void I.warn("Unable to find panorama location", t.panoId)
  16143. }
  16144. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, f.BLACK)
  16145. } else {
  16146. var i = {
  16147. cameraMode: t.mode,
  16148. position: t.position,
  16149. quaternion: t.quaternion,
  16150. scanId: t.panoId,
  16151. orthoZoom: t.zoom,
  16152. floorVisibility: t.floorVisibility,
  16153. thumbUrl: null,
  16154. name: null
  16155. };
  16156. this.player.flyToNewMode({
  16157. mode: t.mode,
  16158. duration: c.warp.outsideTime,
  16159. warpDest: new l(i),
  16160. force: !0
  16161. })
  16162. }
  16163. }
  16164. ,
  16165. n.prototype.handleWarpStart = function(e, t, i, n) {
  16166. this.dismissExaminedTag(),
  16167. t === f.BLACK && (null !== n && void 0 !== n || (n = c.warp.teleportTime),
  16168. e && (i = g.END),
  16169. this.hideShowTagsForBlackoutStyle(i, n))
  16170. }
  16171. ,
  16172. n.prototype.handleWarpInterruption = function(e, t, i) {
  16173. null !== i && void 0 !== i || (i = c.warp.teleportTime),
  16174. this.hideShowTagsForBlackoutStyle(t, i)
  16175. }
  16176. ,
  16177. n.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  16178. var i = 0
  16179. , n = 0
  16180. , r = t / 2;
  16181. switch (null !== e && void 0 !== e || (e = g.MIDDLE),
  16182. e) {
  16183. case g.END:
  16184. this.hideAlltags(r);
  16185. break;
  16186. case g.BEGINNING:
  16187. this.hideAlltags().done(this.showAlltags.bind(this, r));
  16188. break;
  16189. case g.NONE:
  16190. break;
  16191. case g.MIDDLE:
  16192. i = r,
  16193. n = r,
  16194. this.hideAlltags(n),
  16195. setTimeout(function() {
  16196. this.showAlltags(i)
  16197. }
  16198. .bind(this), n);
  16199. break;
  16200. case g.FADEIN:
  16201. setTimeout(function() {
  16202. this.showAlltags(r)
  16203. }
  16204. .bind(this), r)
  16205. }
  16206. }
  16207. ,
  16208. n.prototype.onPlayerModeChanging = function(e, t) {
  16209. t !== p.PANORAMA && this.dismissExaminedTag(),
  16210. t === p.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = p.OUTDOOR);
  16211. var i = t !== p.OUTDOOR;
  16212. i !== this.model.tagsShown && (i ? this.showAlltags(c.tags.startup.fadeInDuration) : this.hideAlltags(c.tags.startup.fadeInDuration))
  16213. }
  16214. ,
  16215. n.prototype.onPanoChange = function(e, t) {
  16216. var i = this.navigatingViaTag;
  16217. if (this.navigatingViaTag = !1,
  16218. !i) {
  16219. this.dismissExaminedTag();
  16220. var n = e && !e.isAligned() ? p.OUTDOOR : p.PANORAMA
  16221. , r = t && !t.isAligned() ? p.OUTDOOR : p.PANORAMA;
  16222. n !== r && (r === p.PANORAMA ? this.showAlltags(c.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(c.tags.startup.fadeInDuration))
  16223. }
  16224. }
  16225. ,
  16226. n.prototype.onPlayerReady = function(e, t, i) {
  16227. this.startAlltags(e, t ? i : null)
  16228. }
  16229. ,
  16230. n.prototype.onPlayerFlyingEnded = function(e, t) {
  16231. this.updateClosestTags(e)
  16232. }
  16233. ,
  16234. n.prototype.dismissExaminedTag = function() {
  16235. this.activeTag && this.tagState === y.EXAMINE && this.dismissActiveTag(),
  16236. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  16237. this.hoveredTag = null)
  16238. }
  16239. ,
  16240. n.prototype.startAlltags = function(e, t) {
  16241. this.model.shouldShowtags = c.tags.enabled,
  16242. this.enabled = !0,
  16243. e || (this.showAlltags(c.tags.startup.fadeInDuration, c.tags.startup.fadeInDelay),
  16244. t && setTimeout(function() {
  16245. this.activateTag(this.model.getTagBySid(t))
  16246. }
  16247. .bind(this), c.tags.startup.fadeInDuration / 2))
  16248. }
  16249. ,
  16250. n.prototype.showAlltags = function(e, t, i) {
  16251. function n() {
  16252. o++,
  16253. o === this.totaltags && (this.model.tagsShown = !0,
  16254. r.resolve())
  16255. }
  16256. var r = $.Deferred();
  16257. if (!i && this.player.mode === p.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  16258. return r.resolve().promise();
  16259. var o = 0;
  16260. for (var a in this.model.tags) {
  16261. var s = this.model.tags[a];
  16262. s.show(e, t).done(n.bind(this))
  16263. }
  16264. return r.promise()
  16265. }
  16266. ,
  16267. n.prototype.hideAlltags = function(e, t) {
  16268. function i() {
  16269. r++,
  16270. r === this.totaltags && (this.model.tagsShown = !1,
  16271. n.resolve())
  16272. }
  16273. var n = $.Deferred()
  16274. , r = 0;
  16275. for (var o in this.model.tags) {
  16276. var a = this.model.tags[o];
  16277. a.hide(e, t).done(i.bind(this)),
  16278. a === this.activeTag && this.dismissActiveTag()
  16279. }
  16280. return n.promise()
  16281. }
  16282. ,
  16283. n.prototype.enableHovering = function() {
  16284. this.enabled = !0
  16285. }
  16286. ,
  16287. n.prototype.disableHovering = function() {
  16288. this.enabled = !1
  16289. }
  16290. ,
  16291. n.prototype.activateTag = function(e, t) {
  16292. t = t || y.EXAMINE,
  16293. this.activeTag = e,
  16294. this.activeTag.hoveringDisc = !0,
  16295. this.activeTag.setHoverState(t === y.EXAMINE),
  16296. this.tagState = t,
  16297. this.emit(v.TagActivated, e)
  16298. }
  16299. ,
  16300. n.prototype.dismissActiveTag = function() {
  16301. this.activeTag.hoveringDisc = !1,
  16302. this.activeTag.setFreeState(!0);
  16303. var e = this.activeTag;
  16304. this.activeTag = null,
  16305. this.tagState = y.IDLE,
  16306. this.emit(v.TagDismissed, e)
  16307. }
  16308. ,
  16309. n.prototype.clickedOnTag = function(e) {
  16310. var t = function() {
  16311. this.navigatingViaTag = !0,
  16312. this.activeTag.examine(this.player),
  16313. this.emit(v.TagNavigation, this.activeTag)
  16314. }
  16315. .bind(this);
  16316. return this.tagState !== y.EXAMINE ? (this.activateTag(this.intersectTag, y.EXAMINE),
  16317. this.activeTag = this.intersectTag,
  16318. t(),
  16319. !0) : (this.dismissActiveTag(),
  16320. !1)
  16321. }
  16322. ,
  16323. n.prototype.intersecttag = function() {
  16324. var e = new r.Vector3
  16325. , t = new r.Vector3
  16326. , i = new r.Vector3;
  16327. return function(n, r, o) {
  16328. if (!this.enabled)
  16329. return null;
  16330. var a = null
  16331. , s = this.tagDiscs.filter(function(e) {
  16332. return e.parent.visible
  16333. });
  16334. if (s.length > 0) {
  16335. var l = this.model.floors.reduce(function(e, t) {
  16336. return t.hidden ? e : e.concat(t.collider.children)
  16337. }, s);
  16338. e.set(n.x, n.y, -1).unproject(o),
  16339. t.set(n.x, n.y, 1).unproject(o),
  16340. i.copy(t).sub(e).normalize(),
  16341. this.raycaster.set(e, i);
  16342. var c = this.raycaster.intersectObjects(l);
  16343. c.length > 0 && s.indexOf(c[0].object) !== -1 && (a = c[0].object.tag)
  16344. }
  16345. return this.intersectTag = a,
  16346. r && (this.activeTag && a !== this.activeTag && (this.tagState === y.BROWSE || this.tagState === y.EXAMINE && a) && this.dismissActiveTag(),
  16347. a && a !== this.activeTag && (a.listeners(h.ENTER).length < 1 && (a.billboard.on(h.ENTER, function() {
  16348. this.hoveredTag = a
  16349. }
  16350. .bind(this)),
  16351. a.billboard.on(h.LEAVE, function() {
  16352. this.hoveredTag = null
  16353. }
  16354. .bind(this))),
  16355. this.activateTag(a, y.BROWSE))),
  16356. a
  16357. }
  16358. }(),
  16359. n.prototype.rankedtagInDirection = function() {
  16360. var e = []
  16361. , t = []
  16362. , i = new r.Vector3
  16363. , n = new r.Vector3
  16364. , o = new r.Vector3;
  16365. return function(r, a, s, l) {
  16366. var c = 0;
  16367. t.length = 0;
  16368. for (var h = 0; h < this.closesttags.length; h++) {
  16369. var u = this.closesttags[h];
  16370. n.copy(u.position),
  16371. n.add(u.discPosition),
  16372. i.copy(a),
  16373. i.sub(n).negate(),
  16374. i.normalize();
  16375. var d = i.dot(l);
  16376. if (d >= 0) {
  16377. o.copy(n),
  16378. o.project(s);
  16379. var p = this.intersecttag(o, !1, s);
  16380. if (p) {
  16381. if (c >= e.length)
  16382. for (var f = 0; f < 64; f++)
  16383. e.push({
  16384. tag: u,
  16385. dot: d
  16386. });
  16387. var g = e[c];
  16388. g.tag = u,
  16389. g.dot = d,
  16390. g.position = math.projectPositionToCanvas(n, s),
  16391. t.push(g),
  16392. c++
  16393. }
  16394. }
  16395. }
  16396. return t.sort(function(e, t) {
  16397. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  16398. }),
  16399. r < t.length ? t[r].tag : null
  16400. }
  16401. }(),
  16402. n.prototype.updateClosestTags = function() {
  16403. var e = new r.Vector3
  16404. , t = 30;
  16405. return function(i) {
  16406. this.closesttags || (this.closesttags = []),
  16407. this.closesttags.length = 0;
  16408. var n = this.model.tags;
  16409. if (n)
  16410. for (var r in n)
  16411. if (n.hasOwnProperty(r)) {
  16412. var o = n[r]
  16413. , a = o.position;
  16414. e.copy(i),
  16415. e.sub(a).negate();
  16416. var s = e.lengthSq();
  16417. s < t && this.closesttags.push(o)
  16418. }
  16419. }
  16420. }(),
  16421. t.exports = n
  16422. }
  16423. ).call(this, "/js/tag/tagManager.js")
  16424. }
  16425. , {
  16426. "../controls/serializer": 14,
  16427. "../enum/BlackoutStyle": 18,
  16428. "../enum/tagEvents": 32,
  16429. "../enum/ModelManagerEvents": 33,
  16430. "../enum/PlayerEvents": 40,
  16431. "../enum/TagStates": 44,
  16432. "../enum/Viewmode": 51,
  16433. "../enum/WarpStyle": 52,
  16434. "../objects/Snapshot": 153,
  16435. "../settings": 166,
  16436. "../util/common": 185,
  16437. "../util/lerp": 188,
  16438. "../util/logger": 189,
  16439. "./Billboard/BillboardEvent": 120,
  16440. "./Media/LinkType": 130,
  16441. "./Media/MediaEvent": 131,
  16442. events: 202,
  16443. three: 217
  16444. }],
  16445. 125: [function(e, t, i) {
  16446. (function(i) {
  16447. "use strict";
  16448. function n() {
  16449. this.embedWrapper = null,
  16450. this.embedElement = null
  16451. }
  16452. var r = e("../../util/ajax")
  16453. , o = e("./mediaSettings")
  16454. , a = e("../../settings")
  16455. , s = e("../../util/logger")
  16456. , l = new s(i);
  16457. n.prototype.createDomElement = function() {
  16458. return this.embedWrapper = document.createElement("div"),
  16459. this.embedWrapper.classList.add("tag-embed"),
  16460. this.embedWrapper.classList.add("hidden"),
  16461. this.embedWrapper
  16462. }
  16463. ,
  16464. n.prototype.load = function(e) {
  16465. var t = "https://api.embedly.com/1/oembed?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + o.maxEmbedWidth;
  16466. return new Promise(function(e, i) {
  16467. r.get(t).then(function(t) {
  16468. if (t = JSON.parse(t),
  16469. t.html && t.html.indexOf("<script") === -1) {
  16470. this.embedWrapper.innerHTML = t.html;
  16471. var n = Math.min(t.width, o.maxEmbedWidth) || o.maxEmbedWidth;
  16472. if (this.embedWrapper.style.width = n + "px",
  16473. t.height) {
  16474. var r = t.height / t.width;
  16475. this.embedWrapper.style.height = n * r + "px"
  16476. }
  16477. this.embedElement = this.embedWrapper.firstChild;
  16478. var a = [];
  16479. try {
  16480. a = [].slice.call(this.embedElement.querySelectorAll("a"))
  16481. } catch (e) {
  16482. l.debug("Error getting `a` elements for embed; was it an iframe?")
  16483. }
  16484. a.forEach(function(e) {
  16485. e.setAttribute("target", "_blank")
  16486. }),
  16487. this.embedElement.classList.add("hidden"),
  16488. this.embedWrapper.classList.remove("hidden"),
  16489. e()
  16490. } else
  16491. i("Not a valid embed")
  16492. }
  16493. .bind(this), function(e) {
  16494. i(e.response)
  16495. })
  16496. }
  16497. .bind(this))
  16498. }
  16499. ,
  16500. n.prototype.show = function() {
  16501. this.embedElement && this.embedElement.classList.remove("hidden")
  16502. }
  16503. ,
  16504. n.prototype.hide = function() {
  16505. this.embedElement && this.embedElement.classList.add("hidden")
  16506. }
  16507. ,
  16508. t.exports = n
  16509. }
  16510. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  16511. }
  16512. , {
  16513. "../../settings": 166,
  16514. "../../util/ajax": 181,
  16515. "../../util/logger": 189,
  16516. "./mediaSettings": 132
  16517. }],
  16518. 126: [function(e, t, i) {
  16519. (function(i) {
  16520. "use strict";
  16521. function n(e) {
  16522. o.call(this),
  16523. this.options = e,
  16524. this.playerControls = null,
  16525. this.state = s.NOT_READY
  16526. }
  16527. var r = e("../../util/browser")
  16528. , o = e("./EmbedlyEmbed")
  16529. , a = e("../../util/logger")
  16530. , s = (new a(i),
  16531. Object.freeze({
  16532. NOT_READY: "player.not.ready",
  16533. CUED: "player.cued",
  16534. PLAYING: "player.playing",
  16535. PAUSED: "player.paused"
  16536. }));
  16537. n.prototype = Object.create(o.prototype),
  16538. n.prototype.createDomElement = function() {
  16539. return this.embedWrapper = document.createElement("div"),
  16540. this.embedWrapper.classList.add("tag-video"),
  16541. this.embedWrapper.classList.add("hidden"),
  16542. this.embedWrapper
  16543. }
  16544. ,
  16545. n.prototype.load = function(e) {
  16546. var t = function() {
  16547. function e(e) {
  16548. this.playerState = s.CUED,
  16549. this.options.startMuted && this.playerControls.mute()
  16550. }
  16551. function t(e) {
  16552. this.playerState = e
  16553. }
  16554. function i(e) {
  16555. this.playerControls.setCurrentTime(0),
  16556. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  16557. }
  16558. this.playerControls = new playerjs.Player(this.embedElement),
  16559. this.playerControls.on("ready", e.bind(this)),
  16560. this.playerControls.on("play", t.bind(this, s.PLAYING)),
  16561. this.playerControls.on("pause", t.bind(this, s.PAUSED)),
  16562. this.playerControls.on("ended", i.bind(this))
  16563. }
  16564. .bind(this);
  16565. return o.prototype.load.call(this, e).then(t.bind(this))
  16566. }
  16567. ,
  16568. n.prototype.play = function() {
  16569. var e = r.isMobile();
  16570. return function() {
  16571. this.playerState !== s.NOT_READY && this.playerControls && !e && (this.state === s.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  16572. }
  16573. }(),
  16574. n.prototype.pause = function() {
  16575. this.playerState !== s.NOT_READY && this.playerControls && this.playerControls.pause()
  16576. }
  16577. ,
  16578. t.exports = n
  16579. }
  16580. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  16581. }
  16582. , {
  16583. "../../util/browser": 182,
  16584. "../../util/logger": 189,
  16585. "./EmbedlyEmbed": 125
  16586. }],
  16587. 127: [function(e, t, i) {
  16588. (function(i) {
  16589. "use strict";
  16590. function n(e) {
  16591. function t() {
  16592. return a.debug("requesting file from embedly:", e.href),
  16593. r.get(e.href, {
  16594. responseType: e.responseType
  16595. }).then(function(t) {
  16596. return a.debug("requesting file finished:", e.href),
  16597. t
  16598. })
  16599. }
  16600. function i() {}
  16601. return s = new Promise(function(e, n) {
  16602. s.catch(i).then(function() {
  16603. t().then(e, n)
  16604. })
  16605. }
  16606. )
  16607. }
  16608. var r = e("../../util/ajax")
  16609. , o = (e("./mediaSettings"),
  16610. e("../../util/logger"))
  16611. , a = new o(i)
  16612. , s = Promise.resolve();
  16613. t.exports.enqueue = n
  16614. }
  16615. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  16616. }
  16617. , {
  16618. "../../util/ajax": 181,
  16619. "../../util/logger": 189,
  16620. "./mediaSettings": 132
  16621. }],
  16622. 128: [function(e, t, i) {
  16623. (function(i) {
  16624. "use strict";
  16625. function n() {
  16626. this.imageWrapper = null,
  16627. this.width = 0,
  16628. this.height = 0,
  16629. this.aspect = 1
  16630. }
  16631. var r = e("./MediaEvent")
  16632. , o = e("./EmbedlyQueue")
  16633. , a = e("events").EventEmitter
  16634. , s = e("../../util/logger")
  16635. , l = e("../../settings");
  16636. new s(i);
  16637. n.prototype = Object.create(a.prototype),
  16638. n.prototype.createDomElement = function() {
  16639. return this.imageWrapper = document.createElement("div"),
  16640. this.imageWrapper.classList.add("tag-image"),
  16641. this.imageWrapper.classList.add("hidden"),
  16642. this.imageWrapper.addEventListener("click", function(e) {
  16643. e.stopPropagation(),
  16644. this.emit(r.IMAGE_OPENING),
  16645. this.imageWrapper.style.pointerEvents = "none"
  16646. }
  16647. .bind(this)),
  16648. this.imageWrapper
  16649. }
  16650. ,
  16651. n.prototype.onClosed = function() {
  16652. this.imageWrapper.style.pointerEvents = "auto"
  16653. }
  16654. ,
  16655. n.prototype.load = function(e) {
  16656. var t = Math.max(window.screen.height, window.screen.width)
  16657. , i = "https://i.embed.ly/1/display/resize?key=" + l.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  16658. return new Promise(function(e, t) {
  16659. function n(t) {
  16660. var i = t.target;
  16661. this.width = i.naturalWidth,
  16662. this.height = i.naturalHeight,
  16663. this.aspect = this.width / this.height;
  16664. var n = t.target.src;
  16665. this.imageWrapper.style.backgroundImage = 'url("' + n + '")',
  16666. this.imageWrapper.style.width = this.width + "px",
  16667. this.imageWrapper.style.height = this.height + "px",
  16668. this.imageWrapper.classList.remove("hidden"),
  16669. e()
  16670. }
  16671. o.enqueue({
  16672. href: i,
  16673. responseType: "arraybuffer"
  16674. }).then(function(e) {
  16675. var t = new Uint8Array(e)
  16676. , i = new Blob([t])
  16677. , r = new window.Image;
  16678. r.addEventListener("load", n.bind(this));
  16679. var o = URL.createObjectURL(i);
  16680. r.src = o
  16681. }
  16682. .bind(this), t)
  16683. }
  16684. .bind(this))
  16685. }
  16686. ,
  16687. t.exports = n
  16688. }
  16689. ).call(this, "/js/tag/Media/Image.js")
  16690. }
  16691. , {
  16692. "../../settings": 166,
  16693. "../../util/logger": 189,
  16694. "./EmbedlyQueue": 127,
  16695. "./MediaEvent": 131,
  16696. events: 202
  16697. }],
  16698. 129: [function(e, t, i) {
  16699. "use strict";
  16700. function n(e) {
  16701. this.label = e.label,
  16702. this.href = e.url,
  16703. this.type = this.updateLinkForType(),
  16704. this.domElement = null,
  16705. this.id = c++
  16706. }
  16707. var r = e("./LinkType")
  16708. , o = e("./MediaEvent")
  16709. , a = e("../../util/browser")
  16710. , s = e("../../analytics")
  16711. , l = e("events").EventEmitter
  16712. , c = 0;
  16713. n.prototype = Object.create(l.prototype),
  16714. n.prototype.updateLinkForType = function() {
  16715. function e(e) {
  16716. var t = new RegExp("[#&?]start=([^#&?]*)")
  16717. , i = t.exec(e);
  16718. return i[1]
  16719. }
  16720. function t(e) {
  16721. return e + "&play=1"
  16722. }
  16723. var i = a.valueFromHash("m") || a.valueFromHash("model");
  16724. 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),
  16725. r.NAVIGATION) : (this.href = t(this.href),
  16726. r.MODEL) : r.EXT_LINK
  16727. }
  16728. ;
  16729. var h = {};
  16730. n.prototype.createDomElement = function() {
  16731. function e(e) {
  16732. switch (e.stopPropagation(),
  16733. h[this.id] = !0,
  16734. s.trackAlways("click_tag_link", {
  16735. link_type: this.type,
  16736. link_count: c,
  16737. links_clicked: Object.keys(h).length
  16738. }),
  16739. this.type) {
  16740. case r.MODEL:
  16741. window.location.replace(this.href);
  16742. break;
  16743. case r.EXT_LINK:
  16744. window.open(this.href, "_blank")
  16745. }
  16746. this.emit(o.LINK_CLICK, {
  16747. type: this.type,
  16748. url: this.href
  16749. })
  16750. }
  16751. if (this.domElement = document.createElement("a"),
  16752. this.domElement.classList.add("tag-link"),
  16753. this.domElement.textContent = this.label,
  16754. this.type === r.EXT_LINK) {
  16755. this.domElement.textContent += " ";
  16756. var t = document.createElement("i");
  16757. t.classList.add("icon-ext-link"),
  16758. t.title = "Link to external web site",
  16759. this.domElement.appendChild(t)
  16760. }
  16761. return this.domElement.addEventListener("click", e.bind(this)),
  16762. this.domElement
  16763. }
  16764. ,
  16765. t.exports = n
  16766. }
  16767. , {
  16768. "../../analytics": 4,
  16769. "../../util/browser": 182,
  16770. "./LinkType": 130,
  16771. "./MediaEvent": 131,
  16772. events: 202
  16773. }],
  16774. 130: [function(e, t, i) {
  16775. "use strict";
  16776. t.exports = {
  16777. NAVIGATION: "navigation",
  16778. MODEL: "model",
  16779. EXT_LINK: "ext-link"
  16780. }
  16781. }
  16782. , {}],
  16783. 131: [function(e, t, i) {
  16784. "use strict";
  16785. t.exports = Object.freeze({
  16786. LINK_CLICK: "mtmedia.link",
  16787. IMAGE_LOADED: "mtmedia.image.loaded",
  16788. IMAGE_OPENING: "mtmedia.image.opening",
  16789. IMAGE_OPENED: "mtmedia.image.opened",
  16790. IMAGE_CLOSING: "mtmedia.image.closing",
  16791. IMAGE_CLOSED: "mtmedia.image.closed",
  16792. VIDEO_START: "mtmedia.video.start",
  16793. VIDEO_PAUSE: "mtmedia.video.pause",
  16794. VIDEO_ENDED: "mtmedia.video.end"
  16795. })
  16796. }
  16797. , {}],
  16798. 132: [function(e, t, i) {
  16799. "use strict";
  16800. t.exports = Object.freeze({
  16801. maxEmbedWidth: 350,
  16802. defaultAspectRatio: .75
  16803. })
  16804. }
  16805. , {}],
  16806. 133: [function(e, t, i) {
  16807. "use strict";
  16808. t.exports = Object.freeze({
  16809. TEXT: "text",
  16810. LINK: "link",
  16811. IMAGE: "photo",
  16812. VIDEO: "video",
  16813. RICH: "rich"
  16814. })
  16815. }
  16816. , {}],
  16817. 134: [function(e, t, i) {
  16818. "use strict";
  16819. function n(e) {
  16820. this.capabilities = {
  16821. links: {
  16822. enable: e.supportLinks,
  16823. keepLabels: e.keepLinkLabels
  16824. }
  16825. }
  16826. }
  16827. var r = e("./DescriptionChunkType");
  16828. n.prototype.parse = function(e, t) {
  16829. var i = []
  16830. , n = e.split("[").map(function(e, t) {
  16831. return 0 === t ? e : "[" + e
  16832. });
  16833. return n.forEach(function(e) {
  16834. var n = this.findMarkdown(e);
  16835. if (n) {
  16836. if (n.url.indexOf("javascript:") !== -1)
  16837. return;
  16838. this.addLinkChunk(i, n, t),
  16839. this.addTextChunk(i, e.slice(n.markdown.length))
  16840. } else
  16841. this.addTextChunk(i, e)
  16842. }
  16843. .bind(this)),
  16844. i
  16845. }
  16846. ,
  16847. n.prototype.findMarkdown = function(e) {
  16848. var t = /\[([^\]]*)\]\((.*)\)/
  16849. , i = e.match(t);
  16850. if (i) {
  16851. for (var n = i[2], r = 1, o = 0; o < n.length && ("(" === n[o] ? r++ : ")" === n[o] && r--,
  16852. 0 !== r); )
  16853. o++;
  16854. var a = n.length - o;
  16855. return {
  16856. markdown: i[0].substring(0, i[0].length - a),
  16857. label: i[1],
  16858. url: i[2].substring(0, o)
  16859. }
  16860. }
  16861. }
  16862. ,
  16863. n.prototype.addTextChunk = function(e, t) {
  16864. 0 !== t.length && e.push({
  16865. type: r.TEXT,
  16866. text: t
  16867. })
  16868. }
  16869. ,
  16870. n.prototype.addLinkChunk = function(e, t) {
  16871. if (!this.capabilities.links.enable)
  16872. return void (this.capabilities.links.keepLabels && this.addTextChunk(e, t.label));
  16873. var i = {
  16874. label: t.label,
  16875. url: t.url
  16876. };
  16877. i.url.indexOf("://") === -1 && (i.url = "http://" + i.url),
  16878. e.push({
  16879. type: r.LINK,
  16880. link: i
  16881. })
  16882. }
  16883. ,
  16884. t.exports = n
  16885. }
  16886. , {
  16887. "./DescriptionChunkType": 133
  16888. }],
  16889. 135: [function(e, t, i) {
  16890. (function(i) {
  16891. "use strict";
  16892. var n = e("../util/logger")
  16893. , r = new n(i)
  16894. , o = {
  16895. parseIdsFromChunkName: function(e, t) {
  16896. t.floorId = o.parseFloor(e),
  16897. t.roomId = o.parseRoom(e)
  16898. },
  16899. parseFloor: function(e) {
  16900. var t = e.match(/_group([0-9]+)/);
  16901. if (!t)
  16902. return 0;
  16903. try {
  16904. return parseInt(t[1], 10)
  16905. } catch (e) {
  16906. return r.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  16907. 0
  16908. }
  16909. },
  16910. parseRoom: function(e) {
  16911. var t = e.match(/_sub([0-9]+)/);
  16912. if (!t)
  16913. return -1;
  16914. try {
  16915. return parseInt(t[1], 10)
  16916. } catch (e) {
  16917. return r.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  16918. 0
  16919. }
  16920. }
  16921. };
  16922. t.exports = o
  16923. }
  16924. ).call(this, "/js/model/Chunks.js")
  16925. }
  16926. , {
  16927. "../util/logger": 189
  16928. }],
  16929. 136: [function(e, t, i) {
  16930. (function(i) {
  16931. "use strict";
  16932. function n(e) {
  16933. s.call(this),
  16934. this.model = e,
  16935. this.exploded = !1
  16936. }
  16937. var r = e("../objects/Floor")
  16938. , o = (e("../settings"),
  16939. e("../util/logger"))
  16940. , a = e("../util/transitions")
  16941. , s = e("../util/IndexedCollection")
  16942. , l = e("../util/common")
  16943. , c = e("../util/easing");
  16944. new o(i);
  16945. l.inherit(n, s),
  16946. n.prototype.add = function(e) {
  16947. s.prototype.add.call(this, e),
  16948. this.model.add(e)
  16949. }
  16950. ,
  16951. n.prototype.getIndex = function(e) {
  16952. return e.floorIndex
  16953. }
  16954. ,
  16955. n.prototype.build = function() {
  16956. this.list.forEach(function(e) {
  16957. e.build()
  16958. })
  16959. }
  16960. ,
  16961. n.prototype.size = function() {
  16962. return this.length
  16963. }
  16964. ,
  16965. n.prototype.sort = function() {
  16966. s.prototype.sort.call(this, function(e, t) {
  16967. return e.floorIndex - t.floorIndex
  16968. })
  16969. }
  16970. ,
  16971. n.prototype.nextFloor = function(e, t) {
  16972. return this.index[e.floorIndex + t] || null
  16973. }
  16974. ,
  16975. n.prototype.getFloorAtPoint = function(e) {
  16976. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16977. var r = this.list[n]
  16978. , o = r.distanceToPoint(e);
  16979. (!t || i > o) && (i = o,
  16980. t = r)
  16981. }
  16982. return t
  16983. }
  16984. ,
  16985. n.prototype.getOrMakeFloor = function(e) {
  16986. var t = this.index[e];
  16987. return t || (t = new r(this.model,e),
  16988. this.add(t)),
  16989. t
  16990. }
  16991. ,
  16992. n.prototype.hide = function() {
  16993. this.list.forEach(function(e) {
  16994. e.hide()
  16995. })
  16996. }
  16997. ,
  16998. n.prototype.show = function() {
  16999. this.list.forEach(function(e) {
  17000. e.show()
  17001. })
  17002. }
  17003. ,
  17004. n.prototype.names = function() {
  17005. return this.list.reduce(function(e, t) {
  17006. return e.concat(t.name)
  17007. }, [])
  17008. }
  17009. ,
  17010. n.prototype.toggleExplodeHorizontal = function() {
  17011. function e(e, t) {
  17012. r.copy(e.position),
  17013. e.position.x = i[e.floorIndex] * t,
  17014. e.position.y = 1 * e.floorIndex * t,
  17015. r.sub(e.position).multiplyScalar(-1),
  17016. e.panos.forEach(function(e) {
  17017. e.translate(r)
  17018. })
  17019. }
  17020. var t, i = [], n = 0;
  17021. this.list.forEach(function(e, r, o) {
  17022. t = r > 0 ? Math.max(o[r - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  17023. n += t,
  17024. i[r] = n
  17025. }),
  17026. i = i.map(function(e) {
  17027. return e - n / 2
  17028. });
  17029. var r = this.list[0].position.clone();
  17030. this.exploded ? this.list.forEach(function(t) {
  17031. a.start(function(i) {
  17032. e(t, 1 - i)
  17033. }, 1500, null, 0, c.easeOutExpo)
  17034. }) : this.list.forEach(function(t) {
  17035. a.start(function(i) {
  17036. e(t, i)
  17037. }, 1500, null, 0, c.easeOutExpo)
  17038. }),
  17039. this.exploded = !this.exploded
  17040. }
  17041. ,
  17042. n.prototype.toggleExplodeVertical = function() {
  17043. function e(e, i) {
  17044. var n = n.copy(e.position);
  17045. e.position.y = (5 * e.floorIndex - t.y / 2) * i,
  17046. n.sub(e.position).multiplyScalar(-1),
  17047. e.panos.forEach(function(e) {
  17048. e.translate(n)
  17049. })
  17050. }
  17051. var t = this.model.size;
  17052. this.list[0].position.clone();
  17053. this.exploded ? this.list.forEach(function(t) {
  17054. a.start(function(i) {
  17055. e(t, 1 - i)
  17056. }, 1500, null, 0, c.easeOutExpo)
  17057. }) : this.list.forEach(function(t) {
  17058. a.start(function(i) {
  17059. e(t, i)
  17060. }, 1500, null, 0, c.easeOutExpo)
  17061. }),
  17062. this.exploded = !this.exploded
  17063. }
  17064. ,
  17065. t.exports = n
  17066. }
  17067. ).call(this, "/js/model/FloorCollection.js")
  17068. }
  17069. , {
  17070. "../objects/Floor": 146,
  17071. "../settings": 166,
  17072. "../util/IndexedCollection": 175,
  17073. "../util/common": 185,
  17074. "../util/easing": 186,
  17075. "../util/logger": 189,
  17076. "../util/transitions": 195
  17077. }],
  17078. 137: [function(e, t, i) {
  17079. (function(i) {
  17080. "use strict";
  17081. function n() {
  17082. c.call(this)
  17083. }
  17084. var r = e("../settings")
  17085. , o = e("../util/logger")
  17086. , a = e("../enum/Viewmode")
  17087. , s = e("../objects/Snapshot")
  17088. , l = (e("../util/math"),
  17089. e("../util/common"))
  17090. , c = e("../util/IndexedCollection")
  17091. , h = new o(i);
  17092. l.inherit(n, c),
  17093. n.prototype.getImage = function(e) {
  17094. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  17095. }
  17096. ,
  17097. n.prototype.filterByModesAndReel = function(e, t) {
  17098. for (var i = [], n = 0; n < t.length; n += 1) {
  17099. var r = t[n]
  17100. , o = this.index[r.sid];
  17101. o && i.push(o)
  17102. }
  17103. var s = e[a.DOLLHOUSE]
  17104. , l = e[a.FLOORPLAN];
  17105. i = i.filter(function(e) {
  17106. if (!e.metadata || void 0 === e.metadata.camera_mode)
  17107. return !0;
  17108. var t;
  17109. try {
  17110. t = a.convertWorkshopModeInt(e.metadata.camera_mode)
  17111. } catch (e) {
  17112. return h.debug(e.message),
  17113. !1
  17114. }
  17115. return t === a.PANORAMA || t === a.FLOORPLAN && l || t === a.DOLLHOUSE && s
  17116. }),
  17117. i.length !== this.list.length && h.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  17118. this.list = i,
  17119. this.reIndex()
  17120. }
  17121. ,
  17122. n.prototype.getHeroLocations = function(panos) {//改 增加二级location
  17123. if (0 === this.list.length)
  17124. return [];
  17125. var locations = [];
  17126. var deal = (info, container)=>{
  17127. var src = info.thumbnail_signed_src,
  17128. o = info.name || "";
  17129. if (info.metadata && void 0 !== info.metadata.camera_quaternion) {
  17130. if (!r.show360Views.enabled && info.metadata.scan_id) {
  17131. let a = panos.get(info.metadata.scan_id);
  17132. if (a && !a.isAligned()) return
  17133. }
  17134. var cameraMode = a.convertWorkshopModeInt(info.metadata.camera_mode);
  17135. if (cameraMode === a.MESH) return
  17136. if(window.isLocal)src = manage.dealURL(src)
  17137. else src = "one" === g_version ? g_Prefix + src + "?" + randomTime().getTime() : src + "?" + randomTime().getTime()
  17138. var l = {
  17139. cameraMode: cameraMode,
  17140. position: info.metadata.camera_position,
  17141. quaternion: info.metadata.camera_quaternion,
  17142. zoom: info.metadata.zoom,
  17143. panoId: info.metadata.scan_id,
  17144. orthoZoom: info.metadata.ortho_zoom,
  17145. floorVisibility: void 0 !== info.metadata.floor_visibility ? info.metadata.floor_visibility.slice(0) : [],
  17146. thumbUrl: src,
  17147. name: n.filterImageName(o),
  17148. sid: info.sid
  17149. }
  17150. var item = new s(l);
  17151. item.momentTour = info.momentTour
  17152. item.dontRot = info.dontRot
  17153. item.rotTime = info.rotTime
  17154. item.musicInfo = info.musicInfo || g_data2.tourAudio[info.sid] || {}//新的music数据统一写在每个info下,如果有musicInfo则覆盖g_data2.tourAudio
  17155. container.push(item)
  17156. return item
  17157. }
  17158. }
  17159. this.list.forEach(image=>{
  17160. if(image.images){
  17161. var folder = $.extend({}, image )
  17162. folder.heroLocations = [];
  17163. image.images.list.forEach(child=>{
  17164. deal(child, folder.heroLocations);
  17165. })
  17166. folder.musicInfo = folder.musicInfo || {}
  17167. locations.push(folder)
  17168. delete folder.images;
  17169. delete folder.locations;
  17170. }else{
  17171. var item = deal(image, locations);
  17172. }
  17173. })
  17174. return locations
  17175. }
  17176. ,
  17177. n.prototype.getIndex = function(e) {
  17178. return e.sid
  17179. }
  17180. ,
  17181. n.filterImageName = function(e) {
  17182. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  17183. }
  17184. ,
  17185. t.exports = n
  17186. }
  17187. ).call(this, "/js/model/ImageCollection.js")
  17188. }
  17189. , {
  17190. "../enum/Viewmode": 51,
  17191. "../objects/Snapshot": 153,
  17192. "../settings": 166,
  17193. "../util/IndexedCollection": 175,
  17194. "../util/common": 185,
  17195. "../util/logger": 189,
  17196. "../util/math": 190
  17197. }],
  17198. 138: [function(e, t, i) {
  17199. (function(i) {
  17200. "use strict";
  17201. function n() {
  17202. u.call(this)
  17203. }
  17204. var r = e("../label/Label")
  17205. , o = e("../settings")
  17206. , a = e("../util/logger")
  17207. , s = e("../util/math")
  17208. , l = e("../util/ajax")
  17209. , c = e("./RoomCollection")
  17210. , h = e("../util/common")
  17211. , u = e("../util/IndexedCollection");
  17212. new a(i);
  17213. h.inherit(n, u),
  17214. n.prototype.getIndex = function(e) {
  17215. return e.labelId
  17216. }
  17217. ,
  17218. n.prototype.associateWithRooms = function(e) {
  17219. this.forEach(function(t) {
  17220. e.forEach(function(e) {
  17221. e.roomId === t.roomId && (t.room = e)
  17222. })
  17223. })
  17224. }
  17225. ,
  17226. n.prototype.createFromLabelData = function(e) {
  17227. e.forEach(function(e) {
  17228. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  17229. t = c.generateRoomId(e.floorId, t);
  17230. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  17231. i.position = s.convertWorkshopVector(i.position),
  17232. this.add(i),
  17233. i.build()
  17234. }
  17235. .bind(this))
  17236. }
  17237. ,
  17238. n.prototype.load = function(e, t) {
  17239. return l.get(e, {
  17240. responseType: "json",
  17241. auth: t ? o.authorizationHeader : null
  17242. }).done(function(e) {
  17243. var t = [];
  17244. for (var i in e) {
  17245. var n = e[i];
  17246. t.push(n)
  17247. }
  17248. this.createFromLabelData(t)
  17249. }
  17250. .bind(this))
  17251. }
  17252. ,
  17253. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  17254. var t = -1;
  17255. if (e) {
  17256. if(typeof e == 'number'){//add
  17257. t = parseInt(e)
  17258. }else{
  17259. var i = e.split("_");
  17260. t = parseInt(i[0])
  17261. }
  17262. }
  17263. return t
  17264. },
  17265. t.exports = n
  17266. }
  17267. ).call(this, "/js/model/LabelCollection.js")
  17268. }
  17269. , {
  17270. "../label/Label": 90,
  17271. "../settings": 166,
  17272. "../util/IndexedCollection": 175,
  17273. "../util/ajax": 181,
  17274. "../util/common": 185,
  17275. "../util/logger": 189,
  17276. "../util/math": 190,
  17277. "./RoomCollection": 141
  17278. }],
  17279. 139: [function(e, t, i) {
  17280. (function(i) {
  17281. "use strict";
  17282. function n(e, t) {
  17283. o.Object3D.call(this)
  17284. this.sid = window.number;//t.sid,
  17285. this.data = t,
  17286. this.options = e,
  17287. this.urls = new s(e.urlFiles),
  17288. this.isPublic = void 0 !== t.is_public && t.is_public,
  17289. //创建heroLocations
  17290. this.images = new _(this),
  17291. this.images.extend(t.images),
  17292. this.images.forEach((info)=>{
  17293. if(info.locations){
  17294. info.images = new _(this);
  17295. info.images.extend(info.locations)
  17296. }
  17297. })
  17298. this.heroLocations = []
  17299. //this.heroImage = this.images.getImage(t.icon), //初始画面沒有用到icon
  17300. this.outdoorPanoLocations = [],
  17301. this.floors = new d(this),
  17302. this.floorsEnabled = void 0 === e.floors || e.floors,
  17303. this.changingFloor = !1,
  17304. this.chunks = [],
  17305. this.panos = new A,
  17306. this.colliders = [],
  17307. this.loadPanosPromise = null,
  17308. this.loadMeshTexturesPromise = null,
  17309. this.auxDataPromise = null,
  17310. this.meshTexturesLoaded = !1,
  17311. this.meshTextures = [],
  17312. this.tags = {},
  17313. this.tagsShown = !1,
  17314. this.shouldShowtags = !1,
  17315. this.has360Views = !1,
  17316. this.showingLabels = f.labels.enabled && t.player_options.labels,
  17317. this.supportedModes = {},
  17318. this.supportedModes[c.PANORAMA] = !0,
  17319. this.supportedModes[c.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && w.valueFromHash("dh", 1),
  17320. this.supportedModes[c.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && w.valueFromHash("dh", 1),
  17321. this.supportedModes[c.TRANSITIONING] = !0,
  17322. this.supportsTiles = this.configureTiling(),
  17323. // this.supportsVR = t.is_vr,
  17324. this.supportsVR = window.DATA.supportsVR || false//true; // 方奕卓 VR功能可配置
  17325. this.mode = c.DOLLHOUSE,
  17326. this.size = null,
  17327. this.center = null,
  17328. this.boundingBox = new o.Box3,
  17329. this.currentFloor = null,
  17330. this.allFloorsVisible = !0,
  17331. this.projectedPano0 = null,
  17332. this.projectedPano1 = null,
  17333. this.floorsEnabled && t.floors && t.floors.indexOf(",") !== -1 && t.floors.split(",").forEach(function(e, t) {
  17334. this.addFloor(new u(this,t,e.trim()))
  17335. }
  17336. .bind(this)),
  17337. this.waitQueue = [],
  17338. this.on("load", function(e) {
  17339. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  17340. return !e.isLoadedCallback()
  17341. }),
  17342. 0 === this.waitQueue.length && this.emit("waiting-done"))
  17343. }
  17344. .bind(this)),
  17345. this.setupCustomProperties()
  17346. this.hots = {};
  17347. }
  17348. function r() {
  17349. try {
  17350. var e = document.createElement("canvas")
  17351. , t = e.getContext("webgl");
  17352. t || (t = e.getContext("experimental-webgl"));
  17353. var i = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE);
  17354. return i
  17355. } catch (e) {
  17356. return 0
  17357. }
  17358. }
  17359. var o = e("three")
  17360. , a = e("../util/ajax")
  17361. , s = e("../util/ModelUrls")
  17362. , l = e("../objects/BoundingTextureSkybox")
  17363. , c = e("../enum/Viewmode")
  17364. , h = e("../enum/RenderOrder")
  17365. , u = (e("../enum/AlignmentType"),
  17366. e("../objects/Floor"))
  17367. , d = e("./FloorCollection")
  17368. , p = e("../objects/Chunk")
  17369. , f = (e("../objects/Room"),
  17370. e("../objects/Snapshot"),
  17371. e("../label/Label"),
  17372. e("../util/math"),
  17373. e("../settings"))
  17374. ,ss = e("../shaders")
  17375. , g = e("../util/logger")
  17376. , m = e("../tag/tag")
  17377. , v = (e("../tag/tagManager"),
  17378. e("../objects/Panorama"))
  17379. , A = e("../util/PanoramaCollection")
  17380. , y = e("../loaders/ModelLoader")
  17381. , C = e("../loaders/ModelTextureLoader")
  17382. , I = e("../loaders/SweepDataLoader")
  17383. , E = e("../util/transitions")
  17384. , b = e("../util/common")
  17385. , es = e("../util/easing")
  17386. ,lerp = e("../util/lerp")
  17387. ,tex = e("../util/texture")
  17388. , w = e("./../util/browser")
  17389. , _ = e("./ImageCollection")
  17390. , T = e("./RoomCollection")
  17391. , x = e("./LabelCollection")
  17392. , S = e("./Chunks")
  17393. , cameraLight = e("./util/cameraLight")
  17394. , M = e("./../util/showcase")
  17395. , R = e("../exception/BasicException")
  17396. , P = (e("../constants")
  17397. ,e("events").EventEmitter)
  17398. ,GLCubeFaces = e("../enum/GLCubeFaces")
  17399. //,Hot = e("hot")
  17400. , O = new g(i);
  17401. n.prototype = Object.create(o.Object3D.prototype),
  17402. b.extend(n, P),
  17403. n.prototype.setupCustomProperties = function() {
  17404. var e = f.modelAlpha;
  17405. Object.defineProperty(this, "alpha", {
  17406. get: function() {
  17407. return e
  17408. },
  17409. set: function(t) {
  17410. e = t
  17411. //console.log(t)
  17412. this.chunks.forEach(function(chunk) {
  17413. if (chunk.material && chunk.material.uniforms.modelAlpha) {
  17414. chunk.material.uniforms.modelAlpha.value = e
  17415. //修改一下defines,为了在不需要map时不加载map。 by xzw
  17416. /* if (e>0) {
  17417. if (!('useModelMap' in chunk.material.defines)) {
  17418. chunk.material.defines.useModelMap = ''
  17419. chunk.material.needsUpdate = true
  17420. console.log('add useModelMap')
  17421. }
  17422. } else {
  17423. if ('useModelMap' in chunk.material.defines) {
  17424. delete chunk.material.defines.useModelMap
  17425. chunk.material.needsUpdate = true
  17426. chunk.material.uniforms.map.value.dispose() //防止崩溃(但是因为这样飞出要等待时间所以被去掉了)
  17427. console.log('delete useModelMap')
  17428. }
  17429. } */
  17430. }
  17431. })
  17432. }
  17433. })
  17434. }
  17435. ,
  17436. n.prototype.configureTiling = function() {
  17437. var e = r();
  17438. if (e < 2048)
  17439. return !1;
  17440. O.warn("Max cube texture size: " + e);
  17441. for (var t = 0; t < f.tiling.tilingFlagNames.length; t++) {
  17442. var i = f.tiling.tilingFlagNames[t];
  17443. if ("1" === w.valueFromHash(i, null))
  17444. return !0;
  17445. if ("0" === w.valueFromHash(i, null))
  17446. return !1
  17447. }
  17448. //--------------------------------------------许钟文-------------------------------------------
  17449. //return true;
  17450. return !!M.modelDataPromisesTiles(this.data) //免去访问mdoeldata.json的vision_version,不明白这是什么
  17451. //--------------------------------------------e n d -------------------------------------------
  17452. }
  17453. ,
  17454. n.prototype.toggleAlpha = function() {
  17455. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  17456. }
  17457. ,
  17458. n.prototype.load = function(e) {
  17459. var t = function() {
  17460. return $.when(this.loadPanos(), this.loadMesh())
  17461. }
  17462. , i = this.urls.init().then(t.bind(this));
  17463. return e ? i = i.then(this.loadMeshTextures.bind(this)) : i.then(this.loadMeshTextures.bind(this)),
  17464. this.auxDataPromise = $.when( /*this.loadHighlightReel(), this.loadtags() */this.loadhots(), this.loadLabels()),
  17465. $.when(i, this.auxDataPromise).done(this.build.bind(this)) //不要另外使用active_reel文件
  17466. }
  17467. ,
  17468. n.prototype.loadMesh = function() {
  17469. function e(e) {
  17470. O.error(e),
  17471. n.reject("loading-failed")
  17472. }
  17473. function t(e, t) {
  17474. n.notify(e, t)
  17475. }
  17476. function i(e, t) {
  17477. if (0 === e.length) {
  17478. O.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  17479. r.supportedModes[c.DOLLHOUSE] = !1,
  17480. r.supportedModes[c.FLOORPLAN] = !1;
  17481. var i = new p({
  17482. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  17483. });
  17484. i.material.visible = !1,
  17485. i.rotateX(-Math.PI / 2),
  17486. i.geometry.computeBoundingBox(),
  17487. e = [i]
  17488. }
  17489. e.forEach(function(e) {
  17490. var t = r.floorsEnabled ? S.parseFloor(e.name) : 0;
  17491. r.addChunk(t, e)
  17492. }),
  17493. r.floors.sort(),
  17494. n.resolve(r)
  17495. }
  17496. var n = $.Deferred()
  17497. , r = this;
  17498. return y.load(r.data.job.uuid, r.urls, i, t, e),
  17499. n.promise()
  17500. }
  17501. ,
  17502. n.prototype.loadMeshTextures = function() {
  17503. return this.loadTexturesPromise ? this.loadTexturesPromise : (this.loadTexturesPromise = C.load(this, this.meshTextures).then(function() {
  17504. this.meshTexturesLoaded = !0
  17505. }
  17506. .bind(this)),
  17507. this.loadTexturesPromise)
  17508. }
  17509. ,
  17510. /* n.prototype.loadtags = function() {//xzw改
  17511. var e = $.Deferred();
  17512. if (!f.tags.enabled)
  17513. return e.resolve();
  17514. //var t = this.options.urlBase + "/api/v1/jsonstore/model/tags/" + this.sid;
  17515. t = "data/" + this.sid + "/tags.json"
  17516. return a.get(t, {
  17517. responseType: "json",
  17518. auth: this.isPublic ? null : f.authorizationHeader
  17519. }).done(function(t) {
  17520. var i = 0
  17521. , n = 0;
  17522. for (var r in t) {
  17523. var o = t[r];
  17524. o.enabled && (n++,
  17525. (o.label.length || o.description.length) && (this.tags[r] = new m(this,r,o),
  17526. i++))
  17527. }
  17528. i !== n && O.warn("Disallowed " + (n - i) + " tags with no text data"),
  17529. e.resolve()
  17530. }
  17531. .bind(this)).fail(function() {
  17532. O.warn("Getting tags failed, not displaying tags."),
  17533. e.resolve()
  17534. }),
  17535. e
  17536. } */
  17537. n.prototype.shineHots = function(){ //xzw
  17538. E.trigger({
  17539. func: function(e) {
  17540. var opa = e <= .5 ? 2 * e : -2 * e + 2
  17541. for(var i in this.hots){
  17542. this.hots[i].mesh.material.uniforms.opac.value = opa;
  17543. }
  17544. }.bind(this),
  17545. cycling: true,
  17546. duration: 3000,
  17547. //easing: "easeInOutQuad",
  17548. name: "hotShine"
  17549. })
  17550. },
  17551. /* n.prototype.loadOverlays = function(overlays){
  17552. var overlays = window.data2 && window.data2.overlays
  17553. overlays && overlays.forEach((info)=>{
  17554. new Overlay(info)
  17555. })
  17556. Overlay.load()
  17557. }
  17558. */
  17559. n.prototype.loadhots = function() {//xzw
  17560. initHot(this)
  17561. this.roomLabels = []
  17562. this.hotsCount = 0;
  17563. var r = $.Deferred();
  17564. var t = g_Prefix+"data/" + this.sid + "/data2.js" +'?'+ randomTime().getTime();
  17565. return a.get(t, {
  17566. responseType: "json",
  17567. auth: this.isPublic ? null : f.authorizationHeader
  17568. }).done(function(e) {
  17569. window.data2 = e;
  17570. if(!e){
  17571. console.error("data2 is null")
  17572. }else{
  17573. g_data2 = hotMatcher(e);
  17574. let create = ()=>{
  17575. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  17576. if(e.hots){
  17577. var sids = Object.keys(e.hots).sort((a,b)=>{return e.hots[a].order - e.hots[b].order});
  17578. sids.forEach((sid)=>{
  17579. e.hots[sid].sid = sid
  17580. if(e.hots[sid].texType == 'photo' && !e.hots[sid].texSrc)return console.error('有photo热点无texSrc',e.hots[sid])
  17581. new Hot(e.hots[sid], e.hots[sid].version != 'multi' && "byHot" )
  17582. })
  17583. }
  17584. if(e.overlays){
  17585. e.overlays.forEach((info)=>{
  17586. //if(info.file.includes('m/data/762/edit/20210312_112357584.mp4') )return;
  17587. new Hot(info, 'byOverlay')
  17588. })
  17589. }
  17590. Hot.createHotList();
  17591. Hot.startLoad()
  17592. {
  17593. let maxCount = browser.isMobile() ? 200000 : 400000
  17594. let noVisiHots = this.hotGroup.children.filter(e=>!e.info.visiblePanos && e.info.texType != 'shine') //只看非热点的,否则数据太多
  17595. //let visiHots = this.hotGroup.children.filter(e=>e.info.visiblePanos)
  17596. let c = this.panos.list.length * this.colliders.length * noVisiHots.length
  17597. if(c > maxCount){ //防止加载时间过长,分批计算
  17598. console.log('hot分批setVisiblePanos')
  17599. Hot.visiPanosCountSlice = Math.ceil(maxCount / this.colliders.length / noVisiHots.length)
  17600. Hot.visiEveryDurSlice = browser.isMobile() ? 25 : 16;
  17601. let dur = Math.ceil(this.panos.list.length / Hot.visiPanosCountSlice) * Hot.visiEveryDurSlice
  17602. console.log(Hot.visiPanosCountSlice, Hot.visiEveryDurSlice, dur, Math.round(dur*noVisiHots.length))
  17603. if(noVisiHots.length){
  17604. let i = 0
  17605. let hotVisiInterval = setInterval(()=>{
  17606. noVisiHots[i].setVisiblePanos();
  17607. i++;
  17608. if(i>=noVisiHots.length){
  17609. clearInterval(hotVisiInterval)
  17610. }
  17611. }, dur)
  17612. }
  17613. }
  17614. }
  17615. if(DATA.roomLabels){
  17616. DATA.roomLabels.forEach((data)=>{
  17617. this.roomLabels.push(new RoomLabel(data))
  17618. })
  17619. }
  17620. }
  17621. if(player.currentPano){
  17622. create()
  17623. }else{
  17624. let f = ()=>{
  17625. window.bus.removeEventListener('playerAndModelReady',f)
  17626. create()
  17627. }
  17628. window.bus.addEventListener('playerAndModelReady',f)
  17629. }
  17630. g_index = w.valueFromHash("m");
  17631. }
  17632. /***************************方奕卓 请求data.js数据, 用于初始化热点列表 ****************************/
  17633. /* var dataJsPromise = $.Deferred();
  17634. var dataJsUrl = g_Prefix+"data/" + this.sid + "/hot/js/data.js" +'?'+ randomTime().getTime();
  17635. a.get(dataJsUrl,{
  17636. responseType: "json",
  17637. auth: this.isPublic ? null : f.authorizationHeader
  17638. }).done(function(data) {
  17639. window.hotData = data;
  17640. this.createHotItem(data, this.hots);
  17641. for(let i in this.hots){//add
  17642. data[i] && this.hots[i].initStyleImg(data[i]);
  17643. }
  17644. dataJsPromise.resolve();
  17645. }.bind(this)).fail(function(){
  17646. console.log('Data.js is empty');
  17647. dataJsPromise.resolve();
  17648. }) */
  17649. r.resolve();
  17650. }.bind(this)).fail(function() {
  17651. console.log('没有热点');
  17652. r.resolve()
  17653. }),
  17654. r
  17655. }
  17656. ,
  17657. n.prototype.loadPanos = function() {
  17658. if (this.loadPanosPromise)
  17659. return this.loadPanosPromise;
  17660. var e = new I(this);
  17661. return this.loadPanosPromise = e.load().then(function(e) {
  17662. return this.data.sweeps && Object.keys(this.data.sweeps).length > 0 && (e = e.filter(function(e) {
  17663. if(this.data.sweeps[e.uuid])return this.data.sweeps[e.uuid].enabled
  17664. else console.log(e.uuid)
  17665. }
  17666. .bind(this))),
  17667. this.panos.extend(e.map(function(e) {
  17668. return new v(this,e.uuid,e,this.supportsTiles)
  17669. }
  17670. .bind(this))),
  17671. this.panos.forEach(function(e) {
  17672. e.neighbourUUIDs && (e.neighbourUUIDs.forEach(function(t) {
  17673. var i = this.panos.get(t);
  17674. i && this.panos.setNeighbour(e, i, !0)
  17675. }
  17676. .bind(this)),
  17677. e.neighbourPanos = this.panos.getNeighbours(e) || this.panos.setNeighbour(e, e, !0))
  17678. }
  17679. .bind(this)),
  17680. 0 === this.panos.length && (O.warn("Model has no panos, turning off inside mode"),
  17681. this.supportedModes[c.PANORAMA] = !1),
  17682. $.when(this)
  17683. }
  17684. .bind(this)),
  17685. this.loadPanosPromise
  17686. }
  17687. ,
  17688. n.prototype.loadHighlightReel = function() {//xzw
  17689. var e = $.Deferred()
  17690. // , t = this.options.urlBase + "/api/v1/jsonstore/model/highlights/" + this.sid + "/active_reel";
  17691. ,t = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  17692. return a.get(t, {
  17693. responseType: "json",
  17694. auth: this.isPublic ? null : f.authorizationHeader
  17695. }).done(function(t) {
  17696. t.reel ? (O.info("Got highlight reel with " + t.reel.length + " items"),
  17697. this.images.filterByModesAndReel(this.supportedModes, t.reel)) : O.info("No highlight reel found"),
  17698. e.resolve()
  17699. }
  17700. .bind(this)).fail(function() {
  17701. O.warn("Getting highlight reel failed, no highlights available"),
  17702. e.resolve()
  17703. }),
  17704. e
  17705. }
  17706. ,
  17707. n.prototype.waitForLoad = function(e, t) {
  17708. t() || (this.waitQueue.push({
  17709. object: e,
  17710. isLoadedCallback: t
  17711. }),
  17712. 1 === this.waitQueue.length && this.emit("waiting"))
  17713. }
  17714. ,
  17715. n.prototype.hide = function() {
  17716. this.floors.hide()
  17717. }
  17718. ,
  17719. n.prototype.show = function() {
  17720. this.floors.show()
  17721. }
  17722. ,
  17723. n.prototype.floorNames = function() {
  17724. return this.floors.names()
  17725. }
  17726. ,
  17727. n.prototype.warpDestFloors = function(e, t) {
  17728. if (!e || this.floors.length !== e.length)
  17729. return void this.toggleAllFloors(!0);
  17730. var i = e.findIndex(function(e) {
  17731. return e
  17732. }
  17733. .bind(this));
  17734. i !== -1 && this.setFloor(this.floors.list[i], null, t)
  17735. }
  17736. ,
  17737. n.prototype.setFloor = function(e, t, i) {
  17738. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  17739. this.allFloorsVisible = !1,
  17740. this._setFloor(e, t, i)
  17741. }
  17742. ,
  17743. n.prototype.toggleAllFloors = function(e) {
  17744. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  17745. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  17746. this._setFloor(this.currentFloor)
  17747. }
  17748. ,
  17749. n.prototype._setFloor = function(e, t, i) {
  17750. t = t || this.mode,
  17751. this.emit("floor.changed", e, t, this.currentFloor),
  17752. this.currentFloor = e;
  17753. var n;
  17754. if (t === c.PANORAMA) {
  17755. if (this.show(),
  17756. this.shouldShowtags && this.tagsShown)
  17757. for (n in this.tags)
  17758. this.tags[n].show(f.showFloorDuration)
  17759. } else if ((t === c.FLOORPLAN || t === c.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  17760. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  17761. }
  17762. .bind(this)),
  17763. this.shouldShowtags && this.tagsShown))
  17764. for (n in this.tags) {
  17765. var r = this.tags[n];
  17766. this.allFloorsVisible ? r.show(f.showFloorDuration) : r.floor === this.currentFloor ? r.show(f.showFloorDuration, f.showFloorDelay) : r.hide(f.hideFloorDuration, f.hideFloorDelay)
  17767. }
  17768. var o = this
  17769. , a = e;
  17770. E.start(function() {}, f.showFloorDelay, function() {
  17771. o.floors.forEach(function(e) {
  17772. e.chunks.forEach(function(t) {
  17773. t.renderOrder = e === a ? h.visibleFloor : h.ghostFloor
  17774. })
  17775. })
  17776. }
  17777. .bind(this))
  17778. }
  17779. ,
  17780. n.prototype.toggleExplode = function() {
  17781. this.floors.toggleExplodeHorizontal()
  17782. }
  17783. ,
  17784. n.prototype.toggleExplodeUp = function() {
  17785. this.floors.toggleExplodeVertical()
  17786. }
  17787. ,
  17788. n.prototype.nextFloor = function(e) {
  17789. return this.floors.nextFloor(this.currentFloor, e)
  17790. }
  17791. ,
  17792. n.prototype.addFloor = function(e) {
  17793. this.floors.add(e)
  17794. }
  17795. ,
  17796. n.prototype.getFloorAtPoint = function(e) {
  17797. return this.floors.getFloorAtPoint(e)
  17798. }
  17799. ,
  17800. n.prototype.getTagBySid = function(e) {
  17801. return this.tags[e]
  17802. }
  17803. ,
  17804. n.prototype.addChunk = function(e, t) {
  17805. this.floors.getOrMakeFloor(e).addChunk(t),
  17806. this.chunks.push(t)
  17807. }
  17808. ,
  17809. n.prototype.setMode = function(e) {
  17810. if (!this.supportedModes[e])
  17811. throw new R("Mode not supported for this model: " + e);
  17812. this.mode = e;
  17813. this.skybox.material.transparent = e == "panorama" ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  17814. this.chunks.forEach(function(t) {
  17815. t.setMode(e)
  17816. })
  17817. }
  17818. ,
  17819. n.prototype.build = function() {
  17820. this.heroLocations = this.images.getHeroLocations(this.panos);
  17821. var e = function() {
  17822. 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()
  17823. }
  17824. .bind(this)();
  17825. this.has360Views = f.show360Views.enabled && this.heroLocations.some(function(e) {
  17826. return e.cameraMode === c.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  17827. }
  17828. .bind(this)) || e,
  17829. null === this.heroImage && O.warn("No hero image defined."),
  17830. this.currentFloor = this.floors.last(),
  17831. this.floors.build(),
  17832. this.colliders = this.floors.reduce(function(e, t) {
  17833. return e.concat(t.collider.children)
  17834. }, []),
  17835. this.panos.forEach(function(e) {
  17836. e.build1(),
  17837. e.on("enter", function() {
  17838. e.floor !== this.currentFloor && this.setFloor(e.floor)
  17839. }
  17840. .bind(this))
  17841. }
  17842. .bind(this))
  17843. //有很多场景的floorPosition在地面之下,导致marker看不到,所以探测一下
  17844. let time1 = performance.now()
  17845. let downVec = new THREE.Vector3(0,-1,0)
  17846. this.panos.forEach((pano)=>{
  17847. player.raycaster.set(pano.position, downVec);
  17848. let collider = pano.floor.collider.children
  17849. let n = player.raycaster.intersectObjects(collider , true );//add true
  17850. if(n && n[0]){
  17851. if(n[0].point.y - pano.floorPosition.y > 0.03){
  17852. //console.error(`${pano.id}, 探测高度${n[0].point.y.toPrecision(5)} 原高度 ${pano.floorPosition.y.toPrecision(5)}, 相差 ${(n[0].point.y - pano.floorPosition.y).toPrecision(5)}`)
  17853. pano.originFloorY = pano.floorPosition.y
  17854. pano.floorPosition.y = n[0].point.y
  17855. }
  17856. }
  17857. //是否需要排除一下相差过高的?因为可能探测到的是长椅这样的
  17858. })
  17859. let time2 = performance.now()
  17860. console.log('探测时间',time2-time1)
  17861. this.panos.forEach(function(e) {
  17862. e.build2()
  17863. }),
  17864. this.floors.forEach(function(e) {
  17865. this.boundingBox.union(e.boundingBox)
  17866. }
  17867. .bind(this)),
  17868. this.size = this.boundingBox.size(),
  17869. this.center = this.boundingBox.center(),
  17870. this.floors.forEach(function(e) {
  17871. O.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  17872. }
  17873. .bind(this)),
  17874. this.panos.populate_path_graph(),
  17875. this.skybox = new l(this.boundingBox),
  17876. this.skybox.matrixWorldNeedsUpdate = !0,
  17877. this.add(this.skybox);
  17878. //因为一部分漫游点在模型外
  17879. {
  17880. let bounding = new THREE.Box3 //不包含pano的bound
  17881. this.floors.list.forEach(floor=>{
  17882. bounding.union(floor.conservativeBoundingBox)
  17883. })
  17884. this.boundWithoutPanos = bounding
  17885. this.sizeWithoutPanos = bounding.size()
  17886. this.centerWithoutPanos = bounding.center()
  17887. /* 如果想居中模型, bound不加pano:
  17888. this.boundingBox = bounding
  17889. this.size = bounding.size()
  17890. this.center = bounding.center() */
  17891. }
  17892. this.createFloorLogo()
  17893. return O.debug("Done building model"),
  17894. v.raycastsDone > 0 && (O.warn("raycasts: " + v.raycastsDone),
  17895. O.warn("raycasts skipped: " + v.raycastsSkipped)),
  17896. this.buildRooms(),
  17897. this.labels.associateWithRooms(this.rooms),
  17898. $.when(this)
  17899. }
  17900. ,
  17901. n.prototype.createFloorLogo = function(){
  17902. console.log('createFloorLogo')
  17903. if(this.floorLogos || !settings.floorlogoURL)return;
  17904. var url = settings.floorlogoURL
  17905. var map = tex.load(url);//可以追加done
  17906. this.floorLogos = [];
  17907. for(var i=0; i<2; i++){ //不可共用uniforms等 [0]在上一个位置,[1]是下一个位置、 是飞入及飞出后的位置
  17908. var material = new o.MeshBasicMaterial({
  17909. opacity:0,
  17910. map:map,
  17911. side: o.DoubleSide,
  17912. transparent: !0,
  17913. depthWrite: !1,
  17914. depthTest:false//改 在chunk\skybox外也可看到
  17915. });
  17916. var logo = new o.Mesh(new o.PlaneGeometry(2,2,1,1),material);
  17917. //var s = (Store.metadata.floorLogoSize || 100)/100;
  17918. //logo.scale.set(s,s,s);
  17919. logo.position.set(0,-1.5,0);
  17920. logo.lookAt(logo.position.clone().add(new o.Vector3(0,1,0)));
  17921. logo.renderOrder = 100;//cover the videoSkybox
  17922. //logo.layers.set(0)
  17923. this.add(logo);
  17924. this.floorLogos.push(logo);
  17925. }
  17926. this.floorLogos[1].visible = false;
  17927. }
  17928. n.prototype.adjustfloorLogoHeight = function(o){
  17929. var h = player.currentPano.floorPosition.y + 0.01;
  17930. this.floorLogos[1].position.setY(h);
  17931. this.floorLogos[0].position.setY(h);
  17932. //publicObjectSet.player.path.currentPanoMarker.mesh.position.y = h
  17933. },
  17934. n.prototype.changefloorLogoOpa = function(o){//改 i, opacity, time, delay
  17935. if(!this.floorLogos) return;
  17936. E.cancelById("flOpa_"+o.index);//先停止之前该logo的透明度变化
  17937. if(o.from!=void 0)this.floorLogos[o.index].material.opacity = o.from;//初始透明度
  17938. if(!o.dur){//立刻
  17939. //this.floorLogos[o.index].material.uniforms.opacity.value = o.opa;
  17940. this.floorLogos[o.index].material.opacity = o.opa;
  17941. }else{
  17942. //E.start(lerp.uniform(this.floorLogos[o.index], "opacity", o.opa), o.dur || 0, null,
  17943. E.start(lerp.property(this.floorLogos[o.index].material, "opacity", o.opa), o.dur || 0, null,
  17944. o.delay||0, es["easeInQuad"], "changefloorLogoOpa", "flOpa_"+o.index)
  17945. }
  17946. },
  17947. n.prototype.updateFloorlogo = function() { //xzw add 更新地标的旋转
  17948. var lastQ, lastP;
  17949. var equals = function(v1, v2, min){
  17950. return Math.abs(v1-v2) < min
  17951. }
  17952. var isSame = function(now, last, k){//如果和上次相同就不改变
  17953. if(!last)return false;
  17954. var R = k.sceneRenderer;
  17955. //var min = R.AFPS < 38 ? 0.005 : R.AFPS < 45 ? 0.0008 : R.AFPS < 50 ? 0.0006 : 0.0003;
  17956. //暂时:
  17957. var min = 0.0008
  17958. var same = equals(now.x , last.x, min) && equals(now.y , last.y, min) && equals(now.z , last.z, min)
  17959. && (now.w!=void 0 ? equals(now.w , last.w, min) : true)
  17960. return same;
  17961. }
  17962. return function(Q, k){
  17963. if(!Q)return;
  17964. /* if(Config.ifFish && window.lowFPS){
  17965. this.fLCompute++;
  17966. if(R.AFPS < 38){
  17967. if(k.flyingToTag && k.flying && k.fLCompute %4 !=1) return; //点击tag过渡
  17968. else if(k.flying && k.fLCompute%2 !=1) return;
  17969. k.fLCompute %= 4;
  17970. }else if(R.AFPS < 45){
  17971. if(k.flyingToTag && k.flying && k.fLCompute %3 !=1) return; //点击tag过渡
  17972. else if(k.flying && k.fLCompute%2 !=1) return;
  17973. k.fLCompute %= 6;
  17974. }else{
  17975. if(k.flyingToTag && k.flying && k.fLCompute %2 !=1) return;
  17976. //else if(k.flying && k.fLCompute%2 !=1) return;
  17977. k.fLCompute %= 2;
  17978. }
  17979. } */
  17980. var sameQ, sameP, quaternion, visible;
  17981. for(var i=0;i<2;i++){
  17982. var logo = this.floorLogos[i];
  17983. if(!logo.visible || logo.material.uniforms.opacity.value==0) continue;
  17984. visible = true;
  17985. }
  17986. if(!visible)return; //如果两个都不可见,就不更改,如果有一个可见,就都改
  17987. var c = k.cameraControls.activeControl;
  17988. var sameQ = c ? ( c.lat < 10 ? equals(c.lon, lastQ, 0.1) : equals(c.lon, lastQ, 1) ): false;
  17989. sameQ || (lastQ = c ? c.lon : null); //相机旋转是否改变了
  17990. for(var i=0;i<2;i++){
  17991. var logo = this.floorLogos[i];
  17992. if(!sameQ){
  17993. if(!quaternion){
  17994. var a = new THREE.Vector3(0,0,-1);
  17995. a.applyQuaternion(Q);
  17996. a.setY(0);
  17997. var _ = (new THREE.Matrix4).lookAt(a,new THREE.Vector3, new THREE.Vector3(0,1,0));
  17998. quaternion = (new THREE.Quaternion).setFromRotationMatrix(_)
  17999. var a = new THREE.Quaternion( 0, 0.7071067811865476, 0.7071067811865476 , 0)//计算得
  18000. quaternion.multiply(a);
  18001. }
  18002. logo.quaternion.copy(quaternion);
  18003. }
  18004. }
  18005. }
  18006. }()
  18007. n.prototype.loadLabels = function() {//xzw
  18008. this.labels = new x(this);
  18009. var e = $.Deferred();
  18010. //加载俯视图的标签 注释这个备注就会加载
  18011. //原先是labels, 改为showLabels,因为之前的somedata写的labels都是true
  18012. window.DATA.showingLabels ? this.showingLabels = true : '';
  18013. if (!this.showingLabels)
  18014. return e.resolve();
  18015. // var t = this.options.urlBase + "/api/v1/jsonstore/model/labels/" + this.sid;
  18016. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  18017. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  18018. O.warn("Getting labels failed, not displaying labels."),
  18019. e.resolve()
  18020. }),
  18021. e
  18022. }
  18023. ,
  18024. n.prototype.buildRooms = function() {
  18025. this.rooms = new T(this),
  18026. this.rooms.createFromChunks(this.chunks),
  18027. this.rooms.calcRoomBoundaries()
  18028. }
  18029. ,
  18030. n.prototype.updateProjectedPanos = function() {
  18031. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  18032. }
  18033. ,
  18034. n.prototype.setProjectedPanos = function(e, t, i) {
  18035. void 0 !== i && null !== i || (i = !0),
  18036. i = !!i,
  18037. this.projectedPano0 = e,
  18038. this.projectedPano1 = t,
  18039. this.skybox.material.setProjectedPanos(e, t, i),
  18040. this.chunks.forEach(function(n) {
  18041. n.materialInside.setProjectedPanos(e, t, i)
  18042. })
  18043. }
  18044. ,
  18045. n.prototype.setSide = function(e) {
  18046. this.floors.forEach(function(t) {
  18047. t.collider.material.side = e
  18048. })
  18049. }
  18050. ,
  18051. n.prototype.heroCount = function() {
  18052. return this.heroLocations ? this.heroLocations.length : 0
  18053. }
  18054. ,
  18055. n.prototype.getHeroDescriptorByIndex = function(e=[]) {//改 因增加了二级目录
  18056. if (e[0] < 0)
  18057. return O.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  18058. null;
  18059. if (this.heroCount() < 1)
  18060. return O.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  18061. null;
  18062. var t = this.heroLocations[e[0]];
  18063. if(t.heroLocations && e[1]!=void 0){
  18064. t = t.heroLocations[e[1]];
  18065. }
  18066. return void 0 === t ? (O.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  18067. null) : t
  18068. }
  18069. ,
  18070. n.prototype.findPanoramicHero = function() {
  18071. for (var e in this.heroLocations)
  18072. if (this.heroLocations[e].cameraMode === c.PANORAMA)
  18073. return this.heroLocations[e];
  18074. return null
  18075. }
  18076. ,
  18077. n.prototype.listImagePanos = function() {
  18078. var e = []
  18079. , t = this;
  18080. return this.images.forEach(function(i) {
  18081. if (i.metadata && i.metadata.scan_id) {
  18082. var n = t.panos.get(i.metadata.scan_id);
  18083. n && (t.supportsTiles || n.isLoaded("high") || e.push(n))
  18084. }
  18085. }),
  18086. e
  18087. }
  18088. ,
  18089. n.prototype.fadePanoMarkers = function(/* e, t */opacity, dur, o = {}) {//改
  18090. //this.panos.fadeMarkerOpacity(e, t)
  18091. if(window.DATA.hideFloorMarker)return
  18092. var currentPano = player.currentPano
  18093. opacity = void 0 == opacity ? _settings.panorama.markerOpacity : opacity //不传opacity代表显示
  18094. var hideWhenFlyOut = () => {
  18095. var shows = [],
  18096. hides = []
  18097. player.model.panos.forEach(pano => {
  18098. hides.push(pano)
  18099. })
  18100. this.panos.fadeMarkerOpacity(0, dur, [{ toOp: 0, member: hides }])
  18101. }
  18102. if (opacity == 0) {
  18103. hideWhenFlyOut()
  18104. } else {
  18105. if (player.mode == 'panorama' && currentPano) {
  18106. var shows = [], hides = []
  18107. player.model.panos.forEach(pano => { //是邻近点就显示否则隐藏
  18108. if (currentPano.neighbourPanos[pano.id]) {
  18109. shows.push(pano)
  18110. } else {
  18111. hides.push(pano)
  18112. }
  18113. })
  18114. this.panos.fadeMarkerOpacity(opacity, dur, [
  18115. { toOp: opacity, member: shows },
  18116. { toOp: 0, member: hides },
  18117. ])
  18118. } else if (player.modeTran.split('-')[1] != 'panorama') {
  18119. //飞出后marker隐藏
  18120. hideWhenFlyOut()
  18121. }
  18122. }
  18123. }
  18124. ,
  18125. n.prototype.setSweepVisibility = function(e) {
  18126. this.panos.forEach(function(t) {
  18127. t.marker && (t.marker.visible = e)
  18128. })
  18129. }
  18130. ,
  18131. n.prototype.outsideAllowed = function() {
  18132. return this.supportedModes[c.DOLLHOUSE] && this.supportedModes[c.FLOORPLAN]
  18133. }
  18134. ,
  18135. n.prototype.addHighMapCube = function() {
  18136. //创建8*8的tile cube
  18137. if (player.qualityManager.getMaxZoomClass() == '4k' && player.qualityManager.maxRenderTargetSize == 2048) {
  18138. var geo = new THREE.PlaneGeometry(1, 1, 1, 1)
  18139. var cube = new THREE.Object3D()
  18140. cube.tiles = []
  18141. for (var cubeIndex = 0; cubeIndex < 6; cubeIndex++) {
  18142. var face = new THREE.Object3D()
  18143. for (var i = 0; i < 8; i++) {
  18144. for (var j = 0; j < 8; j++) {
  18145. var tile = new THREE.Mesh(geo, new THREE.MeshBasicMaterial({ side: 2 }))
  18146. tile.position.set(i - 3.5, j - 3.5, -4)
  18147. if (highMapAddColor) {
  18148. tile.material.opacity = 0.4
  18149. var colorHue = Math.random()
  18150. tile.material.color = new THREE.Color().setHSL(colorHue, 0.6, 0.9)
  18151. }
  18152. tile.material.transparent = true
  18153. tile.material.depthTest /* = tile.material.depthWrite */ = false //防止chunk比cube近从而被遮 且能不遮住box视频和热点等
  18154. tile.visible = false
  18155. tile.tileX = i
  18156. tile.tileY = j
  18157. tile.cubeFace = cubeIndex
  18158. tile.renderOrder = 2//RenderOrder.highTileCube
  18159. cube.tiles.push(tile)
  18160. face.add(tile)
  18161. }
  18162. }
  18163. switch (cubeIndex) {
  18164. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  18165. face.rotation.set(0, Math.PI / 2, 0)
  18166. break
  18167. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  18168. face.rotation.set(0, -Math.PI / 2, 0)
  18169. break
  18170. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  18171. var rot1 = new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(0, 1, 0), Math.PI)
  18172. var rot2 = new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(1, 0, 0), Math.PI / 2)
  18173. face.quaternion.copy(rot1).multiply(rot2)
  18174. //face.rotation.set(Math.PI/2,0,0);
  18175. break
  18176. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  18177. //face.rotation.set(-Math.PI/2,0,0);
  18178. var rot1 = new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(0, 1, 0), Math.PI)
  18179. var rot2 = new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(1, 0, 0), -Math.PI / 2)
  18180. face.quaternion.copy(rot1).multiply(rot2)
  18181. break
  18182. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  18183. face.rotation.set(0, Math.PI, 0)
  18184. break
  18185. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  18186. face.rotation.set(0, 0, 0)
  18187. }
  18188. face.scale.set(1, -1, 1)
  18189. cube.add(face)
  18190. }
  18191. cube.name = 'highMapCube'
  18192. this.highMapCube = cube
  18193. this.add(cube)
  18194. cube.scale.set(0.21, 0.21, 0.21) //camera.near is 0.1
  18195. this.highMapCube.visible = false
  18196. this.highMapCube.texLoadedCount = 0
  18197. player.once("pano.chosen",()=>{//wait sceneRenderer
  18198. player.sceneRenderer.on('after-render', e => {
  18199. if (this.highMapCube.visibleTiles) {
  18200. this.updateTiles()
  18201. }
  18202. if (player && player.lastFrameChanged) {
  18203. common.intervalTool.isWaiting(
  18204. 'update4kTiles',
  18205. () => {
  18206. let vectorForward = player.getDirection()
  18207. this.updateTiles(vectorForward)
  18208. },
  18209. 500
  18210. )
  18211. }
  18212. })
  18213. })
  18214. }
  18215. }
  18216. /*
  18217. highMapCube会遮住场景中所有物体, 如果一定要显示的话,只能类似potree中的那样渲染一个深度贴图出来(model无需贴图),然后其他所有物体的shader中都加入一段代码。(貌似本身已经支持了?)
  18218. */
  18219. n.prototype.isHighMapLoaded = function(cubeFace, tileX, tileY){
  18220. var tile = this.highMapCube.children[cubeFace].children[tileX * 8 + tileY]
  18221. return !!tile.material.map
  18222. }
  18223. n.prototype.updateTiles = function(direction) {
  18224. if (!this.highMapCube || !this.highMapCube.visible) return
  18225. if (this.highMapCube.tiles.filter(e => e.image).length <= 10) return //加载的太少了
  18226. //performance.mark('updateTiles-start')
  18227. if (direction) {
  18228. let camera = player.cameraControls.cameras.panorama
  18229. let hfov = THREE.Math.degToRad(cameraLight.getHFOVForCamera(camera, $("#player").width(), $("#player").height())) / 2
  18230. let vfov = THREE.Math.degToRad(camera.fov) / 2
  18231. /* let hcos = Math.cos(hfov / 2)
  18232. let vcos = Math.cos(vfov / 2) */
  18233. let list = this.highMapCube.tiles
  18234. list.forEach(e => {
  18235. //屏幕外的不显示
  18236. let pos = e.getWorldPosition(new THREE.Vector3())
  18237. let dir = new THREE.Vector3().subVectors(pos, this.highMapCube.position).normalize()
  18238. let hcos_ = dir.clone().setY(direction.y).normalize().dot(direction) //在direction的斜面上水平角度差
  18239. let hRad = Math.acos(hcos_)
  18240. let vRad = -200
  18241. if (hRad > hfov + 0.08) {
  18242. e.score = -100
  18243. } else {
  18244. vRad = Math.abs(Math.acos(dir.y) - Math.acos(direction.y))
  18245. if (vRad > vfov + 0.08) {
  18246. e.score = -100
  18247. } else {
  18248. e.score = -(hRad / hfov + vRad / vfov)
  18249. }
  18250. }
  18251. e.scores = hRad.toFixed(3) + ', ' + vRad.toFixed(3)
  18252. if (e.score == -100) {
  18253. this.resetTile(e)
  18254. }
  18255. })
  18256. this.highMapCube.visibleTiles = list.filter(e => e.score > -100)
  18257. /* this.highMapCube.visibleTiles.sort((e,b)=>{return e.score-b.score})
  18258. this.highMapCube.visibleTiles = this.highMapCube.visibleTiles.slice(0,10)
  18259. */
  18260. //list.forEach(e=>e.scoreLabel.setText(e.scores))
  18261. }
  18262. let needRecover = this.highMapCube.visibleTiles.filter(e => !e.material.map)
  18263. if (needRecover.length) {
  18264. let maxCount = 1//common.getBestCount({ name: '4kmaxTileRecover', minCount: 0, maxCount: 2, durBound1: 1.5, durBound2: 6, ifLog: false, maxHistory: 2 })
  18265. let count = 0
  18266. needRecover.forEach((e, i) => {
  18267. //只更新若干个,因为太耗时了, 其余的等下帧更新
  18268. if (count >= maxCount) return
  18269. let r = this.recoverTile(e)
  18270. if (r) count++
  18271. })
  18272. }
  18273. }
  18274. n.prototype.getHighImage = function(image, cubeFace, tileX, tileY){
  18275. this.gotSomeHighImg = true; //标记,需要马上updateTiles
  18276. let tile = this.highMapCube.children[cubeFace].children[tileX * 8 + tileY]
  18277. tile.image = image //先记录下来
  18278. }
  18279. n.prototype.updateHighMap = function(image, cubeFace, tileX, tileY) {
  18280. let tile = this.highMapCube.children[cubeFace].children[tileX * 8 + tileY]
  18281. if (image) tile.image = image //先记录下来
  18282. if (tile.material.map) return
  18283. if (this.highMapCube.visibleTiles && !this.highMapCube.visibleTiles.includes(tile) ) {
  18284. return
  18285. }
  18286. //简易创建贴图
  18287. /* var tex = this.$app.core.get('SceneRenderer').initSizedTexture2D(512, THREE.ClampToEdgeWrapping)
  18288. //var loaded = this.$app.core.get('Player').model.isHighMapLoaded(tile.cubeFace, tile.tileX, tile.tileY)
  18289. this.$app.core.get('SceneRenderer').uploadTexture2D(image, tex, 0, 0, 512, 512) //只替换tex对应的img,不新建
  18290. */
  18291. var tex = new THREE.Texture()
  18292. tex.image = image
  18293. tex.flipY = false
  18294. tex.wrapS = tex.wrapT = THREE.ClampToEdgeWrapping
  18295. tex.generateMipmaps = false
  18296. tex.minFilter = THREE.LinearFilter
  18297. tex.needsUpdate = true
  18298. tile.material.map = tex
  18299. if (highMapAddColor) {
  18300. tile.material.opacity = 1
  18301. }
  18302. tile.visible = true
  18303. tile.material.needsUpdate = true //发现每次开始放大但还未放大到4k时也会把之前加载过的4k加载
  18304. //console.log( {level:1} , 'updateHighMap', cubeFace, tileX, tileY)
  18305. }
  18306. n.prototype.recoverTile = function(tile) {
  18307. if (tile.material.map) return
  18308. if (tile.image) {
  18309. this.updateHighMap(tile.image, tile.cubeFace, tile.tileX, tile.tileY)
  18310. return true
  18311. } else {
  18312. //console.log('no image')
  18313. }
  18314. }
  18315. n.prototype.resetTile = function(tile, kill) {
  18316. if (kill) {
  18317. //完全消灭
  18318. tile.image = null
  18319. }
  18320. let map = tile.material.map
  18321. if (map) {
  18322. map.dispose() //这句其实无效。本来可以使用three自带的deallocateTexture(texture),但因为创建的方式不是普通的new Texture,所以并没有onTextureDispose的侦听,故要自己写
  18323. map.loaded = !1
  18324. map.version = 0
  18325. //这两句才是真正释放贴图资源的 ,类似app.sceneRenderer.deallocateCubeTexture(tile.material.map)
  18326. var h = player.sceneRenderer.renderer.properties.get(map)
  18327. player.sceneRenderer.renderer.getContext().deleteTexture(h.__webglTexture)
  18328. tile.material.map = null
  18329. if (highMapAddColor) {
  18330. tile.material.opacity = 0.4
  18331. }
  18332. tile.material.needsUpdate = true
  18333. tile.visible = false
  18334. //this.highMapCube.texLoadedCount --
  18335. //console.log({level:1},'resetTile'/* , tile.cubeFace, tile.tileX, tile.tileY */)
  18336. }
  18337. }
  18338. n.prototype.resetHighMap = function() {
  18339. if (!this.highMapCube) return
  18340. this.highMapCube.children.forEach(e =>
  18341. e.children.forEach(tile => {
  18342. this.resetTile(tile, true)
  18343. })
  18344. )
  18345. //this.highMapCube.texLoadedCount = 0
  18346. this.highMapCube.visibleTiles = null
  18347. this.hideHighMap()
  18348. }
  18349. n.prototype.setHighMap = function(pano) {
  18350. if (!this.highMapCube) return
  18351. this.highMapCube.position.copy(pano.position)
  18352. this.highMapCube.quaternion.copy(pano.quaternion)
  18353. }
  18354. n.prototype.showHighMap = function() {
  18355. if (!this.highMapCube) return
  18356. this.highMapCube.visible = true
  18357. }
  18358. n.prototype.hideHighMap = function() {
  18359. if (!this.highMapCube) return
  18360. this.highMapCube.visible = false
  18361. }
  18362. //缩小后继续显示cube呢还是不显示? 不显示的话,就要把cube上的复制到renderTarget上……会不会又崩溃,or没加载的显示???
  18363. t.exports = n
  18364. }
  18365. ).call(this, "/js/model/Model.js")
  18366. }
  18367. , {
  18368. "../constants": 8,
  18369. "../enum/AlignmentType": 17,
  18370. "../enum/RenderOrder": 42,
  18371. "../enum/Viewmode": 51,
  18372. "../exception/BasicException": 55,
  18373. "../label/Label": 90,
  18374. "../loaders/ModelLoader": 105,
  18375. "../loaders/ModelTextureLoader": 106,
  18376. "../loaders/SweepDataLoader": 107,
  18377. "../tag/tag": 123,
  18378. "./util/cameraLight": 184,
  18379. "../tag/tagManager": 124,
  18380. "../objects/BoundingTextureSkybox": 143,
  18381. "../objects/Chunk": 144,
  18382. "../objects/Floor": 146,
  18383. "../objects/Panorama": 148,
  18384. "../objects/Room": 150,
  18385. "../objects/Snapshot": 153,
  18386. "../settings": 166,
  18387. "../shaders": 167,
  18388. "../util/ModelUrls": 177,
  18389. "../util/PanoramaCollection": 178,
  18390. "../util/ajax": 181,
  18391. "../util/common": 185,
  18392. "../util/easing": 186,
  18393. "../util/lerp": 188,
  18394. "../util/logger": 189,
  18395. "../util/math": 190,
  18396. "../util/texture": 194,
  18397. "../util/transitions": 195,
  18398. "./../util/browser": 182,
  18399. "./../util/showcase": 193,
  18400. "./Chunks": 135,
  18401. "./FloorCollection": 136,
  18402. "./ImageCollection": 137,
  18403. "./LabelCollection": 138,
  18404. "./RoomCollection": 141,
  18405. events: 202,
  18406. three: 217,
  18407. "hot": "hot" ,
  18408. "../enum/GLCubeFaces":25 ,
  18409. }],
  18410. 140: [function(e, t, i) {
  18411. "use strict";
  18412. function n() {
  18413. this.modelMap = {},
  18414. this.activeModel = null,
  18415. this.modelCount = 0,
  18416. this.tileDownloader = null,
  18417. this.panoRenderer = null
  18418. }
  18419. var r = (e("three"),
  18420. e("../util/common"))
  18421. , o = e("../exception/BasicException")
  18422. , a = e("../enum/ModelManagerEvents")
  18423. , s = e("../enum/PanoRendererEvents")
  18424. , l = e("events").EventEmitter;
  18425. n.prototype.init = function(e, t, i) {
  18426. this.tileDownloader = e,
  18427. this.panoRenderer = t,
  18428. this.qualityManager = i,
  18429. this.bindEvents()
  18430. }
  18431. ,
  18432. n.prototype.bindEvents = function() {
  18433. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  18434. }
  18435. ,
  18436. n.prototype.onTileRendered = function(e, t, i, n) {}
  18437. ,
  18438. n.prototype.addModel = function(e) {
  18439. this.modelMap[e.sid] = e,
  18440. 0 === this.modelCount && this.activateModel(e.sid),
  18441. this.modelCount++,
  18442. this.emit(a.ModelAdded)
  18443. }
  18444. ,
  18445. n.prototype.getModel = function(e) {
  18446. return this.modelMap[e]
  18447. }
  18448. ,
  18449. n.prototype.activateModel = function(e) {
  18450. var t = this.modelMap[e];
  18451. if (!t)
  18452. throw new o("Tried to activate invalid model!");
  18453. var i = this.activeModel;
  18454. this.activeModel = t,
  18455. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  18456. this.tileDownloader.setUrls(t.urls),
  18457. t.panos.forEach(function(e) {
  18458. e.attachToPanoRenderer(this.panoRenderer),
  18459. e.tileDownloader = this.tileDownloader,
  18460. e.qualityManager = this.qualityManager
  18461. }
  18462. .bind(this)),
  18463. this.emit(a.ActiveModelChanged, {
  18464. oldModel: i,
  18465. model: t
  18466. })
  18467. }
  18468. ,
  18469. n.prototype.getActiveModel = function() {
  18470. return this.activeModel
  18471. }
  18472. ,
  18473. r.extend(n, l),
  18474. t.exports = n
  18475. }
  18476. , {
  18477. "../enum/ModelManagerEvents": 33,
  18478. "../enum/PanoRendererEvents": 35,
  18479. "../exception/BasicException": 55,
  18480. "../util/common": 185,
  18481. events: 202,
  18482. three: 217
  18483. }],
  18484. 141: [function(e, t, i) {
  18485. (function(i) {
  18486. "use strict";
  18487. function n() {
  18488. s.call(this)
  18489. }
  18490. var r = e("../objects/Room")
  18491. , o = (e("../settings"),
  18492. e("../util/logger"))
  18493. , a = (e("../util/transitions"),
  18494. e("../util/easing"),
  18495. e("../util/common"))
  18496. , s = e("../util/IndexedCollection")
  18497. , l = e("./Chunks");
  18498. new o(i);
  18499. a.inherit(n, s),
  18500. n.prototype.getIndex = function(e) {
  18501. return e.roomId
  18502. }
  18503. ,
  18504. n.prototype.calcRoomBoundaries = function() {
  18505. this.forEach(function(e) {
  18506. e.calcBoundaries()
  18507. })
  18508. }
  18509. ,
  18510. n.prototype.createFromChunks = function(e) {
  18511. var t = {
  18512. floorId: -1,
  18513. roomId: -1
  18514. }
  18515. , i = {};
  18516. e.forEach(function(e) {
  18517. l.parseIdsFromChunkName(e.name, t);
  18518. var o = i[t.roomId];
  18519. if (!o) {
  18520. var a = n.generateRoomId(t.floorId, t.roomId);
  18521. o = new r(t.floorId,a),
  18522. this.add(o),
  18523. i[t.roomId] = o
  18524. }
  18525. o.addChunk(e)
  18526. }
  18527. .bind(this)),
  18528. this.calcRoomBoundaries()
  18529. }
  18530. ,
  18531. n.generateRoomId = function(e, t) {
  18532. return e + "_" + t
  18533. }
  18534. ,
  18535. t.exports = n
  18536. }
  18537. ).call(this, "/js/model/RoomCollection.js")
  18538. }
  18539. , {
  18540. "../objects/Room": 150,
  18541. "../settings": 166,
  18542. "../util/IndexedCollection": 175,
  18543. "../util/common": 185,
  18544. "../util/easing": 186,
  18545. "../util/logger": 189,
  18546. "../util/transitions": 195,
  18547. "./Chunks": 135
  18548. }],
  18549. 142: [function(e, t, i) {
  18550. "use strict";
  18551. function n(e, t, i) {
  18552. e = e.clone().expandByScalar(0.01);//改
  18553. var n = e.size()
  18554. , o = new r.BoxGeometry(n.x,n.y,n.z);
  18555. o.boundingBox = e,
  18556. r.Mesh.call(this, o, t),
  18557. this.position.copy(e.center()),
  18558. this.frustumCulled = !1,
  18559. i && this.add(new r.WireframeHelper(this))
  18560. }
  18561. var r = e("three");
  18562. n.prototype = Object.create(r.Mesh.prototype),
  18563. n.prototype.constructor = n,
  18564. t.exports = n
  18565. }
  18566. , {
  18567. three: 217
  18568. }],
  18569. 143: [function(e, t, i) {
  18570. (function(i) {
  18571. "use strict";
  18572. function n(e) {
  18573. h.time("Computing a nice bounding cubemap");
  18574. var t = new a({
  18575. side: r.BackSide,
  18576. transparent: !0
  18577. });
  18578. t.uniforms.modelAlpha.value = 0,
  18579. t.uniforms.opacity.value = 1 - s.modelAlpha,
  18580. this.renderOrder = l.boundingSkybox,
  18581. o.call(this, e, t),
  18582. h.timeEnd("Computing a nice bounding cubemap")
  18583. }
  18584. var r = e("three")
  18585. , o = (e("../enum/Viewmode"),
  18586. e("../shaders"),
  18587. e("./BoundingMesh"))
  18588. , a = e("../materials/ModelTextureMaterial")
  18589. , s = e("../settings")
  18590. , l = e("../enum/RenderOrder")
  18591. , c = e("../util/logger")
  18592. , h = new c(i);
  18593. n.prototype = Object.create(o.prototype),
  18594. n.prototype.constructor = n,
  18595. t.exports = n
  18596. }
  18597. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  18598. }
  18599. , {
  18600. "../enum/RenderOrder": 42,
  18601. "../enum/Viewmode": 51,
  18602. "../materials/ModelTextureMaterial": 118,
  18603. "../settings": 166,
  18604. "../shaders": 167,
  18605. "../util/logger": 189,
  18606. "./BoundingMesh": 142,
  18607. three: 217
  18608. }],
  18609. 144: [function(e, t, i) {
  18610. "use strict";
  18611. function n(e) {
  18612. this.materialInside = new s({
  18613. side: r.DoubleSide
  18614. });
  18615. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  18616. this.materialOutside = new r.RawShaderMaterial({
  18617. fragmentShader: o.modelOutside.fragmentShader,
  18618. vertexShader: o.modelOutside.vertexShader,
  18619. uniforms: t,
  18620. side: r.FrontSide,
  18621. name: "chunkOut"
  18622. }),
  18623. r.Mesh.call(this, e.geometry, this.materialInside),
  18624. this.name = e.name || "",
  18625. this.textureName = e.textureName,
  18626. this.meshUrl = e.meshUrl
  18627. }
  18628. var r = e("three")
  18629. , o = e("../shaders")
  18630. , a = e("../enum/Viewmode")
  18631. , s = e("../materials/ModelTextureMaterial");
  18632. n.prototype = Object.create(r.Mesh.prototype),
  18633. n.prototype.setTextureMap = function(e) {
  18634. this.materialInside.uniforms.map.value = e,
  18635. this.materialOutside.uniforms.map.value = e
  18636. }
  18637. ,
  18638. n.prototype.setMode = function(e) {
  18639. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  18640. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  18641. t.transparent = this.material.transparent,
  18642. t.uniforms.opacity.value = this.material.uniforms.opacity.value,
  18643. this.material = t
  18644. }
  18645. ,
  18646. t.exports = n
  18647. }
  18648. , {
  18649. "../enum/Viewmode": 51,
  18650. "../materials/ModelTextureMaterial": 118,
  18651. "../shaders": 167,
  18652. three: 217
  18653. }],
  18654. 145: [function(e, t, i) {
  18655. "use strict";
  18656. function n(e) {
  18657. this.chunksize = e || 10,
  18658. this.chunks = {},
  18659. this.boundingBoxes = {},
  18660. this.children = [],
  18661. this.offset = new r.Vector3(0,.5,0),
  18662. this.material = new r.MeshBasicMaterial({
  18663. color: 16777215 * Math.random(),
  18664. side: r.DoubleSide
  18665. })
  18666. }
  18667. var r = e("three");
  18668. e("../enum/Viewmode");
  18669. n.prototype.add = function(e) {
  18670. var t, i, n, o, a, s, l, c, h, u, d, p, f, g, m = e.attributes;
  18671. m ? (t = m.position.array,
  18672. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  18673. n = e.faces);
  18674. var v = new r.Vector3;
  18675. if (i)
  18676. for (o = 0,
  18677. a = i.length; o < a; o += 3) {
  18678. var A = 3 * i[o]
  18679. , y = 3 * i[o + 1]
  18680. , C = 3 * i[o + 2];
  18681. s = (t[A] + t[y] + t[C]) / 3,
  18682. l = (t[A + 1] + t[y + 1] + t[C + 1]) / 3,
  18683. c = (t[A + 2] + t[y + 2] + t[C + 2]) / 3,
  18684. h = Math.floor(s / this.chunksize),
  18685. u = Math.floor(l / this.chunksize),
  18686. d = Math.floor(c / this.chunksize),
  18687. p = h + "." + u + "." + d,
  18688. p in this.chunks ? (g = this.chunks[p],
  18689. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  18690. f = this.boundingBoxes[p] = new r.Box3),
  18691. 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]),
  18692. f.expandByPoint(v.set(t[A], t[A + 1], t[A + 2])),
  18693. f.expandByPoint(v.set(t[y], t[y + 1], t[y + 2])),
  18694. f.expandByPoint(v.set(t[C], t[C + 1], t[C + 2]))
  18695. }
  18696. else
  18697. for (o = 0,
  18698. a = t.length; o < a; o += 9)
  18699. s = (t[o] + t[o + 3] + t[o + 6]) / 3,
  18700. l = (t[o + 1] + t[o + 4] + t[o + 7]) / 3,
  18701. c = (t[o + 2] + t[o + 5] + t[o + 8]) / 3,
  18702. h = Math.floor(s / this.chunksize),
  18703. u = Math.floor(l / this.chunksize),
  18704. d = Math.floor(c / this.chunksize),
  18705. p = h + "." + u + "." + d,
  18706. p in this.chunks ? (g = this.chunks[p],
  18707. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  18708. f = this.boundingBoxes[p] = new r.Box3),
  18709. 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]),
  18710. f.expandByPoint(v.set(t[o], t[o + 1], t[o + 2])),
  18711. f.expandByPoint(v.set(t[o + 3], t[o + 4], t[o + 5])),
  18712. f.expandByPoint(v.set(t[o + 6], t[o + 7], t[o + 8]))
  18713. }
  18714. ,
  18715. n.prototype.build = function() {
  18716. var e = new r.Object3D;
  18717. e.material = this.material;
  18718. for (var t in this.chunks) {
  18719. var i = this.chunks[t]
  18720. , n = new r.BufferGeometry;
  18721. n.addAttribute("position", new r.BufferAttribute(new Float32Array(i),3)),
  18722. n.boundingBox = this.boundingBoxes[t];
  18723. var o = new r.Mesh(n,this.material);
  18724. o.material.visible = !1,
  18725. e.add(o),
  18726. this.chunks[t] = []
  18727. }
  18728. return e
  18729. }
  18730. ,
  18731. t.exports = n
  18732. }
  18733. , {
  18734. "../enum/Viewmode": 51,
  18735. three: 217
  18736. }],
  18737. 146: [function(e, t, i) {
  18738. "use strict";
  18739. var r = e("three")
  18740. , o = e("../settings")
  18741. , a = e("../util/common")
  18742. , s = e("../util/lerp")
  18743. , l = e("./ChunkedCollider")
  18744. , c = e("../util/transitions")
  18745. , h = e("../util/easing")
  18746. , u = (e("../objects/Panorama"),
  18747. e("../enum/RenderOrder"))
  18748. , d = e("../localization/localize");
  18749. function n(e, t, i) {
  18750. r.Object3D.call(this),
  18751. this.model = e,
  18752. this.floorIndex = t,
  18753. this.lang = o.languageTag,
  18754. this.name = i || o.languageTag === "cn" ? "Floor " + (t + 1) + "" : "第" + (t + 1) + "层",
  18755. this.panos = [],
  18756. this.chunks = [],
  18757. this.colliderBuilder = new l(3),
  18758. this.collider = null,
  18759. this.center = null,
  18760. this.boundingBox = new r.Box3,
  18761. this.size = null,
  18762. this.hidden = !1,
  18763. this.conservativeBoundingBox = new r.Box3,
  18764. this.debugColor = 16777215 * Math.random(),
  18765. this.transition = null
  18766. }
  18767. n.prototype = Object.create(r.Object3D.prototype),
  18768. n.prototype.enter = function(e) {
  18769. this.model.setFloor(this, e)
  18770. }
  18771. ,
  18772. n.prototype.hide = function(e) {
  18773. if (!this.hidden || this.transition) {
  18774. this.chunks.forEach(function(e) {
  18775. e.material.transparent = !0
  18776. }),
  18777. c.cancel(this.transition);
  18778. var t = e ? 0 : o.hideFloorDuration + o.hideFloorDelay
  18779. , i = e ? 0 : o.hideFloorDelay / t;
  18780. this.transition = c.start(s.allUniforms(this.chunks, "opacity", .08), t, function() {
  18781. this.hidden = !0
  18782. }
  18783. .bind(this), i, h.easeInOutQuad)
  18784. }
  18785. }
  18786. ,
  18787. n.prototype.show = function(e) {
  18788. if (this.hidden || this.transition) {
  18789. this.hidden = !1,
  18790. c.cancel(this.transition);
  18791. var t = e ? o.showFloorDuration : o.showFloorDuration + o.showFloorDelay
  18792. , i = e ? 0 : o.showFloorDelay / t;
  18793. this.transition = c.start(s.allUniforms(this.chunks, "opacity", 1), t, function() {
  18794. this.hidden || this.chunks.forEach(function(e) {
  18795. e.material.transparent = !1
  18796. })
  18797. }
  18798. .bind(this), i, h.easeInOutQuad)
  18799. }
  18800. }
  18801. ,
  18802. n.prototype.toggle = function(e, t) {
  18803. e = void 0 === e ? this.hidden : e,
  18804. e ? this.show(t) : this.hide(t)
  18805. }
  18806. ,
  18807. n.prototype.containsPoint = function(e) {
  18808. return this.collider.children.some(function(t) {
  18809. return t.geometry.boundingBox || t.geometry.computeBoundingBox(),
  18810. t.geometry.boundingBox.containsPoint(e)
  18811. })
  18812. }
  18813. ,
  18814. n.prototype.distanceToPoint = function(e) {
  18815. var t = null
  18816. , i = 1 / 0;
  18817. return this.collider.children.forEach(function(n) {
  18818. n.geometry.boundingBox || n.geometry.computeBoundingBox();
  18819. var r = n.geometry.boundingBox.distanceToPoint(e);
  18820. (!t || i > r) && (i = r,
  18821. t = n)
  18822. }),
  18823. i
  18824. }
  18825. ,
  18826. n.prototype.addChunk = function(e) {
  18827. e.renderOrder = u.ghostFloor,
  18828. this.add(e),
  18829. this.chunks.push(e),
  18830. this.boundingBox.union(e.geometry.boundingBox),
  18831. this.size = this.boundingBox.size(),
  18832. this.colliderBuilder.add(e.geometry)
  18833. }
  18834. ,
  18835. n.prototype.addPano = function(e) {
  18836. this.panos.push(e),
  18837. this.add(e.skyboxMesh),
  18838. e.marker && this.add(e.marker);
  18839. if(e.neighbourUUIDs && e.neighbourUUIDs.length){//add 有相邻点才算入bound 因为拍摄有bug,会出现floorPosition为000,且position位置很偏的点,它们一般都是不可见点。
  18840. var t = new r.Vector3(1,1,1)
  18841. , i = (new r.Box3).setFromCenterAndSize(e.position, t);
  18842. this.boundingBox.union(i)
  18843. }
  18844. }
  18845. ,
  18846. n.prototype.build = function() {
  18847. this.collider = this.colliderBuilder.build(!0),
  18848. this.add(this.collider),
  18849. this.center = this.boundingBox.center(),
  18850. this.conservativeBoundingBox.copy(this.boundingBox),
  18851. this.conservativeBoundingBox.min.y = a.lowerMedian(this.collider.children.map(function(e) {
  18852. return e.geometry.boundingBox.min.y
  18853. }), 5),
  18854. this.conservativeBoundingBox.max.y = a.lowerMedian(this.collider.children.map(function(e) {
  18855. return e.geometry.boundingBox.max.y
  18856. }), 5)
  18857. if(!settings.extractFloor || !settings.extractFloor[window.number]){
  18858. this.colliderBuilder = null
  18859. }
  18860. }
  18861. ,
  18862. n.prototype.toShortString = function() {
  18863. return a.nth(this.floorIndex + 1)
  18864. }
  18865. ,
  18866. n.prototype.toString = function() {
  18867. return this.name
  18868. }
  18869. ,
  18870. n.prototype.constructor = n, //add
  18871. t.exports = n
  18872. }
  18873. , {
  18874. "../enum/RenderOrder": 42,
  18875. "../localization/localize": 108,
  18876. "./strings-cn-CN": 109,
  18877. "../objects/Panorama": 148,
  18878. "../settings": 166,
  18879. "../util/common": 185,
  18880. "../util/easing": 186,
  18881. "../util/lerp": 188,
  18882. "../util/transitions": 195,
  18883. "./ChunkedCollider": 145,
  18884. three: 217
  18885. }],
  18886. 147: [function(e, t, i) {
  18887. "use strict";
  18888. function n(e) {
  18889. this.player = e,
  18890. this.obj3d = null,
  18891. this.UP = new r.Vector3(0,1,0)
  18892. }
  18893. var r = e("three")
  18894. , o = e("../settings");
  18895. n.prototype.prefs = {
  18896. linewidth: 3,
  18897. height: .07,
  18898. opacity: .45,
  18899. endScale: .05
  18900. },
  18901. n.prototype.discard = function() {
  18902. if (this.obj3d) {
  18903. var e = this.obj3d.parent;
  18904. e && e.remove(this.obj3d)
  18905. }
  18906. this.obj3d = null
  18907. }
  18908. ,
  18909. n.prototype.draw = function() {
  18910. if (this.discard(),
  18911. o.showNeighbors) {
  18912. var e = this.player.currentPano.floor;
  18913. this.obj3d = new r.Object3D;
  18914. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  18915. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  18916. i.y += this.prefs.height;
  18917. var n = .1525
  18918. , a = .127
  18919. , s = .0127
  18920. , l = .1
  18921. , c = .19
  18922. , h = .2032
  18923. , u = .2286
  18924. , d = .255
  18925. , p = new r.Matrix4;
  18926. for (var f in t)
  18927. if (t[f]) {
  18928. var g = this.player.model.panos.get(f)
  18929. , m = (g.position.clone().sub(this.player.model.position),
  18930. g.position.clone().sub(g.floorPosition))
  18931. , v = g.floorPosition.clone().sub(this.player.model.position);
  18932. v.y += this.prefs.height;
  18933. var A = new r.Geometry;
  18934. 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)),
  18935. 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)),
  18936. p.identity().setPosition(m),
  18937. A.applyMatrix(p),
  18938. A.vertices.push(new r.Vector3(0,-this.prefs.endScale,0)),
  18939. 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)),
  18940. p.lookAt(v, i, this.UP).setPosition(v),
  18941. A.applyMatrix(p),
  18942. A.vertices.push(v, i);
  18943. var y = new r.Line(A,new r.LineBasicMaterial({
  18944. color: g.debugColor.getHex(),
  18945. transparent: !0,
  18946. opacity: this.prefs.opacity,
  18947. depthWrite: !1,
  18948. name: "sLine" + f,
  18949. linewidth: this.prefs.linewidth
  18950. }));
  18951. this.obj3d.add(y)
  18952. }
  18953. e.add(this.obj3d)
  18954. }
  18955. }
  18956. ,
  18957. n.prototype.update = function() {
  18958. o.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  18959. }
  18960. ,
  18961. t.exports = n
  18962. }
  18963. , {
  18964. "../settings": 166,
  18965. three: 217
  18966. }],
  18967. 148: [function(e, t, i) {
  18968. (function(i) {
  18969. "use strict";
  18970. function n(e, t, i, n) {
  18971. this.model = e,
  18972. this.id = t,
  18973. this.alignmentType = i.alignmentType || l.ALIGNED,
  18974. this.neighbourUUIDs = i.neighbours || null,
  18975. this.neighbourPanos = null,
  18976. this.floor = null,
  18977. this.floorIndex = i.floor,
  18978. this.failedLoadingAt = 0,
  18979. this.maxLoadRetries = 4,
  18980. this.origin = i.position.clone(),
  18981. this.position = this.alignmentType === l.UNALIGNED ? new r.Vector3(0,-5,0) : i.position.clone(),
  18982. this.quaternion = i.quaternion.clone(),
  18983. this.skyboxMesh = new r.Mesh(E),
  18984. this.skyboxMesh.position.copy(this.position),
  18985. this.skyboxMesh.quaternion.copy(this.quaternion),
  18986. this.skyboxMesh.name = "skybox",
  18987. this.skyboxMesh.visible = !1,
  18988. this.skyboxMesh.updateMatrix(),
  18989. this.skyboxMesh.updateMatrixWorld(),
  18990. this.marker = null,
  18991. this.showFloorMarker = !window.DATA.hideFloorMarker;
  18992. if(this.isAligned() ){
  18993. this.marker = new r.Mesh(b,new r.MeshBasicMaterial({
  18994. map: w,
  18995. side: r.DoubleSide,
  18996. opacity: 0,
  18997. transparent: !0,
  18998. depthWrite: !1
  18999. })),
  19000. this.marker.visible = false //改:先不显示,之后根据opacity显示
  19001. this.marker.renderOrder = s.panoMarker,
  19002. this.marker.name = "marker",
  19003. this.marker.pano = this,
  19004. this.marker.layers.set(v.PANOMARKERS),
  19005. this.marker.updateMatrixWorld()
  19006. if(!window.DATA.hideFloorMarker){//xzw
  19007. let opa = this.marker.material.opacity
  19008. Object.defineProperty(this.marker.material, 'opacity', {
  19009. get: function () {
  19010. return opa
  19011. },
  19012. set: (o)=>{
  19013. opa = o
  19014. convertTool.updateVisible(this.marker, 'hideWhenZeroOpa', o > 0)
  19015. //if(o==0)console.log('o==0',this.id,this.marker.visible)
  19016. //console.log(o,this.id,this.marker.visible)
  19017. },
  19018. })
  19019. }
  19020. a.colorMarkerOnLoad && this.on("load", function() {
  19021. this.marker.material.color.set(65280)
  19022. })
  19023. }
  19024. this.debugColor = (new r.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  19025. this.floorPosition = i.puck ? i.puck.clone() : null,
  19026. this.tiled = n,
  19027. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new r.Texture([null, null, null, null, null, null]),
  19028. this.solidSkybox.flipY = !1,
  19029. a.minimalMemoryMode && (this.solidSkybox.minFilter = r.LinearFilter,
  19030. this.solidSkybox.magFilter = r.LinearFilter,
  19031. this.solidSkybox.generateMipmaps = !1)),
  19032. this.zoomed = !1,
  19033. this.panoRenderer = null,
  19034. this.qualityManager = null,
  19035. this.tileDownloader = null,
  19036. this.tiledPanoRenderTarget = null,
  19037. this.minimumTiledPanoLoaded = !1,
  19038. this.highestPartialTileRenderOpCompleted = 0,
  19039. this.highestFullTileRenderOpCompleted = 0,
  19040. this.shouldRedrawOnBaseLoaded = !1,
  19041. this.lockUntilRenderingComplete = !1,
  19042. a.colorMarkerOnLoad && this.on("load", function() {
  19043. this.marker.material.color.set(65280)
  19044. });
  19045. /********************************************************************fyz改vr from徐世廷*************************************************************/
  19046. var e = new r.TextureLoader;
  19047. e.setCrossOrigin(!0);
  19048. var g = e.load("images/texture.jpg");
  19049. if (this.vrMarker = new r.Mesh(new r.OctahedronGeometry(.1,0),new r.MeshLambertMaterial({
  19050. color: 16777215,
  19051. transparent: !0,
  19052. opacity: .75,
  19053. map: g
  19054. })),
  19055. this.vrMarker.boluoType = "vr",
  19056. this.vrMarker.position.z = 1,
  19057. this.vrMarker.enabled = !0,
  19058. this.vrMarker.visible = !1,
  19059. window.vrMarkers = window.vrMarkers || [],
  19060. window.vrMarkers.push(this.vrMarker),
  19061. this.marker && this.marker.add(this.vrMarker),
  19062. a.showAxis && (this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(0,1,0),new r.Vector3(0,0,0),1,255)),
  19063. this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(0,0,1),new r.Vector3(0,0,0),1,16711680)),
  19064. this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(1,0,0),new r.Vector3(0,0,0),1,65280))),
  19065. this.adjustAngleEnable) {
  19066. var i = new r.Quaternion;
  19067. i.setFromAxisAngle(new r.Vector3(1,0,0), this.adjustAngleX),
  19068. this.skyboxMesh.quaternion.multiply(i);
  19069. var m = new r.Quaternion;
  19070. m.setFromAxisAngle(new r.Vector3(0,1,0), this.adjustAngleY),
  19071. this.skyboxMesh.quaternion.multiply(m);
  19072. var n = new r.Quaternion;
  19073. n.setFromAxisAngle(new r.Vector3(0,0,1), this.adjustAngleZ),
  19074. this.skyboxMesh.quaternion.multiply(n),
  19075. this.skyboxMesh.updateMatrix(),
  19076. this.skyboxMesh.updateMatrixWorld(),
  19077. this.model.updateProjectedPanos()
  19078. }
  19079. /**************************************************************************************************************************************/
  19080. }
  19081. var r = e("three")
  19082. , o = e("../util/logger")
  19083. , a = e("../settings")
  19084. , s = (e("../enum/Viewmode"),
  19085. e("../enum/RenderOrder"))
  19086. , l = e("../enum/AlignmentType")
  19087. , c = (e("../util/common"),
  19088. e("../util/transitions"))
  19089. , h = e("../util/lerp")
  19090. , u = e("../util/ajax")
  19091. , d = e("../util/texture")
  19092. , p = e("../util/panorama")
  19093. , f = (e("../enum/TileDownloaderEvents"),
  19094. e("../enum/PanoramaEvents"))
  19095. , g = e("../enum/PanoRendererEvents")
  19096. , m = e("../enum/PanoSizeClass")
  19097. , v = e("../enum/RenderLayers")
  19098. , A = (e("../scene/SceneRenderer"),
  19099. e("../enum/GLCubeFaces"),
  19100. e("../exception/BasicException"))
  19101. , y = e("../tile/TileUtils")
  19102. , C = e("events").EventEmitter
  19103. , I = new o(i)
  19104. , E = new r.SphereBufferGeometry(.1)
  19105. , b = new r.PlaneBufferGeometry(.35,.35,1,1)
  19106. , w = d.load("images/marker.png");
  19107. w.anisotropy = browser.isMobile() ? 1 : 3 //add
  19108. n.prototype = Object.create(C.prototype),
  19109. n.prototype.enter = function() {
  19110. var e = null;
  19111. return function() {
  19112. this.setZoomed(!1),
  19113. this.emit("enter", {
  19114. oldPano: e,
  19115. newPano: this
  19116. }),
  19117. e = this
  19118. this.model.setHighMap(this) //add
  19119. }
  19120. }(),
  19121. n.prototype.exit = function() {
  19122. this.tiled ? (this.clearWaitDeferreds(),
  19123. this.minimumTiledPanoLoaded = !1,
  19124. this.tiledPanoRenderTarget = null,
  19125. this.setZoomed(!1),
  19126. this.panoRenderer.deactivateTiledPano(this),
  19127. this.highestPartialTileRenderOpCompleted = 0,
  19128. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  19129. this.solidSkybox.loaded = !1,
  19130. this.solidSkybox.version = 0),
  19131. this.emit("exit")
  19132. }
  19133. ,
  19134. n.prototype.hoverOn = function(e) {
  19135. this.marker && (c.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  19136. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  19137. }
  19138. ,
  19139. n.prototype.hoverOff = function(e) {
  19140. this.marker && c.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  19141. }
  19142. ,
  19143. n.prototype.build1 = function() {
  19144. 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),
  19145. this.floor.addPano(this),
  19146. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  19147. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  19148. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  19149. }
  19150. ,
  19151. n.prototype.build2 = function() {
  19152. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  19153. this.height = this.position.distanceTo(this.floorPosition),
  19154. this.placeMarker()
  19155. }
  19156. ,
  19157. n.prototype.interpolateFloorPosition = function() {
  19158. var e = this.model.panos.filter(n.filters.isNeighbourPanoTo(this)).filter(function(e) {
  19159. return !!e.floorPosition
  19160. }).sort(function(e, t) {
  19161. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  19162. }
  19163. .bind(this))
  19164. , t = this.position.clone();
  19165. return e.length >= 2 ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  19166. t
  19167. }
  19168. ,
  19169. n.prototype.raycastFloorPosition = function() {
  19170. I.warn("Performance warning: Raycasting to find floor position");
  19171. var e = new r.Raycaster(this.position,new r.Vector3(0,-1,0))
  19172. , t = e.intersectObjects(this.model.colliders);
  19173. return t.length ? t[0].point : null
  19174. }
  19175. ,
  19176. n.prototype.raycastToFindFloor = function() {
  19177. 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)];
  19178. return function() {
  19179. I.warn("Performance warning: Raycasting to find floor index");
  19180. for (var t = 0; t < e.length; t++) {
  19181. var i = new r.Raycaster(this.position.clone(),e[t].clone())
  19182. , n = i.intersectObjects(this.model.colliders);
  19183. if (n.length)
  19184. return n[0].object.parent.parent
  19185. }
  19186. return null
  19187. }
  19188. }(),
  19189. n.prototype.placeMarker = function() {
  19190. this.marker && (this.marker.position.copy(this.floorPosition),
  19191. //this.fixedFloorY != void 0 && this.marker.position.setY(this.fixedFloorY),//add
  19192. this.marker.position.y += settings.markerHeight,
  19193. this.marker.lookAt(new r.Vector3(0,1,0).add(this.marker.position)))
  19194. }
  19195. ,
  19196. n.prototype.translate = function(e) {
  19197. this.position.add(e),
  19198. this.floorPosition.add(e)
  19199. }
  19200. ,
  19201. n.prototype.findClosestMidtpointPanoTo = function(e) {
  19202. (new r.Vector3).addVectors(this.position, e.position).divideScalar(2);
  19203. return this.model.panos.find([n.filters.notIn([this, e])], [n.sortFunctions.distanceToPoint(point)])
  19204. }
  19205. ,
  19206. n.prototype.attachToPanoRenderer = function(e) {
  19207. this.panoRenderer = e,
  19208. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  19209. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  19210. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  19211. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  19212. }
  19213. ;
  19214. var _ = {};
  19215. n.prototype.getWaitDeferred = function(e) {
  19216. var t = _[this.id];
  19217. t || (t = {},
  19218. _[this.id] = t);
  19219. var i = t[e];
  19220. return i || (i = {
  19221. deferred: $.Deferred(),
  19222. active: !1
  19223. },
  19224. t[e] = i),
  19225. i
  19226. }
  19227. ,
  19228. n.prototype.resetWaitDeferred = function(e) {
  19229. var t = this.getWaitDeferred(e);
  19230. t.active = !1,
  19231. t.deferred = $.Deferred()
  19232. }
  19233. ,
  19234. n.prototype.clearWaitDeferreds = function() {
  19235. var e = _[this.id];
  19236. e || (e = {},
  19237. _[this.id] = e);
  19238. for (var t in e)
  19239. if (e.hasOwnProperty(t)) {
  19240. var i = e[t];
  19241. i.active = !1,
  19242. i.deferred = $.Deferred()
  19243. }
  19244. }
  19245. ,
  19246. n.prototype.loadTiledPano = function() {
  19247. var e = (new r.Vector3,
  19248. [])
  19249. , t = [];
  19250. return function(i, n, r, o, a, s) {
  19251. null !== o && void 0 !== o || (o = !0),
  19252. null !== a && void 0 !== a || (a = !0);
  19253. var l = this.getWaitDeferred(i)
  19254. , c = l.deferred
  19255. , h = null
  19256. , u = null;
  19257. if (r && ("number" == typeof r ? h = r : (h = r.hFov,
  19258. u = r.vFov)),
  19259. !this.isLoaded(i)) {
  19260. if (!l.active) {
  19261. if (l.active = !0,
  19262. r) {
  19263. var d = y.matchingTilesInDirection(this, i, n, h, u);
  19264. e[this.id + ":" + i] = {
  19265. tileCount: 0,
  19266. targetTileCount: d
  19267. },
  19268. I.info("Loading partial pano: " + this.id + " with " + d + " tiles")
  19269. }
  19270. t[this.id] || (t[this.id] = !0,
  19271. this.on(f.LoadComplete, function(e, t) {
  19272. //console.warn('点位下载完成 ', 'id:'+this.id, 'count:'+t )
  19273. var i = this.getWaitDeferred(e).deferred;
  19274. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  19275. this.resetWaitDeferred(e))
  19276. }
  19277. .bind(this)),
  19278. this.on(f.LoadFailed, function(e) {
  19279. var t = this.getWaitDeferred(e).deferred;
  19280. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  19281. this.resetWaitDeferred(e))
  19282. }
  19283. .bind(this)),
  19284. this.on(f.TileLoaded, function(t, i, n) {
  19285. //console.log('tileLoaded', 'id:'+this.id, 'size:'+t, 'index:'+i )
  19286. var r = this.getWaitDeferred(t).deferred;
  19287. if (r && "pending" === r.state()) {
  19288. r.notify(t, i, n);
  19289. var o = e[this.id + ":" + t];
  19290. o && (o.tileCount++,
  19291. o.tileCount === o.targetTileCount && (this.onPanoRendered(this.id, t, n, !0),
  19292. r.resolve(t, n),
  19293. this.resetWaitDeferred(t)))
  19294. }
  19295. }
  19296. .bind(this)))
  19297. }
  19298. this.tileDownloader.clearForceQueue(),
  19299. this.tileDownloader.forceQueueTilesForPano(this, i, n, h, u, s),
  19300. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, Math.min(2048, this.qualityManager.getMaxNavPanoSize()) , o), //不要超过2048否则漫游到下一个点时卡顿
  19301. this.panoRenderer.renderPanoTiles(this.id, n, a)
  19302. }
  19303. return c.promise()
  19304. }
  19305. }(),
  19306. n.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  19307. if (e === this.id) {
  19308. var n = this.qualityManager.getPanoSize(m.BASE);
  19309. t === n && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  19310. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  19311. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  19312. }
  19313. }
  19314. ,
  19315. n.prototype.onTileRendered = function(e, t, i, n) {
  19316. e === this.id && this.emit(f.TileLoaded, t, i, n)
  19317. }
  19318. ,
  19319. n.prototype.onPanoRendered = function(e, t, i, n) {
  19320. e === this.id && (this.minimumTiledPanoLoaded = !0,
  19321. this.updateSkyboxForZoomLevel(),
  19322. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  19323. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  19324. this.emit("load", t),
  19325. this.model.emit("load", this),
  19326. this.emit(f.LoadComplete, t, i))
  19327. }
  19328. ,
  19329. n.prototype.setZoomed = function(e) {
  19330. this.zoomed = e,
  19331. this.updateSkyboxForZoomLevel()
  19332. if(e){ //add
  19333. if(player.qualityManager.getNavZoomClass() != '1k' ){
  19334. this.model.showHighMap()
  19335. }
  19336. }else{
  19337. this.model.hideHighMap()
  19338. }
  19339. }
  19340. ,
  19341. n.prototype.ensureSkyboxReadyForRender = function() {
  19342. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  19343. this.solidSkybox.loaded = !0)
  19344. }
  19345. ,
  19346. n.prototype.updateSkyboxForZoomLevel = function() {
  19347. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  19348. }
  19349. ,
  19350. n.prototype.getSkyboxTexture = function() {
  19351. //return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  19352. if(!this.tiled){
  19353. return this.solidSkybox
  19354. }
  19355. if(this.minimumTiledPanoLoaded)
  19356. {
  19357. if(this.zoomed && (this.qualityManager.maxRenderTargetSize > this.qualityManager.maxNavPanoSize|| player.qualityManager.getNavZoomClass() == '4k' ))//change 如果放大后和不放大都是2k就不用这个
  19358. {
  19359. return this.panoRenderer.zoomRenderTarget.texture;
  19360. }
  19361. else
  19362. {
  19363. this.tiledPanoRenderTarget.texture.mapping = THREE.UVMapping//add
  19364. return this.tiledPanoRenderTarget.texture;
  19365. }
  19366. }
  19367. else
  19368. {
  19369. return null;
  19370. }
  19371. }
  19372. ,
  19373. n.prototype.onTileRenderFail = function(e, t, i) {
  19374. e === this.id && this.emit(f.LoadFailed, t)
  19375. }
  19376. ,
  19377. n.prototype.isLoaded = function(e) {
  19378. if (this.tiled) {
  19379. if (e && "string" == typeof e)
  19380. throw new A("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  19381. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  19382. }
  19383. if (e && "number" == typeof e)
  19384. throw new A("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  19385. return !!this.solidSkybox.high || e in this.solidSkybox
  19386. }
  19387. ,
  19388. n.prototype.loadCube = function(e) {
  19389. if (this.isLoaded(e))
  19390. return I.info("Skipping load of pano, already loaded"),
  19391. $.when();
  19392. this.emit("loading", e),
  19393. this.model.emit("loading", this);
  19394. var t = p.getCubemapUrls(this.model.urls, this.id, e)
  19395. , i = t.filter(function(e) {
  19396. return !e
  19397. });
  19398. "low" === e && i.length > 0 && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  19399. e = "high",
  19400. t = p.getCubemapUrls(this.model.urls, this.id, e));
  19401. var n = 0
  19402. , r = [0, 1, 2, 3, 4, 5].map(function(e, i, n) {
  19403. return u.getImage(t[i])
  19404. }
  19405. .bind(this));
  19406. return $.when(r[0], r[1], r[2], r[3], r[4], r[5]).then(function(t, i, n, r, o, a) {
  19407. return this.solidSkybox[e] = [t, i, n, r, o, a],
  19408. "high" !== e && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[e],
  19409. this.solidSkybox.low = null),
  19410. this.solidSkybox.needsUpdate = !0,
  19411. this.emit("load", e),
  19412. this.model.emit("load", this),
  19413. this
  19414. }
  19415. .bind(this), function() {
  19416. I.error("Downloading cubemap for pano", this.id, "failed"),
  19417. this.failedLoadingAt = Date.now()
  19418. }
  19419. .bind(this), function() {
  19420. return $.when(++n, 6)
  19421. })
  19422. }
  19423. ,
  19424. n.raycastsSkipped = 0,
  19425. n.raycastsDone = 0,
  19426. n.prototype.findNeighourPanos = function() {
  19427. return this.model.panos.setNeighbour(this.id, this.id, !1),
  19428. this.model.panos.forEach(function(e) {
  19429. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  19430. var t = this.position.distanceTo(e.position);
  19431. if (t > a.panoramaNeighbourMaxDistance)
  19432. return this.model.panos.setNeighbour(this, e, !1),
  19433. void n.raycastsSkipped++;
  19434. var i = e.position.clone().sub(this.position).normalize()
  19435. , o = new r.Raycaster(this.position,i.clone(),0,t)
  19436. , s = o.intersectObjects(this.model.colliders);
  19437. n.raycastsDone++,
  19438. this.model.panos.setNeighbour(this, e, 0 === s.length),
  19439. 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)))
  19440. }
  19441. }
  19442. .bind(this)),
  19443. this.model.panos.neighbourMap[this.id]
  19444. }
  19445. ,
  19446. n.prototype.worldPosition = function() {
  19447. return this.position
  19448. }
  19449. ,
  19450. n.prototype.addLabel = function() {
  19451. this.removeLabel()
  19452. this.label = new TextSprite({
  19453. sizeInfo: {
  19454. minSize: 100,
  19455. maxSize: 200,
  19456. nearBound: 0.7,
  19457. farBound: 10, //Math.max(20, player.model.size.length() / 3),
  19458. farBoundPlan: 100,
  19459. },
  19460. backgroundColor: { r: 255, g: 255, b: 255, a: 0.4 },
  19461. textColor: { r: 0, g: 0, b: 0, a: 1 },
  19462. borderRadius: 15,
  19463. renderOrder: 5,
  19464. text: this.id //`${this.id}-f${this.floorIndex}`
  19465. })
  19466. let position = this.floorPosition.clone()
  19467. position.y += 0.2
  19468. this.label.position.copy(position)
  19469. this.floor.add(this.label)
  19470. },
  19471. n.prototype.removeLabel = function() {
  19472. this.label && (this.floor.remove(this.label), this.label.material.dispose(), (this.label = null))
  19473. },
  19474. /* n.prototype.addTextSprite = function(e, t) {
  19475. this.removeTextSprite();
  19476. var i = document.createElement("canvas")
  19477. , n = i.getContext("2d");
  19478. i.width = 256,
  19479. i.height = 256;
  19480. var o = "Arial"
  19481. , a = 60;
  19482. n.font = "bold " + a + "px " + o,
  19483. n.fillStyle = "white";
  19484. var s = n.measureText(e).width;
  19485. n.fillText(e, (i.width - s) / 2, (i.height + a) / 2);
  19486. var l = new r.Texture(i);
  19487. l.needsUpdate = !0;
  19488. var c = new r.SpriteMaterial({
  19489. map: l,
  19490. color: t || 16428055
  19491. });
  19492. this.text3d = new r.Sprite(c),
  19493. this.text3d.position.copy(this.skyboxMesh.position),
  19494. this.floor.add(this.text3d)
  19495. }
  19496. ,
  19497. n.prototype.removeTextSprite = function() {
  19498. this.text3d && (this.floor.remove(this.text3d),
  19499. this.text3d = null)
  19500. }*/
  19501. n.prototype.isAligned = function() {
  19502. return this.alignmentType === l.ALIGNED
  19503. }
  19504. ,
  19505. n.filters = {
  19506. inDirection: function(e, t, i) {
  19507. return function(n) {
  19508. var r = n.position.clone().sub(e).normalize();
  19509. return r.dot(t) > i
  19510. }
  19511. },
  19512. inFloorDirection: function(e, t, i) {
  19513. return function(n) {
  19514. var r = n.floorPosition.clone().sub(e).normalize();
  19515. return r.dot(t) > i
  19516. }
  19517. },
  19518. inPanoDirection: function(e, t, i) {
  19519. return i = a.navigation.panoScores ? a.navigation.filterStrictness : i,
  19520. function(n) {
  19521. var r = n.floorPosition.clone().sub(e).normalize()
  19522. , o = n.position.clone().sub(e).normalize();
  19523. return r.dot(t) > i || o.dot(t) > i
  19524. }
  19525. },
  19526. atFloor: function(e) {
  19527. return function(t) {
  19528. return !e || t.floor === e
  19529. }
  19530. },
  19531. not: function(e) {
  19532. return function(t) {
  19533. return t !== e
  19534. }
  19535. },
  19536. notIn: function(e) {
  19537. return function(t) {
  19538. return e.indexOf(t) === -1
  19539. }
  19540. },
  19541. isLoaded: function() {
  19542. return function(e) {
  19543. return e.isLoaded()
  19544. }
  19545. },
  19546. isNotLoaded: function() {
  19547. return function(e) {
  19548. return !e.isLoaded()
  19549. }
  19550. },
  19551. isCloseEnoughTo: function(e, t) {
  19552. return function(i) {
  19553. return e.distanceTo(i.floorPosition) < t
  19554. }
  19555. },
  19556. hasMinimumHeightDifferenceTo: function(e, t) {
  19557. return function(i) {
  19558. return Math.abs(i.position.y - e.y) > t
  19559. }
  19560. },
  19561. isNotBehindNormal: function(e, t) {
  19562. var i = new r.Vector3;
  19563. return t = t.clone(),
  19564. function(n) {
  19565. var r = i.copy(n.position).sub(e).normalize();
  19566. return r.dot(t) > 0
  19567. }
  19568. },
  19569. isNeighbourPanoTo: function(e) {
  19570. return function(t) {
  19571. return !e || !e.neighbourPanos || !!e.neighbourPanos[t.id]
  19572. }
  19573. },
  19574. isNeighbourOfNeighbourTo: function(e) {
  19575. return function(t) {
  19576. return !!e.neighbourPanos[t.id] || e.neighbourUUIDs.some(function(i) {
  19577. var n = e.model.panos.get(i);
  19578. return !!n && n.neighbourPanos[t.id]
  19579. })
  19580. }
  19581. },
  19582. isNotRecentlyFailed: function(e) {
  19583. return function(t) {
  19584. return Date.now() - t.failedLoadingAt > e
  19585. }
  19586. },
  19587. isOnVisibleFloor: function() {
  19588. return function(e) {
  19589. return !e.floor.hidden
  19590. }
  19591. },
  19592. isPanoAligned: function() {
  19593. return function(e) {
  19594. return e.isAligned()
  19595. }
  19596. }
  19597. },
  19598. n.sortFunctions = {
  19599. distanceToPoint: function(e) {
  19600. return function(t, i) {
  19601. return t.position.distanceTo(e) - i.position.distanceTo(e)
  19602. }
  19603. },
  19604. floorDistanceToPoint: function(e) {
  19605. return function(t, i) {
  19606. return t.floorPosition.distanceTo(e) - i.floorPosition.distanceTo(e)
  19607. }
  19608. },
  19609. choose: function(e) {
  19610. return function(t, i) {
  19611. return e.id === t.id ? -1 : e.id === i.id ? 1 : 0
  19612. }
  19613. }
  19614. },
  19615. n.scoreFunctions = {
  19616. distance: function(e, t) {
  19617. return t = t || a.navigation.distanceFactor,
  19618. function(i) {
  19619. return e ? e.position.distanceTo(i.position) * t : 0
  19620. }
  19621. },
  19622. distanceSquared: function(e, t) {
  19623. return t = t || a.navigation.distanceFactor,
  19624. function(i) {
  19625. return e ? e.position.distanceToSquared(i.position) * t : 0
  19626. }
  19627. },
  19628. direction: function(e, t) {
  19629. return function(i) {
  19630. var n = i.position.clone().sub(e).normalize();
  19631. return n.dot(t) * a.navigation.directionFactor
  19632. }
  19633. },
  19634. angle: function(e, t) {
  19635. return function(i) {
  19636. var n = i.position.clone().sub(e).normalize();
  19637. return n.angleTo(t) * a.navigation.angleFactor
  19638. }
  19639. },
  19640. inFieldOfView: function(e, t) {
  19641. return function(i) {
  19642. var n = i.position.clone().sub(e).normalize();
  19643. return n.dot(t) > .75 ? 10 : -1
  19644. }
  19645. },
  19646. optionality: function(e) {
  19647. return function(t) {
  19648. var i = t.neighbourUUIDs.filter(function(t) {
  19649. return !(t in e.neighbourUUIDs) && t !== e.id
  19650. });
  19651. return i.length * a.navigation.optionalityFactor
  19652. }
  19653. },
  19654. penalizeHeightDifferenceUnder: function(e, t) {
  19655. return function(i) {
  19656. return e.y - i.position.y < t ? -20 : 0
  19657. }
  19658. }
  19659. },
  19660. t.exports = n
  19661. }
  19662. ).call(this, "/js/objects/Panorama.js")
  19663. }
  19664. , {
  19665. "../enum/AlignmentType": 17,
  19666. "../enum/GLCubeFaces": 25,
  19667. "../enum/PanoRendererEvents": 35,
  19668. "../enum/PanoSizeClass": 36,
  19669. "../enum/PanoramaEvents": 37,
  19670. "../enum/RenderLayers": 41,
  19671. "../enum/RenderOrder": 42,
  19672. "../enum/TileDownloaderEvents": 45,
  19673. "../enum/Viewmode": 51,
  19674. "../exception/BasicException": 55,
  19675. "../scene/SceneRenderer": 158,
  19676. "../settings": 166,
  19677. "../tile/TileUtils": 174,
  19678. "../util/ajax": 181,
  19679. "../util/common": 185,
  19680. "../util/lerp": 188,
  19681. "../util/logger": 189,
  19682. "../util/panorama": 191,
  19683. "../util/texture": 194,
  19684. "../util/transitions": 195,
  19685. events: 202,
  19686. three: 217
  19687. }],
  19688. 149: [function(e, t, i) {
  19689. "use strict";
  19690. function n(e) {
  19691. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  19692. t.map.value = d,
  19693. t.opacity.value = 0,
  19694. t.color.value.set(o.reticuleColor),
  19695. t.showMouseMarker = !window.DATA.hideMouseMarker;
  19696. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  19697. side: r.DoubleSide,
  19698. depthWrite: !1,
  19699. depthTest: !1,
  19700. transparent: !0,
  19701. vertexShader: c.waypoint.vertexShader,
  19702. fragmentShader: c.waypoint.fragmentShader,
  19703. uniforms: t,
  19704. name: "waypoint",
  19705. opacity: 0,
  19706. visible: t.showMouseMarker // 显示/隐藏鼠标标志
  19707. })),
  19708. this.layers.set(h.RETICULE),
  19709. this.renderOrder = u.reticule,
  19710. this.player = e,
  19711. this.direction = new r.Vector3,
  19712. this.hidden = !0,
  19713. this.mouseLastMoveTime = Date.now()
  19714. }
  19715. var r = e("three")
  19716. , o = e("../settings")
  19717. , a = e("../util/transitions")
  19718. , s = e("../util/texture")
  19719. , l = e("../util/lerp")
  19720. , c = e("../shaders")
  19721. , h = e("../enum/RenderLayers")
  19722. , u = e("../enum/RenderOrder")
  19723. , d = s.load("images/reticule.png");
  19724. d.anisotropy = browser.isMobile() ? 1 : 4; //各向异性
  19725. n.prototype = Object.create(r.Mesh.prototype),
  19726. n.prototype.move = function(e, t, i) {
  19727. this.hidden = i,
  19728. this.mouseLastMoveTime = Date.now()
  19729. }
  19730. ,
  19731. n.prototype.hide = function() {
  19732. this.hidden || (this.hidden = !0,
  19733. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  19734. }
  19735. ,
  19736. n.prototype.show = function() {
  19737. this.hidden = !1,
  19738. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  19739. }
  19740. ,
  19741. n.prototype.update = function() {
  19742. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  19743. }
  19744. ,
  19745. n.prototype.updatePosition = function(e, t) {
  19746. if (!this.hidden) {
  19747. if (!t)
  19748. return this.hide();
  19749. var i = t.point
  19750. , n = e.distanceTo(i)
  19751. , r = 1 + .01 * n;
  19752. n < 1 && (r -= 1 - n),
  19753. this.show(),
  19754. this.scale.set(r, r, r),
  19755. this.direction = this.direction.multiplyScalar(.8),
  19756. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  19757. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  19758. this.lookAt(this.position.clone().add(this.direction))
  19759. }
  19760. }
  19761. ,
  19762. n.prototype.writeAstag = function() {
  19763. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  19764. , t = new Date;
  19765. this.tagCount = "undefined" == typeof this.tagCount ? 1 : this.tagCount + 1;
  19766. var i = {
  19767. enabled: !0,
  19768. version: "0",
  19769. created: t.toISOString(),
  19770. created_by: "APITest",
  19771. position: this.position.clone(),
  19772. stem: {
  19773. enabled: o.tags.pole.enabled,
  19774. direction: this.direction.multiplyScalar(o.tags.pole.height)
  19775. },
  19776. label: "tag " + this.tagCount,
  19777. description: "Description " + e,
  19778. floor: function(e) {
  19779. if (e.currentFloor) {
  19780. var t = e.floors.indexOf(e.currentFloor);
  19781. return t > -1 ? t : void 0
  19782. }
  19783. }(this.player.model),
  19784. type: "info",
  19785. metadata: {
  19786. preferred_camera: {
  19787. mode: this.player.mode
  19788. }
  19789. }
  19790. };
  19791. console.log("--------------------------"),
  19792. console.log(JSON.stringify(i));
  19793. var n = this.player.model.addtag(e, i).build();
  19794. n && (n.disc && this.player.tagDiscs.push(n.disc),
  19795. n.visible || n.show(o.tags.startup.fadeInDuration))
  19796. }
  19797. ,
  19798. t.exports = n
  19799. }
  19800. , {
  19801. "../enum/RenderLayers": 41,
  19802. "../enum/RenderOrder": 42,
  19803. "../settings": 166,
  19804. "../shaders": 167,
  19805. "../util/lerp": 188,
  19806. "../util/texture": 194,
  19807. "../util/transitions": 195,
  19808. three: 217
  19809. }],
  19810. 150: [function(e, t, i) {
  19811. "use strict";
  19812. function n(e, t) {
  19813. this.chunks = [],
  19814. this.floorId = e,
  19815. this.roomId = t,
  19816. this.position = new r.Vector3
  19817. }
  19818. var r = e("three");
  19819. n.prototype.addChunk = function(e) {
  19820. this.chunks.push(e)
  19821. }
  19822. ,
  19823. n.prototype.calcBoundaries = function() {
  19824. 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++) {
  19825. var s = this.chunks[a]
  19826. , l = s.geometry.attributes.position;
  19827. if (l)
  19828. for (var c = 0; c < l.array.length; c += 3)
  19829. e.set(l.array[c], l.array[c + 1], l.array[c + 2]),
  19830. t.add(e),
  19831. 0 === c ? (i.copy(e),
  19832. n.copy(e)) : (i.max(e),
  19833. n.min(e)),
  19834. o++
  19835. }
  19836. o > 0 ? (t.multiplyScalar(1 / o),
  19837. this.average = t) : this.average = null,
  19838. this.boundsMax = i,
  19839. this.boundsMin = n,
  19840. this.center = new r.Vector3,
  19841. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  19842. }
  19843. ,
  19844. t.exports = n
  19845. }
  19846. , {
  19847. three: 217
  19848. }],
  19849. 151: [function(e, t, i) {
  19850. (function(i) {
  19851. "use strict";
  19852. function n(e, t, i) {
  19853. this.obj3d = null,
  19854. this.nodes = [],
  19855. this.colorHull = [],
  19856. this.shortPaths = {},
  19857. this.floorHull = null,
  19858. this.cameraHull = null,
  19859. this.floorPathDistance = 0,
  19860. this.floorCurvePoints = null,
  19861. this.floorCurveColors = null,
  19862. this.camCurvePoints = null,
  19863. this.warpDestHeroLoc = null,
  19864. this.warpDestPano = null,
  19865. this.warpPathPoints = null,
  19866. this.warpPathLengths = [0],
  19867. this.warpLength = 0,
  19868. this.closeWarpDistance = 4,
  19869. this.UP = A.UP.clone(),
  19870. this.longestStep = 0,
  19871. this.upcomingTransType = null,
  19872. this.burnsDir = 1, //导览在DOLLHOUSE停留时的旋转方向 1 或 -1
  19873. this.prevNextDist = 0,
  19874. this.nextI = 0,
  19875. this.activeTransType = null,
  19876. this.lastTransType = null,
  19877. this.bunnyObj = null,
  19878. this.director = e,
  19879. this.player = t,
  19880. this.playerControls = i,
  19881. this.modelManager = t.modelManager,
  19882. this.updateModel(),
  19883. this.updateDefaultsFromModelData(),
  19884. this.bindEvents(),
  19885. this.warping = !1,
  19886. this.waitingToWarp = !1,
  19887. this.warpInterrupted = !1,
  19888. this.warpInterruptionBlackoutStyle = null,
  19889. this.warpInterruptionTravelTime = null
  19890. }
  19891. var r = e("three")
  19892. , o = e("../util/logger")
  19893. , a = e("../enum/Viewmode")
  19894. , s = e("../enum/RenderOrder")
  19895. , l = e("../enum/WarpStyle")
  19896. , c = e("../settings")
  19897. , h = e("../util/math")
  19898. , u = e("../util/lerp")
  19899. , d = e("../util/easing")
  19900. , p = e("../util/transitions")
  19901. , f = e("../objects/Snapshot")
  19902. , g = e("../effects")
  19903. , m = e("../shaders")
  19904. , v = (e("../gui/gui"),
  19905. e("../util/texture"))
  19906. , A = e("../enum/Vectors")
  19907. , y = (e("../model/ModelManager"),
  19908. new o(i))
  19909. , C = e("../enum/PlayerEvents")
  19910. , I = e("../enum/BlackoutStyle")
  19911. , E = e("../enum/ModelManagerEvents")
  19912. , b = e("../constants")
  19913. , w = {
  19914. 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"),
  19915. pathEnd: v.load("images/End.png"),
  19916. 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==")
  19917. };
  19918. n.prototype.setScene = function(e) {
  19919. this.createCpm(e),
  19920. this.createBunnyObj(e)
  19921. }
  19922. ,
  19923. n.prototype.updateModel = function() {
  19924. this.model = this.modelManager.getActiveModel()
  19925. }
  19926. ,
  19927. n.prototype.bindEvents = function() {
  19928. this.modelManager.on(E.ActiveModelChanged, this.updateModel.bind(this))
  19929. }
  19930. ,
  19931. n.prototype.updateDefaultsFromModelData = function() {
  19932. this.model.data
  19933. }
  19934. ,
  19935. n.prototype.pointPathDistance = function(e) {
  19936. for (var t = 0, i = 1; i < e.length; i += 1)
  19937. t += e[i - 1].distanceTo(e[i]);
  19938. return t
  19939. }
  19940. ,
  19941. n.prototype.pointPathLengths = function(e) {
  19942. for (var t = [0], i = 1; i < e.length; i += 1)
  19943. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  19944. return t
  19945. }
  19946. ,
  19947. n.prototype.interpAlongPath = function(e, t, i) {
  19948. var n, o = new r.Vector3, a = t[t.length - 1];
  19949. if (i < 1) {
  19950. n = i * a;
  19951. for (var s = 1; s < t.length; s += 1)
  19952. if (t[s] > n) {
  19953. var l = (n - t[s - 1]) / (t[s] - t[s - 1]);
  19954. return o.copy(e[s]),
  19955. o.sub(e[s - 1]),
  19956. o.multiplyScalar(l),
  19957. o.add(e[s - 1]),
  19958. o
  19959. }
  19960. } else
  19961. o.copy(e[e.length - 1]);
  19962. return o
  19963. }
  19964. ,
  19965. n.prototype.pathHeight = function() {
  19966. return this.player.mode !== a.FLOORPLAN ? c.path.height : c.path.outsideHeight
  19967. }
  19968. ,
  19969. n.prototype.createBunnyObj = function(e) {
  19970. this.bunnyObj || (this.bunnyObj = new r.AxisHelper(.1),
  19971. this.bunnyObj.visible = c.warp.showBunny),
  19972. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  19973. e.add(this.bunnyObj)
  19974. }
  19975. ,
  19976. n.prototype.createCpm = function(e) {
  19977. if (!this.currentPanoMarker) {
  19978. /* var t = this.makeWaypointObj(w.pathEnd, "Current");
  19979. t.material.uniforms.opacity.value = 0, */
  19980. let sprite = new THREE.Mesh(new THREE.PlaneBufferGeometry(0.4,0.4,1,1), new THREE.MeshBasicMaterial({
  19981. map: v.load('images/icon_address.png'), depthTest:false,
  19982. transparent:true,
  19983. }))
  19984. sprite.position.y = 0.3
  19985. let t = new THREE.Object3D()
  19986. t.add(sprite)
  19987. setTimeout(()=>{
  19988. window.player.on("view.changed",()=>{
  19989. player.path.currentPanoMarker.mesh.quaternion.copy(player.quaternion)
  19990. })
  19991. },1000)
  19992. this.currentPanoMarker = {
  19993. mesh: t,
  19994. placed: !1
  19995. }
  19996. }
  19997. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  19998. this.placeCpm(),
  19999. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  20000. }
  20001. ,
  20002. n.prototype.placeCpm = function() {
  20003. if (c.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  20004. var e = this.player.currentPano.floor;
  20005. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  20006. e.add(this.currentPanoMarker.mesh)),
  20007. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  20008. this.currentPanoMarker.mesh.position.y += this.pathHeight() ,
  20009. this.currentPanoMarker.placed = !0
  20010. } else
  20011. this.popOutCpm()
  20012. }
  20013. ,
  20014. n.prototype.fadeInCpm = function(e) {
  20015. this.player.mode === a.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || c.path.mapGuides && this.currentPanoMarker.placed && p.start(u.property(this.currentPanoMarker.mesh.children[0].material/* .uniforms.opacity */, "opacity", 1), e)
  20016. }
  20017. ,
  20018. n.prototype.fadeOutCpm = function(e) {
  20019. p.start(u.property(this.currentPanoMarker.mesh.children[0].material/* .uniforms.opacity */, "opacity", 0), e)
  20020. }
  20021. ,
  20022. n.prototype.popInCpm = function() {
  20023. c.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  20024. }
  20025. ,
  20026. n.prototype.popOutCpm = function() {
  20027. this.fadeOutCpm(2)
  20028. }
  20029. ,
  20030. n.prototype.brushPrefs = {
  20031. linewidth: 7,
  20032. strokeWidth: 15,
  20033. cvSegments: 48,
  20034. paveStep: .1,
  20035. paveWidth: .2,
  20036. lookBlendDist: 3,
  20037. maxTurn: r.Math.degToRad(2)
  20038. },
  20039. n.prototype.panoPathDistance = function(e) {
  20040. var t = this.model.panos;
  20041. if (!e || e.length < 2)
  20042. return 0;
  20043. for (var i = [], n = 0; n < e.length; n += 1)
  20044. i.push(t.get(e[n]).floorPosition);
  20045. return this.pointPathDistance(i)
  20046. }
  20047. ,
  20048. n.prototype.loadTileTexture = function(e) {
  20049. var t = v.load(e, function(t) {
  20050. t.wrapS = r.RepeatWrapping,
  20051. t.wrapT = r.RepeatWrapping,
  20052. t.needsUpdate = !0,
  20053. y.debug('path texture "' + e + '" is ready')
  20054. }, function() {
  20055. y.error('path texture "' + e + '" failed')
  20056. });
  20057. return t.mapping = r.UVMapping,
  20058. t
  20059. }
  20060. ,
  20061. n.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  20062. var a = {
  20063. cameraMode: n,
  20064. position: e,
  20065. quaternion: t,
  20066. panoId: i,
  20067. orthoZoom: o,
  20068. floorVisibility: r,
  20069. thumbUrl: null,
  20070. name: null
  20071. };
  20072. return new f(a)
  20073. }
  20074. ,
  20075. n.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  20076. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  20077. }
  20078. ,
  20079. n.prototype.setWarpDestination = function(e) {
  20080. this.warpDestHeroLoc = e
  20081. }
  20082. ,
  20083. n.prototype.setWarpDestinationByHeroIndex = function(e) {
  20084. var t = this.getHeroDescriptorByHeroIndex(e);
  20085. return null !== t && (this.setWarpDestination(t),
  20086. !0)
  20087. }
  20088. ,
  20089. n.prototype.setWarpDestinationByPano = function(e, t) {
  20090. var i = this.model.panos.get(e.id);
  20091. return !!i && this.setWarpDestinationByPanoId(e.id, t)
  20092. }
  20093. ,
  20094. n.prototype.setWarpDestinationByPanoId = function(e, t) {
  20095. var i = this.model.panos.get(e);
  20096. if (i) {
  20097. t = t || new r.Quaternion;
  20098. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  20099. return this.setWarpDestination(n),
  20100. !0
  20101. }
  20102. return !1
  20103. }
  20104. ,
  20105. n.prototype.getHeroDescriptorByHeroIndex = function(e) {
  20106. var t = this.model.heroCount();
  20107. /* if (null !== this.warpDestHeroLoc && t < 2)
  20108. return y.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  20109. this.model.getHeroDescriptorByIndex(0); */
  20110. var i = this.model.getHeroDescriptorByIndex(e);
  20111. if (i) {
  20112. var n = i.isPano() ? i.panoId : i.cameraMode;
  20113. y.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  20114. }
  20115. return i
  20116. }
  20117. ,
  20118. n.prototype.getHeroDescriptorByPano = function(e) {
  20119. var t = this.model.panos.get(e.id);
  20120. return t ? this.getHeroDescriptorByPanoId(e.id) : null
  20121. }
  20122. ,
  20123. n.prototype.getHeroDescriptorByPanoId = function(e) {
  20124. var t = this.getHeroIndexFromPanoId(e);
  20125. return this.getHeroDescriptorByHeroIndex(t)
  20126. }
  20127. ,
  20128. n.prototype.getHeroIndexFromPanoId = function(e) {
  20129. for (var t = 0; t < this.model.heroLocations.length; t++) {
  20130. var i = this.model.heroLocations[t]
  20131. , n = this.getHeroId(i);
  20132. if (n && n === e)
  20133. return t
  20134. }
  20135. return -1
  20136. }
  20137. ,
  20138. n.prototype.getHeroPano = function(e) {
  20139. if (null === e)
  20140. return y.warn("getHeroPano(): no destination"),
  20141. null;
  20142. var t = this.getHeroId(e)
  20143. , i = this.model.panos.get(t);
  20144. return void 0 === i && (i = null,
  20145. "" !== t && y.debug('unable to find pano "' + t + '"')),
  20146. i
  20147. }
  20148. ,
  20149. n.prototype.getHeroId = function(e) {
  20150. return e.panoId
  20151. }
  20152. ,
  20153. n.prototype.setWarpDestPano = function() {
  20154. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  20155. this.warpDestPano
  20156. }
  20157. ,
  20158. n.prototype.brushToWarpPano = function(e, t) {
  20159. if (this.discardPathObject(),
  20160. !this.setWarpDestPano())
  20161. return !1;
  20162. if (this.warpDestHeroLoc.cameraMode !== a.PANORAMA && y.warn("Can only brush from pano to pano"),
  20163. !this.warpDestPano)
  20164. return y.info("No brush"),
  20165. !1;
  20166. if (!this.player.currentPano)
  20167. return y.debug("No current pano, visibility undefined"),
  20168. !1;
  20169. if (!this.warpDestPano)
  20170. return y.info("No wPano, visibility undefined"),
  20171. !1;
  20172. if (!this.warpDestPano.isAligned())
  20173. return y.debug("Cannot brush to unaligned pano"),
  20174. !1;
  20175. var i = (e === l.STD || e === l.WALK) && c.path.mapGuides
  20176. , n = !0;
  20177. if (this.player.currentPano.id === this.warpDestPano.id)
  20178. y.debug("Already at destination pano");
  20179. else {
  20180. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  20181. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  20182. this.obj3d = new r.Object3D,
  20183. y.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  20184. n ? (y.info('No "walkable" route, using fall-back warp style transition'),
  20185. e = t) : (this.setPathHulls(this.nodes),
  20186. this.setFloorCurves(),
  20187. 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)))),
  20188. this.player.currentPano.floor.add(this.obj3d);
  20189. var o = this.player.mode === a.DOLLHOUSE || this.player.mode === a.FLOORPLAN
  20190. , s = e === l.STD;
  20191. if (!n && (i || s)) {
  20192. if (o) {
  20193. var h = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  20194. this.obj3d.add(h)
  20195. }
  20196. var u = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  20197. this.obj3d.add(u)
  20198. }
  20199. this.appearSlow()
  20200. }
  20201. return this.upcomingTransType = e,
  20202. !n
  20203. }
  20204. ,
  20205. n.prototype.findShortestPath = function(e, t) {
  20206. if (!e || !t)
  20207. return null;
  20208. var i = c.warp.walkExtraPanosDistance
  20209. , n = e.id + ":" + t.id + ":" + i;
  20210. if (this.shortPaths.hasOwnProperty(n))
  20211. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  20212. var r = t.id + ":" + e.id + ":" + i;
  20213. if (this.shortPaths.hasOwnProperty(r))
  20214. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  20215. var o = this.model.panos.aStarSearch(e, t);
  20216. return this.model.panos.includeNodesNearPath(o, i),
  20217. this.shortPaths[n] = o ? o.slice() : null,
  20218. o
  20219. }
  20220. ,
  20221. n.prototype.makePathHulls = function(e) {
  20222. var t, i, n, r, o, a = 0, s = [], l = [], h = [], u = this.model.panos;
  20223. t = u.get(e[0]),
  20224. r = t.floor.floorIndex;
  20225. for (var d = 0; d < e.length; d += 1)
  20226. t = u.get(e[d]),
  20227. i = t.floorPosition.clone().sub(this.model.position),
  20228. i.y += this.pathHeight(),
  20229. s.push(i),
  20230. l.push(t.position.clone()),
  20231. n = t.floor.floorIndex,
  20232. h.push(n > r ? c.path.colorUp : n < r ? c.path.colorDown : c.path.color),
  20233. d > 0 && (o = l[d].distanceTo(l[d - 1]),
  20234. o > a && (a = o));
  20235. return a > this.longestStep && (this.longestStep = a,
  20236. y.debug("path contains " + a + " meter segment")),
  20237. {
  20238. floor: s,
  20239. camera: l,
  20240. color: h
  20241. }
  20242. }
  20243. ,
  20244. n.prototype.makeFloorCurves = function(e, t, i) {
  20245. var n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  20246. , o = this.pointPathDistance(e) - 2 * n
  20247. , s = e.slice(0)
  20248. , l = s[1].clone().sub(s[0]);
  20249. l.y = 0,
  20250. l.normalize().multiplyScalar(n),
  20251. s[0] = (new r.Vector3).copy(s[0]).add(l),
  20252. l = s[s.length - 2].clone().sub(s[s.length - 1]),
  20253. l.y = 0,
  20254. l.normalize().multiplyScalar(n),
  20255. s[s.length - 1] = (new r.Vector3).copy(s[s.length - 1]).add(l);
  20256. var h = new r.CatmullRomCurve3(s)
  20257. , u = Math.floor(o / i);
  20258. u = 4 * Math.floor(u / 4),
  20259. u = Math.max(4, u);
  20260. for (var d, p, f, g = h.getSpacedPoints(u), m = [], v = new r.Vector3, A = 0; A < g.length; A += 1) {
  20261. f = 0,
  20262. d = g[A].distanceTo(e[0]);
  20263. for (var y = 1; y < e.length; y += 1)
  20264. v.copy(g[A]).sub(e[y]),
  20265. v.y *= 4,
  20266. p = v.length(),
  20267. p < d && (f = y);
  20268. m.push(t[f])
  20269. }
  20270. return {
  20271. distance: o,
  20272. points: g,
  20273. colors: m
  20274. }
  20275. }
  20276. ,
  20277. n.prototype.makeCameraCurvePoints = function(e, t) {
  20278. var i = this.pointPathDistance(e)
  20279. , n = new r.CatmullRomCurve3(e);
  20280. return n.getSpacedPoints(Math.max(2, Math.floor(i / t)))
  20281. }
  20282. ,
  20283. n.prototype.makeCameraCurveTangents = function(e, t) {
  20284. var i = this.pointPathDistance(e)
  20285. , n = new r.CatmullRomCurve3(e)
  20286. , o = Math.max(2, Math.floor(i / t));
  20287. o || (o = 5);
  20288. for (var a = [], s = 0; s <= o; s++)
  20289. a.push(n.getTangentAt(s / o));
  20290. return a
  20291. }
  20292. ,
  20293. n.prototype.setPathHulls = function(e) {
  20294. var t = this.makePathHulls(e);
  20295. this.floorHull = t.floor,
  20296. this.cameraHull = t.camera,
  20297. this.colorHull = t.color
  20298. }
  20299. ,
  20300. n.prototype.setFloorCurves = function() {
  20301. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  20302. this.floorPathDistance = e.distance,
  20303. this.floorCurvePoints = e.points,
  20304. this.floorCurveColors = e.colors
  20305. }
  20306. ,
  20307. n.prototype.setCameraCurvePoints = function() {
  20308. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, c.warp.stepFactor * this.brushPrefs.paveStep)
  20309. }
  20310. ,
  20311. n.prototype.chooseWarpPath = function(e) {
  20312. var t, i, n, o = this.playerControls.cameras[a.PANORAMA];
  20313. if (this.player.currentPano === this.warpDestPano || !e)
  20314. return this.warpPathPoints = null,
  20315. this.warpLength = 0,
  20316. !1;
  20317. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  20318. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (y.debug("warp path to unreachable node"),
  20319. t = this.warpDestPano.position.clone().sub(o.position),
  20320. i = t.clone().negate(),
  20321. t.multiplyScalar(.15).add(o.position),
  20322. i.multiplyScalar(.15).add(this.warpDestPano.position),
  20323. t.y = o.position.y,
  20324. i.y = this.warpDestPano.position.y,
  20325. n = new r.CubicBezierCurve3(o.position.clone(),t,i,this.warpDestPano.position.clone()),
  20326. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (y.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  20327. this.setCameraCurvePoints(),
  20328. this.warpPathPoints = this.camCurvePoints.slice(0)),
  20329. this.warpLength = 0,
  20330. this.warpPathLengths = [0];
  20331. 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) {
  20332. s.copy(this.warpPathPoints[d - 1]).sub(this.warpPathPoints[d]);
  20333. var p = s.length();
  20334. s.y *= c.warp.climbEffort;
  20335. var f = s.length() / p;
  20336. if (d > 1) {
  20337. s.setY(0).normalize(),
  20338. l.copy(this.warpPathPoints[d - 2]).sub(this.warpPathPoints[d - 1]).setY(0).normalize();
  20339. var g = Math.min(1, s.dot(l))
  20340. , m = 1 + (c.warp.brakeStrength - 1) * (1 - r.Math.smoothstep(g, u, h));
  20341. f = Math.max(m, f)
  20342. }
  20343. this.warpLength += p * f,
  20344. this.warpPathLengths[d] = this.warpLength
  20345. }
  20346. return !0
  20347. }
  20348. ,
  20349. n.prototype.drawPathRibbon = function(e, t) {
  20350. this.bunnyObj.visible = c.warp.showBunny;
  20351. 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) {
  20352. h.copy(e[u]),
  20353. 0 === u ? h.sub(e[u + 1]) : h.sub(e[u - 1]).negate(),
  20354. h.normalize(),
  20355. n.crossVectors(h, A.UP),
  20356. n.multiplyScalar(i);
  20357. var d = (new r.Vector3).copy(e[u]).add(o);
  20358. d.sub(n),
  20359. l.vertices.push(d),
  20360. d = (new r.Vector3).copy(e[u]).add(o),
  20361. d.add(n),
  20362. l.vertices.push(d)
  20363. }
  20364. var p, f = 0;
  20365. for (u = 0; u < e.length - 1; u += 1) {
  20366. var g = 2 * u
  20367. , v = f;
  20368. f += e[u + 1].distanceTo(e[u]);
  20369. var y = f
  20370. , C = t[u]
  20371. , I = t[u + 1];
  20372. p = new r.Face3(g,g + 1,g + 2),
  20373. p.vertexColors = [new r.Color(C), new r.Color(C), new r.Color(I)],
  20374. l.faces.push(p),
  20375. l.faceVertexUvs[0].push([new r.Vector2(0,v), new r.Vector2(1,v), new r.Vector2(0,y)]),
  20376. p = new r.Face3(g + 2,g + 1,g + 3),
  20377. p.vertexColors = [new r.Color(I), new r.Color(C), new r.Color(I)],
  20378. l.faces.push(p),
  20379. l.faceVertexUvs[0].push([new r.Vector2(0,y), new r.Vector2(1,v), new r.Vector2(1,y)])
  20380. }
  20381. l.computeFaceNormals(),
  20382. l.computeVertexNormals();
  20383. var E, b;
  20384. this.player.mode === a.PANORAMA ? (b = r.UniformsUtils.clone(m.ribbon.uniforms),
  20385. b.map.value = w.path,
  20386. b.opacity.value = 0,
  20387. b.color.value.set(c.path.color),
  20388. E = new r.RawShaderMaterial({
  20389. side: r.DoubleSide,
  20390. depthWrite: !1,
  20391. transparent: !0,
  20392. vertexShader: m.ribbon.vertexShader,
  20393. fragmentShader: m.ribbon.fragmentShader,
  20394. uniforms: b,
  20395. name: "ribbonT",
  20396. opacity: 0
  20397. })) : E = new r.MeshBasicMaterial({
  20398. color: 16777215,
  20399. side: r.DoubleSide,
  20400. name: "ribbonOut",
  20401. vertexColors: r.VertexColors
  20402. });
  20403. var _ = new r.Mesh(l,E);
  20404. _.renderOrder = 10
  20405. return _.name = "ribbon",
  20406. this.player.mode === a.PANORAMA && (_.renderOrder = s.ribbon),
  20407. _
  20408. }
  20409. ,
  20410. n.prototype.drawPathPavement = function(e) {
  20411. for (var t, i = .25, n = new r.Vector3, o = new r.Geometry, s = new r.Vector3, l = 0; l < e.length; l += 1)
  20412. s.copy(e[l]),
  20413. 0 === l ? s.sub(e[l + 1]).negate() : s.sub(e[l - 1]),
  20414. s.normalize(),
  20415. n.crossVectors(s, A.UP),
  20416. n.multiplyScalar(this.brushPrefs.paveWidth),
  20417. t = (new r.Vector3).copy(e[l]),
  20418. t.sub(n),
  20419. o.vertices.push(t),
  20420. o.vertices.push((new r.Vector3).copy(e[l])),
  20421. t = (new r.Vector3).copy(e[l]),
  20422. t.add(n),
  20423. o.vertices.push(t);
  20424. var h, u, d;
  20425. for (l = 0; l < e.length - 1; l += 1)
  20426. h = 3 * l + 1,
  20427. u = l * i,
  20428. d = u + i,
  20429. o.faces.push(new r.Face3(h - 1,h,h + 3)),
  20430. o.faceVertexUvs[0].push([new r.Vector2(0,u), new r.Vector2(.5,u), new r.Vector2(.5,d)]),
  20431. o.faces.push(new r.Face3(h + 3,h + 2,h - 1)),
  20432. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(0,d), new r.Vector2(0,u)]),
  20433. o.faces.push(new r.Face3(h + 3,h,h + 1)),
  20434. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(.5,u), new r.Vector2(1,u)]),
  20435. o.faces.push(new r.Face3(h + 3,h + 1,h + 4)),
  20436. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(1,u), new r.Vector2(1,d)]);
  20437. var p = this.player.mode === a.PANORAMA ? new r.MeshBasicMaterial({
  20438. color: c.path.color,
  20439. side: r.DoubleSide,
  20440. transparent: !0,
  20441. depthWrite: !1,
  20442. opacity: 0,
  20443. name: "paveT",
  20444. map: w.path
  20445. }) : new r.MeshBasicMaterial({
  20446. color: c.path.color,
  20447. side: r.DoubleSide,
  20448. transparent: !0,
  20449. depthWrite: !1,
  20450. opacity: 1,
  20451. name: "paveO",
  20452. map: w.path
  20453. });
  20454. return new r.Mesh(o,p)
  20455. }
  20456. ,
  20457. n.prototype.hintPrefs = {
  20458. rad: .18,
  20459. width: .0125,
  20460. depth: .0625,
  20461. setBack: -.04,
  20462. markRad: .25,
  20463. markInnerRad: .16
  20464. },
  20465. n.prototype.makeWaypointObj = function(e, t) {
  20466. var i = new r.Geometry
  20467. , n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  20468. , o = this.pathHeight();
  20469. 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)),
  20470. i.faces.push(new r.Face3(0,1,2), new r.Face3(2,3,0)),
  20471. i.faceVertexUvs[0].push([new r.Vector2(0,0), new r.Vector2(1,0), new r.Vector2(1,1)]),
  20472. i.faceVertexUvs[0].push([new r.Vector2(1,1), new r.Vector2(0,1), new r.Vector2(0,0)]);
  20473. var s = r.UniformsUtils.clone(m.waypoint.uniforms);
  20474. s.map.value = e,
  20475. s.opacity.value = 0,
  20476. s.color.value.set(c.path.color);
  20477. var l = {
  20478. side: r.DoubleSide,
  20479. depthWrite: !1,
  20480. transparent: !0,
  20481. vertexShader: m.waypoint.vertexShader,
  20482. fragmentShader: m.waypoint.fragmentShader,
  20483. uniforms: s,
  20484. name: "waypoint",
  20485. opacity: 0
  20486. };
  20487. this.player.mode !== a.PANORAMA && (l.depthTest = !1,
  20488. l.name = "wayPtOut");
  20489. var h = new r.RawShaderMaterial(l)
  20490. , u = new r.Mesh(i,h);
  20491. return u.name = t,
  20492. u
  20493. }
  20494. ,
  20495. n.prototype.makeStartMarker = function(e, t) {
  20496. var i = (new r.Vector3).copy(t[1]).sub(t[0]);
  20497. i.y = 0,
  20498. i.normalize();
  20499. var n = Math.acos(i.x)
  20500. , o = this.makeWaypointObj(w.pathStart, "Start");
  20501. return o.rotateOnAxis(new r.Vector3(0,1,0), n),
  20502. o.position.copy(e),
  20503. o
  20504. }
  20505. ,
  20506. n.prototype.makeEndMarker = function(e) {
  20507. var t = this.makeWaypointObj(w.pathEnd, "End")
  20508. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  20509. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  20510. return i < n ? t.material.uniforms.color.value.set(c.path.colorUp) : i > n && t.material.uniforms.color.value.set(c.path.colorDown),
  20511. t.position.copy(e),
  20512. t
  20513. }
  20514. ,
  20515. n.prototype.pathClean = function(e) {
  20516. if (e) {
  20517. for (var t in e.children)
  20518. this.pathClean(e.children[t]);
  20519. e.geometry && e.geometry.dispose(),
  20520. e.material && e.material.dispose()
  20521. }
  20522. }
  20523. ,
  20524. n.prototype.discardPathObject = function() {
  20525. if (this.obj3d) {
  20526. var e = this.obj3d.parent;
  20527. e && e.remove(this.obj3d),
  20528. this.pathClean(this.obj3d)
  20529. }
  20530. this.obj3d = null,
  20531. this.popInCpm()
  20532. }
  20533. ,
  20534. n.prototype.discardSlow = function() {
  20535. if (this.obj3d) {
  20536. if (this.player.mode !== a.PANORAMA)
  20537. return void this.discardPathObject();
  20538. for (var e, t = this, i = 0, n = function() {
  20539. this.discardPathObject()
  20540. }
  20541. .bind(this), r = 0; r < t.obj3d.children.length; r += 1)
  20542. e = t.obj3d.children[r],
  20543. 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]),
  20544. i += 1,
  20545. n = null);
  20546. 0 === i && this.discardPathObject(),
  20547. this.player.mode !== a.PANORAMA && this.fadeInCpm(c.path.fadeInTime - 3)
  20548. }
  20549. }
  20550. ,
  20551. n.prototype.appearSlow = function() {
  20552. var e, t = this;
  20553. this.fadeOutCpm(c.path.fadeInTime);
  20554. for (var i = this.player.mode === a.PANORAMA ? c.path.opacity : 1, n = 0; n < t.obj3d.children.length; n += 1)
  20555. e = t.obj3d.children[n],
  20556. 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]))
  20557. }
  20558. ,
  20559. n.prototype.update = function() {
  20560. this.obj3d && this.obj3d.updateMatrixWorld()
  20561. }
  20562. ,
  20563. n.prototype.calcBurnsAmount = function(e) {//计算导览点旋转角
  20564. var t = r.Math.degToRad(c.warp.burnsAngle);
  20565. if (this.player.mode === a.PANORAMA) {
  20566. var i = this.burnsDir * t;
  20567. if (this.upcomingTransType === l.BLACK)
  20568. return i;
  20569. var n = e;
  20570. if (null === n)
  20571. return y.warn("Transition request for non-highlight"),
  20572. i;
  20573. var o = this.getHeroDescriptorByHeroIndex(n);
  20574. if (null === o)
  20575. return i;
  20576. if (!o.isPano())
  20577. return i;
  20578. var s = this.getHeroPano(o)
  20579. , h = this.playerControls.cameras[a.PANORAMA]
  20580. , u = A.FORWARD.clone().applyQuaternion(h.quaternion).setY(0).normalize()
  20581. , d = Math.min(r.Math.degToRad(c.warp.minBurnsAngle), t)
  20582. , p = function(e) {
  20583. var i = Math.acos(Math.min(1, e.dot(u)))
  20584. , n = (new r.Vector3).crossVectors(u, e);
  20585. return Math.max(d, Math.min(Math.abs(i), t)) * Math.sign(n.y)
  20586. };
  20587. if (s === this.player.currentPano)
  20588. return i = p(A.FORWARD.clone().applyQuaternion(o.quaternion).setY(0).normalize());
  20589. var f = this.findShortestPath(this.player.currentPano, s);
  20590. if (void 0 === f || null === f || f.length < 1)
  20591. return y.debug("Empty path ahead..."),
  20592. i;
  20593. var g = this.makePathHulls(f)
  20594. , m = new r.CatmullRomCurve3(g.camera)
  20595. , v = Math.min(.1, c.warp.lookAheadDist / m.getLength());
  20596. return i = p(m.getPointAt(v).clone().sub(h.position).setY(0).normalize())
  20597. }
  20598. return this.player.mode === a.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir
  20599. }
  20600. ,
  20601. n.prototype.waitNextStep = function(e, t, time) {//xzw 改时间
  20602. var i = (time==void 0)? c.warp.tourStepDelay : time;
  20603. i==void 0 && (i = this.lastTransType === l.BLACK ? b.tourStepDelaySlideShow : b.tourStepDelayDefault);
  20604. var n = new r.Euler
  20605. , o = new r.Vector3;
  20606. y.debug("Starting wait: " + (void 0 !== t));
  20607. var currentLocation = this.model.getHeroDescriptorByIndex(this.director.currentItem)//this.model.heroLocations[this.director.currentItem[0]]
  20608. var s = currentLocation.dontRot || this.calcBurnsAmount(e)
  20609. , h = function() {
  20610. this.endWarpState(),
  20611. this.player.mode === a.DOLLHOUSE && (this.playerControls.cameras[a.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  20612. t && t()
  20613. }
  20614. .bind(this)
  20615. , u = function(e, t) {
  20616. if (this.warpInterrupted)
  20617. return h(),
  20618. !0;
  20619. var r = t || 1e3 / 60;
  20620. if (c.warp.doBurns && !currentLocation.dontRot )
  20621. if (this.player.mode === a.PANORAMA) {
  20622. var l = this.playerControls.cameras[a.PANORAMA];
  20623. n.setFromQuaternion(l.quaternion, c.warp.eOrder);
  20624. var u = i == 0 ? s : r * s / i;
  20625. u = Math.sign(u) * Math.max(u, 0.0001) //add 如果音频长的话,使旋转可见,否则以为停住了
  20626. n.y += u,
  20627. o.set(0, 0, -1),
  20628. o.applyEuler(n),
  20629. o.add(l.position),
  20630. l.controls.lookAt(o),
  20631. l.controls.lookVector.copy(o)
  20632. ,l.lookAt(o)
  20633. } else
  20634. this.player.mode === a.DOLLHOUSE ? this.playerControls.controls[a.DOLLHOUSE].rotationAcceleration.x = s : this.playerControls.controls[a.FLOORPLAN].absoluteScale *= .9996
  20635. }
  20636. .bind(this);
  20637. this.startWarpState(),
  20638. p.start(u, i, h, 0, d.easeInOutQuad, "wait")
  20639. }
  20640. ,
  20641. n.prototype.warpToNonPano = function(e) {
  20642. if (this.discardPathObject(),
  20643. this.warpDestHeroLoc.cameraMode === a.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === a.FLOORPLAN) {
  20644. var t = function() {
  20645. e && e()
  20646. }
  20647. .bind(this);
  20648. this.player.flyToNewMode({
  20649. mode: this.warpDestHeroLoc.cameraMode,
  20650. duration: c.warp.outsideTime,
  20651. warpDest: this.warpDestHeroLoc,
  20652. callback: t,
  20653. force: !0
  20654. })
  20655. } else
  20656. y.warn("no warp destination!!!"),
  20657. e && e()
  20658. }
  20659. ,
  20660. n.prototype._resetWarpShaderParams = function(e) {//
  20661. this.player.mode === a.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  20662. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  20663. /* if(momentTourBlackNewType && "newBlack" in e.material.defines){
  20664. delete e.material.defines.newBlack;
  20665. e.material.needsUpdate = true
  20666. } */
  20667. }
  20668. ,
  20669. n.prototype._clearWarpShading = function() {
  20670. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  20671. this._resetWarpShaderParams(e[t]),
  20672. e[t].visible = !0;
  20673. this._resetWarpShaderParams(this.model.skybox)
  20674. }
  20675. ,
  20676. n.prototype._warpStopFlying = function() {
  20677. this.activeTransType = null,
  20678. this.placeCpm()
  20679. }
  20680. ,
  20681. n.prototype._wrapupTravelOnlyBits = function() {
  20682. this._warpStopFlying(),
  20683. this.warpPathPoints && (this.player.currentPano.exit(),
  20684. this.warpDestPano.enter(),
  20685. this.player.currentPano = this.warpDestPano),
  20686. this.player.spider.draw(),
  20687. this.placeCpm()
  20688. }
  20689. ,
  20690. n.prototype._wrapupTravel = function(e) {
  20691. this._wrapupTravelOnlyBits(),
  20692. this.warpCameraAim(e)
  20693. }
  20694. ,
  20695. n.prototype._wrapupWarpShading = function(e) {
  20696. this._clearWarpShading(),
  20697. this._wrapupTravel(e)
  20698. }
  20699. ,
  20700. n.prototype.wrapupWarpShadingOnly = function(e, t) {
  20701. t !== I.END && this._clearWarpShading(),
  20702. this._wrapupTravelOnlyBits(),
  20703. this.upcomingTransType = null,
  20704. e && e()
  20705. }
  20706. ,
  20707. n.prototype._warpCameraAim = function(e, t) {//到每个片段终点时转向终点朝向。
  20708. var i = this.warpDestHeroLoc.quaternion
  20709. , n = this.playerControls.cameras[a.PANORAMA]
  20710. , o = new r.Vector3(0,0,1).applyQuaternion(i).normalize()
  20711. , s = new r.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize()
  20712. , l = s.dot(o)
  20713. , u = r.Math.radToDeg(Math.acos(l))
  20714. , f = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(i, c.warp.eOrder)
  20715. , g = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  20716. , m = new r.Euler(f.x - g.x,f.y - g.y,f.z - g.z,c.warp.eOrder);
  20717. m.y = h.constrainedTurn(m.y),
  20718. this.burnsDir = Math.sign(m.y);
  20719. var v = new r.Euler(0,0,0,c.warp.eOrder)
  20720. , A = new r.Vector3
  20721. , C = function(e, t) {
  20722. return !!this.warpInterrupted || (v.x = g.x + e * m.x,
  20723. v.y = g.y + e * m.y,
  20724. v.z = g.z + e * m.z,
  20725. A.set(0, 0, -1),
  20726. A.applyEuler(v),
  20727. A.add(n.position),
  20728. n.controls.lookAt(A),
  20729. n.controls.lookVector.copy(A),
  20730. void n.lookAt(A))
  20731. }
  20732. .bind(this);
  20733. /* return u > c.warp.minRotation ? (p.start(C, e, t, 0, d[c.warp.movementEasing])
  20734. ,(this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  20735. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  20736. ):
  20737. (y.info("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim")
  20738. ,void (t && t())
  20739. ) */
  20740. (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  20741. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  20742. return u > c.warp.minRotation ? p.start(C, e, t, 0, d[c.warp.movementEasing]) :
  20743. (y.info("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim")
  20744. ,void (t && t())
  20745. )
  20746. }
  20747. ,
  20748. n.prototype._warpBendAim = function(e, t, i, n) {
  20749. var o = n || 0
  20750. , s = this.playerControls.cameras[a.PANORAMA]
  20751. , l = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20752. , u = (new r.Euler).setFromQuaternion(s.quaternion, c.warp.eOrder)
  20753. , f = new r.Euler(l.x - u.x,l.y - u.y,l.z - u.z,c.warp.eOrder);
  20754. f.y = h.constrainedTurn(f.y);
  20755. var g = Math.min(r.Math.degToRad(c.warp.softBendTilt), Math.abs(f.x));
  20756. f.x = g * Math.sign(f.x),
  20757. g = Math.min(r.Math.degToRad(Math.max(0, c.warp.softBendAngle)), g),
  20758. this.burnsDir = Math.sign(f.y),
  20759. g *= Math.sign(f.y),
  20760. f.y = g;
  20761. var m = new r.Euler(0,0,0,c.warp.eOrder)
  20762. , v = new r.Vector3
  20763. , A = function(e, t) {
  20764. if (e < .5)
  20765. m.x = u.x + e * f.x,
  20766. m.y = u.y + e * f.y,
  20767. m.z = u.z + e * f.z;
  20768. else {
  20769. var i = (1 - e) * c.warp.softBendEnd;
  20770. m.x = l.x - i * f.x,
  20771. m.y = l.y - i * f.y,
  20772. m.z = l.z - i * f.z
  20773. }
  20774. v.set(0, 0, -1),
  20775. v.applyEuler(m),
  20776. v.add(s.position);
  20777. s.controls.lookAt(v),
  20778. s.controls.lookVector.copy(v),
  20779. s.lookAt(v);
  20780. }
  20781. .bind(this);
  20782. if(window.DATA.momentTourBlackNewType){
  20783. A(1)
  20784. }else return p.start(A, t, i, o, d[c.warp.movementEasing])
  20785. }
  20786. ,
  20787. n.prototype._warpStepCameraAim = function(e, t, i) {
  20788. var n = this.playerControls.cameras[a.PANORAMA]
  20789. , o = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20790. , s = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  20791. , l = new r.Euler(o.x - s.x,o.y - s.y,o.z - s.z,c.warp.eOrder);
  20792. l.y = h.constrainedTurn(l.y),
  20793. this.burnsDir = Math.sign(l.y);
  20794. var u = new r.Euler(0,0,0,c.warp.eOrder)
  20795. , f = new r.Vector3
  20796. , g = function(e, t) {
  20797. e < .5 ? u.copy(s) : u.copy(o),
  20798. f.set(0, 0, -1),
  20799. f.applyEuler(u),
  20800. f.add(n.position),
  20801. n.controls.lookAt(f),
  20802. n.controls.lookVector.copy(f),
  20803. n.lookAt(f)
  20804. }
  20805. .bind(this);
  20806. return p.start(g, t, i, 0, d[c.warp.movementEasing])
  20807. }
  20808. ,
  20809. n.prototype.setBurnsDir = function() {
  20810. var e = this.playerControls.cameras[a.PANORAMA]
  20811. , t = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20812. , i = (new r.Euler).setFromQuaternion(e.quaternion, c.warp.eOrder)
  20813. , n = new r.Euler(t.x - i.x,t.y - i.y,t.z - i.z,c.warp.eOrder);
  20814. n.y = h.constrainedTurn(n.y),
  20815. this.burnsDir = Math.sign(n.y)
  20816. }
  20817. ,
  20818. n.prototype.stepWarpPath = function(firstPos, e ) {
  20819. var i = this.playerControls.cameras[a.PANORAMA];
  20820. var n = this.warpPathPoints ? this.warpPathPoints[0] : firstPos
  20821. if (!n){
  20822. return i.position.copy(this.warpDestPano.position),
  20823. !0;
  20824. }
  20825. /* if (!this.warpPathPoints)
  20826. return i.position.copy(this.warpDestPano.position),
  20827. !0;
  20828. var n = this.warpPathPoints[0] */
  20829. var o = this.warpDestPano.position;
  20830. /* console.log(firstPos)
  20831. console.log(o) */
  20832. if (null !== this.nodes && this.cameraHull && this.cameraHull.length > 1) {
  20833. var s = new r.Vector3;
  20834. 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),
  20835. i.position.copy(s)
  20836. } else
  20837. e < .5 ? i.position.copy(n) : i.position.copy(o)
  20838. }
  20839. ,
  20840. n.prototype.interruptAndFastForward = function(e, t) {
  20841. this.warping && (this.warpInterrupted = !0,
  20842. this.warpInterruptionBlackoutStyle = e,
  20843. this.warpInterruptionTravelTime = t,
  20844. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = I.MIDDLE),
  20845. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = c.minWarpTime))
  20846. }
  20847. ,
  20848. n.prototype.warpCameraAim = function(e) {
  20849. var t = c.warp.minWarpTime;
  20850. if (this.upcomingTransType === l.BLACK)
  20851. t = c.warp.teleportTime;
  20852. else {
  20853. var i = this.playerControls.cameras[a.PANORAMA]
  20854. , n = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20855. , o = (new r.Euler).setFromQuaternion(i.quaternion, c.warp.eOrder)
  20856. , s = new r.Euler(n.x - o.x,n.y - o.y,n.z - o.z,c.warp.eOrder);
  20857. s.y = h.constrainedTurn(s.y);
  20858. var u = 1e3 * Math.abs(s.y) / r.Math.degToRad(c.warp.maxAimPerSec);
  20859. t = Math.max(t, u)
  20860. }
  20861. var d = function() {
  20862. this._warpStopFlying(),
  20863. this.discardSlow(),
  20864. e && e()
  20865. }
  20866. .bind(this);
  20867. this._warpCameraAim(t, d)
  20868. }
  20869. ,
  20870. n.prototype.warpCommonParameters = function(e, t, i, n) {
  20871. this.model.skybox.material.uniforms.blackout.value = n;
  20872. var r = u.uniform(this.model.skybox, "progress", 1)
  20873. , o = u.allUniforms(this.model.chunks, "progress", 1)
  20874. , a = !1
  20875. , s = function() {
  20876. if (this.warpInterrupted)
  20877. return a = !0,
  20878. !0
  20879. }
  20880. .bind(this)
  20881. , l = function(e, t) {
  20882. return i && a ? (this.model.skybox.material.uniforms.progress.value = 0,
  20883. !0) : void r(e, t)
  20884. }
  20885. .bind(this)
  20886. , h = function(e, t) {
  20887. return i && a ? (o(0),
  20888. !0) : void o(e, t)
  20889. }
  20890. .bind(this);
  20891. p.start(s, e, null, t, null, "safeHaltWatch"),
  20892. p.start(l, e, null, t, d[c.warp.blendEasing], "skyboxProgress"),
  20893. p.start(h, e, null, t, d[c.warp.blendEasing], "chunkProgress")
  20894. }
  20895. ,
  20896. n.prototype.warpTravel_STD = function(e) {
  20897. 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),
  20898. 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;
  20899. w += this.warpLength * c.warp.timePerMeter,
  20900. c.warp.flySpeed > .01 && (w = 1e3 * this.warpLength / c.warp.flySpeed);
  20901. var _ = !1
  20902. , T = this.warpDestHeroLoc.quaternion
  20903. , x = new r.Vector3(0,0,-1).applyQuaternion(T).normalize()
  20904. , S = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  20905. , M = S.dot(x)
  20906. , R = r.Math.radToDeg(Math.acos(M))
  20907. , P = function(e) {
  20908. var t = o
  20909. , i = r.Math.smoothstep(e, 0, t) * (1 - r.Math.smoothstep(e, 1 - t, 1));
  20910. return i
  20911. }
  20912. , O = function() {
  20913. return E.lookAt(C, t, A.UP),
  20914. s.setFromRotationMatrix(E, c.warp.eOrder),
  20915. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  20916. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  20917. h.constrainedTurn(b.y)
  20918. }
  20919. .bind(this)
  20920. , L = function(e, t) {
  20921. if (this.warpInterrupted)
  20922. return _ = !0,
  20923. !0
  20924. }
  20925. .bind(this)
  20926. , D = function(e, t) {
  20927. return _ || !this.warpPathPoints ? (g.blur(0),
  20928. !0) : void g.blur(e)
  20929. }
  20930. .bind(this)
  20931. , N = u.allUniforms(this.model.chunks, "modelAlpha", 1)
  20932. , B = function(e, t) {
  20933. return _ || !this.warpPathPoints ? (N(0),
  20934. !0) : void N(e, t)
  20935. }
  20936. .bind(this)
  20937. , F = function(e, t) {
  20938. if (!this.warpPathPoints)
  20939. return n.position.copy(this.warpDestPano.position),
  20940. !0;
  20941. if (_)
  20942. return !0;
  20943. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  20944. n.position.copy(i),
  20945. C = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  20946. }
  20947. .bind(this)
  20948. , V = function(e, n) {
  20949. return this.warpPathPoints ? !!_ || void (t = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + i, 1))) : (y.debug("Lost bunny."),
  20950. !0)
  20951. }
  20952. .bind(this)
  20953. , U = function(e, o) {
  20954. if (_)
  20955. return y.debug(">>>> Walkthrough interupted at t=" + e),
  20956. !0;
  20957. if (!this.warpPathPoints)
  20958. return !0;
  20959. var a = this.warpLength * e
  20960. , l = r.Math.smoothstep(a, 0, this.brushPrefs.lookBlendDist)
  20961. , u = r.Math.smoothstep(a, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  20962. c.warp.matchCam && (l *= 1 - u),
  20963. E.lookAt(C, t, A.UP),
  20964. s.setFromRotationMatrix(E, c.warp.eOrder),
  20965. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  20966. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  20967. b.y = h.constrainedTurn(b.y),
  20968. s.x = m.x + l * b.x,
  20969. s.y = m.y + l * b.y,
  20970. s.z = m.z + l * b.z,
  20971. b.set(s.x - v.x, s.y - v.y, s.z - v.z, c.warp.eOrder),
  20972. b.y = h.constrainedTurn(b.y);
  20973. var d = r.Math.degToRad(c.warp.maxTurnPerSec) * o / 1e3;
  20974. b.y = Math.sign(b.y) * Math.min(d, Math.abs(b.y)),
  20975. v.x = v.x + b.x * c.warp.turnFriction,
  20976. v.y = v.y + b.y * c.warp.turnFriction,
  20977. v.z = v.z + b.z * c.warp.turnFriction,
  20978. v.x = Math.max(r.Math.degToRad(c.warp.minDownAngle), v.x);
  20979. var p = t.clone().sub(C).normalize();
  20980. if (R < c.warp.maxAimRotation && u > 0) {
  20981. var g = 1 - u;
  20982. p.x = p.x * g + u * S.x,
  20983. p.y = p.y * g + u * S.y,
  20984. p.z = p.z * g + u * S.z,
  20985. p.normalize()
  20986. }
  20987. this.bunnyObj.position.copy(n.position).add(p),
  20988. f.set(0, 0, -1).applyEuler(v).normalize(),
  20989. f.multiplyScalar(8),
  20990. f.add(n.position),
  20991. e > 1 - i && c.warp.matchCam || (n.controls.lookAt(f),
  20992. n.controls.lookVector.copy(f),
  20993. n.lookAt(f))
  20994. }
  20995. .bind(this)
  20996. , k = function() {
  20997. _ ? (this.discardSlow(),
  20998. this.upcomingTransType = l.BLACK,
  20999. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, I.BEGINNING, e)) : this._wrapupWarpShading(e)
  21000. }
  21001. .bind(this);
  21002. V(0);
  21003. var H = c.warp.motionLeadTime + 1e3 * Math.abs(O()) / r.Math.degToRad(c.warp.maxTurnPerSec);
  21004. w += H;
  21005. var G = H / w;
  21006. this.warpCommonParameters(w, G, !0, I.NONE),
  21007. p.start(L, w, null, 0, null, "_haltWatcher"),
  21008. c.warp.blur > 0 && (g.blurStrength = c.warp.blur,
  21009. p.start(D, w, null, G, P, "blurring")),
  21010. p.start(B, w, null, G, P, "modelAlpha"),
  21011. p.start(F, w, null, G, d[c.warp.blendEasing], "followPath"),
  21012. p.start(V, w, null, G, d[c.warp.blendEasing], "goBunny"),
  21013. p.start(U, w, k, 0, d[c.warp.blendEasing], "lookAtBunny")
  21014. }
  21015. ,
  21016. n.prototype.warpTravel_BLACK = function(e, t, i, n) {
  21017. var r = e || 0;
  21018. void 0 !== t && null !== t || (t = c.warp.teleportTime)
  21019. //add
  21020. player.model.hotGroup.visible = false
  21021. var done = ()=>{
  21022. this.player.transitionPos({type:"beforeFlytopano", pano:this.player.currentPano, dur:0, callback:()=>{
  21023. player.model.hotGroup.visible = true
  21024. Hot.updateVisibles([this.player.currentPano]) //更新热点显示
  21025. }})
  21026. }
  21027. if(window.DATA.momentTourBlackNewType){
  21028. player.sceneRenderer.effects.fastTranMaskPass.start(player.sceneRenderer)
  21029. var camera = this.playerControls.cameras[a.PANORAMA];
  21030. var end = this.warpDestHeroLoc.position
  21031. camera.position.copy(end)
  21032. setTimeout(()=>{
  21033. player.sceneRenderer.effects.fastTranMaskPass.stop()
  21034. this.wrapupWarpShadingOnly(n, i);
  21035. done()
  21036. },t)
  21037. }else{
  21038. var o = function() {
  21039. this.wrapupWarpShadingOnly(n, i);
  21040. done()
  21041. }
  21042. .bind(this);
  21043. var firstPos = this.player.position.clone()//add
  21044. p.start(this.stepWarpPath.bind(this, firstPos), t, o, r, d[c.warp.blendEasing], "stepMotion")
  21045. }
  21046. this.warpCommonParameters(t, r, !1, i)
  21047. this.model.chunks.concat(this.model.skybox).forEach(function(e) {// 改
  21048. if(window.DATA.momentTourBlackNewType){
  21049. e.material.uniforms.blackout.value = 5//i 改
  21050. //e.material.defines.newBlack = ''
  21051. //e.material.needsUpdate = true
  21052. }else{
  21053. e.material.uniforms.blackout.value = i
  21054. }
  21055. }),
  21056. this._warpBendAim(null, t, null, r);
  21057. }
  21058. ,
  21059. n.prototype.flightStepWalk = function(e, t, i) {
  21060. var n = .001
  21061. , o = 1
  21062. , a = 1.2
  21063. , s = new r.Vector3
  21064. , h = new r.Vector3
  21065. , u = function(e, t) {
  21066. //导览速度
  21067. var i = Math.min(this.player.position.distanceTo(e.position), c.transition.flytimeMaxDistanceThreshold)
  21068. // , r = i * c.transition.flytimeDistanceMultiplier + c.transition.flyTime;
  21069. , r = i * c.warp.flytimeDistanceMultiplier + c.warp.flyTime;
  21070. h.copy(A.FORWARD),
  21071. this.player.getDirection(h),
  21072. s.copy(t).sub(e.position).normalize();
  21073. var l = s.dot(h)
  21074. , u = Math.acos(l)
  21075. , d = u / r;
  21076. d > n && (r *= d / n,
  21077. u < o && (r *= a))
  21078. return r / DATA.tourWalkSpeed * 100 // 改
  21079. };
  21080. return function(e, t, i) {
  21081. if (this.warpInterrupted)
  21082. i && i();
  21083. else if (this.activeTransType !== l.WALK)
  21084. this._clearWarpShading(),
  21085. this._warpStopFlying(),
  21086. this.player.spider.draw(),
  21087. this.placeCpm(),
  21088. i && i();
  21089. else if (this.player.currentPano !== e) {
  21090. var n = {
  21091. pano: e,
  21092. lookAtPoint: t,
  21093. duration: null,
  21094. maxDistanceOverride: c.warp.walkMaxDist,
  21095. skipWarpingCheck: !1,
  21096. constantMoveSpeed: !0
  21097. };
  21098. if(e == this.warpDestPano){//到达终点前,放大到终点的zoom
  21099. n.zoomLevel = this.warpDestHeroLoc.zoom
  21100. }
  21101. n.duration = u.call(this, e, t),
  21102. this.player.nonInterruptingFlyToPano(n, i)
  21103. } else
  21104. i && i()
  21105. }
  21106. }(),
  21107. n.prototype.makeWalkFlightFunc = function(e, t, i) {
  21108. return this.flightStepWalk.bind(this, e, t, i)
  21109. }
  21110. ,
  21111. n.prototype.warpTravel_WALK = function() {
  21112. var e = [];
  21113. return function(t) {
  21114. var i = this.player.model.panos;
  21115. e.length = 0;
  21116. for (var n = null, o = !1, a = 0; a < this.nodes.length; a++) {
  21117. var s = this.nodes[a]
  21118. , l = i.get(s);
  21119. a === this.nodes.length - 1;
  21120. o = n && l.position.distanceTo(n.position) < c.warp.walkMinDist,
  21121. n && o || (e.push(s),
  21122. n = l)
  21123. }
  21124. o && this.nodes.length > 1 && (e[e.length - 1] = this.nodes[this.nodes.length - 1]);
  21125. var h = e.length
  21126. , u = i.get(e[h - 1])
  21127. , d = new Array(h + 1);
  21128. d[d.length - 1] = function() {
  21129. t && t()
  21130. }
  21131. .bind(this);
  21132. for (var p = h - 1, f = d.length - 1; f > 0; f -= 1) {
  21133. var g = e[p];
  21134. u = i.get(g);
  21135. var m = new r.Vector3;
  21136. this.getLookAtForWalkingTourNode(e, p, m),
  21137. d[f - 1] = this.makeWalkFlightFunc(u, m, d[f]),
  21138. p--
  21139. }
  21140. d[0]()
  21141. }
  21142. }(),
  21143. n.prototype.getLookAtForWalkingTourNode = function() {
  21144. var e = new r.Vector3
  21145. , t = new r.Vector3
  21146. , i = new r.Vector3
  21147. , n = new r.Vector3
  21148. , o = new r.Vector3
  21149. , a = .65
  21150. , s = .75
  21151. , l = .2
  21152. , c = .4
  21153. , h = .2
  21154. , u = 3;
  21155. return function(r, d, p) {
  21156. var f = r.length;
  21157. if (d >= f)
  21158. return !1;
  21159. var g = 1
  21160. , m = 1;
  21161. t.set(0, 0, 0),
  21162. o.set(0, 0, 0);
  21163. for (var v = null, A = d; A < d + u && !(A >= f); A++) {
  21164. if (v = this.player.model.panos.get(r[A]),
  21165. this.getOrientationForWalkingTourNode(r, A, i),
  21166. A === d && e.copy(i),
  21167. n.copy(i),
  21168. A > d) {
  21169. var y = n.dot(e) < a;
  21170. g *= y ? l : s,
  21171. m *= y ? h : c
  21172. }
  21173. i.multiplyScalar(g),
  21174. t.add(i),
  21175. o.lerp(v.position, m)
  21176. }
  21177. return t.normalize(),
  21178. p.copy(o),
  21179. p.add(t),
  21180. !0
  21181. }
  21182. }(),
  21183. n.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  21184. var n = e.length;
  21185. if (t >= n)
  21186. return !1;
  21187. if (t === n - 1)
  21188. i.copy(A.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  21189. else {
  21190. var r = this.player.model.panos.get(e[t])
  21191. , o = this.player.model.panos.get(e[t + 1]);
  21192. i.copy(o.position).sub(r.position)
  21193. }
  21194. return i.normalize(),
  21195. !0
  21196. }
  21197. ,
  21198. n.prototype.warpCameraTravel = function(e, t, i, n) {
  21199. if (this.activeTransType = this.upcomingTransType,
  21200. this.lastTransType = this.activeTransType,
  21201. this.upcomingTransType = null,
  21202. !e) {
  21203. var r = function() {
  21204. this._wrapupTravel(n)
  21205. }
  21206. .bind(this)
  21207. , o = {
  21208. pano: this.warpDestPano,
  21209. lookAtPoint: null,
  21210. duration: null,
  21211. maxDistanceOverride: null,
  21212. skipWarpingCheck: !1
  21213. };
  21214. return void this.player.flyToPano(o, r)
  21215. }
  21216. this.activeTransType === l.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === l.WALK ? this.warpTravel_WALK(function() {
  21217. this._clearWarpShading(),
  21218. this._warpStopFlying(),
  21219. this.player.spider.draw(),
  21220. this.placeCpm(),
  21221. n && n()
  21222. }
  21223. .bind(this)) : this.warpTravel_STD(n)
  21224. }
  21225. ,
  21226. n.prototype.startWarpState = function() {
  21227. this.warping = !0,
  21228. this.warpInterrupted = !1,
  21229. this.warpInterruptionBlackoutStyle = null,
  21230. this.warpInterruptionTravelTime = null
  21231. }
  21232. ,
  21233. n.prototype.endWarpState = function() {
  21234. this.warping = !1
  21235. }
  21236. ,
  21237. n.prototype.warpToPano = function(e, t, i, n) {
  21238. if (this.warping)
  21239. return void y.warn("Cannot warp when already warping");
  21240. if (this.upcomingTransType = e,
  21241. this.activeTransType = null,
  21242. !this.setWarpDestPano())
  21243. return this.upcomingTransType = null,
  21244. void this.warpToNonPano(n);
  21245. if (this.player.mode !== a.PANORAMA)
  21246. return this.upcomingTransType = null,
  21247. this.discardSlow(),
  21248. void this.player.flyToNewMode({
  21249. mode: a.PANORAMA,
  21250. pano: this.warpDestPano,
  21251. duration: c.warp.outsideTime,
  21252. warpDest: this.warpDestHeroLoc,
  21253. callback: n,
  21254. force: !0
  21255. });
  21256. if (!this.warpDestPano)
  21257. return y.warn("no warp destination, callback dropped"),
  21258. void (this.upcomingTransType = null);
  21259. 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)
  21260. , o = this.chooseWarpPath(r);
  21261. if (o && this.upcomingTransType !== l.WALK) {
  21262. var s = function() {
  21263. this.waitingToWarp = !1,
  21264. this.warpToPano(e, t, i, n)
  21265. }
  21266. .bind(this);
  21267. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, s))
  21268. return void (this.waitingToWarp = !0)
  21269. }
  21270. this.player.currentPano || (y.warn("Arrived at a very strange spot!"),
  21271. this.player.currentPano = this.warpDestPano,
  21272. this.placeCpm(),
  21273. this.fadeOutCpm(c.path.fadeOutTime),
  21274. this.player.spider.draw()),
  21275. y.debug("Warping to pano ", this.warpDestPano.position),
  21276. this.upcomingTransType !== l.WALK && this.player.emit(C.PanoChosen, this.player.currentPano, this.warpDestPano),
  21277. this.startWarpState();
  21278. var h = function() {
  21279. this.endWarpState(),
  21280. n && n()
  21281. }
  21282. .bind(this);
  21283. o ? this.warpCameraTravel(r, t, i, h) : this.warpCameraAim(h)
  21284. //this.player.smoothZoomToDefault(c.zoom.restoreTime);
  21285. }
  21286. ,
  21287. t.exports = n
  21288. }
  21289. ).call(this, "/js/objects/ShowPath.js")
  21290. }
  21291. , {
  21292. "../constants": 8,
  21293. "../effects": 16,
  21294. "../enum/BlackoutStyle": 18,
  21295. "../enum/ModelManagerEvents": 33,
  21296. "../enum/PlayerEvents": 40,
  21297. "../enum/RenderOrder": 42,
  21298. "../enum/Vectors": 50,
  21299. "../enum/Viewmode": 51,
  21300. "../enum/WarpStyle": 52,
  21301. "../gui/gui": 65,
  21302. "../model/ModelManager": 140,
  21303. "../objects/Snapshot": 153,
  21304. "../settings": 166,
  21305. "../shaders": 167,
  21306. "../util/easing": 186,
  21307. "../util/lerp": 188,
  21308. "../util/logger": 189,
  21309. "../util/math": 190,
  21310. "../util/texture": 194,
  21311. "../util/transitions": 195,
  21312. three: 217
  21313. }],
  21314. 152: [function(e, t, i) {
  21315. "use strict";
  21316. function n() {
  21317. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  21318. , t = new r.RawShaderMaterial({
  21319. fragmentShader: o.skysphere.fragmentShader,
  21320. vertexShader: o.skysphere.vertexShader,
  21321. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  21322. side: r.BackSide,
  21323. name: "skysphere"
  21324. });
  21325. t.uniforms.radius.value = e.parameters.radius,
  21326. r.Mesh.call(this, e, t)
  21327. }
  21328. var r = e("three")
  21329. , o = e("../shaders")
  21330. , a = e("../settings");
  21331. n.prototype = Object.create(r.Mesh.prototype),
  21332. n.prototype.constructor = n,
  21333. t.exports = n
  21334. }
  21335. , {
  21336. "../settings": 166,
  21337. "../shaders": 167,
  21338. three: 217
  21339. }],
  21340. 153: [function(e, t, i) {
  21341. (function(i) {
  21342. "use strict";
  21343. function n(e) {
  21344. o.call(this, e),
  21345. this.sid = e.sid,//xzw add
  21346. this.panoId = e.panoId,
  21347. this.orthoZoom = e.orthoZoom,
  21348. this.floorVisibility = e.floorVisibility,
  21349. this.thumbUrl = e.thumbUrl,
  21350. this.name = e.name,
  21351. this.zoom = e.zoom
  21352. }
  21353. var r = (e("three"),
  21354. e("../util/logger"))
  21355. , o = (e("../settings"),
  21356. e("../enum/Viewmode"),
  21357. e("../util/common"),
  21358. e("../util/transitions"),
  21359. e("../util/lerp"),
  21360. e("../util/ajax"),
  21361. e("../util/texture"),
  21362. e("./View"));
  21363. e("events").EventEmitter,
  21364. new r(i);
  21365. n.prototype = Object.create(o.prototype),
  21366. n.prototype.isPano = function() {
  21367. return this.panoId && "" !== this.panoId && this.panoId != "outside"
  21368. }
  21369. ,
  21370. t.exports = n
  21371. }
  21372. ).call(this, "/js/objects/Snapshot.js")
  21373. }
  21374. , {
  21375. "../enum/Viewmode": 51,
  21376. "../settings": 166,
  21377. "../util/ajax": 181,
  21378. "../util/common": 185,
  21379. "../util/lerp": 188,
  21380. "../util/logger": 189,
  21381. "../util/texture": 194,
  21382. "../util/transitions": 195,
  21383. "./View": 154,
  21384. events: 202,
  21385. three: 217
  21386. }],
  21387. 154: [function(e, t, i) {
  21388. (function(i) {
  21389. "use strict";
  21390. function n(e) {
  21391. e = e || {},
  21392. this.position = new r.Vector3,
  21393. this.quaternion = new r.Quaternion,
  21394. this.update(e)
  21395. }
  21396. var r = e("three")
  21397. , o = e("../util/logger")
  21398. , a = (e("../settings"),
  21399. e("../enum/Viewmode"),
  21400. e("../util/common"),
  21401. e("../util/transitions"),
  21402. e("../util/lerp"),
  21403. e("../util/ajax"),
  21404. e("../util/texture"),
  21405. e("events").EventEmitter);
  21406. new o(i);
  21407. n.prototype = Object.create(a.prototype),
  21408. n.prototype.isValid = function() {
  21409. return !!this.cameraMode
  21410. }
  21411. ,
  21412. n.prototype.update = function(e) {
  21413. return this.cameraMode = e.cameraMode || this.cameraMode,
  21414. this.pano = e.pano || this.pano,
  21415. e.position && this.position.copy(e.position),
  21416. e.quaternion && this.quaternion.copy(e.quaternion),
  21417. this
  21418. }
  21419. ,
  21420. t.exports = n
  21421. }
  21422. ).call(this, "/js/objects/View.js")
  21423. }
  21424. , {
  21425. "../enum/Viewmode": 51,
  21426. "../settings": 166,
  21427. "../util/ajax": 181,
  21428. "../util/common": 185,
  21429. "../util/lerp": 188,
  21430. "../util/logger": 189,
  21431. "../util/texture": 194,
  21432. "../util/transitions": 195,
  21433. events: 202,
  21434. three: 217
  21435. }],
  21436. 155: [function(e, t, i) {//player.js
  21437. (function(i) {
  21438. "use strict";
  21439. function n(e) {
  21440. this.currentPano = null,
  21441. this.nextPano = null,
  21442. this.camera = null,
  21443. this.paused = !1,
  21444. this.flying = !1,
  21445. this.sceneIntersectionPlane = null,
  21446. this.target = new r.Vector3,
  21447. this.mouse = new r.Vector3(1.1,1.1,.5),
  21448. this.mouseAtMouseDown = new r.Vector2,
  21449. this.mouseCouldBeClickToMove = !1,
  21450. this.mouseLastMoveTime = Date.now(),
  21451. this.mouseDown = !1,
  21452. this.mouseDownTimer = null,
  21453. this.couldBeLongTap = !1,
  21454. this.containsMouse = !1, //
  21455. this.isTouchEvent = !1,
  21456. this.isPanoHover = !1,
  21457. this.reticule = new a(this),
  21458. this.panoMarkers = [],
  21459. this.spider = new h(this),
  21460. this.quaternion = new r.Quaternion,
  21461. this.position = new r.Vector3(15,10,15),
  21462. this.previousState = null,
  21463. this.lastInsideView = new c,
  21464. this.last360View = new c,
  21465. this.raycaster = new r.Raycaster,
  21466. this.intersect = null,
  21467. this.lastChangeTime = Date.now(),
  21468. this.history = new I,
  21469. this.cameraControls = null,
  21470. this.path = null,
  21471. this.model = null,
  21472. this.domElement = null,
  21473. this.cachedPanoCandidates = null,
  21474. this.basePanoSize = 0,
  21475. this.standardPanoSize = 0,
  21476. this.highPanoSize = 0,
  21477. this.ultraHighPanoSize = 0,
  21478. this.zoomLevel = 1,
  21479. this.zooming = 0,
  21480. this.zoomSpeed = .5,
  21481. this.scrollZoomSpeed = .06,
  21482. this.zoomSpeedAdjust = .05,
  21483. this.defaultZoomIncrement = .2,
  21484. this.baseFov = f.insideFOV,
  21485. this.zoomFov = this.baseFov,
  21486. this.zoomEnabled = !0,
  21487. this.preRenderingEnabled = !1,
  21488. this.setupCustomProperties(e),
  21489. this.zoomStats = new L
  21490. window.player = this
  21491. this.modeTran = ''
  21492. }
  21493. var r = e("three")
  21494. , o = e("./util/logger")
  21495. , a = e("./objects/Reticule")
  21496. , s = e("./objects/Panorama")
  21497. , l = e("./objects/ShowPath")
  21498. , c = e("./objects/View")
  21499. , h = (e("./objects/Snapshot"),
  21500. e("./objects/NSpider"))
  21501. , u = e("./enum/Viewmode")
  21502. , d = (e("./enum/TagStates"),
  21503. e("./enum/Vectors"))
  21504. , p = e("./enum/Keys")
  21505. , f = (e("./enum/AlignmentType"),
  21506. e("./settings"))
  21507. , g = e("./util/common")
  21508. , m = (e("./util/browser"),
  21509. e("./util/math"))
  21510. , v = e("./util/lerp")
  21511. , A = e("./util/easing")
  21512. , y = e("./util/transitions")
  21513. , C = e("events").EventEmitter
  21514. , I = (e("./shaders"),
  21515. e("./util/history"))
  21516. , E = (e("./util/camera"),
  21517. e("./model/ModelManager"),
  21518. e("./enum/PathDiscardMode"))
  21519. , b = e("./enum/PathDisplayMode")
  21520. , w = e("./enum/PlayerEvents")
  21521. , _ = e("./enum/ControlEvents")
  21522. , T = e("./enum/ModelManagerEvents")
  21523. , x = e("./enum/WarpStyle")
  21524. , S = e("./enum/BlackoutStyle")
  21525. , M = e("./exception/BasicException")
  21526. , R = e("./enum/PanoSizeClass")
  21527. , P = (e("./tile/TileDownloader"),
  21528. e("./tile/TilePrioritizer"))
  21529. , O = (e("./enum/PanoramaEvents"),
  21530. e("./enum/ZoomEvents"))
  21531. , L = e("./util/ZoomStats")
  21532. , D = e("./constants")
  21533. , N = e("./util/common")
  21534. , B = e("./util/cameraLight")
  21535. //, Hot = e('hot')
  21536. , F = new o(i)
  21537. , V = Object.freeze({
  21538. FlyToPano: y.getUniqueId(),
  21539. FlyToNewMode: y.getUniqueId(),
  21540. FlyToSameMode: y.getUniqueId(),
  21541. FlyToViewFloor: y.getUniqueId(),
  21542. LookTransition: y.getUniqueId(),
  21543. ZoomTransition: y.getUniqueId()
  21544. });
  21545. n.prototype = Object.create(C.prototype),
  21546. n.prototype.init = function(e) {
  21547. this.modelManager = e.modelManager,
  21548. this.tileDownloader = e.tileDownloader,
  21549. this.panoRenderer = e.panoRenderer,
  21550. this.qualityManager = e.qualityManager,
  21551. this.domElement = e.container,
  21552. this.camera = e.camera,
  21553. this.tagManager = e.tagManager,
  21554. this.cameraControls = e.controls,
  21555. this.path = new l(e.director,this,e.controls),
  21556. this.basePanoSize = this.qualityManager.getPanoSize(R.BASE),
  21557. this.standardPanoSize = this.qualityManager.getPanoSize(R.STANDARD),
  21558. this.highPanoSize = this.qualityManager.getPanoSize(R.HIGH),
  21559. this.ultraHighPanoSize = this.qualityManager.getPanoSize(R.ULTRAHIGH),
  21560. this.tileDownloader.processPriorityQueue = !1,
  21561. this.tileDownloader.tilePrioritizer = new P(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  21562. this.bindEvents(e.container),
  21563. this.updateModel()
  21564. this.guider2 = new PanTransGuide(this)
  21565. }
  21566. //xzw add: 截图
  21567. function dataURLtoBlob(dataurl) {
  21568. var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
  21569. bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
  21570. while(n--){
  21571. u8arr[n] = bstr.charCodeAt(n);
  21572. };
  21573. return new Blob([u8arr], {type:mime});
  21574. }
  21575. n.prototype.screenShot = function(o){
  21576. if(this.flying || this.flyingToTag) return;
  21577. var R = this.sceneRenderer;
  21578. R.updateScreenSize(o);
  21579. for(var i in this.model.panos.index){
  21580. if(!this.model.panos.index[i].marker) continue;
  21581. this.model.panos.index[i].marker.forceHide = this.model.panos.index[i].marker.visible;
  21582. this.model.panos.index[i].marker.visible = false;
  21583. }
  21584. for(var i in this.model.hots){
  21585. this.model.hots[i].mesh.visible = false;
  21586. }
  21587. this.reticule.visible = false;
  21588. this.reticule.forceUnvisible = true;
  21589. this.path.currentPanoMarker.mesh.visible = false;
  21590. setTimeout(function(){//因resize效用没办法立即生效(原因未知),故而延后
  21591. R.renderer.clear(true,true,true);
  21592. R.renderer.render(R.scene, R.camera);
  21593. var imgData = R.renderer.domElement.toDataURL(o.type,0.9);
  21594. o.f && o.f(imgData)
  21595. R.updateScreenSize({resize:true});
  21596. this.reticule.visible = true;
  21597. for(var i in this.model.hots){
  21598. this.model.hots[i].mesh.visible = true;
  21599. }
  21600. for(var i in this.model.panos.index){
  21601. this.model.panos.index[i].marker.visible = this.model.panos.index[i].marker.forceHide;
  21602. }
  21603. this.path.currentPanoMarker.mesh.visible = true;
  21604. R.renderer.render(R.scene, R.camera);
  21605. }.bind(this),30) //这个数字不能太小
  21606. }
  21607. var scaleImg = e("scaleImg");
  21608. var ResizeImg = function(img, option){
  21609. var img2; //不能直接改img 否则可能触发第二次img.onload
  21610. var compress = function(ratio,type){
  21611. var image = img2 || img;
  21612. var c = document.createElement('canvas');
  21613. c.width = image.width; c.height = image.height;
  21614. var ctx = c.getContext('2d');
  21615. ctx.drawImage(image,0,0,image.width,image.height);
  21616. img2 = scaleImg(ratio/* option.maxSize/oldSize */, c, type/* option.type||"png" */);//最大不能超过0.8M
  21617. }
  21618. var reCom = function(){ //如果有了img2 就只需要img2 否则创造新的img2
  21619. var image = img2 || img;
  21620. var blob = dataURLtoBlob(image.src);
  21621. if(option.maxWeight && blob.size > option.maxWeight){
  21622. compress(option.maxWeight/blob.size, "jpeg")
  21623. blob = dataURLtoBlob(image.src);
  21624. }
  21625. if(!img2){
  21626. img2 = new Image();
  21627. }
  21628. img2.base64Src = image.src;
  21629. img2.src = window.URL.createObjectURL(blob);
  21630. }
  21631. var oldSize = Math.max(img.width, img.height);
  21632. if(option.toType != "png"){//不是非要png的话
  21633. if(option.oldType == "jpeg"){//jpeg先判断尺寸,然后是尺寸
  21634. if(oldSize > option.maxSize){
  21635. compress(option.maxSize/oldSize, "jpeg");
  21636. }
  21637. reCom();
  21638. }else if(option.oldType == "png"){//png先判断数据量 如果数据量达标,就无视大小(有可能超出大小)
  21639. if(option.maxWeight && option.weight > option.maxWeight){//如果一开始大小不大就不压缩 还是png
  21640. compress(oldSize>option.maxSize ? option.maxSize/oldSize : 1, "jpeg");
  21641. reCom();
  21642. }
  21643. }
  21644. }else{
  21645. //?貌似png会越压缩越大?
  21646. }
  21647. return img2 || img;
  21648. }
  21649. var _fixType=function(type) {
  21650. type = type.toLowerCase().replace(/jpg/i, 'jpeg');
  21651. var r = type.match(/png|jpeg|bmp|gif/)[0];
  21652. return 'image/' + r;
  21653. };
  21654. var saveFile=function(data, filename){
  21655. var save_link = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');
  21656. save_link.href = data;
  21657. save_link.download = filename;
  21658. var event = document.createEvent('MouseEvents');
  21659. event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
  21660. save_link.dispatchEvent(event);
  21661. };
  21662. n.prototype.getWrapShot = function(){ //获取导览点截图/初始画面和信息
  21663. var info = this.getSnapAngleInfo();
  21664. var str = ',{\r\t' + info;
  21665. var arg = arguments[0];
  21666. this.screenShot({ width:g_snapShotWidth*4, height:g_snapShotHeight*4, type:"image/jpeg", f:function(imgData){
  21667. if (arg && arg.__callback) {
  21668. return arg.__callback(imgData, info)
  21669. }
  21670. var img = new Image();
  21671. img.src = imgData;
  21672. img.onload = function(){
  21673. var img2 = ResizeImg(this,{maxSize: g_snapShotWidth, oldType:"jpeg"}); //暂定缩略图大小
  21674. img2.src.replace(_fixType("image/jpeg"),'image/octet-stream');
  21675. var filename = "snap" + (new Date()).getTime();
  21676. saveFile(img2.src,filename + ".jpg");
  21677. str +=(',\r\t"thumbnail_signed_src":"'+filename+'.jpg",');
  21678. str +=('\r\t"sid":"'+filename+'",');
  21679. str +=('\r\t"name":"'+filename+'"\r}');
  21680. logData(str)
  21681. }
  21682. }});
  21683. }
  21684. ,
  21685. n.prototype.getSnapAngleInfo = function(){
  21686. var info = {};
  21687. var str = '"metadata":{';
  21688. var q = this.camera.quaternion.clone();
  21689. switch (this.mode) {
  21690. case "panorama":
  21691. info.scan_id = this.currentPano.id;
  21692. str += ('"scan_id":"'+this.currentPano.id+'",');
  21693. break;
  21694. case "floorplan":
  21695. info.camera_mode = 1;
  21696. q = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  21697. q.multiply(this.camera.quaternion);
  21698. str += ('"camera_mode":1,');
  21699. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  21700. str += ('"ortho_zoom":'+ m.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  21701. break;
  21702. case "dollhouse":
  21703. info.camera_mode = 2;
  21704. str += ('"camera_mode":2,');
  21705. break;
  21706. }
  21707. info.camera_position = m.toPrecision(this.camera.position.toArray(),4);
  21708. console.log(info.camera_position)
  21709. if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的
  21710. /**fyz 对相机截屏的角度进行校对 */
  21711. var out = new r.Quaternion(q.x, q.y, q.z, q.w)
  21712. out.multiply(new r.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  21713. out.x *= -1;
  21714. out.w *= -1;
  21715. info.camera_quaternion = m.toPrecision(out.toArray(),4);
  21716. }else{
  21717. info.camera_quaternion = m.toPrecision(q.toArray(),4);;
  21718. }
  21719. info.zoom = this.zoomLevel;
  21720. console.log(info.camera_quaternion)
  21721. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  21722. // fyz 扩展编辑页面, 加上导览点缩放值
  21723. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+'], "zoom":' + info.zoom + '}');
  21724. return str;
  21725. }
  21726. //------end
  21727. n.prototype.setupCustomProperties = function(e) {
  21728. var t = e || u.PANORAMA;
  21729. Object.defineProperty(this, "mode", {
  21730. get: function() {
  21731. return t
  21732. },
  21733. set: function(e) {
  21734. var i = t;
  21735. t = e,
  21736. this.onModeUpdated(i, t)
  21737. }
  21738. })
  21739. }
  21740. ,
  21741. n.prototype.isInMode = function() {
  21742. for (var e = 0; e < arguments.length; e++)
  21743. if (this.mode === arguments[e])
  21744. return !0;
  21745. return !1
  21746. }
  21747. ,
  21748. n.prototype.isOutsideMode = function(e) {
  21749. return e = e || this.mode,
  21750. e === u.DOLLHOUSE || e === u.FLOORPLAN
  21751. }
  21752. ,
  21753. n.prototype.is360View = function(e, t) {
  21754. return e === u.PANORAMA && t && !t.isAligned()
  21755. }
  21756. ,
  21757. n.prototype.setScene = function(e) {
  21758. this.sceneIntersectionPlane = e.plane,
  21759. this.path.setScene(e),
  21760. this.moveReticuleToScene(e)
  21761. }
  21762. ,
  21763. n.prototype.moveReticuleToScene = function(e) {
  21764. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  21765. e.add(this.reticule)
  21766. }
  21767. ,
  21768. n.prototype.updateModel = function() {
  21769. function e(e, t, n) {
  21770. this.mode === u.DOLLHOUSE && e !== n && i.call(this, e.center.y)
  21771. }
  21772. function t(e, t) {
  21773. if (this.mode === u.DOLLHOUSE) {
  21774. var n = e ? this.model.center.y : n = t.center.y;
  21775. i.call(this, n)
  21776. }
  21777. }
  21778. function i(e) {
  21779. var t = this.cameraControls.cameras[u.DOLLHOUSE]
  21780. , i = this.cameraControls.controls[u.DOLLHOUSE]
  21781. , n = t.position.y + (e - i.target.y)
  21782. , r = f.showFloorDuration + f.showFloorDelay;
  21783. y.start(v.property(i.target, "y", e), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor),
  21784. y.start(v.property(t.position, "y", n), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor)
  21785. }
  21786. this.model = this.modelManager.getActiveModel(),
  21787. this.model.on("floor.changed", e.bind(this)),
  21788. this.model.on("allfloors.toggled", t.bind(this)),
  21789. this.on(w.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  21790. /*******************************************************************VR fyz改 from徐世廷*******************************************************************/
  21791. var e2 = this;
  21792. this.model.panos.list.forEach(function(a) {
  21793. a.vrMarker.addEventListener("click", function() {
  21794. e2.flyToPano({
  21795. pano: a
  21796. })
  21797. })
  21798. })
  21799. /********************************************************************************************************************************************/
  21800. this.model.addHighMapCube()//add
  21801. this.on(w.FlyingStarted, this.model.resetHighMap.bind(this.model))
  21802. }
  21803. ,
  21804. n.prototype.updateModelDependentData = function() {
  21805. this.cameraControls.setModelForControls(this.model),
  21806. this.getPanoMarkersFromModel(this.model)
  21807. }
  21808. ,
  21809. n.prototype.onModelChanged = function() {
  21810. this.updateModel(),
  21811. this.updateModelDependentData()
  21812. }
  21813. ,
  21814. n.prototype.getPanoMarkersFromModel = function(e) {
  21815. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  21816. return t.marker ? e.concat(t.marker) : e
  21817. }, [])
  21818. }
  21819. ,
  21820. n.prototype.handleControlMove = function(e) {
  21821. this.emit(w.Move, e)
  21822. }
  21823. ,
  21824. n.prototype.handleControlInputStart = function(e) {
  21825. this.emit(w.InputStart, e)
  21826. }
  21827. ,
  21828. n.prototype.onModeUpdated = function(e, t) {
  21829. this.cameraControls.activateControls(t),
  21830. this.emit(w.ModeChanged, e, t)
  21831. }
  21832. ,
  21833. n.prototype.isWarping = function() {//是否导览缓慢走向某个点
  21834. return this.path.warping
  21835. }
  21836. ,
  21837. n.prototype.isWaitingToWarp = function() {
  21838. return this.path.waitingToWarp
  21839. }
  21840. ,
  21841. n.prototype.getLabelScaleFactor = function() {
  21842. if (this.isOutsideMode()) {
  21843. var e = 10
  21844. , t = Math.sqrt(this.cameraControls.controls[u.FLOORPLAN].currentScale / e);
  21845. return t
  21846. }
  21847. return .5
  21848. }
  21849. ,
  21850. /* n.prototype.changeMusic = function() {//xzw add
  21851. if(!this.director.tourIsPlaying) this.director.bgmReplay()
  21852. } */
  21853. n.prototype.bindEvents = function(e) {
  21854. e !== document && e.setAttribute("tabindex", -1),
  21855. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  21856. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  21857. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  21858. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  21859. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  21860. this.modelManager.on(T.ActiveModelChanged, this.onModelChanged.bind(this)),
  21861. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  21862. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  21863. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  21864. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  21865. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  21866. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  21867. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  21868. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  21869. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  21870. this.cameraControls.on(_.Move, this.handleControlMove.bind(this)),
  21871. this.cameraControls.on(_.InputStart, this.handleControlInputStart.bind(this)),
  21872. this.cameraControls.on(_.Pinch, this.handleControlPinch.bind(this)),
  21873. this.cameraControls.on(_.Scroll, this.handleControlScroll.bind(this)),
  21874. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),//xzw add
  21875. //window.addEventListener("tourAudioEnded", this.changeMusic.bind(this));//xzw add
  21876. // lzb
  21877. window.getSeft && getSeft(this);
  21878. }
  21879. ,
  21880. n.prototype.onMouseDown = function(e) {
  21881. e.currentTarget !== document && e.currentTarget.focus(),
  21882. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  21883. this.updateIntersect())
  21884. }
  21885. ,
  21886. n.prototype.onMouseMove = function(e) {
  21887. this.isTouchEvent = !1,
  21888. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  21889. }
  21890. ,
  21891. n.prototype.onMouseOver = function(e) {
  21892. this.containsMouse = !0,
  21893. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  21894. if(this.intersectHot){
  21895. this.intersectHot.setHoverState(true)
  21896. }
  21897. }
  21898. ,
  21899. n.prototype.onMouseOut = function(e) {
  21900. this.containsMouse = !1
  21901. if(this.intersectHot){
  21902. this.intersectHot.setHoverState(false)
  21903. }
  21904. }
  21905. ,
  21906. n.prototype.onMouseUp = function(e) {
  21907. this.handleInputEnd.call(this, e.clientX, e.clientY, !1);
  21908. }
  21909. ,
  21910. n.prototype.onTouchStart = function(e) {
  21911. if (e.currentTarget !== document && e.currentTarget.focus(),
  21912. !this.mouseDown) {
  21913. this.couldBeLongTap = !0;
  21914. var t = g.average(e.changedTouches, "clientX")
  21915. , i = g.average(e.changedTouches, "clientY");
  21916. this.handleInputStart.call(this, t, i, !0),
  21917. this.mouseDownTimer = setTimeout(function() {
  21918. this.updateIntersect(),
  21919. this.handleInputEnd.call(this, t, i, !0)
  21920. }
  21921. .bind(this), f.input.longTapThreshold)
  21922. }
  21923. }
  21924. ,
  21925. n.prototype.onTouchMove = function(e) {
  21926. var t = g.average(e.changedTouches, "clientX")
  21927. , i = g.average(e.changedTouches, "clientY");
  21928. this.handleInputMove.call(this, t, i, !0)
  21929. }
  21930. ,
  21931. n.prototype.onTouchEnd = function(e) {
  21932. if (clearTimeout(this.mouseDownTimer),
  21933. this.mouseDown) {
  21934. this.couldBeLongTap = !1,
  21935. this.updateIntersect();
  21936. var t = g.average(e.changedTouches, "clientX")
  21937. , i = g.average(e.changedTouches, "clientY");
  21938. this.handleInputEnd.call(this, t, i, !0)
  21939. }
  21940. //add
  21941. if (this.intersectHot) this.intersectHot.setHoverState(false)
  21942. this.intersectHot = null
  21943. Hot.mobileAutoPlay(this)
  21944. }
  21945. ,
  21946. n.prototype.onPointerDown = function(e) {
  21947. return e.currentTarget !== document && e.currentTarget.focus(),
  21948. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  21949. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  21950. void (this.mouseDownTimer = setTimeout(function() {
  21951. this.updateIntersect(),
  21952. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  21953. }
  21954. .bind(this), f.input.longTapThreshold)))
  21955. }
  21956. ,
  21957. n.prototype.onPointerMove = function(e) {
  21958. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  21959. }
  21960. ,
  21961. n.prototype.onPointerUp = function(e) {
  21962. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  21963. this.couldBeLongTap = !1,
  21964. this.updateIntersect(),
  21965. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  21966. }
  21967. ,
  21968. n.prototype.onPointerOut = function(e) {
  21969. this.mouseDown = !1
  21970. }
  21971. ,
  21972. n.prototype.onPointerCancel = function(e) {
  21973. this.mouseDown = !1
  21974. }
  21975. ,
  21976. n.prototype.onKeyDown = function(e) {
  21977. var t = function() {
  21978. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, "key")
  21979. }
  21980. .bind(this)
  21981. , i = e.which;
  21982. switch (i) {
  21983. case p.F:
  21984. t(),
  21985. this.changeFloor(-1);
  21986. break;
  21987. case p.R:
  21988. t(),
  21989. this.changeFloor(1)
  21990. }
  21991. if (this.mode === u.PANORAMA)
  21992. switch (i) {
  21993. case p.UPARROW:
  21994. case p.W:
  21995. this.flyLocalDirection(d.FORWARD.clone());
  21996. break;
  21997. case p.DOWNARROW:
  21998. case p.S:
  21999. this.flyLocalDirection(d.BACK.clone());
  22000. break;
  22001. case p.A:
  22002. this.flyLocalDirection(d.LEFT.clone());
  22003. break;
  22004. case p.D:
  22005. this.flyLocalDirection(d.RIGHT.clone())
  22006. }
  22007. }
  22008. ,
  22009. n.prototype.handleScrollPinchZoom = function() {
  22010. return function(e) {
  22011. var t = e
  22012. , i = this.zoomLevel;
  22013. this.zoomBy(t),
  22014. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  22015. }
  22016. }(),
  22017. n.prototype.handleControlPinch = function(e) {
  22018. f.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new r.Vector3(0,0,e).normalize())
  22019. }
  22020. ,
  22021. n.prototype.handleControlScroll = function(e) {
  22022. f.zoom.enabled ? (e > 0 ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  22023. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new r.Vector3(0,0,-e).normalize())
  22024. }
  22025. ,
  22026. n.prototype.handleInputStart = function(e, t, i) {
  22027. //许钟文加
  22028. var pad = this.handelPadding(e, t);
  22029. e = pad.x;
  22030. t = pad.y;
  22031. this.isTouchEvent = i,
  22032. m.convertScreenPositionToNDC(e, t, this.mouse),
  22033. m.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  22034. this.mouseCouldBeClickToMove = !0,
  22035. this.mouseDown = !0;
  22036. Hot.mobileAutoPlay(this)
  22037. }
  22038. ,
  22039. n.prototype.handelPadding = function(x, y) {
  22040. //去除player左边和上面的宽高,因为pc的player左上有其他element 许钟文
  22041. if (!this.pad)
  22042. this.pad = {//可以直接用$("#player")[0].getBoundingClientRect() , 因为body没有offset
  22043. x: dom.getOffset("left", $("#player")[0]),
  22044. y: dom.getOffset("top", $("#player")[0])
  22045. }
  22046. return {
  22047. x: x - this.pad.x,
  22048. y: y - this.pad.y
  22049. }
  22050. }
  22051. n.prototype.handleInputMove = function(e, t, i) {
  22052. //许钟文加
  22053. var pad = this.handelPadding(e, t);
  22054. e = pad.x;
  22055. t = pad.y;
  22056. this.isTouchEvent = i,
  22057. m.convertScreenPositionToNDC(e, t, this.mouse),
  22058. this.mouseAtMouseDown.distanceTo(this.mouse) > f.input.moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  22059. this.couldBeLongTap = !1,
  22060. clearTimeout(this.mouseDownTimer)),
  22061. this.mouseLastMoveTime = Date.now(),
  22062. this.reticule.move(e, t, i)
  22063. }
  22064. ,
  22065. n.prototype.handleInputEnd = function(e, t, i) {//xzw
  22066. if (this.isTouchEvent = i,
  22067. this.mouseDown = !1,
  22068. this.cameraControls.controls[u.PANORAMA].emit("interaction.direct"),
  22069. !i && this.couldBeLongTap)
  22070. return !0;
  22071. if (this.handleLongTap())
  22072. return !0;
  22073. /* if(this.director.tourIsPlaying){
  22074. return !0;
  22075. } */
  22076. if (this.mouseCouldBeClickToMove) {
  22077. if (this.flying)
  22078. return this.path.activeTransType === x.WALK && this.emit(w.WarpInterruptedWithFlyTo, this.path.activeTransType), //停止导览
  22079. !0;
  22080. //add----
  22081. if(this.checkHotClick())//add
  22082. return !0;
  22083. if(this.hoveringPlane){
  22084. this.clickOverlay(this.hoveringPlane)
  22085. return;
  22086. }
  22087. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, this.isTouchEvent ? "touch" : "mouse"),
  22088. this.history.invalidate(),
  22089. this.intersect)
  22090. return this.flyToPanoClosestToMouse();
  22091. if (this.mode === u.PANORAMA) {
  22092. var n = this.closestPanoInDirection(this.getMouseDirection());
  22093. return n ? this.flyToPano({
  22094. pano: n
  22095. }) : this.bump(this.getMouseDirection())
  22096. }
  22097. }
  22098. //this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode) //xzw 删,否则拖拽后就不高亮了
  22099. }
  22100. ,
  22101. n.prototype.handleLongTap = function() {
  22102. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== u.PANORAMA))
  22103. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.LongTap, "touch"),
  22104. !0
  22105. }
  22106. ,
  22107. n.prototype.checktagClick = function() {
  22108. if (this.tagManager.intersectTag) {
  22109. var e = this.isTouchEvent
  22110. , t = this.tagManager.clickedOnTag(e, this);
  22111. return e || t || y.cancelById(V.LookTransition),
  22112. !0
  22113. }
  22114. if (this.tagManager.activeTag)
  22115. return this.tagManager.dismissActiveTag(),
  22116. !1
  22117. }
  22118. ,
  22119. n.prototype.rankedtagInDirection = function(e, t) {
  22120. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  22121. }
  22122. ,
  22123. n.prototype.start = function(e) {
  22124. //-------------------
  22125. //-------------------
  22126. var t = e.mode
  22127. , i = e.pano
  22128. , n = e.position
  22129. , rr = e.quaternion
  22130. , o = e.tag
  22131. , a = e.quickstart
  22132. , s = $.Deferred();
  22133. this.updateModelDependentData(),
  22134. this.updateFromControls(),
  22135. this.findDefaultViews();
  22136. var l = this.is360View(t, i);
  22137. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, rr, o, s) : this.startOutside(e, s),
  22138. s.done(function(e) {
  22139. this.emit(w.Ready, l, e, o)
  22140. }
  22141. .bind(this)),
  22142. s.promise()
  22143. }
  22144. ,
  22145. n.prototype.startOutside = function(e, t) {
  22146. var i = e.mode
  22147. , n = e.pano
  22148. , r = e.position
  22149. , o = e.quaternion
  22150. , a = e.zoom
  22151. , s = e.floorVisibility
  22152. , l = e.tag;
  22153. this.emit(w.StartOutside, f[i].transitionTime),
  22154. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  22155. y.cancelById(V.FlyToViewFloor),
  22156. i === u.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  22157. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  22158. }
  22159. ,
  22160. n.prototype.startInside = function(e, t, i, n, r) {
  22161. r = r || $.Deferred(),
  22162. this.currentPano = e;
  22163. window.bus.dispatchEvent({type:'playerAndModelReady'})
  22164. this.ready = true
  22165. var o = e && !e.isAligned();
  22166. if (t = o ? e.position : t || e.position,
  22167. i = i || e.quaternion,
  22168. e) {
  22169. var a = this.startInside.bind(this, e, t, i, n, r);
  22170. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  22171. return
  22172. }
  22173. //add
  22174. this.transitionPos({type:"beforeFlytopano", pano:this.currentPano, dur:0})
  22175. //this.updateHotVisible()
  22176. Hot.updateVisibles([this.currentPano])
  22177. this.modeTran = "panorama-panorama"
  22178. return this.mode = u.PANORAMA,
  22179. e.floor.enter(this.mode),
  22180. this.emit(w.PanoChosen, this.currentPano, this.currentPano),
  22181. this.switchCameraMode(this.mode, i),
  22182. this.emit(w.StartInside, o),
  22183. r.resolve(!0),
  22184. r
  22185. }
  22186. ,
  22187. n.prototype.startInsideWithFlyin = function(e, t, i, n, r) {
  22188. if (r = r || $.Deferred(),
  22189. this.dollhouseMode(),
  22190. !e)
  22191. return F.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  22192. r.resolve(!1),
  22193. r;
  22194. t = t || e.position;
  22195. var o = i || this.cameraControls.activeControl.camera.quaternion
  22196. , a = e.position;
  22197. return this.fitDollhouse(a, t, o),
  22198. setTimeout(function(t) {
  22199. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = t);
  22200. var n = {
  22201. mode: u.PANORAMA,
  22202. pano: e,
  22203. quaternion: i,
  22204. callback: function() {
  22205. this.emit(w.FlyinFinished),
  22206. r.resolve(!0)
  22207. }
  22208. .bind(this)
  22209. };
  22210. this.flyToNewMode(n)
  22211. }.bind(this, this.cameraControls.activeControl.maxDistance), f.startupFlyinDelay),
  22212. r
  22213. }
  22214. ,
  22215. n.prototype.checkAndWaitForPanoLoad = function() {
  22216. var e = {}
  22217. , t = {}
  22218. , i = 5e3
  22219. , n = function() {
  22220. for (var n in e)
  22221. if (e.hasOwnProperty(n) && e[n]) {
  22222. var r = performance.now() - t[n];
  22223. if (r < i)
  22224. return !0
  22225. }
  22226. return !1
  22227. };
  22228. return function(r, o, a, s, l, c, h, u, d, p) {
  22229. if (n())
  22230. return !0;
  22231. var f = function(t, i, n) {
  22232. N.delayOneFrame(function() {
  22233. e[t] = !1,
  22234. l && l(i, n)
  22235. }
  22236. .bind(this))
  22237. }
  22238. .bind(this, r.id)
  22239. , g = function(t, i) {
  22240. N.delayOneFrame(function() {
  22241. e[t] = !1,
  22242. c && c(i)
  22243. }
  22244. .bind(this))
  22245. }
  22246. .bind(this, r.id);
  22247. try {
  22248. return null !== u && void 0 !== u || (u = !0),
  22249. 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),
  22250. e[r.id] && (t[r.id] = performance.now()),
  22251. e[r.id]
  22252. } catch (n) {
  22253. throw e[r.id] = !1,
  22254. t[r.id] = performance.now() - i,
  22255. n
  22256. }
  22257. }
  22258. }(),
  22259. n.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  22260. if (!e)
  22261. throw new M("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  22262. return r && this.model.waitForLoad(e, function() {
  22263. return e.isLoaded(i)
  22264. }),
  22265. !e.isLoaded(t) && (e.loadCube(t).done(n),
  22266. !0)
  22267. }
  22268. ,
  22269. n.prototype.checkAndWaitForTiledPanoLoad = function() {
  22270. var e = new r.Vector3;
  22271. return function(t, i, n, r, o, a, s, l) {
  22272. if (!t)
  22273. throw new M("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  22274. return e.copy(d.FORWARD),
  22275. this.getDirection(e),
  22276. !t.isLoaded(i) && (a && this.model.waitForLoad(t, function() {
  22277. return t.isLoaded(i)
  22278. }),
  22279. t.loadTiledPano(i, e, null, s, l).done(function(e, t) {
  22280. n && n(e, t)
  22281. }
  22282. .bind(this)).fail(function(e) {
  22283. r && r(e)
  22284. }
  22285. .bind(this)).progress(function(e, t, i) {
  22286. o && o(e, t, i)
  22287. }
  22288. .bind(this)),
  22289. !0)
  22290. }
  22291. }(),
  22292. n.prototype.switchCameraMode = function(e, t) {
  22293. var i = this.cameraControls.controls[e]
  22294. , n = i.camera;
  22295. switch (e) {
  22296. case u.PANORAMA:
  22297. n.position.copy(this.currentPano.position);
  22298. var o = t ? d.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  22299. i.lookAt(o.add(n.position));
  22300. break;
  22301. case u.DOLLHOUSE:
  22302. /* var a = this.position.clone();
  22303. 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),
  22304. n.position.copy(a),
  22305. i.target.copy(this.target.clone().setY(this.model.center.y));
  22306. break; */
  22307. //for多楼层 且 让模型刚好适应屏幕
  22308. var box = this.model.boundingBox.clone();
  22309. box.applyMatrix4(this.camera.matrixWorld);//将 boundingbox、也就是模型, 转换到当前相机朝向
  22310. var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  22311. var fov = B.getHFOVFromVFOV(f.insideFOV, n.aspect, 1); //获得在当前窗口的横向的fov
  22312. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2))//根据上面获得的参数得到target到相机的距离
  22313. //console.log(boxSize.x,distance, boxSize.length() / 2)
  22314. distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  22315. if(this.mode === u.PANORAMA){
  22316. i.target.copy(this.model.center);
  22317. var vec = this.getDirection().negate().setY(1).normalize()//获得朝向
  22318. }else{
  22319. i.target.copy(this.target.clone().setY(this.model.center.y))
  22320. var vec = d.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
  22321. }
  22322. vec.multiplyScalar(distance )
  22323. n.position.copy(i.target.clone().add(vec))
  22324. break
  22325. case u.FLOORPLAN:
  22326. n.position.copy(this.model.center).setY(f.floorplan.cameraHeight),
  22327. i.target.copy(this.model.center).setY(0),
  22328. i.zoomToContain(this.model.size),
  22329. i.rotateToView(this.model.size, this.getDirection())
  22330. }
  22331. i.update(0)
  22332. }
  22333. ,
  22334. n.prototype.update = function() {
  22335. var e = (new r.Vector3,
  22336. {})
  22337. , t = [];
  22338. return function(i) {
  22339. this.updatePersistentZooming(i),
  22340. this.updateFromControls(i),
  22341. this.getCurrentNodePanos(t)
  22342. this.lastFrameChanged = false
  22343. if(this.hasChanged(e) ) {
  22344. this.lastFrameChanged = e.cameraChanged3 ? 'level3' : e.cameraChanged2 ? 'level2' : e.cameraChanged ? 'level1' : false
  22345. this.lastChangeTime = Date.now(),
  22346. !this.mouseDown && this.containsMouse && this.updateIntersect(),
  22347. this.emit(w.ViewChanged, e),
  22348. // 注意: player.cameraControls.activeControl.camera 的 matrix是错的
  22349. this.intersect && this.magnifier && this.magnifier.update(this.intersect.point)
  22350. }
  22351. if(e.cameraChanged2){ //变化要更大些
  22352. }
  22353. if(e.cameraChanged){
  22354. this.mode == "panorama" && window.cad && cad.setSign({ x: this.position.x, y: this.position.z }, this.cameraControls.controls.panorama.lon);
  22355. /* for(var i in this.model.hots){
  22356. this.model.hots[i].updateTitle(this)
  22357. } */
  22358. Hot.updateHots()
  22359. }
  22360. this.model.supportsTiles && (this.updateTileDownloader(t),
  22361. this.updatePanoRenderer(t)),
  22362. this.updatePreRendering(t),
  22363. this.reticule.update(),
  22364. this.path.update(),
  22365. this.spider.update(),
  22366. this.cachedPanoCandidates && f.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  22367. this.updateControlLocks(),
  22368. this.model.supportsTiles && this.updateZoomPano()
  22369. }
  22370. }(),
  22371. /* n.prototype.controlVideosPlay = function() {//判断box视频是否可见 不可见就暂停
  22372. var lastMode, lastPano;
  22373. return function(){
  22374. var mode = this.mode;
  22375. var pano = mode == "panorama" ? this.currentPano : "";
  22376. if(mode != "panorama" || pano != lastPano){
  22377. overlay.noBlock = null
  22378. }
  22379. this.overlayGroup.children.forEach((overlay)=>{
  22380. if(overlay.overlayType == "video" ){
  22381. var matrix = overlay.plane.matrixWorld;
  22382. var inSight = false;
  22383. var cameraDir = this.getDirection();
  22384. var planeDir = (new r.Vector3).copy(d.FORWARD).applyQuaternion(overlay.plane.quaternion)
  22385. var vertexes = []
  22386. if(cameraDir.angleTo(planeDir)>Math.PI/2){//朝向相机视线
  22387. for(let i=0; i<4; i++){
  22388. var vertex = overlay.plane.geometry.vertices[i].clone().applyMatrix4(matrix)
  22389. vertexes.push(vertex)
  22390. if(overlay.noBlock == null){
  22391. if(!m.ifShelter(vertex)){
  22392. overlay.noBlock = true
  22393. }
  22394. inSight = true; break;
  22395. }else{
  22396. overlay.noBlock = true
  22397. }
  22398. if(m.getPos2d(vertex, this.camera, $("#player")[0]).inSight){
  22399. inSight = true; break;
  22400. }
  22401. }
  22402. }
  22403. overlay.inSight = inSight
  22404. if(!inSight)overlay.plane.material.map.image.pause()
  22405. else overlay.plane.material.map.image.play()//maybe fail
  22406. }
  22407. })
  22408. lastMode = mode, lastPano = pano
  22409. }
  22410. }() */
  22411. n.prototype.updatePersistentZooming = function(e) {
  22412. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : this.zooming === -1 && this.zoomBy(1 - this.zoomSpeed * e)
  22413. }
  22414. ,
  22415. n.prototype.updateControlLocks = function() {
  22416. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[u.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  22417. }
  22418. ,
  22419. n.prototype.updatePanoRenderer = function() {
  22420. var e = new r.Vector3;
  22421. return function(t) {
  22422. var i = this.nextPano || this.currentPano;
  22423. this.panoRenderer.hasQueuedTiles() && i && (e.copy(d.FORWARD),
  22424. this.getDirection(e),
  22425. this.panoRenderer.updateDirection(e))
  22426. }
  22427. }(),
  22428. n.prototype.cleanupInactivePanos = function() {
  22429. var e = []
  22430. , t = [];
  22431. return function() {
  22432. e.length = 0,
  22433. e.push(this.currentPano),
  22434. this.nextPano && e.push(this.nextPano),
  22435. t.length = 0;
  22436. for (var i = 0; i < this.panoRenderer.activePanos.length; i++)
  22437. t.push(this.panoRenderer.activePanos[i]);
  22438. for (var n = 0; n < t.length; n++) {
  22439. for (var r = t[n], o = !0, a = 0; a < e.length; a++)
  22440. r.id === e[a].id && (o = !1);
  22441. o && r.exit()
  22442. }
  22443. }
  22444. }(),
  22445. n.prototype.updatePreRendering = function() {
  22446. var e = {};
  22447. return function(t) {
  22448. if (1 === f.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  22449. var i = this.nextPano || this.currentPano;
  22450. if (i && t && t.length > 1) {
  22451. var n = t.findIndex(function(e) {
  22452. if (e.id === i.id)
  22453. return !0
  22454. });
  22455. if (n >= 0 && n + 1 < t.length) {
  22456. var r = t[n + 1];
  22457. r.isLoaded(this.basePanoSize) || e[r.id] || (window.setTimeout(function(t) {
  22458. this.checkAndWaitForPanoLoad(t, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  22459. window.setTimeout(function(t) {
  22460. e[t.id] = !1
  22461. }
  22462. .bind(this, t), f.tiling.panoPreRenderRepeatDelay)
  22463. }
  22464. .bind(this, r), f.tiling.panoPreRenderDelay),
  22465. e[r.id] = !0)
  22466. }
  22467. }
  22468. }
  22469. }
  22470. }(),
  22471. n.prototype.enablePreRendering = function() {
  22472. this.preRenderingEnabled = !0
  22473. }
  22474. ,
  22475. n.prototype.disablePreRendering = function() {
  22476. this.preRenderingEnabled = !1,
  22477. this.cleanupInactivePanos()
  22478. }
  22479. ,
  22480. n.prototype.updateTileDownloader = function() {
  22481. var e = new r.Vector3;
  22482. return function(t) {
  22483. var i = this.nextPano || this.currentPano;
  22484. i && (e.copy(d.FORWARD),
  22485. this.getDirection(e),
  22486. this.tileDownloader.tilePrioritizer.updateCriteria(i, this.position, e, t.length > 0 ? t : null),
  22487. this.tileDownloader.processPriorityQueue = !0)
  22488. }
  22489. }(),
  22490. n.prototype.updateFromControls = function(e) {
  22491. null !== e && void 0 !== e || (e = 0),
  22492. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  22493. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  22494. this.position.copy(this.cameraControls.activeControl.camera.position),
  22495. this.target.copy(this.cameraControls.activeControl.target),
  22496. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  22497. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  22498. this.camera.position.copy(this.position),
  22499. this.camera.quaternion.copy(this.quaternion),
  22500. this.camera.updateMatrix(),
  22501. this.camera.updateMatrixWorld()
  22502. }
  22503. ,
  22504. n.prototype.hasChanged = function(e) {
  22505. if (!this.previousState)
  22506. {
  22507. this.previousState = {
  22508. allFloorsVisible: this.model.allFloorsVisible,
  22509. position: this.position.clone(),
  22510. quaternion: this.quaternion.clone(),
  22511. mouse: this.mouse.clone(),
  22512. //labelScaleFactor: this.getLabelScaleFactor(),
  22513. currentFloor: this.model.currentFloor,
  22514. projectionMatrix: this.camera.projectionMatrix.clone(),
  22515. worldMatrix: this.camera.matrixWorld.clone(),
  22516. mode: this.mode,
  22517. modelPosition: this.model.position.clone(),
  22518. modelCenter: this.model.center.clone(),
  22519. zoomLevel: this.zoomLevel
  22520. };
  22521. e.cameraChanged = e.cameraChanged2 = true;
  22522. return !0;
  22523. }
  22524. //许钟文改 分成相机是否改变cameraChanged 和其他
  22525. 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)
  22526. 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 ;
  22527. e.cameraChanged = !a;
  22528. e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  22529. e.moved = !this.position.equals(this.previousState.position),
  22530. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  22531. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  22532. // e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  22533. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  22534. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  22535. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  22536. e.modeChanged = this.mode !== this.previousState.mode,
  22537. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  22538. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  22539. e.nextPanoActive = null !== this.nextPano,
  22540. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel
  22541. /* if(e.cameraChanged){//
  22542. 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)
  22543. }else e.cameraChanged2 = false */
  22544. if(e.cameraChanged){
  22545. e.cameraChanged2 = e.cameraProjectionChanged || !MathLight.closeTo(this.quaternion, this.previousState.quaternion, 5) || !MathLight.closeTo(this.position, this.previousState.position, 4)
  22546. e.cameraChanged3 = e.cameraProjectionChanged || !MathLight.closeTo(this.quaternion, this.previousState.quaternion, 3) || !MathLight.closeTo(this.position, this.previousState.position, 3)
  22547. } else {
  22548. e.cameraChanged2 = false
  22549. e.cameraChanged3 = false
  22550. }
  22551. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  22552. this.previousState.position.copy(this.position),
  22553. this.previousState.quaternion.copy(this.quaternion),
  22554. this.previousState.mouse.copy(this.mouse),
  22555. //this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  22556. this.previousState.currentFloor = this.model.currentFloor,
  22557. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  22558. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  22559. this.previousState.mode = this.mode,
  22560. this.previousState.modelPosition.copy(this.model.position),
  22561. this.previousState.modelCenter.copy(this.model.center),
  22562. this.previousState.zoomLevel = this.zoomLevel;
  22563. //console.log("cameraChanged2 "+ e.cameraChanged2 + ", mouseMoved "+e.mouseMoved)
  22564. return !t
  22565. }
  22566. ,
  22567. n.prototype.updateIntersect = function() {
  22568. var e = this.flying || this.isWarping()
  22569. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  22570. , i = y.getById(V.LookTransition)
  22571. , n = !(e || t || this.isTouchEvent || i.length && i[0].running);
  22572. {//clear:
  22573. if(this.intersectHot) this.intersectHot.setHoverState(false)
  22574. this.intersectHot = null
  22575. CursorDeal.remove('hoverHot')
  22576. }
  22577. var deal = ()=>{
  22578. if(this.intersect && this.intersect.object.visible ){
  22579. if("hotSprite" == this.intersect.object.type){
  22580. this.intersectHot = this.intersect.object
  22581. while(!(this.intersectHot instanceof Hot)){
  22582. this.intersectHot = this.intersectHot.parent
  22583. }
  22584. $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass("active")
  22585. this.intersectHot.setHoverState(true)
  22586. }
  22587. }
  22588. }
  22589. if(this.model.hotGroup){
  22590. var hots = this.model.hotGroup.children.filter(e=> e.info.actionType.examine || e.info.actionType.fastTran || e.info.actionType.openHot || e.info.actionType.playAndPause)
  22591. let colliders = this.model.floors.reduce(function(e, t) {
  22592. return t.hidden ? e : e.concat(t.collider.children)
  22593. }, this.mode === 'panorama' ? this.panoMarkers : [])
  22594. this.intersect = this.getMouseIntersect(null, hots.concat(colliders/* this.model.colliders */));
  22595. if(this.intersect){
  22596. deal()
  22597. let intersect = this.intersect
  22598. if(this.intersectHot){
  22599. this.intersect = null
  22600. CursorDeal.add('hoverHot')
  22601. }else{
  22602. if(intersect.object.parent.parent.hidden ){//楼层已隐藏
  22603. this.intersect = null
  22604. }
  22605. }
  22606. }
  22607. }else{
  22608. this.intersect = this.getMouseIntersect()
  22609. }
  22610. this.intersect && this.updateClosestPano(this.intersect),
  22611. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  22612. f.navigation.panoScores && !f.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  22613. }
  22614. ,
  22615. n.prototype.checkHotClick = function() {
  22616. if(this.intersectHot){
  22617. if(this.intersectHot.texType == "video" && this.intersectHot.info.actionType.playAndPause){
  22618. this.intersectHot.switchPlay(!!this.intersectHot.pausedByUser)
  22619. }
  22620. this.intersectHot.examine(this)
  22621. return true;
  22622. }
  22623. },
  22624. n.prototype.getMouseDirection = function(e) {
  22625. e = e || this.mouse;
  22626. var t = new r.Vector3(e.x,e.y,-1).unproject(this.camera)
  22627. , i = new r.Vector3(e.x,e.y,1).unproject(this.camera);
  22628. return i.sub(t).normalize()
  22629. }
  22630. ,
  22631. n.prototype.hoverOverlay = function(mesh){
  22632. if(!mesh){
  22633. this.hoveringPlane = null;
  22634. $("#player").css("cursor",this.currentCursor || "" );
  22635. }else{
  22636. var overlay = mesh.parent;
  22637. $("#player").css("cursor","pointer");
  22638. this.hoveringPlane = overlay;
  22639. return true;
  22640. }
  22641. },
  22642. n.prototype.clickOverlay = function(overlay){
  22643. if(this.openOverlay && !overlay)return;
  22644. var plane = overlay.plane;
  22645. /* if(overlay.overlayType == "video"){
  22646. if(plane.material.map.image.paused) plane.material.map.image.play()
  22647. else plane.material.map.image.pause()
  22648. } */
  22649. if(overlay.overlayType == "video"){
  22650. overlay.switchPlay(!!overlay.pausedByUser)
  22651. }
  22652. /* if(window.EditOverlay &&EditOverlay.editing){
  22653. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane) EditOverlay.closeOverlayPanel('cancel')
  22654. $('#overlayProp').removeClass('atRight').removeClass('hide')
  22655. EditOverlay.endAddPlane();
  22656. EditOverlay.updateOverlayPanel(overlay)
  22657. EditOverlay.controlSelectOverlay(overlay)
  22658. return;
  22659. } */
  22660. },
  22661. n.prototype.getMouseIntersect = function(e, t) {//xzw change
  22662. e = e || this.mouse.clone(),
  22663. t = t || this.model.floors.reduce(function(e, t) {
  22664. return t.hidden ? e : e.concat(t.collider.children)
  22665. }, this.mode === u.PANORAMA ? this.panoMarkers : []);
  22666. var i = new r.Vector3(e.x,e.y,-1).unproject(this.camera);
  22667. this.raycaster.set(i, this.getMouseDirection(e));
  22668. var n = this.raycaster.intersectObjects(t, true);//add true
  22669. var o = n[0];
  22670. if(o){
  22671. o.face && (o.normal = o.face.normal.applyQuaternion(o.object.quaternion),
  22672. this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
  22673. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  22674. o.horizontal = .8 < o.normal.y);
  22675. return o
  22676. }
  22677. }
  22678. ,
  22679. n.prototype.updateClosestPano = function(e) {
  22680. var t = [s.filters.isPanoAligned()];
  22681. if (this.mode === u.PANORAMA) {
  22682. if (!this.currentPano)
  22683. return;
  22684. t.push(s.filters.not(this.currentPano)),
  22685. t.push(s.filters.isNeighbourPanoTo(this.currentPano)),
  22686. t.push(s.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  22687. t.push(s.filters.isCloseEnoughTo(e.point, f.panoFloorClickRadius)),
  22688. t.push(s.filters.isNotBehindNormal(e.point, e.normal))
  22689. } else{
  22690. t.push(s.filters.isOnVisibleFloor()),
  22691. t.push(this.checkHasNeighbor)//add
  22692. this.mode !== u.FLOORPLAN && t.push(s.filters.inDirection(this.position, this.getDirection(), .25));
  22693. }
  22694. var i = this.model.panos.find(t, [s.sortFunctions.floorDistanceToPoint(e.point)]);
  22695. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  22696. this.emit(w.ClosestPanoChanging, this.closestPano, i, this.mode),
  22697. this.closestPano = i,
  22698. this.closestPano && this.mode == 'panorama' ? CursorDeal.add('hoverPano' ) : CursorDeal.remove('hoverPano' ) //add
  22699. ) : this.isPanoHover = !1
  22700. }
  22701. ,
  22702. n.prototype.dollhouseMode = function(e, t) {
  22703. this.emit(w.ModeChanging, this.mode, u.DOLLHOUSE),
  22704. this.mode = u.DOLLHOUSE,
  22705. this.cameraControls.controls[u.DOLLHOUSE].reset();
  22706. var i = new r.Vector3(this.model.center.x,0,this.model.center.z)
  22707. , n = new r.Vector3(15,10,15);
  22708. if (e && t) {
  22709. var o = d.FORWARD.clone().applyQuaternion(t)
  22710. , a = this.model.center.clone().sub(e)
  22711. , s = a.dot(o);
  22712. s > 0 ? (i = o.clone().multiplyScalar(s).add(e),
  22713. n.copy(e)) : F.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  22714. }
  22715. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(0, !0),
  22716. this.cameraControls.controls[u.DOLLHOUSE].target.copy(i),
  22717. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(n),
  22718. this.updateFromControls(),
  22719. this.model.alpha = 1,
  22720. this.model.skybox.material.uniforms.opacity.value = 0
  22721. }
  22722. ,
  22723. n.prototype.insideMode = function(e, t) {
  22724. var i = $.Deferred()
  22725. , n = t || null;
  22726. if (this.mode !== u.PANORAMA && this.mode !== u.TRANSITIONING) {
  22727. var r = [s.filters.isPanoAligned()];
  22728. this.model.currentFloor && r.push(s.filters.atFloor(this.model.currentFloor)),
  22729. e = e || this.currentPano || this.model.panos.find(r, [s.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  22730. this.flyToNewMode({
  22731. mode: u.PANORAMA,
  22732. pano: e,
  22733. callback: n
  22734. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  22735. } else {
  22736. var o = this.mode === u.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  22737. i.reject(o)
  22738. }
  22739. return i.promise()
  22740. }
  22741. ,
  22742. n.prototype.fitDollhouse = function(e, t, i) {//许钟文改 飞入前寻找和初始视角最合适的位置
  22743. //if(urlHasValue('oldEntry')){
  22744. //搬自一代。
  22745. var maxY = this.model.boundingBox.max.y;
  22746. var n = d.FORWARD.clone().applyQuaternion(i)
  22747. , i = n.clone().add(e);
  22748. this.cameraControls.activeControl.target.copy(i),
  22749. this.cameraControls.activeControl.camera.position.set(0, maxY * 2.4, 0).add(e).add(n.multiplyScalar(-10))
  22750. //return;
  22751. /* //this.camera.position.copy(this.model.center);
  22752. //this.camera.updateMatrixWorld()
  22753. this.switchCameraMode("dollhouse", i) */
  22754. //}//下面是二代代码,看不太懂。因为有的场景在靠近一端的某个方向截取的初始视角会甩镜头,也就是不是下去之后的方向
  22755. //直接用一代的这个 效果和二代几乎一样,且不会甩
  22756. /* var n = d.FORWARD.clone().applyQuaternion(i);
  22757. this.cameraControls.activeControl.target.copy(n).add(e);
  22758. var o = d.RIGHT.clone().applyQuaternion(i)
  22759. , a = d.UP.clone()
  22760. , s = o.clone().applyAxisAngle(a, Math.PI / 2)
  22761. , l = this.model.boundingBox.max.clone()
  22762. , c = this.model.boundingBox.min.clone()
  22763. , 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)]
  22764. , u = 0
  22765. , p = 0
  22766. , g = 0;
  22767. h.forEach(function(e, t, i) {
  22768. var n = Math.abs(e.dot(o))
  22769. , r = e.dot(s);
  22770. n > u && (u = n,
  22771. p = r),
  22772. r > g && (g = r)
  22773. });
  22774. 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)))
  22775. , v = s.clone().multiplyScalar(p).add(t)
  22776. , A = s.clone().multiplyScalar(g).add(t);
  22777. p = u / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * this.cameraControls.activeControl.camera.aspect * (Math.PI / 180));
  22778. g = m / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * (Math.PI / 180));
  22779. p = Math.max(p, 10),
  22780. g = Math.max(g, 10);
  22781. var y = n.clone().multiplyScalar(-p).add(v).sub(t).length()
  22782. , C = n.clone().multiplyScalar(-g).add(v).sub(t).length();
  22783. this.cameraControls.activeControl.maxDistance = f.skyboxRadius - 1;
  22784. y >= C ? this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(v).add(n.multiplyScalar(1.1 * -p))
  22785. : this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(A).add(n.multiplyScalar(1.1 * -g))
  22786. */
  22787. }
  22788. ,
  22789. n.prototype.floorplanMode = function(e, t, i) {
  22790. this.mode = u.FLOORPLAN;
  22791. var n = this.cameraControls.controls[u.FLOORPLAN];
  22792. n.reset();
  22793. var r = e ? e : this.model.center;
  22794. if (n.target.copy(r).setY(0),
  22795. n.camera.position.copy(r).setY(f.floorplan.cameraHeight),
  22796. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  22797. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  22798. t) {
  22799. var o = d.LEFT.clone().applyQuaternion(t);
  22800. n.rotateLeft(-Math.atan2(o.x, o.z))
  22801. } else
  22802. n.rotateToView(this.model.size, this.getDirection());
  22803. n.update(0)
  22804. }
  22805. ,
  22806. n.prototype.nonInterruptingFlyToPano = function(e, t) {
  22807. return e.skipWarpingCheck = !0,
  22808. this.flyToPano(e, t)
  22809. }
  22810. ,
  22811. n.prototype.updateMarkerVisi = function() {//加
  22812. if(this.mode != "panorama")return;
  22813. this.model.panos.list.forEach((pano)=>{
  22814. if(!pano.marker)return;
  22815. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id];
  22816. })
  22817. }
  22818. ,
  22819. /* n.prototype.updateHotVisible = function(pano){
  22820. var hots = this.model.hots;
  22821. pano = pano || this.currentPano;
  22822. for (var index in hots){
  22823. var visible;
  22824. if(this.mode != "panorama"){
  22825. visible = true;
  22826. }else{
  22827. //hots[index].mesh.material.depthTest = false;
  22828. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  22829. }
  22830. hots[index].mesh.visible = visible;
  22831. }
  22832. } */
  22833. n.prototype.flyToPano = function(e, t) {
  22834. var i = e.pano
  22835. , aim = e.lookAtPoint
  22836. , aimQua = e.quaternion //ADD
  22837. , o = e.duration
  22838. , a = e.aimDuration
  22839. , s = e.maxDistanceOverride
  22840. , l = e.skipWarpingCheck
  22841. , c = e.constantMoveSpeed
  22842. , h = null
  22843. , p = null
  22844. if (aim){
  22845. var _ = (new r.Matrix4).lookAt(i.position, aim, d.UP)
  22846. aimQua = (new r.Quaternion).setFromRotationMatrix(_)
  22847. }
  22848. else aimQua = aimQua
  22849. var zoomLevel = e.zoomLevel || 1 //add
  22850. if(this.flying) return t && t(e)
  22851. window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(i);
  22852. if (this.isWarping() && !l && (this.path.activeTransType === x.BLACK || this.path.activeTransType === x.STD))
  22853. return F.warn("Player.flyToPano() -> Cannot fly when warping"),
  22854. t && t(),
  22855. !1;
  22856. if (this.updateLastView(),
  22857. this.mode !== u.PANORAMA) {
  22858. var m;
  22859. return void this.flyToNewMode({
  22860. mode: u.PANORAMA,
  22861. pano: i,
  22862. duration: o,
  22863. quaternion: aimQua ,
  22864. callback: t
  22865. })
  22866. }
  22867. if (!i || (h = g.deepExtend(e),
  22868. p = function() {
  22869. N.delayOneFrame(function() {
  22870. this.flyToPano(h, t)
  22871. }
  22872. .bind(this))
  22873. }
  22874. .bind(this),
  22875. !this.checkAndWaitForPanoLoad(i, "high", "low", this.basePanoSize, p))) {
  22876. var C = function(e) {
  22877. t && t(e)
  22878. }
  22879. .bind(this);
  22880. this.currentPano || (this.currentPano = i,
  22881. this.path.placeCpm(),
  22882. this.path.fadeOutCpm(f.path.fadeOutTime),
  22883. this.spider.draw());
  22884. var I = o;
  22885. if ("number" != typeof o) {
  22886. var E = s || f.transition.flytimeMaxDistanceThreshold;
  22887. I = Math.min(this.currentPano.position.distanceTo(i.position), E) * f.transition.flytimeDistanceMultiplier + f.transition.flyTime
  22888. }
  22889. if (f.transition.flySpeed > .01 && (I = 1e3 * this.currentPano.position.distanceTo(i.position) / f.transition.flySpeed),
  22890. zoomLevel !== this.zoomLevel)
  22891. switch (f.zoom.transitionStyle) {
  22892. case 1:
  22893. this.smoothZoomFovTo(null, zoomLevel, zoomLevel == 1 ? I / 2 : I); //改
  22894. break;
  22895. case 2:
  22896. return h = g.deepExtend(e),
  22897. p = this.flyToPano.bind(this, h, t),
  22898. void this.smoothZoomFovTo(null, zoomLevel, f.zoom.restoreTime * (this.zoomLevel - 1), p)
  22899. }
  22900. if (aimQua) {
  22901. y.cancelById(V.LookTransition),
  22902. I *= f.transition.aimSlowFactor;
  22903. var b = this.cameraControls.activeControl.camera.quaternion.clone()
  22904. , S = b.clone()
  22905. , M = new r.Vector3;
  22906. if (i === this.currentPano) {
  22907. var R = d.FORWARD.clone().applyQuaternion(b)
  22908. , P = d.FORWARD.clone().applyQuaternion(aimQua)
  22909. , O = R.angleTo(P);
  22910. return void 0 !== a && null !== a || (a = 1 * Math.sqrt(O) / f.tags.navigate.rotateSpeedFactor * 1e3),
  22911. void y.start(function(e) {
  22912. S.copy(b),
  22913. v.quaternion(S, aimQua)(e),
  22914. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  22915. this.cameraControls.activeControl.lookAt(M)
  22916. }
  22917. .bind(this), a, C, 0, A[f.transition.movementEasing], null, V.LookTransition)
  22918. }
  22919. }
  22920. if (i === this.currentPano )
  22921. return void C();
  22922. this.flying = !0;
  22923. var L = this.position.clone()
  22924. , D = this.currentPano;
  22925. F.debug("Flying to pano ", i.position),
  22926. this.emit(w.PanoChosen, this.currentPano, i),
  22927. this.emit(w.FlyingStarted, i.position, L, i, D)
  22928. //---------before fly--------------- add
  22929. this.transitionPos({type:"beforeFlytopano", pano:i, dur:I})//add
  22930. Hot.updateVisibles([this.currentPano, i],'every')
  22931. //地标变化
  22932. if(this.model.floorLogos){
  22933. this.model.changefloorLogoOpa({index:0, opa:0, dur: p, delay:0.7})//this.model.floorLogoFade(0, _duration*0.5, 0.7);
  22934. this.model.floorLogos[1].position.copy(i.floorPosition.clone().sub(this.model.position));
  22935. //this.model.adjustfloorLogoHeight();
  22936. this.model.floorLogos[1].material.opacity = 0;//uniforms.opacity.value = 0;
  22937. this.model.floorLogos[1].visible = true;
  22938. this.model.changefloorLogoOpa({index:1, opa:1, dur: 250})//this.model.floorLogoShow(1,250);
  22939. }
  22940. //=======================================
  22941. this.nextPano = i
  22942. let beginTran = ()=>{
  22943. aimQua && y.start(function(e) {
  22944. S.copy(b),
  22945. v.quaternion(S, aimQua)(e),
  22946. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  22947. this.cameraControls.activeControl.lookAt(M)
  22948. }
  22949. .bind(this), I, null, 0, A[f.transition.movementEasing], null, V.LookTransition);
  22950. var B = c ? null : A[f.transition.movementEasing];
  22951. y.start(v.uniform(this.model.skybox, "progress", 1), I, null, 0, A[f.transition.blendEasing], "skyFly", V.FlyToPano),
  22952. y.start(v.allUniforms(this.model.chunks, "progress", 1), I, null, 0, A[f.transition.blendEasing], "chunkFly", V.FlyToPano),
  22953. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, i.position), I, function(e) {
  22954. this.flying = !1,
  22955. this.currentPano !== i && this.currentPano.exit(),
  22956. i.enter(),
  22957. this.currentPano = i,
  22958. this.nextPano = null,
  22959. this.path.placeCpm(),
  22960. this.path.fadeOutCpm(f.path.fadeOutTime),
  22961. this.spider.draw(),
  22962. this.emit(w.FlyingEnded, i.position, L, i, D),
  22963. this.updateMarkerVisi(),//add
  22964. C(e)
  22965. //add:
  22966. if(this.mode == "panorama" ){
  22967. if(this.model.floorLogos){
  22968. this.model.floorLogos[0].position.copy(this.model.floorLogos[1].position)
  22969. //this.model.adjustfloorLogoHeight()
  22970. this.model.changefloorLogoOpa({index:0,opa:1,dur:0});//this.model.floorLogos[0].material.uniforms.opacity.value = 1;
  22971. this.model.floorLogos[1].visible = false;
  22972. }
  22973. this.model.fadePanoMarkers()//add
  22974. Hot.updateVisibles([this.currentPano])//add
  22975. }
  22976. }
  22977. .bind(this), 0, B, "camFly", V.FlyToPano)
  22978. }
  22979. if(!this.model.supportsTiles && i.getSkyboxTexture().image[0].width > 1024 /* || this.qualityManager.getMaxZoomClass() == '4k' */){
  22980. setTimeout(()=>{
  22981. beginTran()
  22982. }, 50) //2048的非tile需要延迟到下一帧,因为需要时间载入贴图,否则掉帧
  22983. }else{
  22984. beginTran()
  22985. }
  22986. }
  22987. }
  22988. ,
  22989. n.prototype.warpToPano = function(o={}) {
  22990. }
  22991. n.prototype.blackToPano = function(o={}) {//add 瞬间过渡
  22992. //o.panoId = "8bc9156b288d48459e4e0f74d7051ef1"
  22993. if(this.flying || this.isWarping() )return;
  22994. let pano = o.pano || this.model.panos.index[o.panoId]
  22995. if (this.mode !== u.PANORAMA) {
  22996. var m;
  22997. void this.flyToNewMode({
  22998. mode: u.PANORAMA,
  22999. pano ,
  23000. duration: o.duration,
  23001. quaternion: o.quaternion ,
  23002. //callback: t
  23003. })
  23004. }
  23005. let oldPos = this.position.clone();
  23006. let oldPano = this.currentPano
  23007. this.path.warpDestPano = pano
  23008. var retry = ()=>{
  23009. this.waitingToWarp = !1,
  23010. this.blackToPano(o)
  23011. }
  23012. if (this.checkAndWaitForPanoLoad(pano, "high", "low", this.basePanoSize, retry))
  23013. return void (this.waitingToWarp = !0)
  23014. this.emit("pano.chosen", oldPano, pano)
  23015. this.flying = true
  23016. this.nextPano = pano //提前加载高清图片
  23017. this.path.warpDestHeroLoc = {
  23018. panoId : o.panoId,
  23019. position: pano.position,
  23020. quaternion: o.quaternion || this.quaternion.clone()
  23021. }
  23022. this.path.warpTravel_BLACK(null, 1500,1, ()=>{
  23023. pano != this.currentPano && this.currentPano.exit()
  23024. pano.enter()
  23025. this.currentPano = pano
  23026. this.emit("flying.ended", pano.position, oldPos, pano, oldPano)
  23027. this.flying = false
  23028. this.nextPano = null
  23029. this.updateMarkerVisi();//add
  23030. } )
  23031. }
  23032. window._transitionPosId = 9999
  23033. n.prototype.transitionPos = function(o={}) {//渐变overlay和热点的位置
  23034. y.cancelById(_transitionPosId)
  23035. var begin = function(object, pos, qua, scale){
  23036. if(pos){
  23037. if(!same(object.position, pos, 0.01)){
  23038. y.start(v.vector(object.position, pos), o.dur, (e)=>{
  23039. object.updateScale()
  23040. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  23041. }
  23042. if(qua && !same(object.quaternion, qua, 1e-6)){
  23043. y.start(v.quaternion(object.quaternion, qua), o.dur, (e)=>{
  23044. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  23045. }
  23046. if(scale && !same(object.scale, scale, 0.001)){
  23047. y.start(v.vector(object.scale, scale), o.dur, (e)=>{
  23048. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  23049. }
  23050. }
  23051. }
  23052. var same = function(vec1, vec2, diff){
  23053. var s = Math.abs(vec1.x-vec2.x) < diff && Math.abs(vec1.y-vec2.y) < diff && Math.abs(vec1.z-vec2.z) < diff
  23054. if(s && vec1.w) s = Math.abs(vec1.w-vec2.w) < diff
  23055. return s
  23056. }
  23057. var sid = o.pano != void 0 ? o.pano.id : "outside";
  23058. for(let i in this.model.hots){//是否判断visible?
  23059. var hot = this.model.hots[i];
  23060. var panoData = hot.info.transformAtPanos[sid];
  23061. var useCustom = !panoData
  23062. //if(hot.usingTransformData || !useCustom){
  23063. var pos = useCustom ? hot.info.position : panoData.pos;
  23064. var qua = hot.isSprite ? null : (useCustom ? hot.info.quaternion : panoData.qua);
  23065. var scale = useCustom ? hot.info.scale : panoData.scale;
  23066. begin(hot, pos , qua, scale )
  23067. //}
  23068. //hot.usingTransformData = !useCustom;
  23069. }
  23070. if(o.callback){
  23071. setTimeout(()=>{
  23072. o.callback()
  23073. },o.dur + 16) ;//姑且这么写
  23074. }
  23075. }
  23076. window._tranOutsideFocus = 4399
  23077. n.prototype.focusPoint = function(o={}){//当在外时,聚焦相机到这一点
  23078. console.log("focusPoint")
  23079. if(this.mode == "floorplan"){
  23080. var modelSize = o.modelSize || new THREE.Vector3(8,8,8);//可视范围
  23081. var control = this.cameraControls.controls.floorplan;
  23082. var absoluteScale = control.getDefaultAbsoluteScale(modelSize)
  23083. var currentScale = control.absoluteScale;
  23084. var currentTarget = control.target.clone()
  23085. y.cancelById(window._tranOutsideFocus, true);
  23086. y.start(function(progress){
  23087. control.absoluteScale = absoluteScale*progress + currentScale*(1-progress);
  23088. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  23089. control.camera.position.copy(control.target.clone().add(control.offset)) //维持角度
  23090. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, A[f.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  23091. }else if(player.mode == "dollhouse"){
  23092. var control = player.cameraControls.controls.dollhouse;
  23093. var radius = o.radius || 8;
  23094. var currentTarget = control.target.clone()
  23095. var dir = control.offset.clone().normalize()
  23096. var currentRadius = control.offset.length();
  23097. y.cancelById(window._tranOutsideFocus, true);
  23098. y.start(function(progress){
  23099. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  23100. let radius_ = radius*progress+currentRadius*(1-progress)
  23101. control.camera.position.copy(control.target.clone().add(dir.clone().multiplyScalar(radius_)))
  23102. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, A[f.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  23103. }else if(this.mode == 'panorama'){
  23104. this.flyToPano({
  23105. lookAtPoint: o.aim.clone() ,
  23106. pano: this.currentPano,
  23107. aimDuration: o.dur || 600
  23108. })
  23109. }
  23110. }
  23111. /*
  23112. 切换到某个模式后再执行函数
  23113. */
  23114. n.prototype.FlyToMode = function(mode, f1, duration){
  23115. var f2;
  23116. if (this.mode == mode) {
  23117. f1 && f1()
  23118. } else {
  23119. f2 = f1;
  23120. if (this.mode == "transitioning" && this.modeTran.split('-')[1] != mode) {//正飞向其他模式,就要先飞完再飞进来然后执行
  23121. this.afterCModeFuc = function() {
  23122. /* objects.gui.modeChange[mode](null, {
  23123. fuc: f2 这个写法会使得先添加的回调fuc取代之后添加的afterCModeFuc,所以统一改为afterCModeFuc
  23124. }); */
  23125. this.afterCModeFuc = f2
  23126. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano,
  23127. //callback : f2
  23128. });
  23129. //这个fuc在trainsitioning状态下传入是无效的,所以后面得用afterCModeFuc。但是执行完afterCModeFuc,afterCModeFuc会变为null,所以里面得用fuc。。orz
  23130. }.bind(this)
  23131. } else {
  23132. if(this.afterCModeFuc)console.log("已经有afterCModeFuc了!!!!!!!!!!!!!!!")
  23133. this.afterCModeFuc = f2;//飞入后执行
  23134. try{ //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  23135. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano, duration:duration});
  23136. }catch(e){
  23137. console.log('FlyToMode遇到问题?')
  23138. }
  23139. }
  23140. }
  23141. }
  23142. n.prototype.fastForwardActivePanoFlight = function(e) {
  23143. e = e || f.transition.fastForwardFactor / 10 * 4 + 1
  23144. y.adjustSpeed(V.FlyToPano, e)
  23145. y.adjustSpeed(V.LookTransition, e)
  23146. }
  23147. ,
  23148. n.prototype.flyToPanoClosestToMouse = function() {
  23149. if (Date.now() - this.mouseLastMoveTime > 50 && (this.intersect = this.getMouseIntersect(),
  23150. this.intersect && this.updateClosestPano(this.intersect)),
  23151. this.closestPano)
  23152. return this.flyToPano({
  23153. pano: this.closestPano
  23154. });
  23155. var e = this.getMouseDirection();
  23156. this.flyDirection(e) || this.flyToPano({
  23157. pano: this.currentPano
  23158. })
  23159. }
  23160. ,
  23161. n.prototype.flyLocalDirection = function(e) {
  23162. var t = this.getDirection(e)
  23163. , i = 1 === e.z ? .4 : .75
  23164. , n = 1 === Math.abs(e.x);
  23165. return this.flyDirection(t, i, n)
  23166. }
  23167. ,
  23168. n.prototype.flyDirection = function(e, t, i) {
  23169. Hot.closePopup();//xzw add
  23170. var n = $.Deferred();
  23171. this.history.invalidate();
  23172. var r = this.closestPanoInDirection(e, t, i);
  23173. return r ? this.flyToPano({
  23174. pano: r
  23175. }, n.resolve.bind(n, !0)) : (this.bump(e),
  23176. n.resolve(!1)),
  23177. n.promise()
  23178. }
  23179. ,
  23180. n.prototype.closestPanoInDirection = function(e, t, i) {
  23181. return this.rankedPanoInDirection(0, e, t, i)
  23182. }
  23183. ,
  23184. n.prototype.rankedPanoInDirection = function() {
  23185. var e = {
  23186. pano: null,
  23187. candidates: []
  23188. };
  23189. return function(t, i, n, r) {
  23190. t || (t = 0),
  23191. n = void 0 !== n ? n : .75;
  23192. var o = r ? "angle" : "direction";
  23193. return this.model.panos.findRankedByScore(t,
  23194. [s.filters.isPanoAligned(),
  23195. s.filters.not(this.currentPano),
  23196. s.filters.isNeighbourPanoTo(this.currentPano),
  23197. s.filters.inPanoDirection(this.position, i, n)],
  23198. [s.scoreFunctions.distanceSquared(this.currentPano),
  23199. s.scoreFunctions[o](this.position, i)], e),
  23200. this.cachedPanoCandidates = e.candidates,
  23201. e.pano
  23202. }
  23203. }(),
  23204. n.prototype.bump = function(e) {
  23205. if (this.mode === u.PANORAMA && !this.flying && !this.isWarping()) {
  23206. 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;
  23207. if (s)
  23208. t = function() {
  23209. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", a > 0 ? 1.04 : .96), o, i, 0, A.easeInOutSine, "bumpZStart")
  23210. }
  23211. .bind(this),
  23212. i = function() {
  23213. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", 1), 5 * o, n, 0, A.easeInOutSine, "bumpZRelax")
  23214. }
  23215. .bind(this);
  23216. else {
  23217. var l = this.camera.position.clone()
  23218. , c = e.clone();
  23219. this.raycaster.set(l, c);
  23220. var h = this.model.floors.reduce(function(e, t) {
  23221. return e.concat(t.collider.children)
  23222. }, [])
  23223. , d = this.raycaster.intersectObjects(h)
  23224. , p = d.length > 0 ? d[0].distance / 25 : .04
  23225. , g = l.clone().add(c.multiplyScalar(p));
  23226. t = function() {
  23227. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, g), o, i, 0, A.easeInOutSine, "bumpTStart")
  23228. }
  23229. .bind(this),
  23230. i = function() {
  23231. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, l), 5 * o, n, 0, A.easeInOutSine, "bumpTRelax")
  23232. }
  23233. .bind(this)
  23234. }
  23235. n = function() {
  23236. this.flying = !1
  23237. }
  23238. .bind(this),
  23239. this.flying = !0,
  23240. t()
  23241. }
  23242. }
  23243. ,
  23244. n.prototype.changeFloor = function(e) {
  23245. if (!this.is360View(this.mode, this.currentPano))
  23246. if (this.mode === u.PANORAMA) {
  23247. var t = this.history.reversePano(e);
  23248. t && t.isAligned() ? this.flyToPano({
  23249. pano: t
  23250. }) : this.changeFloorByScore(e)
  23251. } else
  23252. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  23253. }
  23254. ,
  23255. n.prototype.changeFloorByScore = function() {
  23256. var e = {
  23257. pano: null,
  23258. candidates: []
  23259. };
  23260. return function(t) {
  23261. var i = this.model.nextFloor(t);
  23262. 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),
  23263. void (e.pano ? (this.cachedPanoCandidates = e.candidates,
  23264. this.history.push(t, this.currentPano),
  23265. this.flyToPano({
  23266. pano: e.pano
  23267. })) : F.warn("No pano found on selected floor, not moving there."))) : void F.debug("player.changeFloor(" + t + "): no such floor")
  23268. }
  23269. }(),
  23270. n.prototype.gotoFloor = function(e) {
  23271. var t = e - this.model.currentFloor.floorIndex;
  23272. this.changeFloor(t)
  23273. }
  23274. ,
  23275. n.prototype.getDirection = function(e) {
  23276. return e = e ? e : (new r.Vector3).copy(d.FORWARD),
  23277. e.applyQuaternion(this.camera.quaternion)
  23278. }
  23279. ,
  23280. n.prototype.flyToSameMode = function(e, t, i, n, o) {
  23281. if (o = o || $.Deferred(),
  23282. this.mode === u.TRANSITIONING)
  23283. return F.warn("should not be transitioning here"),
  23284. n && n(!1),
  23285. o.reject().promise();
  23286. var a = i || !1
  23287. , s = i ? i.position : this.position
  23288. , l = this.position.clone()
  23289. , c = this.currentPano;
  23290. if (F.debug("New pose in mode " + this.mode),
  23291. !e || (retryCallback = function() {
  23292. N.delayOneFrame(function() {
  23293. this.flyToSameMode(e, t, i, n, o)
  23294. }
  23295. .bind(this))
  23296. }
  23297. .bind(this),
  23298. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  23299. var h = function() {
  23300. this.emit(w.FlyingEnded, s, l, e, c),
  23301. n && n(!0)
  23302. }
  23303. .bind(this)
  23304. , d = f[this.mode]
  23305. , p = void 0 !== t ? t : d.transitionTime
  23306. , g = new r.Vector3
  23307. , C = new r.Vector3;
  23308. if (this.emit(w.FlyingStarted, s, l, e, c),
  23309. this.mode === u.PANORAMA)
  23310. F.warn("we should not be here for panorama views");
  23311. else if (this.mode === u.DOLLHOUSE)
  23312. if (a) {
  23313. var I = new r.Vector3(0,1,0);
  23314. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  23315. this.model.warpDestFloors(i.floorVisibility),
  23316. C.copy(i.position);
  23317. var E = new r.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  23318. , b = new r.Raycaster(C.clone(),E.clone(),0,1 / 0)
  23319. , _ = b.intersectObjects(this.model.colliders)
  23320. , T = 3;
  23321. _.length ? (g.copy(_[0].point),
  23322. T = .75 * C.distanceTo(g)) : (g.copy(E).multiplyScalar(3).add(C),
  23323. F.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  23324. var x = (new r.Matrix4).lookAt(C, g, I)
  23325. , S = (new r.Euler).setFromRotationMatrix(x, f.warp.eOrder)
  23326. , M = g.distanceTo(C)
  23327. , R = (new r.Matrix4).lookAt(this.cameraControls.cameras[u.DOLLHOUSE].position, this.cameraControls.controls[u.DOLLHOUSE].target, I)
  23328. , P = (new r.Euler).setFromRotationMatrix(R, f.warp.eOrder)
  23329. , O = this.cameraControls.cameras[u.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[u.DOLLHOUSE].target);
  23330. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(Math.min(O, T), !0);
  23331. var L = new r.Euler(S.x - P.x,S.y - P.y,S.z - P.z,f.warp.eOrder);
  23332. L.y = L.y > Math.PI ? L.y -= 2 * Math.PI : L.y < -Math.PI ? L.y += 2 * Math.PI : L.y,
  23333. this.path.burnsDir = Math.sign(L.y);
  23334. var D = new r.Euler(0,0,0,f.warp.eOrder)
  23335. , B = new r.Vector3;
  23336. y.start(v.vector(this.cameraControls.controls[u.DOLLHOUSE].target, g), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  23337. y.start(function(e, t) {
  23338. D.x = P.x + e * L.x,
  23339. D.y = P.y + e * L.y,
  23340. D.z = P.z + e * L.z;
  23341. var i = O + e * (M - O);
  23342. B.set(0, 0, i).applyEuler(D).add(this.cameraControls.controls[u.DOLLHOUSE].target),
  23343. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(B).add(this.model.position)
  23344. }
  23345. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  23346. y.start(function(e, t) {
  23347. this.cameraControls.controls[u.DOLLHOUSE].update(),
  23348. this.quaternion.copy(this.cameraControls.cameras[u.DOLLHOUSE].quaternion),
  23349. this.position.copy(this.cameraControls.cameras[u.DOLLHOUSE].position)
  23350. }
  23351. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  23352. } else
  23353. F.warn("invalid warp destination in flyToSameMode()? ignore it then");
  23354. else if (this.path.placeCpm(),
  23355. this.path.fadeInCpm(f.path.fadeInTime),
  23356. i) {
  23357. this.model.warpDestFloors(i.floorVisibility);
  23358. var U = this.cameraControls.cameras[u.FLOORPLAN]
  23359. , k = this.cameraControls.controls[u.FLOORPLAN]
  23360. , H = k.target.clone()
  23361. , G = i.position.clone().sub(H)
  23362. , z = U.position.clone().sub(k.target)
  23363. , W = z.length()
  23364. , j = new r.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  23365. , Y = Math.atan2(k.offset.x, k.offset.z)
  23366. , X = Math.atan2(j.x, j.z)
  23367. , Z = k.absoluteScale
  23368. , q = m.convertWorkshopOrthoZoom(i.orthoZoom);
  23369. y.start(function(e, t) {
  23370. k.target.copy(G).multiplyScalar(e).add(H);
  23371. var i = Y + (X - Y) * e;
  23372. k.offset.x = W * Math.sin(i),
  23373. k.offset.z = W * Math.cos(i),
  23374. U.position.copy(k.target).add(k.offset),
  23375. k.absoluteScale = Z + e * (q - Z),
  23376. k.update(),
  23377. this.quaternion.copy(U.quaternion),
  23378. this.position.copy(U.position),
  23379. this.target.copy(k.target),
  23380. this.camera.projectionMatrix.copy(U.projectionMatrix)
  23381. }
  23382. .bind(this), p, null, 0, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  23383. } else
  23384. F.info("flyToSameMode() funny floorplan view? skipping");
  23385. return y.setTimeout(function(e) {
  23386. this.mode = e,
  23387. h(),
  23388. o.resolve(!0)
  23389. }
  23390. .bind(this, this.mode), p, V.FlyToSameMode),
  23391. this.mode = u.TRANSITIONING,
  23392. o.promise()
  23393. }
  23394. }
  23395. ,
  23396. n.prototype.flyToNewMode = function(e, t) {
  23397. Hot.closePopup();//xzw add
  23398. e = e || {};
  23399. var i = e.mode
  23400. , n = e.pano
  23401. , o = e.duration
  23402. , a = e.warpDest
  23403. , s = e.callback
  23404. , l = e.force
  23405. , c = e.quaternion;
  23406. if (t = t || $.Deferred(),
  23407. this.isWarping())
  23408. return F.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  23409. s && s(!1),
  23410. t.reject("Cannot change mode during tour transition").promise();
  23411. if (this.mode === u.TRANSITIONING)
  23412. return s && s(!1),
  23413. t.reject("Cannot change mode during mode transition").promise();
  23414. if (i === this.mode)
  23415. return l ? (this.flyToSameMode(n, o, a, s).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  23416. t.promise()) : (s && s(!1),
  23417. t.reject("Already in " + i + " mode").promise());
  23418. var h = a || !1;
  23419. F.debug("Switching mode to " + i);
  23420. if (window.vrEnabled && i != 'panorama'){
  23421. return s && s(!1), t.reject("vr不允许飞出").promise();
  23422. }
  23423. var d = function() {
  23424. N.delayOneFrame(function() {
  23425. this.flyToNewMode(e, t)
  23426. }
  23427. .bind(this))
  23428. }
  23429. .bind(this);
  23430. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, d))
  23431. return t.promise();
  23432. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  23433. return F.info("Waiting for model textures to be loaded before going out to dollhouse"),
  23434. this.model.waitForLoad(this.model, function() {
  23435. return this.model.meshTexturesLoaded;
  23436. }
  23437. .bind(this)),
  23438. this.model.loadMeshTextures().done(d),
  23439. t.promise();
  23440. this.history.invalidate(),
  23441. this.updateLastView();
  23442. var p = this.mode
  23443. , C = this.cameraControls.cameras[i];
  23444. e = g.deepExtend({}, f[i], f[p + "-" + i]);
  23445. var I = void 0 !== o ? o : e.transitionTime;
  23446. this.emit(w.ModeChanging, p, i, n, I),
  23447. n && (this.currentPano = n),
  23448. this.switchCameraMode(i, c),
  23449. y.cancelById(V.LookTransition);
  23450. //before fly---------------------
  23451. this.modeTran = p + "-" + i; //add
  23452. if(this.mode == "panorama"){
  23453. if(this.model.floorLogos){
  23454. this.model.floorLogos[0].visible = false;
  23455. this.model.floorLogos[1].visible = false;
  23456. }
  23457. }
  23458. if(i == "panorama"){
  23459. this.transitionPos({type:"beforeFlyIn", pano:n, dur:I})//add
  23460. }else{
  23461. this.transitionPos({type:"beforeFlyOut", dur:I/2})//add
  23462. }
  23463. window.bus.dispatchEvent({type:'playerAndModelReady'})
  23464. this.ready = true
  23465. //------------------------------------
  23466. var beginTran = ()=>{
  23467. var _ = (new r.Vector3).copy(this.position);
  23468. if (i === u.PANORAMA){
  23469. this.emit(w.PanoChosen, n, n),
  23470. setTimeout(function() {
  23471. n.floor.enter(i)
  23472. }
  23473. .bind(this), I / 2),
  23474. this.path.fadeOutCpm(f.path.fadeOutTime);
  23475. if(this.model.floorLogos){
  23476. this.model.floorLogos[0].position.copy(n.floorPosition.clone().sub(this.model.position));//改
  23477. this.model.floorLogos[1].position.copy(this.model.floorLogos[0].position);//for floorIcon position
  23478. }
  23479. }else if (i === u.DOLLHOUSE) {
  23480. if (h && (this.model.stayPut = !0),
  23481. a ? (this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  23482. this.model.warpDestFloors(a.floorVisibility)) : this.model.toggleAllFloors(!0),
  23483. this.path.placeCpm(),
  23484. this.path.fadeInCpm(f.path.fadeInTime),
  23485. h) {
  23486. var T = new r.Vector3(this.model.center.x,0,this.model.center.z);
  23487. _.set(15, 10, 15);
  23488. var M = new r.Vector3(0,0,-1).applyQuaternion(a.quaternion)
  23489. , R = new r.Raycaster(a.position.clone(),M.clone(),0,1 / 0)
  23490. , P = R.intersectObjects([this.sceneIntersectionPlane]);
  23491. P.length ? (T.copy(P[0].point),
  23492. _.copy(a.position),
  23493. 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),
  23494. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(3, !0)),
  23495. this.cameraControls.controls[u.DOLLHOUSE].target.copy(T),
  23496. _.add(this.model.position),
  23497. C.position.copy(_),
  23498. this.cameraControls.controls[u.DOLLHOUSE].update()
  23499. }
  23500. } else if (this.path.placeCpm(),
  23501. this.path.fadeInCpm(f.path.fadeInTime),
  23502. a) {
  23503. this.model.warpDestFloors(a.floorVisibility);
  23504. var O = this.cameraControls.cameras[u.FLOORPLAN]
  23505. , L = this.cameraControls.controls[u.FLOORPLAN]
  23506. , D = O.position.clone().sub(L.target)
  23507. , B = new r.Vector3(-1,0,0).applyQuaternion(a.quaternion).normalize()
  23508. , U = Math.atan2(B.x, B.z);
  23509. L.target.copy(a.position);
  23510. var k = D.length();
  23511. L.offset.x = k * Math.sin(U),
  23512. L.offset.y = 0,
  23513. L.offset.z = k * Math.cos(U),
  23514. O.position.copy(L.target).add(L.offset);
  23515. L.target.clone().sub(C.position);
  23516. C.quaternion.copy(a.quaternion),
  23517. L.currentScale = m.convertWorkshopOrthoZoom(a.orthoZoom),
  23518. L.absoluteScale = L.currentScale,
  23519. L.update()
  23520. } else
  23521. this.model.currentFloor.enter(i);
  23522. var H = this.currentPano
  23523. , G = this.position.clone();
  23524. this.emit(w.FlyingStarted, _, G, n, this.currentPano),
  23525. this.flying = !0,
  23526. this.isOutsideMode(i) && this.is360View(p, H) ? (h || i !== u.DOLLHOUSE || (C.position.set(15, 10, 15),
  23527. C.controls.target.set(this.model.center.x, 0, this.model.center.z),
  23528. C.controls.update()),
  23529. e.blackoutStyle = S.FADEIN,
  23530. I = f.show360Views.transitionTime,
  23531. this.fade360View(I, C, e)) : this.isOutsideMode(p) && this.is360View(i, n) ? (h && this.switchCameraMode(i, h.quaternion),
  23532. this.mode = i,
  23533. this.path && this.path.popOutCpm(),
  23534. e.blackoutStyle = S.END,
  23535. I = f.show360Views.transitionTime,
  23536. this.fade360View(I, C, e)) : (y.start(v.property(this.model, "alpha", e.modelAlpha, null), I * e.modelAlphaLength, null, e.modelAlphaDelay, null, V.FlyToNewMode),
  23537. y.start(v.vector(this.position, C.position), I, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToNewMode),
  23538. y.start(v.quaternion(this.quaternion, C.quaternion), I * e.rotationDuration, null, e.rotationDelay, A[f.flydown.rotationEasing], null, V.FlyToNewMode),
  23539. y.start(v.matrix4(this.camera.projectionMatrix, C.projectionMatrix), I * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, V.FlyToNewMode),
  23540. y.start(v.uniform(this.model.skybox, "opacity", e.skyboxOpacity), I * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, V.FlyToNewMode),
  23541. y.start(v.property(this.reticule.material.uniforms.opacity, "value", 0), I, null, V.FlyToNewMode)),
  23542. y.setTimeout(function() {
  23543. this.flying = !1,
  23544. p === u.PANORAMA && i !== u.PANORAMA ? this.currentPano.exit() : p !== u.PANORAMA && i === u.PANORAMA && (this.currentPano !== H && H.exit(),
  23545. this.currentPano.enter(),
  23546. this.path.placeCpm(),
  23547. this.path.fadeOutCpm(f.path.fadeOutTime),
  23548. this.spider.draw()),
  23549. p === u.DOLLHOUSE && this.cameraControls.controls[u.DOLLHOUSE].resetRanges(),
  23550. this.mode = i,
  23551. this.emit(w.FlyingEnded, _, G, this.currentPano, H)
  23552. //add:
  23553. this.updateMarkerVisi() ;
  23554. //(this.mode == u.PANORAMA) && this.updateHotVisible(),
  23555. this.mode == u.PANORAMA&&this.model.floorLogos&&(
  23556. this.model.changefloorLogoOpa({index:0, from:0, opa:1, dur: 150 }),//this.model.floorLogoShow(0,150);
  23557. this.model.floorLogos[0].visible = true
  23558. )
  23559. if (this.afterCModeFuc) {
  23560. //手动加的函数
  23561. var cf = this.afterCModeFuc;
  23562. this.afterCModeFuc = null;//因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  23563. cf();
  23564. }
  23565. if(this.mode == u.PANORAMA){
  23566. Hot.updateVisibles([this.currentPano])
  23567. this.model.fadePanoMarkers()
  23568. }else{
  23569. Hot.updateVisibles(true)
  23570. this.model.hotGroup.children.forEach(overlay=>{
  23571. if(overlay.animateInfo){
  23572. GifTexDeal.start(overlay.animation)
  23573. }
  23574. })
  23575. }
  23576. h && p !== u.PANORAMA && i === u.PANORAMA ? this.startWarp(b.Retain, E.Retain, x.BLACK, null, null, s) : (s && s(),
  23577. t.resolve())
  23578. }
  23579. .bind(this), I, V.FlyToNewMode)
  23580. }
  23581. if( i == "panorama" && !this.model.supportsTiles && n.getSkyboxTexture().image[0].width > 1024){
  23582. setTimeout(()=>{
  23583. beginTran()
  23584. },16) //2048的非tile需要延迟到下一帧,因为需要时间载入贴图,否则掉帧
  23585. }else{
  23586. beginTran()
  23587. }
  23588. this.mode = u.TRANSITIONING
  23589. //p == "panorama" && this.updateHotVisible(),
  23590. return t.promise()
  23591. }
  23592. ,
  23593. n.prototype.fade360View = function(e, t, i) {
  23594. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  23595. $(this.domElement).fadeOut(.5 * e, function() {
  23596. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  23597. this.model.alpha = i.modelAlpha,
  23598. this.position.copy(t.position),
  23599. this.quaternion.copy(t.quaternion),
  23600. this.camera.projectionMatrix.copy(t.projectionMatrix),
  23601. $(this.domElement).fadeIn(.5 * e)
  23602. }
  23603. .bind(this))
  23604. }
  23605. ,
  23606. n.prototype.findDefaultViews = function() {
  23607. this.findDefaultView(this.lastInsideView, !0),
  23608. this.findDefaultView(this.last360View, !1)
  23609. }
  23610. ,
  23611. n.prototype.findDefaultView = function(e, t) {
  23612. var i, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  23613. if (e.cameraMode !== u.PANORAMA)
  23614. return !1;
  23615. var i = r.get(e.panoId);
  23616. return i && i.isAligned() === t
  23617. });
  23618. o >= 0 ? (i = r.get(n[o].panoId),
  23619. e.update({
  23620. cameraMode: u.PANORAMA,
  23621. pano: i,
  23622. position: n[o].position,
  23623. quaternion: n[o].quaternion
  23624. })) : (o = r.list.findIndex(function(e) {
  23625. return e.isAligned() === t
  23626. }),
  23627. o >= 0 ? (i = r.list[o],
  23628. e.update({
  23629. cameraMode: u.PANORAMA,
  23630. pano: i,
  23631. position: i.position
  23632. })) : F.warn("There are no", t ? "inside" : "360º", "views in this model"))
  23633. }
  23634. ,
  23635. n.prototype.updateLastView = function() {
  23636. if (this.mode === u.PANORAMA) {
  23637. var e = this.currentPano.isAligned() ? this.lastInsideView : this.last360View;
  23638. e.update({
  23639. pano: this.currentPano,
  23640. position: this.position,
  23641. quaternion: this.quaternion
  23642. })
  23643. }
  23644. }
  23645. ,
  23646. n.prototype.goToLastView = function(e, t) {
  23647. var i = $.Deferred()
  23648. , n = i.resolve.bind(i)
  23649. , r = i.reject.bind(i)
  23650. , o = e ? this.lastInsideView : this.last360View;
  23651. return this.isInMode(u.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  23652. this.isInMode(u.PANORAMA) ? (this.path && this.path.popOutCpm(),
  23653. this.fadeToView(e, o, f.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  23654. mode: o.cameraMode,
  23655. pano: o.pano,
  23656. quaternion: o.quaternion,
  23657. callback: t
  23658. }).done(n).fail(r),
  23659. i.promise()
  23660. }
  23661. ,
  23662. n.prototype.fadeToView = function(e, t, i, n) {
  23663. var r = $.Deferred()
  23664. , o = r.resolve.bind(r)
  23665. , a = r.reject.bind(r);
  23666. if (!t.isValid() || t.cameraMode === u.PANORAMA && !t.pano)
  23667. return F.warn("Tried to fade to an illegal view", t.cameraMode),
  23668. a("Cannot go to illegal view"),
  23669. r.promise();
  23670. var s = (f[t.cameraMode],
  23671. function() {
  23672. $(this.domElement).fadeIn(.5 * i),
  23673. n && n(),
  23674. o()
  23675. }
  23676. .bind(this))
  23677. , l = e ? S.FADEIN : S.END;
  23678. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  23679. $(this.domElement).fadeOut(.5 * i, function() {
  23680. this.model.fadePanoMarkers(e ? f.panorama.markerOpacity : 0),
  23681. t.cameraMode === u.PANORAMA ? this.flyToPano({
  23682. pano: t.pano,
  23683. lookAtPoint: d.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  23684. duration: 0
  23685. }, s) : this.flyToNewMode({
  23686. mode: t.cameraMode,
  23687. quaternion: t.quaternion,
  23688. duration: 0,
  23689. callback: s
  23690. })
  23691. }
  23692. .bind(this)),
  23693. r.promise()
  23694. }
  23695. ,
  23696. n.prototype.startWarp = function(e, t, i, n, r, o) {
  23697. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  23698. this.flying)
  23699. return F.warn("Player.startWarp() -> Cannot warp when flying"),
  23700. o && o(),
  23701. !1;
  23702. null !== e && void 0 !== e || (e = b.Show),
  23703. this.history.invalidate()
  23704. e !== b.Retain ? this.path.brushToWarpPano(i, x.BLACK) || (i = x.BLACK) : i = this.path.upcomingTransType;
  23705. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  23706. return this.emit(w.WarpStarted, a, i, n, r),
  23707. n = n || S.MIDDLE,
  23708. this.path.warpToPano(i, n, r, function() {
  23709. t === E.Slow ? this.path.discardSlow() : t === E.Standard && this.path.discardPathObject(),
  23710. this.emit(w.WarpEnded, i),
  23711. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  23712. o && o()
  23713. }
  23714. .bind(this)),
  23715. e === b.Hide && this.path.discardPathObject(),
  23716. !0
  23717. }
  23718. ,
  23719. n.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  23720. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (F.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  23721. s && s(),
  23722. !1)
  23723. }
  23724. ,
  23725. n.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  23726. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (F.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  23727. a && a(),
  23728. !1)
  23729. }
  23730. ,
  23731. n.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  23732. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  23733. }
  23734. ,
  23735. n.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  23736. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  23737. !0) : (F.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  23738. t && t(),
  23739. !1)
  23740. }
  23741. ,
  23742. n.prototype.aimTourCamera = function(e, t, i, n) {
  23743. return F.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  23744. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  23745. }
  23746. ,
  23747. n.prototype.showPathToHeroLocation = function(e) {
  23748. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(x.STD, x.BLACK)
  23749. }
  23750. ,
  23751. n.prototype.tourInterlude = function(e, t) {
  23752. this.history.invalidate();
  23753. this.path.discardSlow();
  23754. //xzw:
  23755. var defaultRotTime = DATA.tourRotTime * 1000
  23756. var timeEachItem = 2e3 / (DATA.tourWalkSpeed + DATA.tourBlackSpeed) * 200 //预估时间假设每个item飞的时间(如果距离远就少了)
  23757. var currentLocation = this.model.getHeroDescriptorByIndex(this.director.currentItem)
  23758. var currentLocation0 = this.model.heroLocations[this.director.currentItem[0]]
  23759. //zeg 标注一下
  23760. //var currentLocation = this.model.heroLocations[this.director.currentItem[0]]
  23761. var rotTime
  23762. if(currentLocation.rotTime == void 0 || currentLocation.rotTime == ''){
  23763. var restChildCount = currentLocation0.heroLocations ? (currentLocation0.heroLocations.length-this.director.currentItem[1]-1) : 0
  23764. var hasMusic = currentLocation0 && currentLocation0.musicInfo.music
  23765. if(hasMusic){
  23766. var audioObj = SoundManager.list.find(e=>e.name == 'tour')
  23767. var current = audioObj.audio.currentTime * 1e3 // || 0 //g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  23768. rotTime = currentLocation0.musicInfo.time - current
  23769. if(restChildCount){//如果当前folder中还有剩下的item,平分一下时间
  23770. rotTime = (rotTime-timeEachItem*restChildCount) / (restChildCount+1);
  23771. }
  23772. }else{
  23773. rotTime = defaultRotTime
  23774. }
  23775. rotTime = Math.max(0, rotTime)
  23776. Log("rotTime "+rotTime +" at item "+this.director.currentItem + (hasMusic ? (",musicCurrentTime:"+current+'音乐总长:'+currentLocation0.musicInfo.time) : ''),"#E8E")
  23777. }else{
  23778. rotTime = currentLocation.rotTime * 1000
  23779. Log("rotTime "+rotTime +" at item "+this.director.currentItem,"#E8E")
  23780. }
  23781. this.path.waitNextStep(e, function() {
  23782. t && t()
  23783. }.bind(this), rotTime)
  23784. }
  23785. ,
  23786. n.prototype.stopInterlude = function() {
  23787. this.interruptAndFastForward(null, 0)
  23788. }
  23789. ,
  23790. n.prototype.interruptAndFastForward = function(e, t) {
  23791. //Log('interruptAndFastForward' , '#f00')
  23792. this.isWarping() && this.emit(w.WarpInterrupted, this.path.activeTransType, e, t),
  23793. this.flying && this.emit(w.FlyingInterrupted),
  23794. this.path.interruptAndFastForward(e, t)
  23795. }
  23796. ,
  23797. n.prototype.setSize = function(e, t) {
  23798. var i = e / t;
  23799. this.baseFov = B.clampVFOV(f.insideFOV, f.insideFOVMax, e, t);
  23800. var n = B.getHFOVFromVFOV(f.insideFOV, e, t);
  23801. n > f.insideFOVMax ? this.baseFov = B.getVFOVFromHFOV(f.insideFOVMax, e, t) : this.baseFov = f.insideFOV;
  23802. for (var r in this.cameraControls.cameras) {
  23803. var o = this.cameraControls.cameras[r];
  23804. o.fov = this.baseFov * (1 / this.zoomLevel),
  23805. o.updateAspect(i)
  23806. }
  23807. }
  23808. ,
  23809. n.prototype.toJSON = function() {
  23810. var e = {};
  23811. return this.cameraControls.activeControl ? (e = this.cameraControls.activeControl.toJSON(),
  23812. e.camera_mode = u.toInt(this.mode),
  23813. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  23814. return e.hidden ? 0 : 1
  23815. }) : u.PANORAMA && (e.scan_id = this.currentPano.id),
  23816. e) : e
  23817. }
  23818. ,
  23819. n.prototype.getCurrentNodePanos = function(e) {
  23820. this.model.panos.map;
  23821. if (e.length = 0, this.path.nodes){
  23822. var momentTour = this.director.getMomentTour(this.director.destinationItem)
  23823. if(momentTour == 'black'){ //改 upcomingPanos如果是black的只需要起点和终点
  23824. if(this.path.nodes.length){
  23825. e.push(this.model.panos.get(this.path.nodes[0]))
  23826. }
  23827. if(this.path.nodes.length>1){
  23828. e.push(this.model.panos.get(this.path.nodes[this.path.nodes.length-1]))
  23829. }
  23830. }else{
  23831. for (var t = 0; t < this.path.nodes.length; t++) {
  23832. var i = this.path.nodes[t];
  23833. e.push(this.model.panos.get(i))
  23834. }
  23835. }
  23836. }
  23837. }
  23838. ,
  23839. n.prototype.zoomIncrementally = function(e) {
  23840. var t = this.zoomLevel;
  23841. this.zoomTo(this.zoomLevel + e),
  23842. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  23843. }
  23844. ,
  23845. n.prototype.zoomInIncrementally = function(e) {
  23846. e = e || this.defaultZoomIncrement,
  23847. this.zoomIncrementally(e)
  23848. }
  23849. ,
  23850. n.prototype.zoomOutIncrementally = function(e) {
  23851. e = e || -this.defaultZoomIncrement,
  23852. this.zoomIncrementally(e)
  23853. }
  23854. ,
  23855. n.prototype.zoomBy = function(e) {
  23856. this.zoomTo(this.zoomLevel * e)
  23857. }
  23858. ,
  23859. n.prototype.zoomIn = function() {
  23860. this.zoomBy(1 + this.zoomSpeed)
  23861. }
  23862. ,
  23863. n.prototype.zoomOut = function() {
  23864. this.zoomBy(1 - this.zoomSpeed)
  23865. }
  23866. ,
  23867. n.prototype.zoomTo = function(e, t) {
  23868. if (t || f.zoom.enabled && this.mode === u.PANORAMA && this.zoomEnabled) {
  23869. if (e < f.zoom.min && (e = f.zoom.min),
  23870. e > f.zoom.max && (e = f.zoom.max),
  23871. e > this.zoomLevel ? (this.emit(O.ZoomIn),
  23872. e === f.zoom.max && this.emit(O.ZoomMax)) : e < this.zoomLevel && (this.emit(O.ZoomOut),
  23873. e === f.zoom.min && this.emit(O.ZoomMin)),
  23874. this.cameraControls.activeControl) {
  23875. var i = this.cameraControls.activeControl.camera;
  23876. this.zoomLevel = e,
  23877. i.fov = this.baseFov * (1 / this.zoomLevel),
  23878. i.updateProjectionMatrix(),
  23879. this.zoomFov = i.fov
  23880. }
  23881. }
  23882. }
  23883. ,
  23884. n.prototype.increaseZoomSpeed = function() {
  23885. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  23886. }
  23887. ,
  23888. n.prototype.decreaseZoomSpeed = function() {
  23889. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  23890. }
  23891. ,
  23892. n.prototype.clampZoomSpeed = function(e) {
  23893. return e < 0 ? 0 : e
  23894. }
  23895. ,
  23896. n.prototype.activatePersistentZooming = function(e) {
  23897. this.zooming = e ? 1 : -1
  23898. }
  23899. ,
  23900. n.prototype.deactivatePersistentZooming = function() {
  23901. this.zooming = 0
  23902. }
  23903. ,
  23904. n.prototype.zoomDefault = function() {
  23905. this.zoomTo(1, !0)
  23906. }
  23907. ,
  23908. window.fovTranId = 333;//add
  23909. n.prototype.smoothZoomToDefault = function(e, t) {
  23910. y.cancelById(window.fovTranId)
  23911. var i, n = this.zoomLevel,
  23912. r = function(e) {
  23913. e > 1 && (e = 1),
  23914. i = n * (1 - e) + e,
  23915. this.zoomTo(i, !0)
  23916. }.bind(this),
  23917. o = function() {
  23918. this.zoomDefault(),
  23919. t && window.setTimeout(t, 50)
  23920. }.bind(this);
  23921. y.start(r, e, o, null, 0, A[f.transition.blendEasing], null, window.fovTranId)
  23922. }
  23923. n.prototype.smoothZoomFovTo = function (fov, zoomLevel, dur, callback) {//add
  23924. y.cancelById(window.fovTranId)
  23925. console.log("smoothZoomFovTo "+zoomLevel)
  23926. var i,
  23927. n = this.zoomLevel,
  23928. aimLevel = zoomLevel || this.baseFov / fov
  23929. if (n == aimLevel) return
  23930. var fun = function (e) {
  23931. e > 1 && (e = 1), (i = n * (1 - e) + e * aimLevel),
  23932. this.zoomTo(i, !0)
  23933. }.bind(this)
  23934. y.start(fun, dur, callback, null, 0, A[f.transition.blendEasing], null, window.fovTranId)
  23935. }
  23936. n.prototype.updateZoomPano = function() {
  23937. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === u.PANORAMA && this.currentPano) {
  23938. let navTileClass = this.qualityManager.getNavZoomClass()
  23939. let tileClass = this.qualityManager.getMaxZoomClass()
  23940. if(navTileClass == '4k'){
  23941. var r = true
  23942. }else{
  23943. var levelThreshold1 = navTileClass == '1k' ? 1.1 : 1.5 , levelThreshold2 = 1.8 //levelThreshold2不能比zoom.max大也就是不能超过2,否则zoom.max将无法提升到3
  23944. var t = this.zoomLevel > levelThreshold1
  23945. , i = this.flying && this.nextPano && this.nextPano !== this.currentPano
  23946. , n = !i && !this.isWarping()
  23947. , r = t //&& n ; // 允许flying状态下加载4K图
  23948. }
  23949. this.tileDownloader.tilePrioritizer.setZoomingActive(r),
  23950. this.panoRenderer.setZoomingActive(r, this.currentPano, !0);
  23951. var o = function(pano, ifZoom) {
  23952. this.panoRenderer.resetRenderStatus(pano.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  23953. this.panoRenderer.clearAllQueuedUploadsForPano(pano.id),
  23954. this.panoRenderer.renderPanoTiles(pano.id, null, !1, !1),
  23955. pano.setZoomed(ifZoom)
  23956. }.bind(this);
  23957. if(navTileClass == '4k'){
  23958. if (!this.currentPano.zoomed) {
  23959. o(this.currentPano, !0);
  23960. this.panoRenderer.enableUltraHighQualityMode(function() {//开启4k getMaxZoomPanoSize
  23961. this.qualityManager.useUltraHighResolutionPanos && (f.zoom.max = D.ultraHighQualityMaxZoom);
  23962. o(this.currentPano, !0)
  23963. }
  23964. .bind(this));
  23965. }
  23966. }else{
  23967. let zoomLevelRes = this.qualityManager.zoomLevelResolution
  23968. if (r && (!this.currentPano.zoomed || zoomLevelRes && zoomLevelRes != '4k')) {//needZoom
  23969. this.currentPano.zoomed || o(this.currentPano, !0);
  23970. if(navTileClass == '1k' && tileClass != '1k' && this.zoomLevel < levelThreshold2){
  23971. this.panoRenderer.enableHighQuality( function() {//开启2k
  23972. if(tileClass != '4k'){
  23973. o(this.currentPano, !0);
  23974. }
  23975. }.bind(this));
  23976. }else{
  23977. this.panoRenderer.enableUltraHighQualityMode(function() {//开启4k getMaxZoomPanoSize
  23978. this.qualityManager.useUltraHighResolutionPanos && !f.zoom.overridemax && (f.zoom.max = D.ultraHighQualityMaxZoom)
  23979. o(this.currentPano, !0)
  23980. }.bind(this));
  23981. }
  23982. } else {
  23983. !t && this.currentPano.zoomed && o(this.currentPano, !1);
  23984. }
  23985. //有三个级别的话,需要标记zoomLevelResolution,以便更新maxZoomPanoSize判断能下载的最高级别
  23986. if(r && navTileClass == '1k' && tileClass == '4k' ){ //目前只有手机端navTileClass == '1k'
  23987. var change = (zoomedFlag)=>{
  23988. this.qualityManager.updateMaximums()//更新maxZoomPanoSize
  23989. this.panoRenderer.setupZoomRenderTarget() //更新renderTarget
  23990. //this.currentPano.setZoomed(t);//更新uniforms贴图
  23991. if(this.qualityManager.zoomLevelResolution == '4k'){
  23992. this.model.showHighMap()
  23993. }else{
  23994. this.model.hideHighMap()
  23995. }
  23996. }
  23997. this.qualityManager.zoomLevelResolution = this.zoomLevel >= levelThreshold2 ? '4k' : this.zoomLevel > levelThreshold1? '2k' : '1k'
  23998. if(this.oldZoomLevel < levelThreshold2 && this.zoomLevel >= levelThreshold2){//1k/2k-4k
  23999. change()
  24000. o(this.currentPano, t)
  24001. }else if(this.oldZoomLevel <= levelThreshold1 && this.zoomLevel > levelThreshold1){//1k-2k
  24002. change()
  24003. }else if(this.oldZoomLevel > levelThreshold2 && this.zoomLevel <= levelThreshold2){//4k-2k/1k
  24004. change()
  24005. o(this.currentPano, t)
  24006. }else if(this.oldZoomLevel > levelThreshold1 && this.zoomLevel <= levelThreshold1){//2k-1k
  24007. change()
  24008. }
  24009. this.oldZoomLevel = this.zoomLevel
  24010. }
  24011. }
  24012. }
  24013. }
  24014. n.prototype.checkHasNeighbor = function(pano){//add
  24015. for(var i in pano.neighbourPanos ){
  24016. if(i == pano.id)continue;
  24017. if(pano.neighbourPanos[i]){
  24018. return true;
  24019. }
  24020. }
  24021. }
  24022. ,
  24023. t.exports = n
  24024. }
  24025. ).call(this, "/js/player.js")
  24026. }
  24027. , {
  24028. "./constants": 8,
  24029. "./enum/AlignmentType": 17,
  24030. "./enum/BlackoutStyle": 18,
  24031. "./enum/ControlEvents": 21,
  24032. "./enum/Keys": 30,
  24033. "./enum/ModelManagerEvents": 33,
  24034. "./enum/PanoSizeClass": 36,
  24035. "./enum/PanoramaEvents": 37,
  24036. "./enum/PathDiscardMode": 38,
  24037. "./enum/PathDisplayMode": 39,
  24038. "./enum/PlayerEvents": 40,
  24039. "./enum/TagStates": 44,
  24040. "./enum/Vectors": 50,
  24041. "./enum/Viewmode": 51,
  24042. "./enum/WarpStyle": 52,
  24043. "./enum/ZoomEvents": 53,
  24044. "./exception/BasicException": 55,
  24045. "./model/ModelManager": 140,
  24046. "./objects/NSpider": 147,
  24047. "./objects/Panorama": 148,
  24048. "./objects/Reticule": 149,
  24049. "./objects/ShowPath": 151,
  24050. "./objects/Snapshot": 153,
  24051. "./objects/View": 154,
  24052. "./settings": 166,
  24053. "./shaders": 167,
  24054. "./tile/TileDownloader": 171,
  24055. "./tile/TilePrioritizer": 172,
  24056. "./util/ZoomStats": 179,
  24057. "./util/browser": 182,
  24058. "./util/camera": 183,
  24059. "./util/cameraLight": 184,
  24060. "./util/common": 185,
  24061. "./util/easing": 186,
  24062. "./util/history": 187,
  24063. "./util/lerp": 188,
  24064. "./util/logger": 189,
  24065. "./util/math": 190,
  24066. "./util/transitions": 195,
  24067. "hot":"hot",
  24068. "scaleImg":"scaleImg",
  24069. events: 202,
  24070. three: 217
  24071. }],
  24072. "scaleImg":[function(t, e){// xzw
  24073. var OUTPUT = e;
  24074. (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")}
  24075. function n(t){if(t){var e,a=G.getImageData(0,0,s,f),i=a.data;for(e=0;at>e;e+=4)
  24076. 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}
  24077. return G.getImageData(0,0,s,f)}
  24078. 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}
  24079. a||(a=t.input,i=t.output,r=t.inputRemovable,t.scale&&(t=t.scale));var u,d;if(a.src)
  24080. if(u=document.createElement("canvas"),null!=a.naturalWidth)
  24081. 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}
  24082. else
  24083. 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)
  24084. 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)
  24085. for(h(),J=n(),K=J.data,x=0;f>x;x++)
  24086. 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)
  24087. 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)
  24088. W=new Float32Array(at);else
  24089. for(W=[],et=0;at>et;++et)
  24090. W[et]=0;for(b=0;w>b;b++)
  24091. 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)
  24092. 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;}
  24093. delete p,h(),J=n(W)}
  24094. 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}
  24095. if("png-src"===i||"jpeg-src"===i)
  24096. return B.toDataURL("image/"+i.split("-")[0],0.85)}
  24097. return B}
  24098. var e=this;"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=t),exports.scale=t):c=t}).call(this);
  24099. OUTPUT.exports = c;
  24100. }, {}
  24101. ],
  24102. 156: [function(e, t, i) {
  24103. (function(i) {
  24104. "use strict";
  24105. function n(e, t) {
  24106. this.model = e,
  24107. this.panos = e.panos,
  24108. this.player = t,
  24109. this.imagePanos = this.listImagePanos(),
  24110. this.retryMinimumTime = 1e4
  24111. }
  24112. var r = (e("three"),
  24113. e("./enum/Viewmode"))
  24114. , o = (e("./settings"),
  24115. e("./objects/Panorama"))
  24116. , a = e("./util/logger")
  24117. , s = new a(i);
  24118. n.prototype.start = function() {
  24119. this.loadNextPano(function(e) {
  24120. e ? this.start() : (s.debug("No suitable pano loaded, waiting a little while before looking again"),
  24121. setTimeout(function() {
  24122. this.start()
  24123. }
  24124. .bind(this), 1e3))
  24125. }
  24126. .bind(this))
  24127. }
  24128. ,
  24129. n.prototype.validLoadTarget = function(e) {
  24130. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  24131. }
  24132. ,
  24133. n.prototype.listImagePanos = function() {
  24134. var e = []
  24135. , t = this;
  24136. return this.model.images.forEach(function(i) {
  24137. if (i.metadata && i.metadata.scan_id) {
  24138. var n = t.model.panos.get(i.metadata.scan_id);
  24139. n && !n.isLoaded("high") && e.push(n)
  24140. }
  24141. }),
  24142. e
  24143. }
  24144. ,
  24145. n.prototype.nextNotLoadedImage = function() {
  24146. for (; this.imagePanos.length > 0; ) {
  24147. var e = this.imagePanos[0];
  24148. if (!e.isLoaded("high"))
  24149. return e;
  24150. this.imagePanos.shift()
  24151. }
  24152. return null
  24153. }
  24154. ,
  24155. n.prototype.loadNextPano = function(e) {
  24156. var t, i, n = this.model.waitQueue.filter(function(e) {
  24157. return e.object instanceof o
  24158. });
  24159. n.length > 0 ? (t = n[0].object,
  24160. s.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  24161. s.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  24162. s.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  24163. t = this.imagePanos[0],
  24164. 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())]),
  24165. t && s.debug("Normal pano selection: neighbor " + t.id)),
  24166. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  24167. s.debug("Preloading " + i + "-res pano " + t.id),
  24168. t.loadCube(i).done(e).fail(function() {
  24169. s.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  24170. e()
  24171. })) : e && e(null)
  24172. }
  24173. ,
  24174. t.exports = n
  24175. }
  24176. ).call(this, "/js/preloaders.js")
  24177. }
  24178. , {
  24179. "./enum/Viewmode": 51,
  24180. "./objects/Panorama": 148,
  24181. "./settings": 166,
  24182. "./util/logger": 189,
  24183. three: 217
  24184. }],
  24185. 157: [function(e, t, i) {
  24186. (function(i) {
  24187. "use strict";
  24188. function n(e, t, i, n, r) {
  24189. this.qualityManager = e,
  24190. this.scene = t,
  24191. this.camera = i,
  24192. this.container = r,
  24193. this.controls = n,
  24194. this.controls.enabled = !0,
  24195. this.controls.locked = !0,
  24196. this.quickstartCamera = n.camera,
  24197. this.quickstartCamera.fov = h.clampVFOV(a.insideFOV, a.insideFOVMax, $("#player").width(), $("#player").height()),
  24198. this.skybox = null
  24199. }
  24200. var r = e("three")
  24201. , o = e("../util/logger")
  24202. , a = e("../constants")
  24203. , s = (e("../util/transitions"),
  24204. e("../util/lerp"),
  24205. e("../util/easing"),
  24206. e("../enum/Vectors"))
  24207. , l = e("../enum/PanoSizeClass")
  24208. , c = (e("../materials/ModelTextureMaterial"),
  24209. e("../materials/CubemapMaterial"))
  24210. , h = (e("../cameras/PanoramaCamera"),
  24211. e("../controls/PanoramaControls"),
  24212. e("../tile/TileUtils"),
  24213. e("../util/camera"),
  24214. e("../util/cameraLight"))
  24215. , u = (e("../util/browser"),
  24216. e("../settings"),
  24217. e("../gui/helpManager"),
  24218. new o(i));
  24219. n.prototype.load = function(e) {
  24220. e.pano.shouldRedrawOnBaseLoaded = !0;
  24221. var t, i, n = this, r = s.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  24222. this.controls.lookAt(r.add(this.quickstartCamera.position));
  24223. var a = this.qualityManager.getPanoSize(l.BASE)
  24224. , c = this.qualityManager.getPanoSize(l.STANDARD);
  24225. if (e.pano.tiled) {
  24226. u.warn("Loading startPano, TILED", e.pano.id);
  24227. var d = h.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  24228. , p = this.quickstartCamera.fov;
  24229. u.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + d + ", vertical FOV: " + p + "]"),
  24230. t = e.pano.loadTiledPano(c, r, {
  24231. hFov: d,
  24232. vFov: p
  24233. }, !1, !1, !0),
  24234. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  24235. } else
  24236. u.warn("Loading startPano", e.pano.id),
  24237. t = e.pano.loadCube("high");
  24238. return $.when(t).then(function() {
  24239. n.init(e.pano, e.quaternion),
  24240. e.pano.tiled ? i.done(function() {
  24241. e.pano.lockUntilRenderingComplete = !1,
  24242. this.controls.locked = !1
  24243. }
  24244. .bind(this)) : this.controls.locked = !1
  24245. }
  24246. .bind(this))
  24247. }
  24248. ,
  24249. n.prototype.init = function(e, t) {
  24250. u.info("Quickstart done loading, adding scene objects"),
  24251. e.lockUntilRenderingComplete = !0,
  24252. this.skybox = new r.Mesh(new r.CubeGeometry(1,1,1),new c({
  24253. side: r.BackSide
  24254. })),
  24255. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  24256. this.skybox.quaternion.copy(e.quaternion),
  24257. this.scene.add(this.skybox),
  24258. $(this.container).show()
  24259. }
  24260. ,
  24261. n.prototype.update = function(e) {
  24262. this.controls.update(e),
  24263. this.camera.copy(this.quickstartCamera)
  24264. }
  24265. ,
  24266. n.prototype.setSize = function(e, t) {
  24267. this.quickstartCamera.updateAspect(e / t)
  24268. }
  24269. ,
  24270. n.prototype.destroy = function() {
  24271. this.scene.remove(this.skybox)
  24272. }
  24273. ,
  24274. t.exports = n
  24275. }
  24276. ).call(this, "/js/scene/QuickstartManager.js")
  24277. }
  24278. , {
  24279. "../cameras/PanoramaCamera": 7,
  24280. "../constants": 8,
  24281. "../controls/PanoramaControls": 13,
  24282. "../enum/PanoSizeClass": 36,
  24283. "../enum/Vectors": 50,
  24284. "../gui/helpManager": 68,
  24285. "../materials/CubemapMaterial": 117,
  24286. "../materials/ModelTextureMaterial": 118,
  24287. "../settings": 166,
  24288. "../tile/TileUtils": 174,
  24289. "../util/browser": 182,
  24290. "../util/camera": 183,
  24291. "../util/cameraLight": 184,
  24292. "../util/easing": 186,
  24293. "../util/lerp": 188,
  24294. "../util/logger": 189,
  24295. "../util/transitions": 195,
  24296. three: 217
  24297. }],
  24298. 158: [function(e, t, i) {
  24299. "use strict";
  24300. function n(e, t, i) {
  24301. this.scene = e,
  24302. this.camera = t,
  24303. this.renderer = null,
  24304. this.effects = i,
  24305. this.animateCallback = null,
  24306. this.composer = null,
  24307. this.qualityManager = null,
  24308. e.renderWidth = 0,
  24309. e.renderHeight = 0,
  24310. this.updateClock = new r.Clock,
  24311. this.components = [],
  24312. this.updateListeners = [],
  24313. this.resizeListeners = [],
  24314. this.forceUpdateSize = !1,
  24315. this.started = !1,
  24316. this.textures = {},
  24317. this.suspendedObjects = []
  24318. }
  24319. var r = e("three")
  24320. , o = e("../shaders")
  24321. , a = e("../enum/SceneRendererEvents")
  24322. , s = e("../enum/GLTextureType")
  24323. , l = e("../enum/GLCubeFaces")
  24324. , c = e("../exception/BasicException")
  24325. , h = e("../exception/RendererCreationException")
  24326. /**********************************************************************fyz改 from徐世廷**********************************************************************/
  24327. , m = e("../util/browser")
  24328. /**************************************************************************************************************************************************/
  24329. , u = e("../settings")
  24330. , d = e("events").EventEmitter;
  24331. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  24332. n.prototype = Object.create(d.prototype),
  24333. n.prototype.addComponent = function(e) {
  24334. this.components.push(e),
  24335. e.update && this.updateListeners.push(e),
  24336. e.setSize && (this.resizeListeners.push(e),
  24337. this.forceUpdateSize = !0)
  24338. }
  24339. ,
  24340. n.prototype.removeComponent = function(e) {
  24341. var t = function(t) {
  24342. return t !== e
  24343. };
  24344. this.components = this.components.filter(t),
  24345. this.updateListeners = this.updateListeners.filter(t),
  24346. this.resizeListeners = this.resizeListeners.filter(t)
  24347. }
  24348. ,
  24349. n.prototype.start = function(e) {
  24350. if (this.started)
  24351. throw new c("Can't start SceneRenderer, already started");
  24352. this.createContext(e),
  24353. /***************************************************VR fyz改 from徐世廷**********************************************************************/
  24354. /* m.isMobile() && */this.boluoVrInit(),
  24355. /*******************************************************************************************************************************/
  24356. this.initComposer(),
  24357. this.started = !0,
  24358. (p = p.bind(this))()
  24359. }
  24360. ,
  24361. n.prototype.createContext = function(e) {
  24362. var transparent = !!(settings.transparentBg || settings.bgImg)
  24363. try {
  24364. this.renderer = new r.WebGLRenderer({antialias: !m.isMobile(), alpha:transparent}),
  24365. this.renderer.autoClear = !0,
  24366. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  24367. this.renderer.setSize($("#player").width(), $("#player").height(), false), //改
  24368. transparent && this.renderer.setClearColor( 0x000000, 0 ); //透明
  24369. this.emit(a.ContextCreated)
  24370. } catch (e) {
  24371. throw new h("Unable to create a WebGL rendering context")
  24372. }
  24373. u.profiling.enabled && this.overrideTextures(),
  24374. e.appendChild(this.renderer.domElement)
  24375. /* window.stats = new Stats();
  24376. e.appendChild( stats.dom ); */
  24377. }
  24378. ,
  24379. n.prototype.overrideTextures = function() {
  24380. var e = this.renderer.context
  24381. , t = 0
  24382. , i = e.createTexture;
  24383. e.createTexture = function() {
  24384. var n = i.call(e);
  24385. return n.id = t++,
  24386. this.textures[n.id] = n,
  24387. n
  24388. }
  24389. .bind(this);
  24390. var n = e.texImage2D;
  24391. e.texImage2D = function(t, i, r, o, a, l, c, h, u) {
  24392. var d, p = this.getTextureTypeFromTarget(e, t);
  24393. d = p === s.TextureCube ? e.getParameter(e.TEXTURE_BINDING_CUBE_MAP) : e.getParameter(e.TEXTURE_BINDING_2D),
  24394. void 0 !== c ? n.call(e, t, i, r, o, a, l, c, h, u) : (c = o,
  24395. h = a,
  24396. u = l,
  24397. o = u.naturalWidth,
  24398. a = u.naturalHeight,
  24399. n.call(e, t, i, r, c, h, u));
  24400. var f = this.textures[d.id];
  24401. f.width = p === s.TextureCube ? 6 * o : o,
  24402. f.height = a
  24403. }
  24404. .bind(this);
  24405. var r = e.deleteTexture;
  24406. e.deleteTexture = function(t) {
  24407. delete this.textures[t.id],
  24408. r.call(e, t)
  24409. }
  24410. .bind(this)
  24411. }
  24412. ,
  24413. n.prototype.updateTextureMemory = function() {
  24414. var e = null;
  24415. return function() {
  24416. var t = 0;
  24417. for (var i in this.textures) {
  24418. var n = this.textures[i];
  24419. n.width && n.height && (t += n.width * n.height * 4)
  24420. }
  24421. t !== e && this.emit(a.MemoryUsageUpdated, t),
  24422. e = t
  24423. }
  24424. }(),
  24425. n.prototype.getTextureTypeFromTarget = function(e, t) {
  24426. switch (t) {
  24427. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  24428. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  24429. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  24430. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  24431. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  24432. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  24433. return s.TextureCube;
  24434. case e.TEXTURE_2D:
  24435. return s.Texture2D;
  24436. default:
  24437. return null
  24438. }
  24439. }
  24440. ,
  24441. n.prototype.initComposer = function() {
  24442. this.composer = new r.EffectComposer(this.renderer),
  24443. this.composer.addPass(new r.RenderPass(this.scene,this.camera)),
  24444. //this.composer.addPass(this.effects.hblurPass),
  24445. //this.composer.addPass(this.effects.vblurPass)
  24446. this.composer.addPass(this.effects.fastTranMaskPass)//add
  24447. }
  24448. ,
  24449. n.prototype.setSize = function(e, t, devicePixelRatio) {
  24450. this.renderWidth = e,
  24451. this.renderHeight = t,
  24452. this.effects.aspect = e / t,
  24453. /* this.renderer.setSize(e, t), -----MP */
  24454. this.renderer.setSize(e, t, false, devicePixelRatio), //改 为了防止给canvas设置宽高
  24455. this.composer.setSize(e, t);
  24456. for (var i = 0; i < this.resizeListeners.length; i++)
  24457. this.resizeListeners[i].setSize(e, t)
  24458. }
  24459. ,
  24460. n.prototype.render = function() {
  24461. //this.effects.currentBlur > 0 ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  24462. this.effects.fastTranMaskPass.enabled ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  24463. }
  24464. /******************************************************************************************************徐世廷**********************************************************************/
  24465. var vrPermission = {};
  24466. var vrPermissionCallBack = function(info1,info2){
  24467. if(info1 == "reset"){
  24468. vrPermission = {};
  24469. }else{
  24470. vrPermission[info1] = info2
  24471. if(Object.keys(vrPermission).length == 2 && (vrPermission.deviceMotion != "granted" || vrPermission.deviceOrientation != "granted")){
  24472. alert("运动和方向访问失败。这会导致画面视角一直固定。您需要完全关闭此应用,然后再次打开,并允许访问运动与方向。" )
  24473. }
  24474. }
  24475. }
  24476. n.prototype.boluoVrInit = function() {
  24477. console.log("boluoVrInit")
  24478. //webxr.init(this.renderer)
  24479. this.isHuawei5X = m.detectHUAWEI5X(),
  24480. this.oldRenderer = this.renderer,
  24481. this.newRenderer = new this.vrRenderer(this.renderer,this,this.camera);
  24482. window.panoCamera = this.camera;
  24483. var a = this;
  24484. window._vrEnabled = !1,
  24485. Object.defineProperty(window, "vrEnabled", {
  24486. get: function() {
  24487. return window._vrEnabled
  24488. },
  24489. set: function(b) {
  24490. //if(webxr.xrType)return webxr.enterVR()
  24491. b = !!b
  24492. b ? (a.renderer = a.newRenderer,
  24493. window.vrMarkers.forEach(function(a) {
  24494. a.visible = !0
  24495. })) : (a.renderer = a.oldRenderer,
  24496. window.vrMarkers.forEach(function(a) {
  24497. a.visible = !1
  24498. })),
  24499. a.cursor.visible = b,
  24500. a.setSize(window.innerWidth, window.innerHeight)
  24501. window._vrEnabled = b
  24502. $('.cad').css('visibility',b?'hidden':'')
  24503. b ? browser.requestFullscreen(document.body) : browser.exitFullscreen()
  24504. a.setSizeFitGlass()
  24505. setTimeout(()=>{
  24506. console.log('ch',document.body.clientWidth, document.body.clientHeight, window.innerWidth, window.innerHeight )//全屏后得到的才准确
  24507. a.setSizeFitGlass()
  24508. },600)
  24509. if(b){
  24510. setTimeout(function(){
  24511. console.log("orientEnable"+window.orientEnable)
  24512. if(window.vrEnabled && !window.orientEnable){//很可能没能触发陀螺仪事件
  24513. if(m.detectIOS()/* && m.detectSafari() */){
  24514. var b = m.iosVersion();//{major: 10, minor: 3, patch: 1}
  24515. console.log("开始获取权限 major"+b.major)
  24516. if(b.major == 12 && b.minor>=2){
  24517. if(browser.detectSafari()) alert("浏览器未能检测到转动。为完整体验VR效果,请打开 “设置” > “Safari” > “隐私和安全” 下的 “运动和方向访问” 开关,然后刷新此页面。")
  24518. else{//app??
  24519. alert("浏览器未能检测到转动。请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。")
  24520. }
  24521. }else if(b.major >= 13){
  24522. if(!window.location.href.includes("https://")){
  24523. console.log("需要https");
  24524. alert("当前网页下,高于ios12的浏览器版本可能不支持陀螺仪开启。")
  24525. return;
  24526. }
  24527. var hasFailed = window.vrPermission && (window.vrPermission.deviceMotion != "granted" || window.vrPermission.deviceOrientation != "granted")
  24528. setTimeout(()=>{//如果使用了alert会阻断这个事件,报以下错requusting device orientation or motion access requires a user gesture
  24529. if(!window.vrEnabled || window.orientEnable)return;
  24530. vrPermissionCallBack("reset")
  24531. console.log(window.DeviceMotionEvent)
  24532. if ( window.DeviceMotionEvent && window.DeviceMotionEvent.requestPermission && typeof window.DeviceMotionEvent.requestPermission === 'function') {
  24533. console.log("开始获取权限1")
  24534. ///注意:需要https 本地服务器permissionState会得到denied
  24535. window.DeviceMotionEvent.requestPermission().then(permissionState => {
  24536. console.log("permissionState1: "+permissionState)
  24537. vrPermissionCallBack("deviceMotion", permissionState)
  24538. }).catch(function(e){
  24539. vrPermissionCallBack("deviceMotion", false)
  24540. console.log(e)
  24541. })
  24542. }else{
  24543. console.log("window.DeviceMotionEvent undefined")
  24544. vrPermissionCallBack("deviceMotion", false)
  24545. }
  24546. if ( window.DeviceOrientationEvent && window.DeviceOrientationEvent.requestPermission && typeof window.DeviceOrientationEvent.requestPermission === 'function') {
  24547. console.log("开始获取权限2")
  24548. window.DeviceOrientationEvent.requestPermission().then(permissionState => {
  24549. console.log("permissionState2: "+permissionState)
  24550. vrPermissionCallBack("deviceOrientation", permissionState)
  24551. }).catch(function(e){
  24552. vrPermissionCallBack("deviceOrientation", false)
  24553. console.log(e)
  24554. })
  24555. }else{
  24556. console.log("window.DeviceOrientationEvent undefined")
  24557. vrPermissionCallBack("deviceOrientation", false)
  24558. }
  24559. },hasFailed ? 0 : 150)
  24560. /* /* setTimeout(function(){
  24561. if(settings.vrEnabled && !window.orientEnable){
  24562. $alert("若画面视角一直固定,您需要完全关闭Safari浏览器,然后再次打开以开启运动和方向访问。")
  24563. }
  24564. },4000) */
  24565. }else console.log("陀螺仪未能启用 ios "+b.major+"."+b.minor)
  24566. }else{
  24567. //$alert("浏览器未能检测到转动", "请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。")
  24568. }
  24569. }else{
  24570. //已经触发了
  24571. }
  24572. },200);
  24573. }else {
  24574. if(player.mode == 'panorama'){ //xzw add
  24575. player.cameraControls.controls.panorama.endRotation()
  24576. }
  24577. }
  24578. }
  24579. }),
  24580. this.createCursor(.5, !1, 1, 16777215, 0);
  24581. var b = {
  24582. setSize: function(b, c) {
  24583. a.camera.aspect = b / c
  24584. }
  24585. };
  24586. this.resizeListeners.push(b),
  24587. this.vrLoadingInit()
  24588. document.addEventListener('fullscreenchange', (e)=>{
  24589. this.setSizeFitGlass()
  24590. })
  24591. }
  24592. ,
  24593. n.prototype.vrLoadingInit = function() {
  24594. var a = function(camera) {
  24595. var a = this
  24596. , b = new r.RingGeometry(1.3,1.5,32,32,0,1.2 * Math.PI)
  24597. , c = new r.MeshBasicMaterial({
  24598. color: 4967932,
  24599. side: r.DoubleSide
  24600. })
  24601. , d = new r.Mesh(b,c);
  24602. this.mesh = d,
  24603. d.position.z = -2,
  24604. d.scale.set(.08, .08, .08),
  24605. d.visible = !1,
  24606. camera.add(d),
  24607. //window.player.camera.add(d),
  24608. a.enabled = !1,
  24609. this.update = function(b) {
  24610. 1 == a.enabled && (d.rotation.z += 15 * b)
  24611. }
  24612. }
  24613. , a = new a(this.camera);
  24614. window.Loading = a,
  24615. this.updateListeners.push(a)
  24616. }
  24617. ,
  24618. n.prototype.createCursor = function(a, b, c, d, e) {
  24619. var g, h = new r.SpriteMaterial({
  24620. opacity: c,
  24621. color: d,
  24622. transparent: b,
  24623. map: this.boluoGetTexture("images/cursor.png"),
  24624. needsUpdate: !0,
  24625. side: r.DoubleSide
  24626. });
  24627. h.map.offset = new r.Vector2(1 / 17 * e,0),
  24628. h.map.repeat = new r.Vector2(1 / 17,1),
  24629. h.depthTest = !1,
  24630. h.blending = r.AdditiveBlending,
  24631. g = new r.Sprite(h),
  24632. // g.scale.set(a, a, a),
  24633. g.scale.set(.3,.3,.3)
  24634. g.position.z = -2,
  24635. g.visible = !1,
  24636. g.name = "cursor",
  24637. this.camera.add(g),
  24638. this.scene.add(this.camera),
  24639. this.cursor = g;
  24640. var i = new this.CursorAnimation(this.scene,g,this.camera);
  24641. this.cursor.triggerTargetEvent = i.triggerTargetEvent,
  24642. this.updateListeners.push(i)
  24643. }
  24644. n.prototype.setSizeFitGlass = function(){//add 现在大多数手机过长,可能超出眼镜范围,导致看不全眩晕。另外注意调节和镜头的距离。
  24645. let verti = window.orientation == 0 || window.orientation == 180//竖屏
  24646. console.log('setSizeFitGlass')
  24647. if( document.fullscreenElement && !verti && window.vrEnabled && !browser.isMobile()){
  24648. let longW = Math.max(document.body.clientWidth, document.body.clientHeight)
  24649. let shortW = Math.min(document.body.clientWidth, document.body.clientHeight)
  24650. const hopeRatio = 1.84 //因为无法知道手机长度,只能估计,若长宽比较大,很可能过长,所以缩短点。
  24651. let r = longW / shortW
  24652. if(r > hopeRatio){
  24653. let w = shortW*hopeRatio
  24654. window.player.domElement.style.width = w + 'px' //缩短
  24655. window.player.domElement.style.transform = `translate(${(longW-w)*0.5}px,0)` //居中。但我手机荣耀自带浏览器会向右多偏移一些不知为何
  24656. }
  24657. }else{
  24658. window.player.domElement.style.width = ''
  24659. window.player.domElement.style.transform = ''
  24660. }
  24661. }
  24662. ,
  24663. window.orientEnable = 0; //是否能触发deviceorientation
  24664. n.prototype.CursorAnimation = function(a, b, c) {
  24665. function d() {
  24666. g.orient = r.Math.degToRad(window.orientation || 0)
  24667. player.sceneRenderer.setSizeFitGlass()
  24668. }
  24669. function e(a) {
  24670. if(!window.vrEnabled && window.orientEnable) return;
  24671. window.orientEnable || (window.orientEnable = 1);
  24672. var b = r.Math.degToRad(a.alpha)
  24673. , c = r.Math.degToRad(a.beta)
  24674. , d = r.Math.degToRad(a.gamma);
  24675. if (this.isHuawei5X ? (-1e3 === g.alpha && (g.alpha = b),
  24676. -1e3 === g.beta && (g.beta = c),
  24677. -1e3 === g.gamma && (g.gamma = d),
  24678. Math.abs(b - g.alpha) > .06 && (g.alpha = b),
  24679. Math.abs(c - g.beta) > .006 && (g.beta = c),
  24680. Math.abs(d - g.gamma) > .006 && (g.gamma = d)) : (g.alpha = b,
  24681. g.beta = c,
  24682. g.gamma = d),
  24683. n.vrDebug) {
  24684. $("#info-device-orientation").css("display", "block");
  24685. var e = "";
  24686. e += "alpha=(" + g.alpha + ")<BR/>",
  24687. e += "beta=(" + g.beta + ")<BR/>",
  24688. e += "gamma=" + g.gamma + "<BR/>",
  24689. document.getElementById("info-device-orientation").innerHTML = e
  24690. }
  24691. }
  24692. this.cursor = b,
  24693. this.raycaster = new r.Raycaster,
  24694. this.targetEventObj = {},
  24695. this.type = 1,
  24696. this.tweenFlag = !0;
  24697. var g = this;
  24698. this.target = c,
  24699. console.log(c.uuid),
  24700. this.euler = new r.Euler,
  24701. this.q0 = new r.Quaternion,
  24702. this.q1 = new r.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),
  24703. this.zee = new r.Vector3(0,0,1),
  24704. this.alpha = -1e3,
  24705. this.beta = -1e3,
  24706. this.gamma = -1e3,
  24707. this.orient = r.Math.degToRad(window.orientation || 0),
  24708. window.addEventListener("orientationchange", d),
  24709. window.addEventListener("deviceorientation", e),
  24710. this.setObjectQuaternion = function(a, b, d, e, f) {
  24711. if (b == -1000) return //防止打开就歪着
  24712. g.euler.set(d, b, -e, "YXZ"),
  24713. a.setFromEuler(g.euler),
  24714. a.multiply(g.q1),
  24715. a.multiply(g.q0.setFromAxisAngle(g.zee, -f)),
  24716. c.updateMatrixWorld()
  24717. }
  24718. ,
  24719. parent !== window && window.addEventListener("message", function(a) {
  24720. var b = JSON.parse(a.data)
  24721. , c = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  24722. b && b.alpha && b.beta && b.gamma && function(a) {
  24723. var c = r.Math.degToRad(b.alpha)
  24724. , d = r.Math.degToRad(b.beta)
  24725. , e = r.Math.degToRad(b.gamma);
  24726. a ? (-1e3 === g.alpha && (g.alpha = c),
  24727. -1e3 === g.beta && (g.beta = d),
  24728. -1e3 === g.gamma && (g.gamma = e),
  24729. Math.abs(c - g.alpha) > .06 && (g.alpha = c),
  24730. Math.abs(d - g.beta) > .006 && (g.beta = d),
  24731. Math.abs(e - g.gamma) > .006 && (g.gamma = e)) : (g.alpha = c,
  24732. g.beta = d,
  24733. g.gamma = e)
  24734. }(c)
  24735. }),
  24736. this.update = function(a) {
  24737. TWEEN.update()
  24738. if (window.vrEnabled) {
  24739. if (window.ifTest || !browser.isMobile()) this.triggerTargetEvent()//测试时不根据陀螺仪来转向
  24740. else {
  24741. this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient)
  24742. this.triggerTargetEvent()
  24743. }
  24744. }
  24745. }
  24746. ,
  24747. this.triggerTargetEvent = function() {
  24748. var a = this.choseObj()
  24749. , b = a ? a.object : void 0;
  24750. this.targetEventObj.currentObj = b,
  24751. b !== this.targetEventObj.lastObj && (b && this.autoCursorPosition(a),
  24752. 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(),
  24753. b && b.enabled && this.startAnimate(function() {
  24754. this.clickCallback(b)
  24755. }
  24756. .bind(this))) : this.type,
  24757. this.targetEventObj.lastObj = b)
  24758. }
  24759. ,
  24760. this.choseObj = function() {
  24761. this.raycaster.setFromCamera({
  24762. x: 0,
  24763. y: 0
  24764. }, c);
  24765. var a = (this.raycaster.ray,
  24766. window.vrMarkers)
  24767. , b = this.raycaster.intersectObjects(a);
  24768. if (b.length > 0)
  24769. return b[0]
  24770. }
  24771. ,
  24772. this.clickCallback = function(a) {
  24773. this.runTHREEAction(a, "onclick")
  24774. }
  24775. ,
  24776. this.runTHREEAction = function(a, b) {
  24777. switch (b) {
  24778. case "onclick":
  24779. a._listeners && a._listeners.click && a._listeners.click.forEach(function(a) {
  24780. a()
  24781. });
  24782. break;
  24783. case "onhover":
  24784. a._listeners && a._listeners.hover && a._listeners.hover.forEach(function(a) {
  24785. a()
  24786. });
  24787. break;
  24788. case "onout":
  24789. a._listeners && a._listeners.out && a._listeners.out.forEach(function(a) {
  24790. a()
  24791. })
  24792. }
  24793. }
  24794. ,
  24795. this.startAnimate = function(a) {
  24796. this.tweenFlag && this.initAnimation(a)
  24797. }
  24798. ,
  24799. this.initAnimation = function(a) {
  24800. var b = this
  24801. , c = this.cursor.material.map.offset
  24802. , d = function(a) {
  24803. return Math.floor(17 * a) / 17
  24804. };
  24805. b.tweenFlag = !1,
  24806. this.cursorAnimate = new TWEEN.Tween(c).to({
  24807. x: 1
  24808. }, 1e3).onStart(function() {
  24809. b.tweenFlag = !1
  24810. }).onStop(function() {
  24811. b.tweenFlag = !0,
  24812. this.x = 0,
  24813. c.x = 0
  24814. }).onUpdate(function() {}).onComplete(function() {
  24815. a(),
  24816. c.x = 0,
  24817. setTimeout(function() {
  24818. b.tweenFlag = !0
  24819. }, 1500)
  24820. }),
  24821. this.cursorAnimate.easing(d),
  24822. this.cursorAnimate.start()
  24823. }
  24824. ,
  24825. this.autoCursorPosition = function(a) {
  24826. // var b = Math.abs(a.distance - 10);
  24827. // this.cursor.position.z = -b,
  24828. // b /= 10;
  24829. // alert(b);
  24830. // this.cursor.scale.set(b, b, b)
  24831. this.cursor.scale.set(.3,.3,.3)
  24832. }
  24833. }
  24834. ,
  24835. n.prototype.vrRenderer = function(a, b, c) {
  24836. var d = new b.vrCamera(c);
  24837. d.bananaAspect = 0.75// fov origin:0.8
  24838. this.width,
  24839. this.height;
  24840. var b = this;
  24841. this.setSize = function(c, d) {
  24842. a.setSize.call(this, c, d),
  24843. b.width = c,
  24844. b.height = d
  24845. }
  24846. ,
  24847. this.render = function(b, c, e, f) {
  24848. window.cameraQua = c.quaternion.clone();
  24849. var g, h;
  24850. if (c.__RESS__SKIP__STEREO__)
  24851. return a.render(b, c, e, f);
  24852. if ("PerspectiveCamera" === c.type)
  24853. g = d.cameraL,
  24854. h = d.cameraR,
  24855. b.updateMatrixWorld(),
  24856. null === c.parent && c.updateMatrixWorld(),
  24857. d.vrCameraUpdate(c);
  24858. else {
  24859. if ("OrthographicCamera" !== c.type)
  24860. return DEBUG && console.error("Unsupported renderer: ", c.type);
  24861. g = h = c
  24862. }
  24863. a.setScissorTest(!0),
  24864. a.setScissor(0, 0, this.width / 2, this.height),
  24865. a.setViewport(0, 0, this.width / 2, this.height),
  24866. a.render.call(this, b, g, e, f),
  24867. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  24868. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  24869. a.render.call(this, b, h, e, f),
  24870. a.setScissorTest(!1)
  24871. }
  24872. ,
  24873. this.__proto__ = {
  24874. __proto__: a
  24875. }
  24876. }
  24877. ,
  24878. n.prototype.vrCamera = function(a) {
  24879. this.type = "StereoCamera",
  24880. this._aspect = 1,
  24881. this._overlap = .064,
  24882. this.cameraL = new r.PerspectiveCamera,
  24883. this.cameraL.layers.enable(1),
  24884. this.cameraL.near = 0.01,//xzw add
  24885. this.cameraL.matrixAutoUpdate = !1,
  24886. this.cameraR = new r.PerspectiveCamera,
  24887. this.cameraR.layers.enable(2),
  24888. this.cameraR.near = 0.01,//xzw add
  24889. this.cameraR.matrixAutoUpdate = !1,
  24890. this.eyeRight = new r.Matrix4,
  24891. this.eyeLeft = new r.Matrix4,
  24892. this.vrCameraNeedsUpdate = !0,
  24893. window.vrCameraL = this.cameraL; // fyz 记录vr相机
  24894. Object.defineProperty(this, "bananaAspect", {
  24895. get: function() {
  24896. return this._aspect
  24897. },
  24898. set: function(a) {
  24899. this._aspect !== a && (this.vrCameraNeedsUpdate = !0),
  24900. this._aspect = a
  24901. }
  24902. }),
  24903. Object.defineProperty(this, "overlap", {//瞳距
  24904. get: function() {
  24905. return this._overlap
  24906. },
  24907. set: function(a) {
  24908. this._overlap !== a && (this.vrCameraNeedsUpdate = !0),
  24909. this._overlap = a
  24910. }
  24911. }),
  24912. this.vrCameraUpdate = function(a) {
  24913. this.vrCameraNeedsUpdate = true;
  24914. if (this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== a.fov || this.bananaReal_aspect !== a.aspect * this.bananaAspect || this.bananaNear !== a.near || this.bananaFar !== a.far,
  24915. this.vrCameraNeedsUpdate) {
  24916. this.vrCameraNeedsUpdate = !1,
  24917. //console.debug("vrCameraUpdate"),
  24918. this.bananaFocus = a.focus,
  24919. this.bananaFov = a.fov,
  24920. this.bananaReal_aspect = a.aspect * (window.ban || this.bananaAspect),
  24921. this.bananaNear = a.near,
  24922. this.bananaFar = a.far,
  24923. //console.debug(a.aspect),
  24924. this.bananaFocus = 10;
  24925. 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);
  24926. this.eyeLeft.elements[12] = -e,
  24927. this.eyeRight.elements[12] = e,
  24928. b = -g * this.bananaReal_aspect + f,
  24929. c = g * this.bananaReal_aspect + f,
  24930. d.elements[0] = 2 * this.bananaNear / (c - b),
  24931. d.elements[8] = (c + b) / (c - b),
  24932. this.cameraL.projectionMatrix.copy(d),
  24933. b = -g * this.bananaReal_aspect - f,
  24934. c = g * this.bananaReal_aspect - f,
  24935. d.elements[0] = 2 * this.bananaNear / (c - b),
  24936. d.elements[8] = (c + b) / (c - b),
  24937. this.cameraR.projectionMatrix.copy(d)
  24938. }
  24939. this.cameraL.matrixWorld.copy(a.matrixWorld).multiply(this.eyeLeft),
  24940. this.cameraR.matrixWorld.copy(a.matrixWorld).multiply(this.eyeRight)
  24941. }
  24942. }
  24943. ,
  24944. n.prototype.boluoGetTexture = function(a) {
  24945. var b = new r.TextureLoader;
  24946. return b.crossOrigin = "anonymous",
  24947. b.load(a)
  24948. }
  24949. /* let webxr = {
  24950. init(renderer) {
  24951. this.renderer = renderer
  24952. renderer.xr = new THREE.WebXRManager(renderer, renderer.getContext());
  24953. renderer.xr.enabled = true
  24954. if ('xr' in navigator && 'isSessionSupported' in navigator.xr) {
  24955. //pico firefox
  24956. var mode = 'immersive-vr'
  24957. navigator.xr
  24958. .isSessionSupported(mode)
  24959. .then(supported => {
  24960. if (!supported) {
  24961. this.xrNotFound('isSessionSupported not supported')
  24962. } else {
  24963. this.xrType = 'xr' //showEnterXR();
  24964. }
  24965. })
  24966. .catch(this.xrNotFound.bind(this, 'isSessionSupported error'))
  24967. } else if ('getVRDisplays' in navigator) {
  24968. //pico 的vr browser是这个
  24969. console.log('getVRDisplays')
  24970. let setDevice = device => {
  24971. this.xrType = 'vr'
  24972. this.device = device
  24973. this.renderer.xr.setDevice(device) //新版是renderer.vr
  24974. }
  24975. window.addEventListener(
  24976. 'vrdisplayconnect',
  24977. function (event) {
  24978. setDevice(event.display)
  24979. },
  24980. false
  24981. )
  24982. window.addEventListener(
  24983. 'vrdisplaydisconnect',
  24984. function ( ) {
  24985. console.log('vrdisplaydisconnect')
  24986. window.bus.dispatchEvent({type:'exitWebXR'})
  24987. },
  24988. false
  24989. )
  24990. window.addEventListener(
  24991. 'vrdisplaypresentchange',
  24992. function (event) {
  24993. console.log('vrdisplaypresentchange', event.display.isPresenting ? 'EXIT VR' : 'ENTER VR')
  24994. event.display.isPresenting || window.bus.dispatchEvent({type:'exitWebXR'})
  24995. },
  24996. false
  24997. )
  24998. window.addEventListener(
  24999. 'vrdisplayactivate',
  25000. function (event) {
  25001. event.display.requestPresent([{ source: this.renderer.domElement }])
  25002. },
  25003. false
  25004. )
  25005. navigator
  25006. .getVRDisplays()
  25007. .then(function (displays) {
  25008. if (displays.length > 0) {
  25009. setDevice(displays[0])
  25010. } else {
  25011. this.xrNotFound('no displays')
  25012. }
  25013. })
  25014. .catch(this.xrNotFound.bind(this, 'getVRDisplays error'))
  25015. } else {
  25016. this.xrNotFound('xr not supported')
  25017. }
  25018. },
  25019. enterVR() {
  25020. if (!this.xrType) return //不支持
  25021. console.log('enterVR', this.xrType)
  25022. if (this.xrType == 'vr') {
  25023. this.device.isPresenting ? this.device.exitPresent() : this.device.requestPresent([{ source: renderer.domElement }])
  25024. } else if (this.xrType == 'xr') {
  25025. if (this.currentSession == void 0) {
  25026. console.log('this.currentSession == void 0 ')
  25027. function getXRSessionInit(mode, options) {
  25028. var space = (options || {}).referenceSpaceType || 'local-floor'
  25029. var sessionInit = (options && options.sessionInit) || {}
  25030. // Nothing to do for default features.
  25031. if (space == 'viewer') return sessionInit
  25032. if (space == 'local' && mode.startsWith('immersive')) return sessionInit
  25033. // If the user already specified the space as an optional or required feature, don't do anything.
  25034. if (sessionInit.optionalFeatures && sessionInit.optionalFeatures.includes(space)) return sessionInit
  25035. if (sessionInit.requiredFeatures && sessionInit.requiredFeatures.includes(space)) return sessionInit
  25036. // The user didn't request the reference space type as a feature. Add it to a shallow copy
  25037. // of the user-supplied sessionInit requiredFeatures (if any) to ensure it's valid to
  25038. // request it later.
  25039. var newInit = Object.assign({}, sessionInit)
  25040. newInit.requiredFeatures = [space]
  25041. if (sessionInit.requiredFeatures) {
  25042. newInit.requiredFeatures = newInit.requiredFeatures.concat(sessionInit.requiredFeatures)
  25043. }
  25044. return newInit
  25045. }
  25046. let onSessionEnded = ( ) => {
  25047. console.log('onSessionEnded')
  25048. this.currentSession.removeEventListener('end', onSessionEnded)
  25049. setTimeout(()=>{
  25050. this.renderer.xr.setSession(null)
  25051. this.currentSession = null
  25052. window.bus.dispatchEvent({type:'exitWebXR'})
  25053. },1)//延迟原因:先使THREE里的onSessionEnded执行
  25054. }
  25055. let onSessionStarted = session => {
  25056. console.log('onSessionStarted')
  25057. session.addEventListener('end', onSessionEnded)
  25058. this.renderer.xr.setSession(session)
  25059. this.currentSession = session
  25060. }
  25061. var mode = 'immersive-vr'
  25062. var sessionInit = getXRSessionInit(mode)
  25063. navigator.xr.requestSession(mode, sessionInit).then(onSessionStarted)
  25064. } else {
  25065. console.log('this.currentSession.end()', this.currentSession)
  25066. this.currentSession.end()
  25067. }
  25068. }
  25069. },
  25070. xrNotFound(text) {
  25071. console.log('xrNotFound:', text)
  25072. },
  25073. } */
  25074. /***********************************************************************************************************************************************************************************/
  25075. n.prototype.updateScreenSize = function() {//xzw 改 为了截屏 要改canvas大小 以及缩放时不模糊
  25076. var W,H;//当截屏时有setTimeout 期间不能恢复大小,所以要用W,H记录正常大小
  25077. return function(o){
  25078. var render = false;
  25079. var ratio;
  25080. var w, h; //记录应当render的大小
  25081. if(o && !o.resize && o.width!= void 0 && o.height!= void 0){
  25082. w = o.width, h = o.height, render = true, ratio=1;
  25083. }else{
  25084. w = $('#player').width();
  25085. h = $('#player').height();
  25086. o && o.resize && (W = this.renderWidth, H = this.renderHeight);
  25087. (w !== W || h !== H || this.forceUpdateSize) &&
  25088. (W = w, H = h, render = true, ratio = window.devicePixelRatio);
  25089. }
  25090. if(render){
  25091. this.setSize(w, h, ratio);
  25092. this.forceUpdateSize = !1
  25093. }
  25094. }
  25095. }()
  25096. ,
  25097. n.prototype.updateComponents = function() {
  25098. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  25099. this.updateListeners[t].update(e)
  25100. }
  25101. ,
  25102. n.prototype.suspend = function() {
  25103. this.started = !1,
  25104. this.suspendedObjects = this.scene.children.map(function(e) {
  25105. return this.scene.remove(e),
  25106. e
  25107. }
  25108. .bind(this)),
  25109. this.render()
  25110. }
  25111. ,
  25112. n.prototype.resume = function() {
  25113. this.suspendedObjects.forEach(function(e) {
  25114. this.scene.add(e)
  25115. }
  25116. .bind(this)),
  25117. this.suspendedObjects = [],
  25118. this.started = !0,
  25119. p()
  25120. }
  25121. ;
  25122. var p = function() {
  25123. this.started && (window.requestAnimationFrame(p),
  25124. this.updateScreenSize(), // fyz resize
  25125. this.updateComponents(),
  25126. this.updateTextureMemory(),
  25127. this.render(),
  25128. window.stats && (window.fps = stats.update()),
  25129. this.emit(a.AfterRender))
  25130. };
  25131. n.prototype.getImageData = function() {
  25132. var e = document.createElement("canvas")
  25133. , t = e.getContext("2d");
  25134. return function(i, n, r) {
  25135. return e.width === n && e.height === r || (e.width = n,
  25136. e.height = r),
  25137. t.drawImage(i, 0, 0, n, r),
  25138. t.getImageData(0, 0, n, r)
  25139. }
  25140. }(),
  25141. n.prototype.initSizedTexture2D = function(e, t, i) {
  25142. var n = this.renderer
  25143. , o = n.context
  25144. , a = n.state
  25145. , s = new r.Texture(null);
  25146. s.flipY = !1,
  25147. i !== !0 && (i = !1),
  25148. s.generateMipmaps = i;
  25149. var l = n.paramThreeToGL(s.format)
  25150. , c = n.paramThreeToGL(s.type)
  25151. , h = n.properties.get(s)
  25152. , u = o.createTexture();
  25153. a.bindTexture(o.TEXTURE_2D, u),
  25154. o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL, s.flipY),
  25155. o.texImage2D(o.TEXTURE_2D, 0, l, e, e, 0, l, c, null),
  25156. s.wrapS = t,
  25157. s.wrapT = t;
  25158. var d = n.paramThreeToGL(t);
  25159. return o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_S, d),
  25160. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_T, d),
  25161. i ? (s.magFilter = r.LinearFilter,
  25162. s.minFilter = r.LinearMipMapLinearFilter,
  25163. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  25164. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR_MIPMAP_NEAREST),
  25165. o.generateMipmap(o.TEXTURE_2D)) : (s.magFilter = r.LinearFilter,
  25166. s.minFilter = r.LinearFilter,
  25167. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  25168. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR)),
  25169. a.bindTexture(o.TEXTURE_2D, null),
  25170. h.__webglTexture = u,
  25171. s
  25172. }
  25173. ,
  25174. n.prototype.initSizedCubeMap = function(e, t) {
  25175. var i = this.renderer
  25176. , n = i.context
  25177. , o = i.state
  25178. , a = new r.CubeTexture([null, null, null, null, null, null]);
  25179. a.flipY = !1,
  25180. a.generateMipmaps = t;
  25181. var s = i.paramThreeToGL(a.format)
  25182. , l = i.paramThreeToGL(a.type)
  25183. , c = i.properties.get(a)
  25184. , h = n.createTexture();
  25185. o.bindTexture(n.TEXTURE_CUBE_MAP, h),
  25186. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, a.flipY);
  25187. for (var u = 0; u < 6; u++)
  25188. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + u, 0, s, e, e, 0, s, l, null);
  25189. return t ? (a.magFilter = r.LinearFilter,
  25190. a.minFilter = r.LinearMipMapLinearFilter,
  25191. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  25192. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  25193. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  25194. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (a.magFilter = r.LinearFilter,
  25195. a.minFilter = r.LinearFilter,
  25196. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  25197. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  25198. o.bindTexture(n.TEXTURE_CUBE_MAP, null),
  25199. c.__image__webglTextureCube = h,
  25200. a
  25201. }
  25202. ,
  25203. n.prototype.deallocateCubeTexture = function(e) {
  25204. var t = this.renderer
  25205. , i = t.context
  25206. , n = t.properties.get(e);
  25207. i.deleteTexture(n.__image__webglTextureCube)
  25208. }
  25209. ,
  25210. n.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  25211. var a = this.renderer
  25212. , s = a.context
  25213. , l = a.state
  25214. , c = a.properties.get(t);
  25215. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  25216. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  25217. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  25218. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  25219. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  25220. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  25221. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  25222. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  25223. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  25224. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  25225. l.bindTexture(s.TEXTURE_2D, null)
  25226. }
  25227. ,
  25228. n.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  25229. var s = this.renderer
  25230. , l = s.context
  25231. , c = s.state
  25232. , h = s.properties.get(t);
  25233. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  25234. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  25235. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  25236. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  25237. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  25238. }
  25239. ,
  25240. n.prototype.rebuildMipMaps2D = function(e) {
  25241. var t = this.renderer
  25242. , i = t.context
  25243. , n = t.state;
  25244. t.properties.get(e);
  25245. i.generateMipmap(i.TEXTURE_2D),
  25246. n.bindTexture(i.TEXTURE_2D, null)
  25247. }
  25248. ,
  25249. n.prototype.rebuildMipMaps3D = function(e) {
  25250. var t = this.renderer
  25251. , i = t.context
  25252. , n = t.state
  25253. , r = t.properties.get(e);
  25254. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  25255. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  25256. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  25257. }
  25258. ,
  25259. n.prototype.renderToCubeMap = function() {
  25260. var e = !1
  25261. , t = null
  25262. , i = null
  25263. , n = null
  25264. , a = null
  25265. , s = null
  25266. , l = 1;
  25267. return function(c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w) {
  25268. var _ = this.renderer;
  25269. _.context;
  25270. e || (i = new r.OrthographicCamera(l / -2,l / 2,l / 2,l / -2,-200,200),
  25271. i.position.z = 150,
  25272. t = new r.Scene,
  25273. t.add(i),
  25274. n = new r.ShaderMaterial({
  25275. uniforms: {
  25276. tDiffuse: {
  25277. type: "t",
  25278. value: null
  25279. },
  25280. alpha: {
  25281. type: "f",
  25282. value: 1
  25283. }
  25284. },
  25285. vertexShader: o.basicTextured.vertexShader,
  25286. fragmentShader: o.basicTextured.fragmentShader,
  25287. depthWrite: !1,
  25288. depthTest: !1,
  25289. side: r.DoubleSide
  25290. }),
  25291. a = new r.PlaneBufferGeometry(l,l),
  25292. s = new r.Mesh(a,n),
  25293. s.position.z = 0,
  25294. t.add(s),
  25295. e = !0);
  25296. var T = a.getAttribute("uv");
  25297. T.setDynamic(!0),
  25298. T.needsUpdate = !0;
  25299. var x = T.array
  25300. , S = p / u
  25301. , M = f / d
  25302. , R = g / u
  25303. , P = m / d;
  25304. x[0] = S,
  25305. x[1] = M + P,
  25306. x[2] = S + R,
  25307. x[3] = M + P,
  25308. x[4] = S,
  25309. x[5] = M,
  25310. x[6] = S + R,
  25311. x[7] = M;
  25312. var O = a.getAttribute("position");
  25313. O.setDynamic(!0),
  25314. O.needsUpdate = !0;
  25315. var L = O.array
  25316. , D = v / h.width - l / 2
  25317. , N = A / h.height - l / 2
  25318. , B = y / h.width
  25319. , F = C / h.height;
  25320. L[0] = D,
  25321. L[1] = N + F,
  25322. L[3] = D + B,
  25323. L[4] = N + F,
  25324. L[6] = D,
  25325. L[7] = N,
  25326. L[9] = D + B,
  25327. L[10] = N;
  25328. this.renderer.properties.get(c);
  25329. n.uniforms.tDiffuse.value = c,
  25330. n.blending = E || r.NoBlending,
  25331. n.transparent = !!b,
  25332. void 0 !== w && null !== w || (w = 1),
  25333. n.uniforms.alpha.value = w,
  25334. n.needUpdate = !0,
  25335. h.activeCubeFace = I,
  25336. h.viewport.set(0, 0, h.width, h.height);
  25337. var V = this.renderer.autoClear;
  25338. this.renderer.autoClear = !1,
  25339. this.renderer.render(t, i, h, !1),
  25340. this.renderer.autoClear = V
  25341. }
  25342. }(),
  25343. n.prototype.copyCubeMap = function() {
  25344. var e = !1
  25345. , t = null
  25346. , i = null
  25347. , a = null
  25348. , s = null
  25349. , l = null
  25350. , c = new r.Euler;
  25351. new r.Vector3;
  25352. return function(h, u, d, p, f, g, m, v, A) {
  25353. if(f > this.qualityManager.maxRenderTargetSize) return; //add
  25354. this.renderer;
  25355. if (!e) {
  25356. var y = 2;
  25357. i = new r.OrthographicCamera(y / -2,y / 2,y / 2,y / -2,0,200),
  25358. i.position.set(0, 0, 0),
  25359. t = new r.Scene,
  25360. t.add(i),
  25361. a = new r.ShaderMaterial({
  25362. uniforms: {
  25363. tDiffuse: {
  25364. type: "t",
  25365. value: null
  25366. },
  25367. alpha: {
  25368. type: "f",
  25369. value: 1
  25370. }
  25371. },
  25372. vertexShader: o.copyCubeMap.vertexShader,
  25373. fragmentShader: o.copyCubeMap.fragmentShader,
  25374. depthWrite: !1,
  25375. depthTest: !1,
  25376. side: r.DoubleSide
  25377. }),
  25378. s = new r.BoxGeometry(y,y,y),
  25379. l = new r.Mesh(s,a),
  25380. t.add(l),
  25381. e = !0
  25382. }
  25383. for (var C = 0; C < 6; C++)
  25384. n.getCubeOrientationForCubeFace(C, c),
  25385. l.rotation.copy(c),
  25386. l.matrixWorldNeedsUpdate = !0,
  25387. l.updateMatrixWorld(),
  25388. a.uniforms.tDiffuse.value = h,
  25389. a.blending = m || r.NoBlending,
  25390. a.transparent = !!v,
  25391. void 0 !== A && null !== A || (A = 1),
  25392. a.uniforms.alpha.value = A,
  25393. a.needUpdate = !0,
  25394. u.activeCubeFace = C,
  25395. u.viewport.set(0, 0, f, g),
  25396. this.renderer.render(t, i, u, !1)
  25397. }
  25398. }(),
  25399. n.getLookAtForCubeFace = function(e, t) {
  25400. switch (e) {
  25401. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  25402. t.set(1, 0, 0);
  25403. break;
  25404. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  25405. t.set(-1, 0, 0);
  25406. break;
  25407. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  25408. t.set(0, 1, 0);
  25409. break;
  25410. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  25411. t.set(0, -1, 0);
  25412. break;
  25413. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  25414. t.set(0, 0, 1);
  25415. break;
  25416. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  25417. t.set(0, 0, -1)
  25418. }
  25419. }
  25420. ,
  25421. n.getCubeOrientationForCubeFace = function(e, t) {
  25422. switch (e) {
  25423. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  25424. t.set(0, -Math.PI / 2, 0);
  25425. break;
  25426. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  25427. t.set(0, Math.PI / 2, 0);
  25428. break;
  25429. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  25430. t.set(Math.PI / 2, Math.PI, 0);
  25431. break;
  25432. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  25433. t.set(-Math.PI / 2, Math.PI, 0);
  25434. break;
  25435. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  25436. t.set(0, -Math.PI, 0);
  25437. break;
  25438. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  25439. t.set(0, 0, 0)
  25440. }
  25441. }
  25442. ,
  25443. t.exports = n
  25444. }
  25445. , {
  25446. "../enum/GLCubeFaces": 25,
  25447. "../enum/GLTextureType": 26,
  25448. "../enum/SceneRendererEvents": 43,
  25449. "../exception/BasicException": 55,
  25450. "../exception/RendererCreationException": 57,
  25451. "../settings": 166,
  25452. "../shaders": 167,
  25453. /********************************************************************fyz改 from徐世廷**********************************************************************/
  25454. "../util/browser": 182,
  25455. /************************************************************************************************************************************************/
  25456. events: 202,
  25457. three: 217
  25458. }],
  25459. 159: [function(e, t, i) {
  25460. "use strict";
  25461. function n(e) {
  25462. this.messenger = new a(e),
  25463. this.clientKey = null
  25464. }
  25465. var r = e("../util/ajax")
  25466. , o = e("./PostMessageType")
  25467. , a = e("./postmessage")
  25468. , s = e("./VersionInfo")
  25469. , l = e("events").EventEmitter
  25470. , c = window.location.origin + "/api/v1/user/";
  25471. n.prototype = Object.create(l.prototype),
  25472. n.prototype.bindEvents = function() {
  25473. this.messenger.on(o.ACTION, this.onMessageReceived.bind(this))
  25474. }
  25475. ,
  25476. n.prototype.waitForConnection = function() {
  25477. var e = new Promise(function(e, t) {
  25478. this.messenger.on(o.CONNECT, function(i) {
  25479. this.onConnectionReceived(i).then(e.bind(this, i.sdkVersion), t.bind())
  25480. }
  25481. .bind(this))
  25482. }
  25483. .bind(this));
  25484. return e
  25485. }
  25486. ,
  25487. n.prototype.onConnectionReceived = function(e) {
  25488. return this.messenger.setTarget(e.source, e.origin),
  25489. this.verifyConnection(e).then(function(t, i) {
  25490. this.messenger.send({
  25491. type: o.ACCEPT,
  25492. toId: e.fromId,
  25493. warning: i
  25494. }),
  25495. this.clientKey = t,
  25496. this.messenger.removeAllListeners(o.CONNECT),
  25497. this.bindEvents()
  25498. }
  25499. .bind(this), function(t) {
  25500. this.messenger.send({
  25501. type: o.REJECT,
  25502. toId: e.fromId,
  25503. reason: t
  25504. }),
  25505. this.messenger.setTarget()
  25506. }
  25507. .bind(this))
  25508. }
  25509. ,
  25510. n.prototype.verifyConnection = function(e) {
  25511. return new Promise(function(t, i) {
  25512. var n;
  25513. if (s.isDeprecated(e.sdkVersion))
  25514. n = "这个版本正在被弃用";
  25515. else if (!s.isSupported(e.sdkVersion))
  25516. return i("不支持此版本的SDK");
  25517. var o = {
  25518. cache: !1,
  25519. headers: {
  25520. "X-port-Application-Key": e.applicationKey,
  25521. "X-port-Referrer": e.origin
  25522. }
  25523. };
  25524. r.get(c, o).done(t.bind(this, e.applicationKey, n)).fail(i.bind(this, "key/referrer mismatch"))
  25525. }
  25526. )
  25527. }
  25528. ,
  25529. n.prototype.onMessageReceived = function(e) {
  25530. if (this.validateClientApplicationKey(e.applicationKey)) {
  25531. var t = this;
  25532. e.onDone = function(i) {
  25533. i.toId = e.fromId,
  25534. i.uid = e.uid,
  25535. i.type = o.RESPONSE,
  25536. t.messenger.send(i)
  25537. }
  25538. ,
  25539. this.emit(o.ACTION, e)
  25540. }
  25541. }
  25542. ,
  25543. n.prototype.validateClientApplicationKey = function(e) {
  25544. return this.clientKey === e
  25545. }
  25546. ,
  25547. n.prototype.sendEvent = function(e, t) {
  25548. this.messenger.send({
  25549. type: o.EVENT,
  25550. eventType: e,
  25551. eventData: t
  25552. })
  25553. }
  25554. ,
  25555. t.exports = n
  25556. }
  25557. , {
  25558. "../util/ajax": 181,
  25559. "./PostMessageType": 160,
  25560. "./VersionInfo": 163,
  25561. "./postmessage": 165,
  25562. events: 202
  25563. }],
  25564. 160: [function(e, t, i) {
  25565. "use strict";
  25566. t.exports = Object.freeze({
  25567. CONNECT: "postmessage.connect",
  25568. ACCEPT: "postmessage.accept",
  25569. REJECT: "postmessage.reject",
  25570. ACTION: "postmessage.action",
  25571. RESPONSE: "postmessage.response",
  25572. EVENT: "postmessage.event"
  25573. })
  25574. }
  25575. , {}],
  25576. 161: [function(e, t, i) {
  25577. "use strict";
  25578. t.exports = Object.freeze({
  25579. MOVE: "sdk.move",
  25580. ENTER_PANO: "sdk.enterpano",
  25581. MODEL_LOADED: "sdk.modelloaded"
  25582. })
  25583. }
  25584. , {}],
  25585. 162: [function(e, t, i) {
  25586. "use strict";
  25587. t.exports = Object.freeze({
  25588. FLY: "transition.fly",
  25589. FADEOUT: "transition.fade",
  25590. INSTANT: "transition.instant"
  25591. })
  25592. }
  25593. , {}],
  25594. 163: [function(e, t, i) {
  25595. "use strict";
  25596. t.exports = {
  25597. current: "1.0",
  25598. supported: ["1.0"],
  25599. deprecated: [],
  25600. isSupported: function(e) {
  25601. return this.supported.indexOf(e) !== -1
  25602. },
  25603. isDeprecated: function(e) {
  25604. return this.deprecated.indexOf(e) !== -1
  25605. },
  25606. isValid: function(e) {
  25607. return this.isSupported(e) || this.isDeprecated(e)
  25608. }
  25609. }
  25610. }
  25611. , {}],
  25612. 164: [function(e, t, i) {
  25613. (function(i) {
  25614. "use strict";
  25615. function n(e, t, i) {
  25616. e && (e = e.toLowerCase().trim());
  25617. var n = new I.UP.clone
  25618. , r = Math.PI / 3
  25619. , o = Math.PI / 2;
  25620. switch (e) {
  25621. case "left":
  25622. i.copy(t),
  25623. i.applyAxisAngle(n, o);
  25624. break;
  25625. case "right":
  25626. i.copy(t),
  25627. i.applyAxisAngle(n, -o);
  25628. break;
  25629. case "forwardleft":
  25630. i.copy(t),
  25631. i.applyAxisAngle(n, r);
  25632. break;
  25633. case "forwardright":
  25634. i.copy(t),
  25635. i.applyAxisAngle(n, -r);
  25636. break;
  25637. case "forward":
  25638. default:
  25639. i.copy(t)
  25640. }
  25641. return i
  25642. }
  25643. function r(e, t) {
  25644. if (e) {
  25645. var i = {
  25646. pano: e,
  25647. lookAtPoint: null,
  25648. duration: null,
  25649. maxDistanceOverride: null,
  25650. skipWarpingCheck: !1
  25651. };
  25652. this.player.flyToPano(i, function() {
  25653. t && t({
  25654. success: !0,
  25655. message: "Transition complete."
  25656. })
  25657. })
  25658. } else
  25659. R.warn("Showcase -> clickPanoObject: Unable to find pano."),
  25660. t && t({
  25661. success: !1,
  25662. error: "Unable to find pano."
  25663. })
  25664. }
  25665. function o(e, t) {
  25666. var i = this.findRankedPano(e, t);
  25667. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  25668. null)
  25669. }
  25670. function a(e, t) {
  25671. var i = this.findRankedtag(e, t);
  25672. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  25673. null)
  25674. }
  25675. function s(e, t) {
  25676. t.copy(I.FORWARD),
  25677. e.getDirection(t)
  25678. }
  25679. function l(e) {
  25680. function t(e) {
  25681. var t = (new c.Euler).setFromQuaternion(e.quaternion, "YXZ");
  25682. return {
  25683. x: c.Math.radToDeg(t._x),
  25684. y: c.Math.radToDeg(t._y),
  25685. z: c.Math.radToDeg(t._z)
  25686. }
  25687. }
  25688. var i = function(e) {
  25689. return e.alignmentType !== m.ALIGNED ? null : {
  25690. x: e.position.x,
  25691. y: e.position.y,
  25692. z: e.position.z
  25693. }
  25694. };
  25695. return {
  25696. panos: e.panos.list.map(function(n) {
  25697. var r = y.getCubemapUrls(e.urls, n.id, "high")[C.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  25698. return {
  25699. uuid: n.id,
  25700. aligned: n.alignmentType === m.ALIGNED,
  25701. neighbourUUIDs: n.neighbourUUIDs.slice(),
  25702. position: i(n),
  25703. rotation: t(n),
  25704. thumbnail: r
  25705. }
  25706. })
  25707. }
  25708. }
  25709. var c = e("three")
  25710. , h = e("./ApiHost")
  25711. , u = e("../util/logger")
  25712. , d = e("../util/common")
  25713. , p = e("../util/math")
  25714. , f = e("../enum/ModelManagerEvents")
  25715. , g = e("./PostMessageType")
  25716. , m = e("../enum/AlignmentType")
  25717. , v = e("../enum/Direction")
  25718. , A = e("./TransitionStyles")
  25719. , y = e("../util/panorama")
  25720. , C = e("../enum/GLCubeFaces")
  25721. , I = e("../enum/Vectors")
  25722. , E = e("../enum/Viewmode")
  25723. , b = e("../enum/WarpStyle")
  25724. , w = (e("../enum/Keys"),
  25725. e("../enum/PlayerEvents"))
  25726. , _ = e("../sdk/SdkEvents")
  25727. , I = e("../enum/Vectors")
  25728. , T = e("../enum/ControlEvents")
  25729. , x = e("../enum/RenderLayers")
  25730. , S = (e("../constants"),
  25731. e("../settings"))
  25732. , M = e("../lib/jpeg_encoder")
  25733. , R = new u(i)
  25734. , P = function() {
  25735. var e = function e() {
  25736. e.playerDirection.copy(e.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  25737. e.player.getDirection(e.playerDirection),
  25738. e.projectVectors();
  25739. var t = e.playerDirection.angleTo(e.lastFacingDirection);
  25740. if (e.angleTravelled += Math.abs(t),
  25741. e.angleTravelled >= Math.abs(e.angle)) {
  25742. if (e.active = !1,
  25743. e.onDone) {
  25744. var i = e.onDone;
  25745. i()
  25746. }
  25747. } else
  25748. e.lastFacingDirection.copy(e.playerDirection),
  25749. window.setTimeout(e, 4)
  25750. };
  25751. return e.active = !1,
  25752. e.angle = 0,
  25753. e.angleTravelled = 0,
  25754. e.playerDirection = new c.Vector3,
  25755. e.lastFacingDirection = new c.Vector3,
  25756. e.onDone = null,
  25757. e.player = null,
  25758. e.start = function(t, i, n, r) {
  25759. e.active = !0,
  25760. t && i && (i = 0),
  25761. e.angle = t || i,
  25762. e.xAngle = t,
  25763. e.yAngle = i,
  25764. e.angleTravelled = 0,
  25765. e.playerDirection.copy(n.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  25766. n.getDirection(e.playerDirection),
  25767. e.lastFacingDirection.copy(e.playerDirection),
  25768. e.projectVectors(),
  25769. e.onDone = r,
  25770. e.player = n,
  25771. e()
  25772. }
  25773. ,
  25774. e.projectVectors = function() {
  25775. e.xAngle && (e.playerDirection.projectOnPlane(I.UP),
  25776. e.lastFacingDirection.projectOnPlane(I.UP))
  25777. }
  25778. ,
  25779. e
  25780. }()
  25781. , O = function() {
  25782. var e = new c.Vector3;
  25783. return function(t) {
  25784. t ? (e.copy(t.position),
  25785. e.add(t.discPosition),
  25786. p.projectPositionToCanvas(e, this.player.camera, e),
  25787. this.click(e.x, e.y)) : R.warn("Showcase -> clicktagObject: Unable to find tag.")
  25788. }
  25789. }()
  25790. , L = function() {
  25791. return this.player.mode === E.PANORAMA ? S.insideLookLimitUp : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.minPolarAngle) : null
  25792. }
  25793. , D = function() {
  25794. return this.player.mode === E.PANORAMA ? S.insideLookLimitDown : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.maxPolarAngle) : null
  25795. }
  25796. , N = function(e) {
  25797. var t = new c.Vector3;
  25798. return function(e) {
  25799. var i = this.player.getDirection();
  25800. t.copy(i);
  25801. var n = t.y;
  25802. t.y = 0,
  25803. t.normalize();
  25804. var r = c.Math.radToDeg(t.angleTo(i)) * (n < 0 ? -1 : 1);
  25805. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.PANORAMA)
  25806. return 0 !== e && R.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  25807. 0;
  25808. this.player.mode === E.DOLLHOUSE && (r = -r);
  25809. var o = L.call(this) - .1
  25810. , a = D.call(this) + .1
  25811. , s = r + e;
  25812. s > o ? s = o : s < a && (s = a);
  25813. var l = s - r;
  25814. return e > 0 && l < .01 && (l = 0),
  25815. e < 0 && l > -.01 && (l = 0),
  25816. l
  25817. }
  25818. }()
  25819. , B = function() {
  25820. var e = new c.Euler;
  25821. return function(t) {
  25822. return e.setFromQuaternion(t.quaternion, "YXZ"),
  25823. {
  25824. position: {
  25825. x: t.position.x,
  25826. y: t.position.y,
  25827. z: t.position.z
  25828. },
  25829. rotation: {
  25830. x: c.Math.radToDeg(e.x),
  25831. y: c.Math.radToDeg(e.y),
  25832. z: 0
  25833. },
  25834. pano: t.currentPano ? t.currentPano.id : null,
  25835. mode: t.mode
  25836. }
  25837. }
  25838. }()
  25839. , F = null;
  25840. t.exports = {
  25841. init: function(e, t, i, n, r) {
  25842. V.init(e, t, i, r),
  25843. F = new Promise(function(e, t) {
  25844. i.on(w.Ready, function() {
  25845. e()
  25846. })
  25847. }
  25848. .bind(this));
  25849. var o = new h(window)
  25850. , a = o.waitForConnection();
  25851. a.then(function(e) {
  25852. o.on(g.ACTION, V.onMessageReceive.bind(V))
  25853. });
  25854. var s = function() {
  25855. var e = Date.now();
  25856. return function() {
  25857. if (!(Date.now() - e < 100)) {
  25858. var t = B(i);
  25859. o.sendEvent(_.MOVE, {
  25860. state: t
  25861. }),
  25862. e = Date.now()
  25863. }
  25864. }
  25865. }();
  25866. i.on(w.Move, s),
  25867. i.on(w.ViewChanged, s),
  25868. n.on(f.ActiveModelChanged, function(e) {
  25869. function t(e) {
  25870. var t, i = e.newPano.id;
  25871. e.oldPano && (t = e.oldPano.id),
  25872. i !== t && o.sendEvent(_.ENTER_PANO, {
  25873. oldPano: t,
  25874. newPano: i
  25875. })
  25876. }
  25877. var i = e.model
  25878. , n = e.oldModel;
  25879. V.model = i,
  25880. a.then(function() {
  25881. o.sendEvent(_.MODEL_LOADED, {
  25882. metadata: l(i)
  25883. })
  25884. }),
  25885. n && n.panos.forEach(function(e) {
  25886. e.removeEventListener("enter", t)
  25887. }),
  25888. i.panos.forEach(function(e) {
  25889. e.on("enter", t)
  25890. })
  25891. })
  25892. }
  25893. };
  25894. var V = {
  25895. director: null,
  25896. player: null,
  25897. controls: null,
  25898. sceneRenderer: null,
  25899. model: null,
  25900. init: function(e, t, i, n) {
  25901. this.director = e,
  25902. this.player = i,
  25903. this.controls = t,
  25904. this.sceneRenderer = n
  25905. },
  25906. handleToObject: {},
  25907. objectToHandle: {},
  25908. handleCount: 0,
  25909. onMessageReceive: function(e) {
  25910. if (e) {
  25911. var t = e.targetFunction
  25912. , i = e.params
  25913. , n = e.onDone;
  25914. t && this[t] && this[t](i, n)
  25915. }
  25916. },
  25917. waitForInit: function(e, t) {
  25918. F.then(t.bind({
  25919. success: !0,
  25920. message: "Init complete."
  25921. }))
  25922. },
  25923. moveToPano: function(e, t) {
  25924. var i = new c.Euler(0,0,0,"YXZ")
  25925. , n = new c.Quaternion;
  25926. return function(e, t) {
  25927. var r = e.pano
  25928. , o = e.rotation
  25929. , a = e.transition;
  25930. if (!this.model)
  25931. return t({
  25932. success: !1,
  25933. error: "The model has not been loaded yet"
  25934. });
  25935. var s = this.model.panos.get(r);
  25936. if (!s)
  25937. return t({
  25938. success: !1,
  25939. error: r + " does not exist in this model"
  25940. });
  25941. if (!o)
  25942. return t({
  25943. sucess: !1,
  25944. erorr: o + " is not a valid rotation"
  25945. });
  25946. i.set(c.Math.degToRad(o.x || 0), c.Math.degToRad(o.y || 0), c.Math.degToRad(o.z || 0), "YXZ"),
  25947. console.log(o.z);
  25948. var l = {
  25949. success: !0,
  25950. message: r
  25951. };
  25952. if (a === A.FADEOUT)
  25953. n.setFromEuler(i),
  25954. this.player.warpToPano(s, n, null, null, b.BLACK, null, null, t.bind(this, l));
  25955. else {
  25956. var h, u;
  25957. a === A.INSTANT && (h = 0,
  25958. u = 0);
  25959. var d = I.FORWARD.clone().applyEuler(i).add(s.position);
  25960. this.player.flyToPano({
  25961. pano: s,
  25962. lookAtPoint: d,
  25963. duration: h,
  25964. aimDuration: u
  25965. }, t.bind(this, l))
  25966. }
  25967. }
  25968. }(),
  25969. moveInDirection: function(e, t) {
  25970. var i = e.direction;
  25971. return "undefined" == typeof v[i] ? (R.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  25972. void (t && t({
  25973. success: !1,
  25974. error: "Invalid direction."
  25975. }))) : void this.player.flyLocalDirection(I[i].clone()).then(function(e) {
  25976. t(e ? {
  25977. success: !0,
  25978. message: "moved " + i
  25979. } : {
  25980. success: !1,
  25981. error: "Cannot move in direction: " + i
  25982. })
  25983. })
  25984. },
  25985. getPose: function(e, t) {
  25986. this.player.camera.position,
  25987. (new c.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ");
  25988. return t({
  25989. success: !0,
  25990. message: B(this.player)
  25991. })
  25992. },
  25993. takeScreenShot: function() {
  25994. var e = new c.PerspectiveCamera
  25995. , t = new c.WebGLRenderTarget;
  25996. return function(i, n) {
  25997. if (!i.resolution)
  25998. return n({
  25999. success: !1,
  26000. error: "An invalid resolution was specified"
  26001. });
  26002. if (i.resolution.width === -1 || i.resolution.height === -1) {
  26003. var r = this.sceneRenderer.renderer.getSize();
  26004. i.resolution.width = r.width,
  26005. i.resolution.height = r.height
  26006. }
  26007. e.layers.set(x.DEFAULT),
  26008. i.visibleObjects && (i.visibleObjects.showtags && e.layers.enable(x.TAG),
  26009. i.visibleObjects.showPucks && e.layers.enable(x.PANOMARKERS),
  26010. i.visibleObjects.showReticule && e.layers.enable(x.RETICULE));
  26011. var o = i.resolution.width
  26012. , a = i.resolution.height
  26013. , s = o / a;
  26014. e.position.copy(this.sceneRenderer.camera.position),
  26015. e.quaternion.copy(this.sceneRenderer.camera.quaternion),
  26016. e.projectionMatrix.copy(this.player.camera.projectionMatrix),
  26017. e.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / s,
  26018. t.setSize(o, a),
  26019. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, e, t);
  26020. var l = new Uint8Array(o * a * 4);
  26021. this.sceneRenderer.renderer.readRenderTargetPixels(t, 0, 0, o, a, l);
  26022. var c = M.encode({
  26023. data: l,
  26024. width: o,
  26025. height: a,
  26026. heading: 180,
  26027. pitch: 0
  26028. }, {
  26029. quality: 75,
  26030. flipY: !0
  26031. })
  26032. , h = "data:image/jpg;base64," + d.uint8ToBase64(c.data);
  26033. n({
  26034. success: !0,
  26035. message: h
  26036. })
  26037. }
  26038. }(),
  26039. findRankedPano: function(e, t) {
  26040. var i = new c.Vector3
  26041. , r = new c.Vector3;
  26042. return function(e, t) {
  26043. s(this.player, r),
  26044. n(t, r, i);
  26045. var o = this.player.rankedPanoInDirection(e, i);
  26046. if (o) {
  26047. var a = this.objectToHandle[o.id];
  26048. return a || (this.objectToHandle[o.id] = a = this.handleCount++,
  26049. this.handleToObject[a] = o),
  26050. a
  26051. }
  26052. return R.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  26053. -1
  26054. }
  26055. }(),
  26056. findRankedtag: function(e, t) {
  26057. var i = new c.Vector3
  26058. , r = new c.Vector3;
  26059. return function(e, t) {
  26060. s(this.player, r),
  26061. n(t, r, i);
  26062. var o = this.player.rankedtagInDirection(e, i);
  26063. if (o) {
  26064. var a = this.objectToHandle[o.sid];
  26065. return a || (this.objectToHandle[o.sid] = a = this.handleCount++,
  26066. this.handleToObject[a] = o),
  26067. a
  26068. }
  26069. return R.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  26070. -1
  26071. }
  26072. }(),
  26073. clickNearesttag: function(e) {
  26074. this.clickRankedtag(0, e)
  26075. },
  26076. clickRankedtag: function(e, t) {
  26077. var i = a.call(this, e, t);
  26078. i && O.call(this, i)
  26079. },
  26080. clickNearestPano: function(e, t) {
  26081. this.clickRankedPano(0, e, t)
  26082. },
  26083. clickRankedPano: function(e, t, i) {
  26084. var n = o.call(this, e, t);
  26085. n ? r.call(this, n, i) : i(null)
  26086. },
  26087. clickPano: function(e, t) {
  26088. var i = this.handleTable[e];
  26089. i ? r.call(this, i, t) : t(null)
  26090. },
  26091. rotateDirection: function() {
  26092. return function(e, t) {
  26093. var i = e.direction
  26094. , n = e.angle;
  26095. if (!P.active) {
  26096. var r = 0
  26097. , o = 0
  26098. , a = 0
  26099. , s = 0;
  26100. if (!n || isNaN(n))
  26101. return R.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  26102. void (t && t({
  26103. success: !1,
  26104. error: "Invalid rotation angle."
  26105. }));
  26106. if (this.player.mode === E.TRANSITIONING)
  26107. return R.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  26108. void (t && t({
  26109. success: !1,
  26110. error: "Cannot rotate while transitioning"
  26111. }));
  26112. if (i === v.RIGHT || i === v.LEFT)
  26113. i === v.RIGHT && (n = -n),
  26114. r = n > 0 ? -1 : 1,
  26115. a = n;
  26116. else {
  26117. if (i !== v.UP && i !== v.DOWN)
  26118. return R.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  26119. void (t && t({
  26120. success: !1,
  26121. error: "Invalid direction for rotation."
  26122. }));
  26123. if (this.player.mode === E.FLOORPLAN)
  26124. return R.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  26125. void (t && t({
  26126. success: !1,
  26127. error: "Cannot rotate " + i + " in floorplan mode"
  26128. }));
  26129. if (i === v.DOWN && (n = -n),
  26130. n = N.call(this, n),
  26131. 0 === n)
  26132. return R.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  26133. void (t && t({
  26134. success: !1,
  26135. error: "Already at maximum rotation in direction: " + i
  26136. }));
  26137. o = n > 0 ? 1 : -1,
  26138. s = n
  26139. }
  26140. var l = n;
  26141. n = c.Math.degToRad(n),
  26142. a = c.Math.degToRad(a),
  26143. s = c.Math.degToRad(s);
  26144. var h = this.controls.activeControl
  26145. , u = function() {
  26146. h.stopRotating(!0),
  26147. t && t({
  26148. success: !0,
  26149. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  26150. })
  26151. };
  26152. h.startRotating(r, o),
  26153. P.start(a, s, this.player, u)
  26154. }
  26155. }
  26156. }(),
  26157. rotate: function() {
  26158. var e = new c.Vector3
  26159. , t = new c.Vector3;
  26160. return function(i, n) {
  26161. var r = i.xAngle
  26162. , o = i.yAngle;
  26163. if (!P.active) {
  26164. if (r = r || 0,
  26165. o = o || 0,
  26166. isNaN(r) || isNaN(o))
  26167. return R.warn("Showcase -> rotate: Invalid rotation angle."),
  26168. void (n && n({
  26169. success: !1,
  26170. error: "Invalid rotation angle."
  26171. }));
  26172. if (this.player.mode === E.TRANSITIONING)
  26173. return R.warn("Automation -> rotate: Cannot rotate while transitioning"),
  26174. void (n && n({
  26175. success: !1,
  26176. error: "Cannot rotate while transitioning"
  26177. }));
  26178. Math.abs(r) < .01 && (r = 0),
  26179. Math.abs(o) < .01 && (o = 0);
  26180. var a = o;
  26181. o = N.call(this, o),
  26182. r = -r;
  26183. var s = a > 0 ? "UP" : "DOWN";
  26184. if (!r && a && !o)
  26185. return R.warn("Showcase -> rotate: Already at maximum rotation in direction: " + s),
  26186. void (n && n({
  26187. success: !1,
  26188. error: "Already at maximum rotation in direction: " + s
  26189. }));
  26190. a > o && R.warn("Showcase -> rotate: Reached maximum rotation in direction: " + s);
  26191. var l = o;
  26192. o = c.Math.degToRad(o),
  26193. r = c.Math.degToRad(r),
  26194. e.copy(this.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  26195. this.player.getDirection(e),
  26196. t.copy(e).applyAxisAngle(I.UP, r),
  26197. t.applyAxisAngle(I.RIGHT, o);
  26198. var h = (e.angleTo(t),
  26199. r > 0 ? -1 : r < 0 ? 1 : 0)
  26200. , u = o > 0 ? 1 : o < 0 ? -1 : 0;
  26201. Math.abs(r) > Math.abs(o) ? u *= Math.abs(o / r) : Math.abs(o) > Math.abs(r) && (h *= Math.abs(r / o));
  26202. var d = this.controls.activeControl
  26203. , p = function() {
  26204. d.stopRotating(!0),
  26205. n && n({
  26206. success: !0,
  26207. message: "Rotated " + i.xAngle.toFixed(2) + "° horizontally, " + l.toFixed(2) + "° vertically"
  26208. })
  26209. };
  26210. d.startRotating(h, u),
  26211. P.start(r, o, this.player, p)
  26212. }
  26213. }
  26214. }(),
  26215. panCamera: function(e, t) {
  26216. function i(e) {
  26217. switch (r.removeAllListeners(T.AutoPanComplete),
  26218. r.removeAllListeners(T.AutoPanInterrupt),
  26219. r.removeAllListeners(T.AutoPanClamped),
  26220. e) {
  26221. case T.AutoPanInterrupt:
  26222. t({
  26223. success: !0,
  26224. message: "Camera panning interrupted."
  26225. });
  26226. break;
  26227. case T.AutoPanClamped:
  26228. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  26229. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  26230. return void t({
  26231. success: !1,
  26232. error: "Already at edge of current model bounds."
  26233. });
  26234. var i = "The view point is outside the bounds for the current model. ";
  26235. i += "The view point was clamped to " + o(r.target.x, r.target.z),
  26236. console.warn(i)
  26237. }
  26238. case T.AutoPanComplete:
  26239. t({
  26240. success: !0,
  26241. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  26242. })
  26243. }
  26244. }
  26245. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.FLOORPLAN)
  26246. return t({
  26247. success: !1,
  26248. error: "Camera panning is not available in the current mode: " + this.player.mode
  26249. });
  26250. var n = e.position
  26251. , r = this.player.control;
  26252. r.setAutoPanPosition(n.x, n.z),
  26253. r.autoPan = !0;
  26254. var o = function(e, t) {
  26255. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  26256. };
  26257. r.on(T.AutoPanComplete, i.bind(this, T.AutoPanComplete)),
  26258. r.on(T.AutoPanInterrupt, i.bind(this, T.AutoPanInterrupt)),
  26259. r.on(T.AutoPanClamped, i.bind(this, T.AutoPanClamped))
  26260. },
  26261. click: function(e, t) {
  26262. var i = e.x
  26263. , n = e.y
  26264. , r = e.percentage;
  26265. r === !0 && (i = i / 100 * $("#player").width(),
  26266. n = n / 100 * $("#player").height()),
  26267. this.player.handleInputStart(i, n),
  26268. this.player.updateIntersect(),
  26269. this.player.handleInputEnd(i, n)
  26270. },
  26271. mouseOver: function(e, t) {
  26272. var i = e.x
  26273. , n = e.y
  26274. , r = e.percentage;
  26275. r === !0 && (i = i / 100 * $("#player").width(),
  26276. n = n / 100 * $("#player").height()),
  26277. this.player.handleInputMove(i, n),
  26278. this.player.updateIntersect()
  26279. },
  26280. moveToMode: function(e, t) {
  26281. function i(e) {
  26282. t(e ? {
  26283. success: !1,
  26284. error: "Failed to load new mode: " + e
  26285. } : {
  26286. success: !0,
  26287. message: "Moved to new mode: " + n
  26288. })
  26289. }
  26290. var n = e.mode;
  26291. n === E.PANORAMA || n === E.DOLLHOUSE || n === E.FLOORPLAN ? this.director.changeMode(n).then(function() {
  26292. i()
  26293. }, function(e) {
  26294. i(e)
  26295. }) : t({
  26296. success: !1,
  26297. error: "Invalid mode selection"
  26298. })
  26299. }
  26300. }
  26301. }
  26302. ).call(this, "/js/sdk/automation.js")
  26303. }
  26304. , {
  26305. "../constants": 8,
  26306. "../enum/AlignmentType": 17,
  26307. "../enum/ControlEvents": 21,
  26308. "../enum/Direction": 22,
  26309. "../enum/GLCubeFaces": 25,
  26310. "../enum/Keys": 30,
  26311. "../enum/ModelManagerEvents": 33,
  26312. "../enum/PlayerEvents": 40,
  26313. "../enum/RenderLayers": 41,
  26314. "../enum/Vectors": 50,
  26315. "../enum/Viewmode": 51,
  26316. "../enum/WarpStyle": 52,
  26317. "../lib/jpeg_encoder": 94,
  26318. "../sdk/SdkEvents": 161,
  26319. "../settings": 166,
  26320. "../util/common": 185,
  26321. "../util/logger": 189,
  26322. "../util/math": 190,
  26323. "../util/panorama": 191,
  26324. "./ApiHost": 159,
  26325. "./PostMessageType": 160,
  26326. "./TransitionStyles": 162,
  26327. three: 217
  26328. }],
  26329. 165: [function(e, t, i) {
  26330. "use strict";
  26331. function n(e) {
  26332. this.sourceWindow = e,
  26333. this.targetWindow = null,
  26334. this.targetOrigin = null,
  26335. this.id = Math.floor(1e5 * Math.random()),
  26336. this.bindEvents()
  26337. }
  26338. var r = e("./PostMessageType")
  26339. , o = e("events").EventEmitter;
  26340. n.prototype = Object.create(o.prototype),
  26341. n.prototype.bindEvents = function() {
  26342. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  26343. }
  26344. ,
  26345. n.prototype.setTarget = function(e, t) {
  26346. this.targetWindow = e,
  26347. this.targetOrigin = t
  26348. }
  26349. ,
  26350. n.prototype.onPostmessageReceived = function(e) {
  26351. var t = e.origin || e.originalEvent.origin
  26352. , i = e.source;
  26353. switch (e.data.type) {
  26354. case r.CONNECT:
  26355. break;
  26356. case r.RESPONSE:
  26357. if (this.id !== e.data.toId)
  26358. return;
  26359. default:
  26360. if (!this.validateMessageOrigin(t))
  26361. return
  26362. }
  26363. var n = e.data;
  26364. n.source = i,
  26365. n.origin = t,
  26366. n.timestamp = Date.now(),
  26367. this.emit(e.data.type, n)
  26368. }
  26369. ,
  26370. n.prototype.validateMessageOrigin = function(e) {
  26371. return "*" === this.targetOrigin || e === this.targetOrigin
  26372. }
  26373. ,
  26374. n.prototype.send = function(e) {
  26375. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  26376. this.targetWindow.postMessage(e, this.targetOrigin))
  26377. }
  26378. ,
  26379. t.exports = n
  26380. }
  26381. , {
  26382. "./PostMessageType": 160,
  26383. events: 202
  26384. }],
  26385. 166: [function(e, t, i) {
  26386. "use strict";
  26387. var n = e("three")
  26388. , r = e("./util/browser")
  26389. , o = e("./enum/Viewmode")
  26390. , a = e("./enum/VROption")
  26391. , s = e("./enum/Colors")
  26392. , l = e("./enum/WarpStyle")
  26393. , c = e("./util/easing")
  26394. , h = e("./util/common")
  26395. , u = e("./util/showcase")
  26396. , d = e("./constants")
  26397. , p = {
  26398. debug: !1,
  26399. version: "2.25.6-0-gd87e5b1",
  26400. languageTag: r.valueFromHash("lang", null),
  26401. pageTitle: "四维虚拟漫游",
  26402. authorizationHeader: u.getAuthorizationHeader(),
  26403. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  26404. logLevel: r.valueFromHash("log", 2),
  26405. skyboxRadius: 2500,
  26406. modelBoundsPadding: 5,
  26407. showNeighbors: !1,
  26408. brand: r.valueFromHash("brand", !0),
  26409. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  26410. startHighlights: r.valueFromHash("hl", -1),
  26411. specialEdition: r.valueFromHash("bn", 0),
  26412. useWheel: r.valueFromHash("wh", !0),
  26413. crossOrigin: "anonymous",
  26414. fancierTransition: !1,
  26415. wireframe: !1,
  26416. skyboxWireframe: !1,
  26417. modelAlpha: 1,
  26418. highlightPanoSelection: !1,
  26419. showSweeps: !0,
  26420. showSkyboxes: !1,
  26421. showMesh: !0,
  26422. showFloors: !1,
  26423. showFloorDuration: 300,
  26424. showFloorDelay: 300,
  26425. hideFloorDuration: 300,
  26426. hideFloorDelay: 0,
  26427. reticuleOpacityTransitionTime: 250,
  26428. reticuleColor: window.DATA.mouseMarkerColor || s.newBlue, // 方奕卓 配置鼠标标志颜色
  26429. markerOpacityTransitionTime: 500,
  26430. guiAnimationSpeed: 250,
  26431. highlightAnimationDuration: 500,
  26432. modelComponentLoadSpinnerDelay: 150,
  26433. captureErrors: !1,
  26434. maxMobileTextures: 6,
  26435. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  26436. startupFlyinDelay: 3e3,
  26437. dollhouseDefault: {
  26438. minDistance: 15,
  26439. maxDistance: 50,
  26440. minPolarAngle: n.Math.degToRad(10),
  26441. maxPolarAngle: n.Math.degToRad(90)
  26442. },
  26443. hideReticuleTimeout: 1e3,
  26444. analytics: {
  26445. inactivityThreshold: 30,
  26446. sessionTrackingRate: .15,
  26447. maxTrackedErrors: 20,
  26448. sessionDurationPingFrequency: 10,
  26449. sessionDurationTimeout: 15
  26450. },
  26451. flydown: {
  26452. movementEasing: "easeInOutQuad",
  26453. movementDelay: .001,
  26454. rotationEasing: "easeInOutQuad",
  26455. rotationDelay: .5,
  26456. modelTextureDelay: .75,
  26457. skyboxDelay: .75
  26458. },
  26459. transition: {
  26460. flySpeed: .001,
  26461. flyTime: 750,
  26462. flytimeMaxDistanceThreshold: 5,
  26463. flytimeDistanceMultiplier: 150,
  26464. aimTime: 1500,
  26465. aimSlowFactor: 1.5,
  26466. blur: 0.8,
  26467. movementEasing: "easeInOutQuad",
  26468. blendEasing: "easeInOutQuad",
  26469. fastForwardFactor: 4,//r.valueFromHash("mfis", 3) //快速停止导览的速度,原先是3
  26470. },
  26471. show360Views: {
  26472. enabled: !0,
  26473. transitionTime: 1e3
  26474. },
  26475. quickstart: {
  26476. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  26477. animation: 1400,
  26478. showTextDelay: 500,
  26479. fadeOutDelay: 3e3,
  26480. fovChange: 10
  26481. },
  26482. appConfig: {
  26483. webvr_version: null,
  26484. segment_key: null,
  26485. embedly_key: null,
  26486. branch_key: null,
  26487. keen_write_key: null,
  26488. keen_project_id: null
  26489. },
  26490. vr: {
  26491. enabled: !0,
  26492. allowWebVR: !1,
  26493. option: r.valueFromHash("vr", a.CONTEXTUAL)
  26494. },
  26495. share: {
  26496. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  26497. },
  26498. input: {
  26499. longTapThreshold: 200,
  26500. moveToleranceNDC: 0.01,//.08,
  26501. touchMoveThreshold: 25
  26502. },
  26503. help: {
  26504. modalStayDuration: 600
  26505. },
  26506. immersive: {
  26507. timeToShowAgain: 1250,
  26508. uiStayDuration: 600
  26509. },
  26510. tourInteraction: {
  26511. disabled: "0" === r.valueFromHash("tourcta", null),
  26512. showPauseButton: 1e3,
  26513. showModal: 1500,
  26514. allowNextClick: 200,
  26515. largeModal: "1" === r.valueFromHash("tourcta", null),
  26516. smallModal: "2" === r.valueFromHash("tourcta", null)
  26517. },
  26518. labels: {
  26519. enabled: !1,
  26520. hideUntilStart: !0,
  26521. fadeInDuration: 250,
  26522. fadeInDelay: 250,
  26523. fadeOutDuration: 250,
  26524. fadeOutDelay: 0,
  26525. zoomHideThreshhold: {
  26526. mobile: r.isSmallScreen() ? .45 : .6,
  26527. desktop: 2
  26528. },
  26529. zoomTruncateThreshhold: {
  26530. mobile: r.isSmallScreen() ? .35 : .45,
  26531. desktop: .85
  26532. },
  26533. minLengthForTruncate: 16,
  26534. truncateLength: 12,
  26535. truncateSuffix: "..."
  26536. },
  26537. tags: {
  26538. enabled: r.valueFromHash("mt", 1),
  26539. startup: {
  26540. hideUntilStart: !0,
  26541. fadeInDuration: 500,
  26542. fadeInDelay: 100
  26543. },
  26544. visibility: {
  26545. anyDistance: !0,
  26546. visibleDistance: 8,
  26547. cameraClearance: .1,
  26548. alphaTestLevel: .05,
  26549. hideViaFloor: !0,
  26550. hideOffScreenDisc: !1,
  26551. hideOffScreenObject: !1
  26552. },
  26553. disc: {
  26554. opacity: 1,
  26555. disabledOpacity: .5,
  26556. scale: {
  26557. nearBound: 1.5,
  26558. farBound: 4.8,
  26559. linkFarBound: !1,
  26560. linkPercent: 40,
  26561. maxSize: 80,
  26562. minSize: 40,
  26563. baseViewportSize: 800,
  26564. responsiveness: 100
  26565. }
  26566. },
  26567. pole: {
  26568. enabled: !0,
  26569. height: .5,
  26570. width: 2,
  26571. opacity: .5,
  26572. color: "white"
  26573. },
  26574. navigate: {
  26575. nearestPano: !0,
  26576. lineOfSight: !0,
  26577. reactivate: !0,
  26578. aimAt: "disc",
  26579. tiltTolerance: 25,
  26580. rotateSpeedFactor: .6
  26581. }
  26582. },
  26583. path: {
  26584. color: window.DATA.floorMarkerColor || s.newBlue, // 方奕卓 配置导览标志颜色
  26585. colorUp: s._desat(s.newBlue, .5),
  26586. colorDown: s._darken(s.newBlue, .35),
  26587. opacity: .5,
  26588. style: "ribbon",
  26589. height: .025,
  26590. ribbonWidth: .24,
  26591. outsideHeight: .5,
  26592. waypointRadius: .5,
  26593. waypointIndoorRadius: .24,
  26594. waypointPulse: 1e3,
  26595. typ: l.BLACK,
  26596. meshFree: r.valueFromHash("mf", 1),
  26597. mapGuides: r.valueFromHash("guides", !0),
  26598. fadeInTime: 400,
  26599. fadeOutTime: 300
  26600. },
  26601. warp: {
  26602. nearPanoDist: .1,
  26603. matchCam: !1,
  26604. blur: .33,
  26605. fastTime: 1500,
  26606. teleportTime: 1500,//瞬间过渡的时间
  26607. flytimeDistanceMultiplier:150,//add
  26608. flyTime:750,//add
  26609. outsideTime: 2e3,
  26610. lookAheadMax: .3,
  26611. lookAheadDist: 2.5,
  26612. softPushDist: .37,
  26613. softPushEnd: .3,
  26614. softBendAngle: 8,
  26615. softBendTilt: 4,
  26616. softBendEnd: .3,
  26617. doBurns: true, //r.valueFromHash("kb", !0),
  26618. burnsAngle: 8, //导览在每个点停留时的旋转角度
  26619. minBurnsAngle: 35,
  26620. minDownAngle: -35,
  26621. maxTurnPerSec: 280,
  26622. maxAimPerSec: 35,
  26623. minRotation: 12,
  26624. maxAimRotation: 33.2,
  26625. turnFriction: .2,
  26626. flySpeed: .01,
  26627. minWarpTime: 1200,
  26628. warpInterruptionRedirectTime: 500,
  26629. tourStepDelay: r.valueFromHash("st", 0),
  26630. walkDelay: 0,
  26631. walkMaxDist: 50,
  26632. walkMinDist: .8,
  26633. walkSlideShowThreshhold: 3000,
  26634. walkExtraPanosDistance: .4,
  26635. timePerMeter: 1200,
  26636. motionLeadTime: 5000,
  26637. movementEasing: "easeInOutQuad",
  26638. blendEasing: "easeInOutQuad",
  26639. showBunny: !1,
  26640. loop: r.valueFromHash("lp", !1),
  26641. auto: r.valueFromHash("ts", -1),
  26642. eOrder: 'YXZ', //"YXZ",
  26643. stepFactor: .25,
  26644. brakeStrength: 2,
  26645. minBrakeAngle: .1,
  26646. maxBrakeAngle: 1.8,
  26647. climbEffort: 4
  26648. },
  26649. rotationFriction: .05,
  26650. rotationAccelerationInside: 4.5,
  26651. rotationAccelerationOutside: .15,
  26652. rotationAfterMoveMultiplier: 40,
  26653. rotationAfterMoveHistoryCount: 5,
  26654. panFriction: .09,
  26655. panAccelerationOutside: 60,
  26656. onload: r.valueFromHash("onload", o.PANORAMA),
  26657. zoomNearLimit: .1,
  26658. zoomFarLimit: 50,
  26659. navigation: {
  26660. panoScores: !1,
  26661. mouseDirection: !0,
  26662. filterStrictness: .75,
  26663. angleFactor: -30,
  26664. directionFactor: 10,
  26665. distanceFactor: -1,
  26666. optionalityFactor: 3
  26667. },
  26668. sdkInit: !1,
  26669. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  26670. console: r.valueFromHash("console", !1),
  26671. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  26672. panoramaNeighbourMaxDistance: 5,
  26673. panoFloorClickRadius: .35,
  26674. showScreenshotLocations: !1,
  26675. showAxis: !1,
  26676. showNeighbourRaycasts: !1,
  26677. colorMarkerOnLoad: !1,
  26678. colorMarkerByFloor: !1,
  26679. tiling: {
  26680. panoPreRenderRepeatDelay: 2500,
  26681. panoPreRenderDelay: 500,
  26682. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  26683. tilingFlagNames: ["usetiles", "tiles"],
  26684. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  26685. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  26686. overlayStyle: r.valueFromHash("tileoverlay", 0),
  26687. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  26688. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  26689. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 1/* 2 */),
  26690. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  26691. customCompression: r.valueFromHash("tilecustcomp", 0),
  26692. // mobileHighQualityOverride: !1,
  26693. mobileHighQualityOverride: 1,
  26694. allowUltraHighResolution: true
  26695. },
  26696. zoom: {
  26697. enabled: true,
  26698. forceOff: r.valueFromHash("nozoom", 0),
  26699. overridemax: r.valueFromHash("maxzoom", null),
  26700. overridemin: r.valueFromHash("minzoom", null),
  26701. max: d.highQualityMaxZoom,
  26702. min: 1,
  26703. transitionStyle: r.valueFromHash("zoomtrans", 1),
  26704. activationThreshold: 1.1,
  26705. restoreTime: 500
  26706. },
  26707. profiling: {
  26708. enabled: r.valueFromHash("mem", !1)
  26709. }
  26710. };
  26711. p = h.deepExtend(p, d, {
  26712. insideFOV: r.valueFromHash("fov", d.insideFOV),
  26713. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  26714. panorama: {
  26715. transitionTime: 1e3,
  26716. modelAlpha: 0,
  26717. modelAlphaDelay: p.flydown.modelTextureDelay,
  26718. modelAlphaLength: 1,
  26719. skyboxOpacity: 1,
  26720. skyboxOpacityDelay: p.flydown.skyboxDelay,
  26721. skyboxOpacityLength: .9,
  26722. fovLength: 1,
  26723. fovDelay: 0,
  26724. cameraMatrixDuration: .8,
  26725. cameraMatrixDelay: 0,
  26726. cameraMatrixEase: c.easeInCubic,
  26727. reticuleOpacity: 1,
  26728. markerOpacity: .3,
  26729. markerOpacityOnHover: 1
  26730. },
  26731. dollhouse: {
  26732. transitionTime: 1e3,
  26733. modelAlpha: 1,
  26734. modelAlphaDelay: 0,
  26735. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  26736. skyboxOpacity: 0,
  26737. skyboxOpacityDelay: 0,
  26738. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  26739. fovLength: 1,
  26740. fovDelay: 0,
  26741. cameraMatrixDuration: .8,
  26742. cameraMatrixDelay: .3,
  26743. cameraMatrixEase: c.easeInCubic,
  26744. reticuleOpacity: 1,
  26745. markerOpacity: 0,
  26746. markerOpacityOnHover: 0
  26747. },
  26748. floorplan: {
  26749. transitionTime: 1e3,
  26750. modelAlpha: 1,
  26751. modelAlphaDelay: 0,
  26752. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  26753. skyboxOpacity: 0,
  26754. skyboxOpacityDelay: 0,
  26755. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  26756. fovLength: 1,
  26757. fovDelay: 0,
  26758. cameraMatrixDuration: .5,
  26759. cameraMatrixDelay: 0,
  26760. cameraMatrixEase: c.easeOutCubic,
  26761. reticuleOpacity: 1,
  26762. markerOpacity: 0,
  26763. markerOpacityOnHover: 0,
  26764. cameraHeight: 50
  26765. },
  26766. transitioning: {
  26767. reticuleOpacity: 0,
  26768. markerOpacity: .3,
  26769. markerOpacityOnHover: 1
  26770. },
  26771. "floorplan-dollhouse": {
  26772. rotationDelay: 0,
  26773. rotationDuration: 1
  26774. },
  26775. "floorplan-panorama": {
  26776. rotationDelay: .5,
  26777. rotationDuration: 1
  26778. },
  26779. "dollhouse-panorama": {
  26780. rotationDelay: .5,
  26781. rotationDuration: 1
  26782. },
  26783. "dollhouse-floorplan": {
  26784. rotationDelay: 0,
  26785. rotationDuration: 1,
  26786. cameraMatrixDuration: 1.05,
  26787. cameraMatrixDelay: .5
  26788. },
  26789. "panorama-dollhouse": {
  26790. rotationDelay: 0,
  26791. rotationDuration: .5
  26792. },
  26793. "panorama-floorplan": {
  26794. transitionTime: 1500,
  26795. rotationDelay: 0,
  26796. rotationDuration: .5
  26797. }
  26798. }),
  26799. p.path.meshFree && (p.path.typ = l.WALK),
  26800. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  26801. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  26802. window._settings = t.exports = p
  26803. }
  26804. , {
  26805. "./constants": 8,
  26806. "./enum/Colors": 19,
  26807. "./enum/VROption": 47,
  26808. "./enum/Viewmode": 51,
  26809. "./enum/WarpStyle": 52,
  26810. "./util/browser": 182,
  26811. "./util/common": 185,
  26812. "./util/easing": 186,
  26813. "./util/showcase": 193,
  26814. three: 217
  26815. }],
  26816. 167: [function(e, t, i) {
  26817. "use strict";
  26818. var n = e("three")
  26819. , r = e("./settings")
  26820. , 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"
  26821. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  26822. t.exports = {
  26823. basicTextured: {
  26824. uniforms: {
  26825. tDiffuse: {
  26826. type: "t",
  26827. value: null
  26828. },
  26829. alpha: {
  26830. type: "f",
  26831. value: 1
  26832. }
  26833. },
  26834. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  26835. 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}"
  26836. },
  26837. copyCubeMap: {
  26838. uniforms: {
  26839. tDiffuse: {
  26840. type: "t",
  26841. value: null
  26842. },
  26843. alpha: {
  26844. type: "f",
  26845. value: 1
  26846. }
  26847. },
  26848. 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}",
  26849. 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}"
  26850. },
  26851. cube: {
  26852. uniforms: {
  26853. map: {
  26854. type: "t",
  26855. value: null
  26856. },
  26857. opacity: {
  26858. type: "f",
  26859. value: 1
  26860. }
  26861. },
  26862. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  26863. 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"
  26864. },
  26865. model: {
  26866. uniforms: {
  26867. map: {
  26868. type: "t",
  26869. value: null
  26870. },
  26871. modelAlpha: {
  26872. type: "f",
  26873. value: r.modelAlpha
  26874. },
  26875. opacity: {
  26876. type: "f",
  26877. value: 1
  26878. },
  26879. progress: {
  26880. type: "f",
  26881. value: 0
  26882. },
  26883. blackout: {
  26884. type: "i",
  26885. value: 0
  26886. },
  26887. pano0Map: {
  26888. type: "t",
  26889. value: null
  26890. },
  26891. pano0Position: {
  26892. type: "v3",
  26893. value: new n.Vector3
  26894. },
  26895. pano0Matrix: {
  26896. type: "m4",
  26897. value: new n.Matrix4
  26898. },
  26899. pano1Map: {
  26900. type: "t",
  26901. value: null
  26902. },
  26903. pano1Position: {
  26904. type: "v3",
  26905. value: new n.Vector3
  26906. },
  26907. pano1Matrix: {
  26908. type: "m4",
  26909. value: new n.Matrix4
  26910. }
  26911. },
  26912. vertexShader: o + `uniform vec3 pano0Position;
  26913. uniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\n
  26914. uniform mat4 pano1Matrix;\n\nvarying vec2 vUv;\n
  26915. varying vec3 vWorldPosition0;
  26916. varying vec3 vWorldPosition1;
  26917. uniform int blackout;
  26918. void main() {
  26919. vUv = uv;
  26920. vec4 worldPosition = modelMatrix * vec4(position, 1.0);
  26921. vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;
  26922. vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;
  26923. vWorldPosition0.x *= -1.0;
  26924. vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;
  26925. vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;
  26926. vWorldPosition1.x *= -1.0;
  26927. gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  26928. }`,
  26929. fragmentShader: a + `uniform sampler2D map;\nuniform float modelAlpha;\nuniform float opacity;\n
  26930. 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
  26931. void main() {
  26932. const vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);
  26933. const vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);
  26934. vec4 colorFromPanos;
  26935. if (blackout == 5){//add for TransitionPass
  26936. colorFromPanos = textureCube( pano1Map, vWorldPosition1.xyz) ;
  26937. }else{
  26938. vec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);
  26939. vec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);
  26940. if (blackout == 0) {colorFromPanos = mix(colorFromPano0, colorFromPano1, progress);}
  26941. else if (blackout == 1) {
  26942. colorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));
  26943. colorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));
  26944. }
  26945. else if (blackout == 2) {colorFromPanos = mix(colorFromPano0, BLACK, progress);}
  26946. else if (blackout == 3) {colorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));}
  26947. }
  26948. //#ifdef useModelMap //起不了作用为啥
  26949. if(modelAlpha>0.0){
  26950. vec4 colorFromTexture = texture2D( map, vUv );
  26951. colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);
  26952. }
  26953. //#endif
  26954. float whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);
  26955. colorFromPanos = mix(colorFromPanos, GREY, whiteness);
  26956. gl_FragColor = vec4(colorFromPanos.rgb, opacity);
  26957. }`
  26958. },
  26959. hot:{
  26960. uniforms:{
  26961. color:{
  26962. type: "c",
  26963. value: new n.Color( 0xff2200 )
  26964. },
  26965. opac:{
  26966. type: "f",
  26967. value: 0
  26968. },
  26969. texture1:{
  26970. type: "t",
  26971. value: null
  26972. },
  26973. texture2:{
  26974. type: "t",
  26975. value: null
  26976. }
  26977. },
  26978. vertexShader:"varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  26979. 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"
  26980. },
  26981. modelOutside: {
  26982. uniforms: {
  26983. map: {
  26984. type: "t",
  26985. value: null
  26986. },
  26987. opacity: {
  26988. type: "f",
  26989. value: 1
  26990. }
  26991. },
  26992. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  26993. 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"
  26994. },
  26995. ribbon: {
  26996. uniforms: {
  26997. map: {
  26998. type: "t",
  26999. value: null
  27000. },
  27001. opacity: {
  27002. type: "f",
  27003. value: 1
  27004. },
  27005. color: {
  27006. type: "c",
  27007. value: new n.Color(r.path.color)
  27008. }
  27009. },
  27010. 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",
  27011. 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"
  27012. },
  27013. waypoint: {
  27014. uniforms: {
  27015. map: {
  27016. type: "t",
  27017. value: null
  27018. },
  27019. opacity: {
  27020. type: "f",
  27021. value: 1
  27022. },
  27023. pulse: {
  27024. type: "f",
  27025. value: 1
  27026. },
  27027. nearFade: {
  27028. type: "v2",
  27029. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  27030. },
  27031. color: {
  27032. type: "c",
  27033. value: new n.Color(r.reticuleColor)
  27034. }
  27035. },
  27036. 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",
  27037. 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"
  27038. },
  27039. modelDebug: {
  27040. uniforms: {
  27041. map: {
  27042. type: "t",
  27043. value: null
  27044. },
  27045. modelAlpha: {
  27046. type: "f",
  27047. value: r.modelAlpha
  27048. },
  27049. depthmapRatio: {
  27050. type: "f",
  27051. value: 0
  27052. },
  27053. opacity: {
  27054. type: "f",
  27055. value: 1
  27056. },
  27057. progress: {
  27058. type: "f",
  27059. value: 0
  27060. },
  27061. considerOcclusion: {
  27062. type: "i",
  27063. value: r.fancierTransition
  27064. },
  27065. highlightPanoSelection: {
  27066. type: "i",
  27067. value: 0
  27068. },
  27069. useThirdPano: {
  27070. type: "i",
  27071. value: r.useThirdPano
  27072. },
  27073. pano0Map: {
  27074. type: "t",
  27075. value: null
  27076. },
  27077. pano0Depth: {
  27078. type: "t",
  27079. value: null
  27080. },
  27081. pano0Position: {
  27082. type: "v3",
  27083. value: new n.Vector3
  27084. },
  27085. pano0Matrix: {
  27086. type: "m4",
  27087. value: new n.Matrix4
  27088. },
  27089. pano0Weight: {
  27090. type: "f",
  27091. value: r.transition.pano0Weight
  27092. },
  27093. pano1Map: {
  27094. type: "t",
  27095. value: null
  27096. },
  27097. pano1Depth: {
  27098. type: "t",
  27099. value: null
  27100. },
  27101. pano1Position: {
  27102. type: "v3",
  27103. value: new n.Vector3
  27104. },
  27105. pano1Matrix: {
  27106. type: "m4",
  27107. value: new n.Matrix4
  27108. },
  27109. pano1Weight: {
  27110. type: "f",
  27111. value: r.transition.pano1Weight
  27112. },
  27113. pano2Map: {
  27114. type: "t",
  27115. value: null
  27116. },
  27117. pano2Depth: {
  27118. type: "t",
  27119. value: null
  27120. },
  27121. pano2Position: {
  27122. type: "v3",
  27123. value: new n.Vector3
  27124. },
  27125. pano2Matrix: {
  27126. type: "m4",
  27127. value: new n.Matrix4
  27128. },
  27129. pano2Weight: {
  27130. type: "f",
  27131. value: r.transition.pano2Weight
  27132. }
  27133. },
  27134. 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",
  27135. 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"
  27136. },
  27137. customDepth: {
  27138. uniforms: {
  27139. panoPosition: {
  27140. type: "v3",
  27141. value: new n.Vector3
  27142. }
  27143. },
  27144. 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",
  27145. 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"
  27146. },
  27147. skysphere: {
  27148. uniforms: {
  27149. radius: {
  27150. type: "f",
  27151. value: 0
  27152. }
  27153. },
  27154. 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",
  27155. 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"
  27156. },
  27157. tagDisc: {
  27158. uniforms: {
  27159. opacity: {
  27160. type: "f",
  27161. value: 0
  27162. },
  27163. color: {
  27164. type: "c",
  27165. value: new n.Color
  27166. },
  27167. bg: {
  27168. type: "t",
  27169. value: null
  27170. },
  27171. mask: {
  27172. type: "t",
  27173. value: null
  27174. }
  27175. },
  27176. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  27177. 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"
  27178. }
  27179. }
  27180. }
  27181. , {
  27182. "./settings": 166,
  27183. three: 217
  27184. }],
  27185. 168: [function(e, t, i) {
  27186. (function(i) {
  27187. "use strict";
  27188. var n = e("three")
  27189. , r = (e("url"),
  27190. e("./util/ajax"))
  27191. , o = e("./settings")
  27192. , a = e("./util/logger")
  27193. , s = e("./util/math")
  27194. , l = e("./util/showcase")
  27195. , c = e("./objects/Panorama")
  27196. , h = new a(i)
  27197. , u = e("./model/Model")
  27198. , d = e("./shaders")
  27199. , p = e("./util/transitions")
  27200. , f = e("./objects/Chunk")
  27201. , g = e("./objects/Reticule")
  27202. , m = e("./objects/Skybox")
  27203. , v = e("./objects/Floor")
  27204. , A = e("./cameras/DollhouseCamera")
  27205. , y = e("./cameras/FloorplanCamera")
  27206. , C = e("./cameras/PanoramaCamera")
  27207. , I = e("./controls/DollhouseControls")
  27208. , E = e("./controls/FloorplanControls")
  27209. , b = e("./controls/PanoramaControls");
  27210. n.ImageUtils.crossOrigin = o.crossOrigin,
  27211. t.exports = {
  27212. shaders: d,
  27213. transitions: p,
  27214. Model: u,
  27215. Chunk: f,
  27216. Floor: v,
  27217. Skybox: m,
  27218. Reticule: g,
  27219. Panorama: c,
  27220. DollhouseCamera: A,
  27221. FloorplanCamera: y,
  27222. PanoramaCamera: C,
  27223. DollhouseControls: I,
  27224. FloorplanControls: E,
  27225. PanoramaControls: b,
  27226. getModel: function(e) {
  27227. if (!e.url)
  27228. throw 'getModel(): missing parameter "url"';
  27229. e.autoload = void 0 === e.autoload || e.autoload;
  27230. var t = l.parseSidUrl(e.url);
  27231. e.urlBase = t.urlBase,
  27232. e.urlModel = t.urlModel,
  27233. e.urlFiles = t.urlFiles;
  27234. var i = this._getPlatformError();
  27235. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  27236. this._loadModel().then(this._buildModel.bind(this)))
  27237. },
  27238. _getPlatformError: function() {
  27239. 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"
  27240. },
  27241. _loadModel: function() {
  27242. return r.get(this.options.urlModel, {
  27243. responseType: "json",
  27244. prefetchFrom: "model",
  27245. auth: l.getAuthorizationHeader()
  27246. }).then(null, function() {
  27247. return h.warn("Model loading failed at initial metadata load"),
  27248. "loading-failed"
  27249. })
  27250. },
  27251. _buildModel: function(e) {
  27252. e = l.normalizeModeldata(e, s);
  27253. var t = new u(this.options,e);
  27254. return this.options.autoload ? t.load(!0) : $.when(t)
  27255. }
  27256. }
  27257. }
  27258. ).call(this, "/js/showcase.js")
  27259. }
  27260. , {
  27261. "./cameras/DollhouseCamera": 5,
  27262. "./cameras/FloorplanCamera": 6,
  27263. "./cameras/PanoramaCamera": 7,
  27264. "./controls/DollhouseControls": 10,
  27265. "./controls/FloorplanControls": 11,
  27266. "./controls/PanoramaControls": 13,
  27267. "./model/Model": 139,
  27268. "./objects/Chunk": 144,
  27269. "./objects/Floor": 146,
  27270. "./objects/Panorama": 148,
  27271. "./objects/Reticule": 149,
  27272. "./objects/Skybox": 152,
  27273. "./settings": 166,
  27274. "./shaders": 167,
  27275. "./util/ajax": 181,
  27276. "./util/logger": 189,
  27277. "./util/math": 190,
  27278. "./util/showcase": 193,
  27279. "./util/transitions": 195,
  27280. three: 217,
  27281. url: 208
  27282. }],
  27283. 169: [function(e, t, i) {
  27284. "use strict";
  27285. function n() {
  27286. var e = {
  27287. renderTarget: null,
  27288. inUse: !1,
  27289. size: -1,
  27290. pano: null
  27291. };
  27292. return e
  27293. }
  27294. function r(e) {
  27295. M.push(e)
  27296. }
  27297. function o(e) {
  27298. var t = n();
  27299. return t.inUse = !0,
  27300. t.size = e,
  27301. r(t),
  27302. t
  27303. }
  27304. function a(e) {
  27305. for (var t = 0; t < M.length; t++) {
  27306. var i = M[t];
  27307. if (!i.inUse && i.size === e)
  27308. return i.inUse = !0,
  27309. i
  27310. }
  27311. return null
  27312. }
  27313. function s(e) {
  27314. for (var t = 0; t < M.length; t++) {
  27315. var i = M[t];
  27316. if (i.renderTarget === e)
  27317. return i.inUse = !1,
  27318. !0
  27319. }
  27320. return !1
  27321. }
  27322. function l() {
  27323. this.tileDirectory = {},
  27324. this.activeRenderTargetDescriptors = {},
  27325. this.activePanos = [],
  27326. this.panoLODDescriptors = {},
  27327. this.panoDescriptors = {},
  27328. this.tileTrees = {},
  27329. this.sceneRenderer = null,
  27330. this.tileDownloader = null,
  27331. this.forceQueue = [],
  27332. this.uploadQueues = {},
  27333. this.uploadInterval = null,
  27334. this.uploadIntervalCancelled = !1,
  27335. this.usingTileOverlay = !1,
  27336. this.overlayTilesLoaded = !1,
  27337. this.overlayTileBase = null,
  27338. this.overlayTilesBasic = {},
  27339. this.overlayTilesEnhanced = {},
  27340. this.zoomRenderTarget = null,
  27341. this.zoomPano = null,
  27342. this.zoomingActive = !1,
  27343. this.zoomPanoId = null,
  27344. this.zoomPanoRenderingDisabled = !1,
  27345. this.direction = new h.Vector3,
  27346. this.initTime = -1,
  27347. this.maxBaseUploadsPerFrame = x,
  27348. this.maxNonBaseUploadsPerFrame = T
  27349. }
  27350. function c() {
  27351. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (b = !0,
  27352. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  27353. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(w) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  27354. }
  27355. /* function c() {
  27356. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (b = !0,
  27357. this.updateUploadQueue(1, 2),
  27358. w = 18,
  27359. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(w) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  27360. } */
  27361. var h = e("three")
  27362. , u = e("../exception/BasicException")
  27363. , d = e("../settings")
  27364. , p = e("../enum/PanoSizeClass")
  27365. , f = (e("../objects/Panorama"),
  27366. e("../enum/PanoRendererEvents"))
  27367. , g = e("../enum/SceneRendererEvents")
  27368. , m = e("../enum/TileDownloaderEvents")
  27369. , v = e("../enum/Vectors")
  27370. , A = (e("../enum/GLCubeFaces"),
  27371. e("../objects/Panorama"),
  27372. e("./TileTree"))
  27373. , y = (e("./TileDownloader"),
  27374. e("./TilePrioritizer"))
  27375. , C = e("./TileUtils")
  27376. , p = e("../enum/PanoSizeClass")
  27377. , I = (e("../util/browser"),
  27378. e("../util/panorama"))
  27379. , E = e("events").EventEmitter
  27380. , b = !1
  27381. , w = d.tiling.uploadIntervalDelay
  27382. , _ = d.tiling.initialIntervalDelay
  27383. , T = d.tiling.maxNonBaseUploadsPerFrame
  27384. , x = d.tiling.maxBaseUploadsPerFrame
  27385. , S = {
  27386. Base: 0,
  27387. Remaining: 1
  27388. }
  27389. ,M = [];
  27390. window.targetList = M
  27391. l.prototype = Object.create(E.prototype),
  27392. l.prototype.init = function(e, t, i) {
  27393. this.sceneRenderer = e,
  27394. this.tileDownloader = t,
  27395. this.qualityManager = i,
  27396. this.bindEvents(),
  27397. this.sceneRenderer.on(g.ContextCreated, this.loadOverlayTiles.bind(this)),
  27398. this.initTime = performance.now()
  27399. }
  27400. ,
  27401. l.prototype.getActivePanoTextures = function(e) {
  27402. e = e || [];
  27403. for (var t = 0; t < M.length; t++) {
  27404. var i = M[t];
  27405. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  27406. }
  27407. }
  27408. ,
  27409. l.prototype.hasQueuedTiles = function() {
  27410. var e = this.peekNextFromUploadQueue();
  27411. return null !== e && void 0 !== e
  27412. }
  27413. ,
  27414. l.prototype.getActiveRenderTargetDescriptor = function(e) {
  27415. return this.activeRenderTargetDescriptors[e]
  27416. }
  27417. ,
  27418. l.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  27419. this.activeRenderTargetDescriptors[e] = t
  27420. }
  27421. ,
  27422. l.prototype.loadOverlayTiles = function() {
  27423. if (0 !== d.tiling.overlayStyle) {
  27424. var e = 0
  27425. , t = function(t, n, r) {
  27426. t = n ? t[n] = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping),
  27427. this.sceneRenderer.uploadTexture2D(r, t, 0, 0, C.TILE_SIZE, C.TILE_SIZE),
  27428. e++,
  27429. e === i.length && (this.overlayTilesLoaded = !0)
  27430. }
  27431. .bind(this)
  27432. , 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)]];
  27433. i.forEach(function(e) {
  27434. this.tileDownloader.loadImage(e[0], 0, e[1])
  27435. }
  27436. .bind(this)),
  27437. this.usingTileOverlay = !0
  27438. } else
  27439. this.usingTileOverlay = !1
  27440. }
  27441. ,
  27442. l.prototype.bindEvents = function() {
  27443. this.tileDownloader.on(m.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  27444. }
  27445. ,
  27446. l.prototype.setupZoomRenderTarget = function() {
  27447. var targets = {};
  27448. return function(){
  27449. if(this.qualityManager.maxRenderTargetSize == '2k' && this.qualityManager.getMaxNavPanoSize()=='2k')return; //不使用zoomTarget 直接用pano的tiledPanoRenderTarget,防崩溃
  27450. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  27451. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  27452. return;
  27453. var e = this.zoomRenderTarget;
  27454. var size = this.qualityManager.getMaxZoomPanoSize()
  27455. if(size > this.qualityManager.maxRenderTargetSize){
  27456. return
  27457. }
  27458. if(targets[size]){
  27459. this.zoomRenderTarget = targets[size]
  27460. }else{
  27461. this.zoomRenderTarget = this.initTiledPano(size, true )//放大后不使用抗锯齿,否则消耗更多内存
  27462. targets[size] = this.zoomRenderTarget
  27463. }
  27464. if(e) {//将旧的zoomRenderTarget渲染到新zoomRenderTarget上
  27465. var t = e.width
  27466. , i = this.zoomRenderTarget.width;
  27467. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  27468. e.texture.dispose(),
  27469. e.texture.loaded = !1,
  27470. e.texture.version = 0,
  27471. this.sceneRenderer.deallocateCubeTexture(e.texture),
  27472. e.texture = null
  27473. }
  27474. this.zoomPanoRenderingDisabled = !1
  27475. } else
  27476. this.zoomPanoRenderingDisabled = !0
  27477. }
  27478. }()
  27479. ,
  27480. l.prototype.enableHighQuality = function(e) {
  27481. //xzw add 如果最多只要2k图的话enableUltraHighQualityMode替换成这个
  27482. if (!this.qualityManager.highQualityModeStarted) {
  27483. this.setupZoomRenderTarget()
  27484. e()
  27485. this.qualityManager.highQualityModeStarted = true
  27486. }
  27487. }
  27488. ,
  27489. l.prototype.enableUltraHighQualityMode = function(e) {
  27490. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  27491. var t = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  27492. this.tileDownloader.testDownload(t, C.TILE_SIZE, function(t) {
  27493. t && (this.qualityManager.enableUltraHighQualityMode(),
  27494. this.setupZoomRenderTarget(),
  27495. e())
  27496. }
  27497. .bind(this))
  27498. }
  27499. }
  27500. ,
  27501. l.prototype.activateTiledPano = function(e, t, i) {
  27502. i && this.clearAllQueuedUploads();
  27503. for (var n = 0; n < C.FACES_PER_PANO; n++)
  27504. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  27505. this.linkAllTilesAndNodes(e);
  27506. var r = this.getActiveRenderTargetDescriptor(e.id)
  27507. , l = t;
  27508. if (l > this.qualityManager.getMaxNavPanoSize() && (l = this.qualityManager.getMaxNavPanoSize()),
  27509. !r || l !== r.size) {
  27510. if (r && s(r.renderTarget),
  27511. r = a(l),
  27512. !r) {
  27513. var c = this.initTiledPano(l, !browser.isMobile()/* !1 */);
  27514. r = o(c.width),
  27515. r.renderTarget = c
  27516. }
  27517. r.pano = e,
  27518. this.resetPanoDescriptor(e.id),
  27519. this.resetPanoLODDescriptors(e.id),
  27520. this.resetRenderStatus(e.id, !0, !0)
  27521. }
  27522. this.setActiveRenderTargetDescriptor(e.id, r);
  27523. var h = i ? 0 : 1;
  27524. return this.updateActivePanos(e, h),
  27525. r.renderTarget
  27526. }
  27527. ,
  27528. l.prototype.deactivateTiledPano = function(e) {
  27529. var t = this.getActiveRenderTargetDescriptor(e.id);
  27530. this.isRenderTargetDescriptorValid(t) && s(t.renderTarget),
  27531. this.setActiveRenderTargetDescriptor(e.id, null);
  27532. var i = this.getUploadQueueForPano(e.id);
  27533. this.clearUploadQueue(i),
  27534. this.updateActivePanos()
  27535. }
  27536. ,
  27537. l.prototype.updateActivePanos = function() {
  27538. var e = [];
  27539. return function(t, i) {
  27540. e.length = 0;
  27541. for (var n = 0; n < this.activePanos.length; n++) {
  27542. t && e.length === i && e.push(t);
  27543. var r = this.activePanos[n]
  27544. , o = this.getActiveRenderTargetDescriptor(r.id);
  27545. t && r.id === t.id || !this.isRenderTargetDescriptorValid(o) || e.push(r)
  27546. }
  27547. t && i >= e.length && e.push(t),
  27548. this.activePanos.length = 0,
  27549. this.activePanos.push.apply(this.activePanos, e)
  27550. }
  27551. }(),
  27552. l.prototype.getActivePanoCount = function() {
  27553. return this.activePanos.length
  27554. }
  27555. ,
  27556. l.prototype.resetRenderStatus = function(e, t, i, n) {
  27557. var r = null;
  27558. n && (r = A.getLevelCountForSize(C.TILE_SIZE, n) + 1);
  27559. for (var o = function(e, n, r, o) {
  27560. i && (n.tile.zoomUploaded = !1),
  27561. t && (n.tile.uploaded = !1)
  27562. }, a = 0; a < C.FACES_PER_PANO; a++) {
  27563. var s = this.getTileTree(e, a);
  27564. s.breadthFirst({
  27565. callback: o.bind(this, a),
  27566. minLevel: r
  27567. })
  27568. }
  27569. }
  27570. ,
  27571. l.prototype.copyBaseRenderStatusToZoomed = function(e) {
  27572. for (var t = A.getLevelCountForSize(C.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  27573. t.tile.zoomUploaded = t.tile.uploaded,
  27574. t.zoomCovered = t.covered
  27575. }, n = 0; n < C.FACES_PER_PANO; n++) {
  27576. var r = this.getTileTree(e, n);
  27577. r.breadthFirst({
  27578. callback: i.bind(this, n),
  27579. maxLevel: t
  27580. })
  27581. }
  27582. }
  27583. ,
  27584. l.prototype.renderPanoTiles = function() {
  27585. var e = [];
  27586. return function(t, i, n, r) {
  27587. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  27588. i = i || this.direction || v.FORWARD;
  27589. var o = this.getActiveRenderTargetDescriptor(t);
  27590. if (!this.isRenderTargetDescriptorValid(o))
  27591. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  27592. for (var a = 0; a < C.FACES_PER_PANO; a++) {
  27593. var s = this.getTileTree(t, a);
  27594. e.length = 0,
  27595. s.breadthFirst({
  27596. saveVisited: e
  27597. });
  27598. for (var l = 0; l < e.length; l++) {
  27599. var c = e[l];
  27600. this.queueTileUpload(c.tile, !1, r || 0 === l && n)
  27601. }
  27602. }
  27603. this.updateDirection(i)
  27604. }
  27605. }(),
  27606. l.prototype.isRenderTargetDescriptorValid = function(e) {
  27607. return e && e.renderTarget
  27608. }
  27609. ,
  27610. l.prototype.isPanoActive = function(e) {
  27611. var t = this.getActiveRenderTargetDescriptor(e);
  27612. return this.isRenderTargetDescriptorValid(t)
  27613. }
  27614. ,
  27615. l.prototype.isPanoZoomed = function(e) {
  27616. return this.zoomingActive && this.zoomPanoId === e
  27617. }
  27618. ,
  27619. l.prototype.initTileTree = function(e, t, i) {
  27620. var n = this.tileTrees[e];
  27621. n || (n = [],
  27622. this.tileTrees[e] = n);
  27623. var r = n[t];
  27624. if (!r) {
  27625. var o = A.getLevelCountForSize(C.TILE_SIZE, i);
  27626. r = new A(C.TILE_SIZE,o),
  27627. n[t] = r
  27628. }
  27629. }
  27630. ,
  27631. l.prototype.getTileTree = function(e, t) {
  27632. var i = this.tileTrees[e];
  27633. if (!i)
  27634. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  27635. var n = i[t];
  27636. if (!n)
  27637. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  27638. return n
  27639. }
  27640. ,
  27641. l.prototype.initTiledPano = function(e, antialias) {
  27642. var i = this.sceneRenderer.renderer
  27643. , n = (i.context,
  27644. new h.WebGLRenderTargetCube(e,e,{
  27645. stencilBuffer: !1
  27646. }))
  27647. , r = new h.CubeTexture([]);
  27648. n.texture = r,
  27649. r.image = [null, null, null, null, null, null],
  27650. r.flipY = !0,
  27651. //antialias: 如果抗锯齿的话,采用mipmap,会增加一倍的存储消耗。原版本都是不抗锯齿的。但是抗锯齿效果更柔和
  27652. antialias ? (r.generateMipmaps = !0,
  27653. r.magFilter = h.LinearFilter,
  27654. r.minFilter = h.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  27655. r.magFilter = h.LinearFilter,
  27656. r.minFilter = h.LinearFilter),
  27657. r.format = h.RGBAFormat,
  27658. i.setRenderTarget(n),
  27659. i.setRenderTarget(null);
  27660. var o = i.properties.get(r);
  27661. return o.__image__webglTextureCube = o.__webglTexture,
  27662. n
  27663. }
  27664. ,
  27665. l.prototype.getUploadQueueForPano = function(e) {
  27666. var t = this.uploadQueues[e];
  27667. return t || (t = [],
  27668. this.uploadQueues[e] = t),
  27669. t
  27670. }
  27671. ,
  27672. l.prototype.isTileUploaded = function(e) {
  27673. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  27674. }
  27675. ,
  27676. l.prototype.setUploaded = function(e, t) {
  27677. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  27678. }
  27679. ,
  27680. l.prototype.queueTileUpload = function(e, t, i) {
  27681. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  27682. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  27683. var r = this.getUploadQueueForPano(e.panoId);
  27684. 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),
  27685. e.uploadQueued = !0,
  27686. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  27687. }
  27688. }
  27689. ,
  27690. l.prototype.shoulPushToFrontOfQueue = function(e) {
  27691. return 0 === A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  27692. }
  27693. ,
  27694. l.prototype.getTopUploadQueue = function() {
  27695. for (var e = null, t = null, i = S.Base; i <= S.Remaining; i++)
  27696. for (var n = 0; n < this.activePanos.length; n++)
  27697. if (e = this.activePanos[n],
  27698. t = this.getUploadQueueForPano(e.id),
  27699. t.length > 0)
  27700. switch (i) {
  27701. case S.Base:
  27702. if (0 === t[0].level)
  27703. return t;
  27704. break;
  27705. case S.Remaining:
  27706. return t
  27707. }
  27708. return null
  27709. }
  27710. ,
  27711. l.prototype.getNextFromUploadQueue = function() {
  27712. var e = function(e) {
  27713. var t = e.shift();
  27714. return t.uploadQueued = !1,
  27715. t
  27716. };
  27717. return function() {
  27718. if (this.forceQueue.length > 0)
  27719. return e(this.forceQueue);
  27720. var t = this.getTopUploadQueue();
  27721. return t && t.length > 0 ? e(t) : null
  27722. }
  27723. }(),
  27724. l.prototype.peekNextFromUploadQueue = function() {
  27725. if (this.forceQueue.length > 0)
  27726. return this.forceQueue[0];
  27727. var e = this.getTopUploadQueue();
  27728. return e && e.length > 0 ? e[0] : null
  27729. }
  27730. ,
  27731. l.prototype.clearAllQueuedUploads = function() {
  27732. this.clearAllUploadQueues(null, 0)
  27733. }
  27734. ,
  27735. l.prototype.clearAllQueuedUploadsForPano = function(e) {
  27736. this.clearAllUploadQueues(e, 0)
  27737. }
  27738. ,
  27739. l.prototype.clearAllUploadQueues = function(e, t) {
  27740. if (e)
  27741. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  27742. this.clearUploadQueue(this.forceQueue, t, e);
  27743. else {
  27744. for (var i = 0; i < this.activePanos.length; i++) {
  27745. var n = this.activePanos[i];
  27746. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  27747. }
  27748. this.clearUploadQueue(this.forceQueue, t)
  27749. }
  27750. }
  27751. ,
  27752. l.prototype.clearUploadQueue = function(e, t, i) {
  27753. void 0 !== t && null !== t || (t = 0);
  27754. for (var n = 0; n < e.length; ) {
  27755. var r = e[n];
  27756. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  27757. e.splice(n, 1)) : n++
  27758. }
  27759. }
  27760. ,
  27761. l.prototype.refreshUploadInterval = function() {
  27762. var e = null;
  27763. return function(t) {
  27764. this.uploadIntervalCancelled || (e || (e = c.bind(this)),
  27765. null !== t && void 0 !== t || (t = w),
  27766. b || (t = _),
  27767. this.uploadInterval = window.setTimeout(e, t),
  27768. this.uploadIntervalDelay = t)
  27769. }
  27770. }(),
  27771. l.prototype.update = function() {
  27772. var e = performance.now()
  27773. , t = 0;
  27774. return function() {
  27775. this.uploadIntervalCancelled = !0,
  27776. window.clearTimeout(this.uploadInterval),
  27777. this.uploadInterval = null;
  27778. var i = performance.now() - e;
  27779. !(i > w || 0 === t) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  27780. e = performance.now()),
  27781. t++
  27782. }
  27783. }(),
  27784. l.prototype.updateUploadQueue = function(e, t) {
  27785. e || (e = 1);
  27786. for (var i = 0, n = 0; ; ) {
  27787. if (n >= t || i >= e)
  27788. break;
  27789. var r = this.getNextFromUploadQueue();
  27790. if (!r)
  27791. break;
  27792. if (0 !== r.level ? i++ : n++,
  27793. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  27794. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  27795. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  27796. }
  27797. }
  27798. }
  27799. ,
  27800. l.prototype.updateDirection = function(e) {
  27801. if (e = e || this.direction) {
  27802. this.direction = e;
  27803. for (var t = 0; t < this.activePanos.length; t++) {
  27804. var i = this.activePanos[t]
  27805. , n = this.getUploadQueueForPano(i.id);
  27806. y.sortPanoTiles(n, i, this.direction)
  27807. }
  27808. }
  27809. }
  27810. ,
  27811. l.prototype.uploadTile = function() {
  27812. var e = {}
  27813. , t = (new h.Vector4,
  27814. d.tiling.overlayStyle);
  27815. //var failHistory = {};
  27816. return function(i, n) {
  27817. var r = i.panoId
  27818. , o = i.image
  27819. , a = i.tileSize
  27820. , s = i.panoSize
  27821. , l = i.tileIndex
  27822. , c = (i.faceTileIndex,
  27823. i.totalTiles)
  27824. , u = (i.face,
  27825. i.tileX)
  27826. , d = i.tileY
  27827. , p = !0
  27828. , g = !1
  27829. , m = (this.getPanoDescriptor(r),
  27830. this.getPanoLODDescriptor(r, s))
  27831. , v = this.getActiveRenderTargetDescriptor(r)
  27832. , A = v.renderTarget
  27833. , y = v.size;
  27834. if (this.isPanoZoomed(r) && (A = this.zoomRenderTarget,
  27835. y = A.width), //this.qualityManager.getMaxZoomPanoSize()),
  27836. this.isRenderTargetDescriptorValid(v) || (p = !1,
  27837. g = !1),
  27838. n || (this.anyUploaded(i.node) && (p = !1,
  27839. g = !0),
  27840. this.isTileUploaded(i) && (p = !1,
  27841. g = !1)),
  27842. p) {
  27843. /* if(failHistory[''+r+s+l]){
  27844. console.log('uploadTile retry', r, s, l)
  27845. }
  27846. console.log('uploadTile 成功', r, s, l)
  27847. */
  27848. var C = u * a
  27849. , I = d * a
  27850. , E = a / s * y
  27851. , b = C / s * y
  27852. , w = I / s * y;
  27853. if (s > this.qualityManager.maxRenderTargetSize) {
  27854. player.model.getHighImage(o, i.cubeFace, u, d)
  27855. }else{
  27856. e[a] || (e[a] = this.sceneRenderer.initSizedTexture2D(a, h.ClampToEdgeWrapping));
  27857. var _ = e[a]
  27858. this.sceneRenderer.uploadTexture2D(o, _, 0, 0, a, a)
  27859. if ( 1 === t || 2 === t) {
  27860. var T = 1 === t ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  27861. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace),
  27862. this.sceneRenderer.renderToCubeMap(T[s], A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace, h.NormalBlending, !0, .5)
  27863. } else
  27864. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace);
  27865. }
  27866. m.uploadCount++,
  27867. this.emit(f.TileRenderSuccess, r, s, l, c),
  27868. m.uploadCount === c && this.emit(f.PanoRenderComplete, r, s, c),
  27869. this.setUploaded(i, !0),
  27870. this.addCoverageForNode(i.node)
  27871. } else{
  27872. this.setUploaded(i, !1);
  27873. //console.log('uploadTile 失败', r, s, l)
  27874. //failHistory[''+r+s+l] = true;
  27875. }
  27876. return i.uploadAttempted || (m.uploadAttempts++,
  27877. this.emit(f.TileUploadAttempted, r, s, l, c)),
  27878. i.uploadAttempted = !0,
  27879. m.uploadAttempts === c && this.emit(f.UploadAttemptedForAllTiles, r, s, c),
  27880. g
  27881. }
  27882. }(),
  27883. l.prototype.linkTileAndNode = function(e, t) {
  27884. t.tile = e,
  27885. e.node = t
  27886. }
  27887. ,
  27888. l.prototype.linkAllTilesAndNodes = function(e) {
  27889. for (var t = function(t, i, n, r, o) {
  27890. var a = this.getTileDirectoryEntry(e.id, i, r, o);
  27891. this.linkTileAndNode(a, n)
  27892. }, i = 0; i < C.FACES_PER_PANO; i++) {
  27893. var n = this.getTileTree(e.id, i);
  27894. n.breadthFirst({
  27895. callback: t.bind(this, n, i)
  27896. })
  27897. }
  27898. }
  27899. ,
  27900. l.prototype.anyUploaded = function(e) {
  27901. if (!e)
  27902. return !1;
  27903. if (e.tile && this.isTileUploaded(e.tile))
  27904. return !0;
  27905. if (e.children)
  27906. for (var t = 0; t < e.children.length; t++) {
  27907. var i = e.children[t];
  27908. if (this.anyUploaded(i))
  27909. return !0
  27910. }
  27911. return !1
  27912. }
  27913. ,
  27914. l.prototype.setNodeCovered = function(e, t) {
  27915. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  27916. }
  27917. ,
  27918. l.prototype.isNodeCovered = function(e) {
  27919. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  27920. }
  27921. ,
  27922. l.prototype.addCoverageForNode = function(e) {
  27923. if (this.setNodeCovered(e, !0),
  27924. e.parent && e.covered) {
  27925. var t = e.parent;
  27926. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  27927. }
  27928. }
  27929. ,
  27930. l.prototype.calcFullCoverage = function(e) {
  27931. var t = !1;
  27932. if (e.children)
  27933. for (var i = 0; i < e.children.length; i++) {
  27934. var n = e.children[i];
  27935. t = t || this.calcFullCoverage(n)
  27936. }
  27937. e.covered = e.tile.uploaded || t
  27938. }
  27939. ,
  27940. l.prototype.nodeSubcovered = function(e) {
  27941. if (!e.children)
  27942. return !1;
  27943. for (var t = 0; t < e.children.length; t++)
  27944. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  27945. return !1;
  27946. return !0
  27947. }
  27948. ,
  27949. l.prototype.resetPanoDescriptor = function(e) {
  27950. this.getPanoDescriptor(e)
  27951. }
  27952. ,
  27953. l.prototype.getPanoDescriptor = function(e) {
  27954. var t = this.panoDescriptors[e];
  27955. return t || (t = {},
  27956. this.panoDescriptors[e] = t),
  27957. t
  27958. }
  27959. ,
  27960. l.prototype.resetPanoLODDescriptors = function(e) {
  27961. var t = this.getPanoLODDescriptors(e);
  27962. for (var i in t)
  27963. if (t.hasOwnProperty(i)) {
  27964. var n = t[i];
  27965. n.uploadCount = 0,
  27966. n.uploadAttempts = 0
  27967. }
  27968. }
  27969. ,
  27970. l.prototype.getPanoLODDescriptor = function(e, t) {
  27971. var i = this.getPanoLODDescriptors(e)
  27972. , n = i[t];
  27973. return n || (n = {
  27974. uploadCount: 0,
  27975. uploadAttempts: 0
  27976. },
  27977. i[t] = n),
  27978. n
  27979. }
  27980. ,
  27981. l.prototype.getPanoLODDescriptors = function(e) {
  27982. var t = this.panoLODDescriptors[e];
  27983. return t || (t = {},
  27984. this.panoLODDescriptors[e] = t),
  27985. t
  27986. }
  27987. ,
  27988. l.prototype.onTileDownloaded = function(e) {
  27989. var t = A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  27990. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  27991. if (i.downloaded = !0,
  27992. i.image = e.image,
  27993. i.panoSize = e.panoSize,
  27994. i.tileX = e.tileX,
  27995. i.tileY = e.tileY,
  27996. i.totalTiles = e.totalTiles,
  27997. i.tileIndex = e.tileIndex,
  27998. i.faceTileIndex = e.faceTileIndex,
  27999. i.face = e.face,
  28000. i.cubeFace = I.mapFaceToCubemapFace(e.face),
  28001. i.panoId = e.panoId,
  28002. i.tileSize = e.tileSize,
  28003. i.direction = (new h.Vector3).copy(e.direction),
  28004. i.node = null,
  28005. i.level = A.getLevelCountForSize(C.TILE_SIZE, i.panoSize),
  28006. this.isPanoActive(i.panoId)) {
  28007. var n = this.getTileTree(i.panoId, i.face)
  28008. , r = n.getSubNode(i.panoSize, i.tileX, i.tileY);
  28009. this.linkTileAndNode(i, r),
  28010. this.queueTileUpload(i, !0)
  28011. }
  28012. }
  28013. ,
  28014. l.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  28015. var r = this.tileDirectory[e];
  28016. r || (r = {},
  28017. this.tileDirectory[e] = r);
  28018. var o = 16384 * t + 1024 * i + n
  28019. , a = r[o];
  28020. return a || (a = {
  28021. downloaded: !1,
  28022. uploaded: !1,
  28023. zoomUploaded: !1
  28024. },
  28025. r[o] = a),
  28026. a._key = e + ":" + t + ":" + i + ":" + n,
  28027. a._tileKey = o,
  28028. a
  28029. }
  28030. ,
  28031. l.prototype.setZoomingActive = function(e, t, i) {
  28032. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  28033. this.zoomPanoId = t.id,
  28034. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  28035. }
  28036. ,
  28037. l.prototype.updateZoomedPanoFromBase = function(e) {
  28038. if (!this.zoomPanoRenderingDisabled) {
  28039. var t = this.getActiveRenderTargetDescriptor(e.id);
  28040. if (t && t.renderTarget) {
  28041. var i = Math.min(this.qualityManager.maxRenderTargetSize, this.qualityManager.getMaxZoomPanoSize()), //this.qualityManager.getMaxZoomPanoSize()
  28042. n = t.renderTarget
  28043. , r = t.size;
  28044. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  28045. this.copyBaseRenderStatusToZoomed(e.id)
  28046. }
  28047. }
  28048. }
  28049. ,
  28050. t.exports = l
  28051. }
  28052. , {
  28053. "../enum/GLCubeFaces": 25,
  28054. "../enum/PanoRendererEvents": 35,
  28055. "../enum/PanoSizeClass": 36,
  28056. "../enum/SceneRendererEvents": 43,
  28057. "../enum/TileDownloaderEvents": 45,
  28058. "../enum/Vectors": 50,
  28059. "../exception/BasicException": 55,
  28060. "../objects/Panorama": 148,
  28061. "../settings": 166,
  28062. "../util/browser": 182,
  28063. "../util/panorama": 191,
  28064. "./TileDownloader": 171,
  28065. "./TilePrioritizer": 172,
  28066. "./TileTree": 173,
  28067. "./TileUtils": 174,
  28068. events: 202,
  28069. three: 217
  28070. }],
  28071. 170: [function(e, t, i) {
  28072. "use strict";
  28073. function n(e, t, i) {
  28074. this.maxNavPanoSize = -1,
  28075. this.maxZoomPanoSize = -1,
  28076. this.devicePixelDensity = e,
  28077. this.deviceScreenSize = t,
  28078. this.clientBandwidth = i,
  28079. this.panoSizeClassMap = {},
  28080. this.useHighResolutionPanos = !0,
  28081. this.useUltraHighResolutionPanos = !1,
  28082. this.modelHasUltraHighPanos = !1
  28083. this.maxRenderTargetSize = a.isMobile() ? 2048 : 4096 //add
  28084. this.maxRenderTargetSize = Math.min( common.getMaxCubemapSize(), this.maxRenderTargetSize)//add
  28085. }
  28086. var r = e("../enum/PanoSizeClass")
  28087. , o = e("../settings")
  28088. , a = e("../util/browser")
  28089. , s = e("../constants")
  28090. , l = e("../util/showcase")
  28091. , c = e("../enum/ModelManagerEvents");
  28092. n.prototype.init = function(e) {
  28093. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  28094. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  28095. this.highSize = this.getPanoSize(r.HIGH),
  28096. this.standardSize = this.getPanoSize(r.STANDARD),
  28097. this.baseSize = this.getPanoSize(r.BASE),
  28098. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  28099. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  28100. this.updateMaximums(),
  28101. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  28102. }
  28103. ,
  28104. n.prototype.updateFromModel = function(e) {
  28105. this.updateHighResolutionSettings(e),
  28106. this.updateUltraHighResolutionSettings(e)
  28107. }
  28108. ,
  28109. n.prototype.updateHighResolutionSettings = function(e) {
  28110. //---------------------许钟文---------原始的会判断modeldata里version,以致useHighResolutionPanos为false,所以我直接变为true啦----------------------------------
  28111. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  28112. //this.useHighResolutionPanos = !0;
  28113. //----------------------e n d -----------------------------------------------------------------
  28114. this.updateMaximums()
  28115. }
  28116. ,
  28117. n.prototype.updateUltraHighResolutionSettings = function(e) {
  28118. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  28119. this.updateMaximums()
  28120. }
  28121. ,
  28122. n.prototype.enableUltraHighQualityMode = function() {
  28123. this.modelHasUltraHighPanos = !0,
  28124. this.updateUltraHighResolutionSettings(null)
  28125. }
  28126. ,
  28127. n.prototype.ultraHighQualityModeEnabled = function() {
  28128. return this.modelHasUltraHighPanos
  28129. }
  28130. ,
  28131. n.prototype.onModelChanged = function(e) {
  28132. this.updateFromModel(e.model),
  28133. this.updateMaximums()
  28134. }
  28135. ,
  28136. n.prototype.updateMaximums = function() {
  28137. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  28138. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  28139. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  28140. }
  28141. ,
  28142. n.prototype.buildPanoSizeClassMap = function() {
  28143. this.panoSizeClassMap[r.BASE] = 512,
  28144. this.panoSizeClassMap[r.STANDARD] = 1024,
  28145. this.panoSizeClassMap[r.HIGH] = 2048,
  28146. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  28147. }
  28148. ,
  28149. n.prototype.getPanoSize = function(e) {
  28150. return this.panoSizeClassMap[e]
  28151. }
  28152. ,
  28153. n.prototype.getMaxPossiblePanoSize = function() {
  28154. return this.getPanoSize(r.ULTRAHIGH)
  28155. }
  28156. ,
  28157. n.prototype.getMaxPanoSize = function() {
  28158. return this.maxZoomPanoSize
  28159. }
  28160. ,
  28161. n.prototype.getMaxNavPanoSize = function() {
  28162. return this.maxNavPanoSize
  28163. }
  28164. ,
  28165. n.prototype.getMaxZoomPanoSize = function() {
  28166. return this.maxZoomPanoSize
  28167. }
  28168. ,
  28169. /* n.prototype.detectMaxNavPanoSizeClass = function() {
  28170. if(settings.mobileNavHigh)return r.HIGH //改
  28171. else return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  28172. } */
  28173. n.prototype.detectDevice = function(){//add
  28174. if(a.isMobile()){
  28175. let area = $("#player").width() * $("#player").height()
  28176. if(area < 768 * 1024){//ipad mini full screen 大场景拍的质量很好默认不需要很高清
  28177. return 'mobile'
  28178. }else{
  28179. return 'bigMobile'
  28180. }
  28181. }else{
  28182. return 'pc'
  28183. }
  28184. }
  28185. n.prototype.detectMaxNavPanoSizeClass = function() { //xzw 改
  28186. switch(this.getNavZoomClass()){
  28187. case '1k':
  28188. return r.STANDARD;
  28189. break;
  28190. case '2k':
  28191. default:
  28192. return r.HIGH;
  28193. case '4k':
  28194. return r.ULTRAHIGH;
  28195. }
  28196. }
  28197. ,
  28198. n.prototype.detectMaxNavPanoSize = function() {
  28199. var e = this.detectMaxNavPanoSizeClass();
  28200. return this.getPanoSize(e)
  28201. }
  28202. ,
  28203. n.prototype.getMaxZoomClass = function(){//add
  28204. let type = this.detectDevice()
  28205. let setting = settings.tileClass[type] //见manage.js的settings
  28206. return setting.max
  28207. }
  28208. n.prototype.getNavZoomClass = function(){//add
  28209. let type = this.detectDevice()
  28210. let setting = settings.tileClass[type]
  28211. return setting.nav
  28212. }
  28213. ,
  28214. n.prototype.detectMaxZoomPanoSize = function() {//获取当前zoomRenderTarget应下载的最高级别
  28215. //若是有三个级别,每次只需要加载到当前的zoomLevel;而两级时因为有zoomed来判断是使用基本贴图还是zoomRenderTarget,所以只需要返回最大的即可
  28216. if (this.zoomLevelResolution) {//有三个级别
  28217. if (this.zoomLevelResolution == '4k' && this.useUltraHighResolutionPanos) {
  28218. return this.getPanoSize(r.ULTRAHIGH)
  28219. } else if (this.zoomLevelResolution == '1k' || !this.useHighResolutionPanos) {
  28220. return this.getPanoSize(r.STANDARD)
  28221. } else {
  28222. return this.getPanoSize(r.HIGH)
  28223. }
  28224. } else {
  28225. let tileClass = this.getMaxZoomClass()
  28226. if(tileClass == '1k')return this.getPanoSize(r.STANDARD);
  28227. if(tileClass == '4k' && this.useUltraHighResolutionPanos ){
  28228. return this.getPanoSize(r.ULTRAHIGH);
  28229. }else{//'2k'
  28230. return this.getPanoSize(r.HIGH);
  28231. }
  28232. }
  28233. }
  28234. /* n.prototype.detectMaxZoomPanoSize = function() {
  28235. 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)
  28236. } */
  28237. ,
  28238. t.exports = n
  28239. }
  28240. , {
  28241. "../constants": 8,
  28242. "../enum/ModelManagerEvents": 33,
  28243. "../enum/PanoSizeClass": 36,
  28244. "../settings": 166,
  28245. "../util/browser": 182,
  28246. "../util/showcase": 193
  28247. }],
  28248. 171: [function(e, t, i) {
  28249. (function(i) {
  28250. "use strict";
  28251. function n(e) {
  28252. this.panos = null,
  28253. this.retryMinimumTime = 1e4,
  28254. this.urls = null,
  28255. this.panoLoadCallbacks = {},
  28256. this.downloadDescriptors = {},
  28257. this.priorityQueue = [],
  28258. this.forceQueue = [],
  28259. this.activeDownloads = [],
  28260. this.qualityManager = null,
  28261. this.tilePrioritizer = null,
  28262. this.refreshInterval = null,
  28263. this.processPriorityQueue = !1,
  28264. this.concurrentDownloads = e.concurrentDownloads || 1,
  28265. this.downloadTestResults = {}
  28266. }
  28267. var r = e("three")
  28268. , o = (e("../enum/Viewmode"),
  28269. e("../settings"))
  28270. , a = (e("../objects/Panorama"),
  28271. e("../util/logger"))
  28272. , s = (e("../enum/Vectors"),
  28273. e("../enum/PanoSizeClass"),
  28274. e("../enum/TileDownloaderEvents"))
  28275. , l = e("./TilePrioritizer")
  28276. , c = e("./TileUtils")
  28277. , h = (e("../enum/GLCubeFaces"),
  28278. e("../enum/DownloadStatus"))
  28279. , u = e("../util/panorama")
  28280. , d = e("../util/ajax")
  28281. , p = e("../ab")
  28282. , f = e("events").EventEmitter
  28283. , g = (new a(i),
  28284. Object.freeze({
  28285. Testing: 1,
  28286. Success: 2,
  28287. Fail: 3
  28288. }));
  28289. n.prototype = Object.create(f.prototype),
  28290. n.IDLE_REFRESH_DELAY = 500,
  28291. n.ACTIVE_REFRESH_DELAY = 16,
  28292. n.DOWNLOAD_RETRIES = 4,
  28293. n.prototype.init = function(e) {
  28294. this.qualityManager = e
  28295. }
  28296. ,
  28297. n.prototype.setUrls = function(e) {
  28298. this.urls = e
  28299. }
  28300. ,
  28301. n.prototype.setPanoData = function(e, t, i) {
  28302. this.panos = e,
  28303. this.imagePanos = t,
  28304. this.panoGroupId = i
  28305. }
  28306. ,
  28307. n.prototype.start = function() {
  28308. this.refreshUpdateInterval(0)
  28309. }
  28310. ,
  28311. n.prototype.stop = function() {
  28312. window.cancel(this.refreshInterval)
  28313. }
  28314. ,
  28315. n.prototype.refreshUpdateInterval = function(e) {
  28316. e || (e = 0),
  28317. this.refreshInterval = window.setTimeout(function() {
  28318. var e = this.update();
  28319. e ? this.refreshUpdateInterval(n.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(n.IDLE_REFRESH_DELAY)
  28320. }
  28321. .bind(this), e)
  28322. }
  28323. ,
  28324. n.prototype.update = function() {
  28325. var e = this.forceQueue.length > 0;
  28326. return this.processQueueForDownloading(this.forceQueue),
  28327. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  28328. this.priorityQueue.length > 0 && (e = !0),
  28329. this.processQueueForDownloading(this.priorityQueue)),
  28330. e
  28331. }
  28332. ,
  28333. n.prototype.forceQueueTilesForPano = function() {
  28334. var e = []
  28335. , t = [];
  28336. return function(i, n, r, o, a, s) {
  28337. e.length = 0;
  28338. for (var u = this.getTileDownloadDescriptors(i, n), d = 0; d < u.length; d++) {
  28339. var p = u[d];
  28340. p.status !== h.None && p.status !== h.Queued || e.push(p)
  28341. }
  28342. if (r && e.length > 0) {
  28343. l.sortPanoTiles(e, i, r),
  28344. t.length = 0,
  28345. c.matchingTilesInDirection(i, n, r, o, a, t);
  28346. for (var f = 0, g = function(e) {
  28347. return e.face === m.face && e.faceTileIndex === m.faceTileIndex
  28348. }; f < e.length; ) {
  28349. var m = e[f]
  28350. , v = t.findIndex(g);
  28351. v < 0 ? e.splice(f, 1) : f++
  28352. }
  28353. }
  28354. for (var A = 0; A < e.length; A++)
  28355. this.forceQueue.push(e[A]);
  28356. this.setStatusForAllDescriptors(this.forceQueue, h.ForceQueued),
  28357. this.clearFromQueue(this.priorityQueue, h.ForceQueued, !1),
  28358. s && this.processQueueForDownloading(this.forceQueue, !0)
  28359. }
  28360. }(),
  28361. n.prototype.clearForceQueue = function() {
  28362. this.clearQueue(this.forceQueue)
  28363. }
  28364. ,
  28365. n.prototype.queuePrioritizedTilesForPanos = function(e) {
  28366. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  28367. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  28368. this.clearFromQueue(this.priorityQueue, h.None, !0),
  28369. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, h.Queued))
  28370. }
  28371. ,
  28372. n.prototype.clearQueue = function(e) {
  28373. this.setStatusForAllDescriptors(e, h.None),
  28374. e.length = 0
  28375. }
  28376. ,
  28377. n.prototype.clearFromQueue = function(e, t, i) {
  28378. for (var n = 0; n < e.length; n++) {
  28379. var r = e[n];
  28380. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  28381. }
  28382. }
  28383. ,
  28384. n.prototype.setStatusForAllDescriptors = function(e, t) {
  28385. for (var i = 0; i < e.length; i++) {
  28386. var n = e[i];
  28387. n && (n.status = t)
  28388. }
  28389. }
  28390. ,
  28391. n.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  28392. for (var i = 0; i < e.length; i++) {
  28393. var n = e[i];
  28394. n && (n.status !== t ? n.status = t : e[i] = null)
  28395. }
  28396. }
  28397. ,
  28398. n.prototype.getTileDownloadDescriptors = function(e, t) {
  28399. var i = this.getAllTileDownloadDescriptorsForPano(e)
  28400. , n = i[t];
  28401. return n || (n = this.buildDownloadDescriptorArray(t),
  28402. i[t] = n,
  28403. this.initTileDownloadDescriptors(n, e, t)),
  28404. n
  28405. }
  28406. ,
  28407. n.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  28408. var t = this.downloadDescriptors[e.id];
  28409. return t || (t = {},
  28410. this.downloadDescriptors[e.id] = t),
  28411. t
  28412. }
  28413. ,
  28414. n.prototype.processQueueForDownloading = function(e, t) {
  28415. if (this.cleanupActiveDownloads(),
  28416. this.activeDownloads.length < this.concurrentDownloads || t)
  28417. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0, r = 0; n < i && e.length > 0; r++) {
  28418. var o = e.shift();
  28419. o && (this.startDownload(o),
  28420. n++)
  28421. }
  28422. }
  28423. ,
  28424. n.prototype.testDownload = function(e, t, i) {
  28425. var n = this.downloadTestResults[e];
  28426. if (n)
  28427. return void (n === g.Success ? i(!0) : n === g.Fail && i(!1));
  28428. this.downloadTestResults[e] = g.Testing;
  28429. var r = this.panos.list[0]
  28430. , o = this.getTileUrl(r.id, e, t, 0)
  28431. , a = function(t) {
  28432. this.downloadTestResults[e] = g.Success,
  28433. i(!0)
  28434. }
  28435. .bind(this)
  28436. , s = function() {
  28437. this.downloadTestResults[e] = g.Fail,
  28438. i(!1)
  28439. }
  28440. .bind(this);
  28441. this.loadImage(o, 0, a, s)
  28442. }
  28443. ,
  28444. n.prototype.startDownload = function(e) {
  28445. e.status = h.Downloading;
  28446. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  28447. this.activeDownloads.push(e),
  28448. this.loadImage(t, n.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  28449. }
  28450. ,
  28451. n.prototype.downloadFailed = function(e, t) {}
  28452. ,
  28453. n.prototype.downloadComplete = function(e, t) {
  28454. if (e.panoGroupId === this.panoGroupId) {
  28455. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  28456. e.status = h.Downloaded,
  28457. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  28458. var n = {
  28459. panoId: e.pano.id,
  28460. image: t,
  28461. tileSize: e.tileSize,
  28462. panoSize: e.panoSize,
  28463. tileIndex: e.tileIndex,
  28464. faceTileIndex: e.faceTileIndex,
  28465. totalTiles: e.totalTiles,
  28466. face: e.face,
  28467. tileX: e.tileX,
  28468. tileY: e.tileY,
  28469. direction: e.direction
  28470. };
  28471. e.image = t,
  28472. this.emit(s.TileDownloadSuccess, n),
  28473. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  28474. panoId: e.pano.id,
  28475. tileSize: e.tileSize,
  28476. panoSize: e.panoSize
  28477. },
  28478. this.emit(s.PanoDownloadComplete, n),
  28479. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  28480. }
  28481. }
  28482. ,
  28483. n.prototype.cleanupActiveDownloads = function() {
  28484. var e = [];
  28485. return function() {
  28486. e.length = 0;
  28487. for (var t = 0; t < this.activeDownloads.length; t++) {
  28488. var i = this.activeDownloads[t];
  28489. i.status !== h.Downloaded && i.status !== h.Failed && e.push(i)
  28490. }
  28491. this.activeDownloads.length = 0,
  28492. this.activeDownloads.push.apply(this.activeDownloads, e)
  28493. }
  28494. }(),
  28495. n.prototype.isPanoDownloaded = function(e, t) {
  28496. var i = this.getTileDownloadDescriptors(e, t);
  28497. if (i.length <= 0)
  28498. return !1;
  28499. for (var n = 0; n < i.length; n++) {
  28500. var r = i[n];
  28501. if (r.status !== h.Downloaded)
  28502. return !1
  28503. }
  28504. return !0
  28505. }
  28506. ,
  28507. n.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  28508. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  28509. this.panoLoadCallbacks[o] = {
  28510. onLoad: i,
  28511. onFail: n,
  28512. onProgress: r
  28513. }
  28514. }
  28515. ,
  28516. n.prototype.getPanoLoadCallbacks = function(e, t) {
  28517. var i = e.id + ":" + t;
  28518. return this.panoLoadCallbacks[i]
  28519. }
  28520. ,
  28521. n.prototype.buildDownloadDescriptorArray = function(e) {
  28522. for (var t = c.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  28523. var r = this.buildDownloadDescriptor();
  28524. i.push(r)
  28525. }
  28526. return i
  28527. }
  28528. ,
  28529. n.prototype.buildDownloadDescriptor = function() {
  28530. var e = {
  28531. panoGroupId: null,
  28532. pano: null,
  28533. panoSize: -1,
  28534. tileSize: -1,
  28535. tileIndex: -1,
  28536. totalTiles: -1,
  28537. faceTileIndex: -1,
  28538. status: h.None,
  28539. url: null,
  28540. image: null,
  28541. direction: new r.Vector3,
  28542. face: -1,
  28543. cubeFace: -1,
  28544. tileX: -1,
  28545. tileY: -1
  28546. };
  28547. return e
  28548. }
  28549. ,
  28550. n.prototype.initTileDownloadDescriptors = function(e, t, i) {
  28551. for (var n = 0; n < e.length; n++) {
  28552. var r = e[n];
  28553. this.initTileDownloadDescriptor(r, t, i, n)
  28554. }
  28555. }
  28556. ,
  28557. n.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  28558. var r = i >= c.TILE_SIZE ? c.TILE_SIZE : i;
  28559. e.face = c.getFaceForTile(i, n),
  28560. e.cubeFace = u.mapFaceToCubemapFace(e.face),
  28561. e.panoGroupId = this.panoGroupId,
  28562. e.pano = t,
  28563. e.panoSize = i,
  28564. e.tileSize = r,
  28565. e.tileIndex = n,
  28566. e.totalTiles = c.getTileCountForSize(i),
  28567. e.status = h.None,
  28568. e.image = null,
  28569. c.getTileLocation(e.panoSize, e.tileIndex, e),
  28570. c.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, c.LocationOnTile.Center, 0, e.direction)
  28571. }
  28572. ,
  28573. n.prototype.getTileUrl = function() {
  28574. var e = {
  28575. 256: "256",
  28576. 512: "512",
  28577. 1024: "1k",
  28578. 2048: "2k",
  28579. 4096: "4k"
  28580. }
  28581. , t = {
  28582. face: -1,
  28583. faceTileIndex: -1,
  28584. tileX: -1,
  28585. tileY: -1
  28586. };
  28587. return function(i, n, r, a) {
  28588. c.getTileLocation(n, a, t);
  28589. var s = Math.floor(n / r)
  28590. , l = s * s
  28591. , h = Math.floor(a / l)
  28592. , u = "";
  28593. 1 === o.tiling.customCompression && (u = "_" + o.tiling["q" + e[n]]);
  28594. var d = this.urls.get("tiles/" + i + "/" + e[n] + u + "_face" + h + "_" + t.tileX + "_" + t.tileY + ".jpg");
  28595. return d = p.changeIfTileGenerating(d)
  28596. }
  28597. }(),
  28598. n.prototype.loadImage = function(e, t, i, n) {
  28599. d.getImage(e, t).then(function(e) {
  28600. i(e)
  28601. }).fail(n)
  28602. }
  28603. ,
  28604. t.exports = n
  28605. }
  28606. ).call(this, "/js/tile/TileDownloader.js")
  28607. }
  28608. , {
  28609. "../ab": 3,
  28610. "../enum/DownloadStatus": 24,
  28611. "../enum/GLCubeFaces": 25,
  28612. "../enum/PanoSizeClass": 36,
  28613. "../enum/TileDownloaderEvents": 45,
  28614. "../enum/Vectors": 50,
  28615. "../enum/Viewmode": 51,
  28616. "../objects/Panorama": 148,
  28617. "../settings": 166,
  28618. "../util/ajax": 181,
  28619. "../util/logger": 189,
  28620. "../util/panorama": 191,
  28621. "./TilePrioritizer": 172,
  28622. "./TileUtils": 174,
  28623. events: 202,
  28624. three: 217
  28625. }],
  28626. 172: [function(e, t, i) {
  28627. (function(i) {
  28628. "use strict";
  28629. function n(e, t, i, o, a) {
  28630. this.qualityManager = e,
  28631. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  28632. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  28633. this.baseSize = t,
  28634. this.standardSize = i,
  28635. this.highSize = o,
  28636. this.ultraHighSize = a,
  28637. this.priorityCriteria = new n.PriorityCriteria(null,new r.Vector3(0,0,0),new r.Vector3(0,0,-1),new r.Vector3(0,0,-1))
  28638. }
  28639. var r = e("three")
  28640. , o = (e("../enum/Viewmode"),
  28641. e("../settings"),
  28642. e("../settings"),
  28643. e("../objects/Panorama"))
  28644. , a = e("../util/logger")
  28645. , s = (e("../enum/Vectors"),
  28646. e("../enum/PanoSizeClass"),
  28647. e("../enum/ModelManagerEvents"),
  28648. e("../enum/GLCubeFaces"),
  28649. e("../enum/DownloadStatus"))
  28650. , l = (e("../util/browser"),
  28651. e("./TileUtils"))
  28652. , c = e("../util/math")
  28653. , h = (e("events").EventEmitter,
  28654. new a(i),
  28655. Object.freeze({
  28656. None: 0,
  28657. DirectionalFOV: 1
  28658. }));
  28659. n.PriorityCriteria = function(e, t, i, n, o) {
  28660. this.pano = e,
  28661. this.cameraPosition = (new r.Vector3).copy(t),
  28662. this.cameraDir = (new r.Vector3).copy(i),
  28663. this.panoSpaceDir = (new r.Vector3).copy(n),
  28664. this.upcomingPanos = o,
  28665. this.copy = function(e) {
  28666. this.pano = e.pano,
  28667. this.cameraPosition.copy(e.cameraPosition),
  28668. this.cameraDir.copy(e.cameraDir),
  28669. this.panoSpaceDir.copy(e.panoSpaceDir),
  28670. this.upcomingPanos = o
  28671. }
  28672. ,
  28673. this.zoomingActive = !1
  28674. }
  28675. ,
  28676. n.DIRECTIONAL_FOV = 180,
  28677. n.DIRECTIONAL_FOV_NARROW = 120,
  28678. n.MAX_SCORED_PANOS_TOCONSIDER = 6,
  28679. n.MAX_SCORED_PANOS_TOADD = 2,
  28680. n.MAX_UPCOMING_PANOS_TOADD = 3,
  28681. n.DIRECTION_SCORE_STRICTNESS = .75,
  28682. n.appendQueue = function(e, t) {
  28683. if (e && t)
  28684. for (var i = 0; i < t.length; i++)
  28685. e.push(t[i])
  28686. }
  28687. ,
  28688. n.prototype.updateCriteria = function(e, t, i, n) {
  28689. this.priorityCriteria.pano = e,
  28690. this.priorityCriteria.cameraPosition.copy(t),
  28691. this.priorityCriteria.cameraDir.copy(i),
  28692. this.priorityCriteria.upcomingPanos = n,
  28693. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize()
  28694. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  28695. if(!player.panoRenderer.isPanoZoomed(e.id)){ //xzw add,直到到达该点后才能下载4k,否则不会渲染到zoomRenderTarget上
  28696. this.maxNavQuality = Math.min(2048, this.maxNavQuality)
  28697. this.maxZoomQuality = Math.min(2048, this.maxZoomQuality)
  28698. }
  28699. }
  28700. ,
  28701. n.prototype.filterAndPrioritize = function() {
  28702. var e = []
  28703. , t = []
  28704. , i = [];
  28705. return function(r, o, a) {
  28706. this.populateNeighborPanos(this.priorityCriteria.pano, o, e),
  28707. this.populateScoredPanos(this.priorityCriteria.pano, o, t, this.priorityCriteria.cameraDir, n.MAX_SCORED_PANOS_TOCONSIDER);
  28708. var s = this.baseSize
  28709. , l = this.standardSize
  28710. , c = this.highSize
  28711. , h = this.ultraHighSize;
  28712. this.queueTilesForPano(r, a, this.priorityCriteria.pano, s),
  28713. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(r, this.priorityCriteria.upcomingPanos, a, s, n.MAX_UPCOMING_PANOS_TOADD),
  28714. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(r, this.priorityCriteria.upcomingPanos, a, 1024 , n.MAX_UPCOMING_PANOS_TOADD),//更清晰些
  28715. i.length = 0,
  28716. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  28717. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  28718. n.appendQueue(r, i),
  28719. this.queueTilesForPanos(r, t, a, s, n.MAX_SCORED_PANOS_TOADD),
  28720. i.length = 0,
  28721. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  28722. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  28723. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  28724. n.appendQueue(r, i),
  28725. i.length = 0,
  28726. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  28727. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  28728. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  28729. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  28730. n.appendQueue(r, i),
  28731. this.queueTilesForPanos(r, e, a, s)
  28732. }
  28733. }(),
  28734. n.prototype.canDownloadSize = function(e) {
  28735. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  28736. }
  28737. ,
  28738. n.prototype.populateNeighborPanos = function(e, t, i) {
  28739. i = i || [],
  28740. i.length = 0;
  28741. var n = t.getNeighbours(e);
  28742. for (var r in n)
  28743. if (n.hasOwnProperty(r)) {
  28744. var o = t.get(r);
  28745. i.push(o)
  28746. }
  28747. return i
  28748. }
  28749. ,
  28750. n.prototype.populateScoredPanos = function(e, t, i, r, a) {
  28751. i = i || [],
  28752. i.length = 0;
  28753. var s = [o.filters.inPanoDirection(e.position, r, n.DIRECTION_SCORE_STRICTNESS), o.filters.not(e)]
  28754. , l = [o.scoreFunctions.distanceSquared(e), o.scoreFunctions.direction(e.position, r)]
  28755. , c = t.sortByScore(s, l);
  28756. if (c)
  28757. for (var h = 0; h < c.length && h < a; h++) {
  28758. var u = c[h].item;
  28759. i.push(u)
  28760. }
  28761. return i
  28762. }
  28763. ,
  28764. n.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  28765. for (var o = 0, a = 0; a < t.length; a++) {
  28766. var s = t[a]
  28767. , l = this.queueTilesForPano(e, i, s, n);
  28768. if (o += l > 0 ? 1 : 0,
  28769. r && o >= r)
  28770. break
  28771. }
  28772. return o
  28773. }
  28774. ,
  28775. n.prototype.queueTilesForPano = function() {
  28776. var e = {
  28777. filter: h.None
  28778. };
  28779. return function(t, i, n, r) {
  28780. return this.filterAndQueueTileDownloadDescriptors(t, i, n, r, e)
  28781. }
  28782. }(),
  28783. n.prototype.queueTilesForPanosInDirection = function() {
  28784. var e = new r.Vector3;
  28785. return function(t, i, n, r, o, a, s, l) {
  28786. for (var h = 0, u = 0; u < n.length; u++) {
  28787. var d = n[u];
  28788. e.copy(d.position),
  28789. e.sub(o),
  28790. e.normalize();
  28791. var p = Math.max(Math.min(a.dot(e), 1), -1)
  28792. , f = c.getFOVDotThreshold(s);
  28793. if (p >= f) {
  28794. var g = this.queueTilesInDirectionForPano(t, i, d, r, o, a, s);
  28795. if (h += g > 0 ? 1 : 0,
  28796. l && h >= l)
  28797. break
  28798. }
  28799. }
  28800. return h
  28801. }
  28802. }(),
  28803. n.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  28804. for (var l = 0, c = 0; c < i.length; c++) {
  28805. var h = i[c]
  28806. , u = this.queueTilesInDirectionForPano(e, t, h, n, o, a);
  28807. if (l += u > 0 ? 1 : 0,
  28808. s && l >= s)
  28809. break
  28810. }
  28811. return l
  28812. }
  28813. ,
  28814. n.prototype.queueTilesInDirectionForPano = function() {
  28815. var e = {
  28816. filter: h.DirectionalFOV,
  28817. direction: new r.Vector3,
  28818. fov: 60
  28819. }
  28820. , t = new r.Vector3;
  28821. return function(i, n, r, o, a, s, c) {
  28822. return t.copy(s),
  28823. l.getRelativeDirection(r.quaternion, t),
  28824. e.direction.copy(t),
  28825. e.fov = c,
  28826. this.filterAndQueueTileDownloadDescriptors(i, n, r, o, e)
  28827. }
  28828. }(),
  28829. n.prototype.filterAndQueueTileDownloadDescriptors = function() {
  28830. var e = [];
  28831. return function(t, i, n, r, o) {
  28832. var a = i.getTileDownloadDescriptors(n, r);
  28833. e.length = 0,
  28834. this.filterTileDownloadDescriptors(n, a, e, o);
  28835. for (var s = 0, l = 0; l < e.length; l++) {
  28836. var c = e[l];
  28837. c && (t.push(c),
  28838. s++)
  28839. }
  28840. return s
  28841. }
  28842. }(),
  28843. n.prototype.filterTileDownloadDescriptors = function() {
  28844. new r.Vector3;
  28845. return function(e, t, i, n) {
  28846. var r, o;
  28847. switch (n.filter) {
  28848. case h.DirectionalFOV:
  28849. for (r = 0; r < t.length; r++)
  28850. o = t[r],
  28851. l.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  28852. break;
  28853. default:
  28854. for (r = 0; r < t.length; r++)
  28855. o = t[r],
  28856. i.push(o)
  28857. }
  28858. for (r = 0; r < i.length; r++)
  28859. o = i[r],
  28860. this.canIncludeDescriptor(o) || (i[r] = null)
  28861. }
  28862. }(),
  28863. n.prototype.canIncludeDescriptor = function(e) {
  28864. return e.status !== s.Downloading && e.status !== s.Downloaded
  28865. }
  28866. ,
  28867. n.prototype.canIncludePano = function(e, t) {
  28868. return !e.isLoaded(t)
  28869. }
  28870. ,
  28871. n.getFOVDotThreshold = function(e) {
  28872. return Math.cos(r.Math.degToRad(e / 2))
  28873. }
  28874. ;
  28875. var u = function() {
  28876. var e = function e(t, i) {
  28877. var n = e._panoSpaceDir
  28878. , r = e._fovThreshold
  28879. , o = e._fovThresholdNarrow
  28880. , a = Math.max(Math.min(n.dot(t.direction), 1), -1)
  28881. , s = Math.max(Math.min(n.dot(i.direction), 1), -1);
  28882. return t._dot = a,
  28883. i._dot = s,
  28884. 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)
  28885. };
  28886. return e._panoSpaceDir = new r.Vector3,
  28887. e._fovThreshold = -1,
  28888. e._fovThresholdNarrow = -1,
  28889. e
  28890. }();
  28891. n.sortPanoTiles = function(e, t, i) {
  28892. u._panoSpaceDir.copy(i),
  28893. l.getRelativeDirection(t.quaternion, u._panoSpaceDir),
  28894. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  28895. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV),
  28896. e.sort(u)
  28897. }
  28898. ,
  28899. n.insertSortedPanoTile = function(e, t, i, r) {
  28900. u._panoSpaceDir.copy(r),
  28901. l.getRelativeDirection(i.quaternion, u._panoSpaceDir),
  28902. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  28903. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV);
  28904. for (var o = -1, a = 0; a < e.length; a++) {
  28905. var s = u(t, e[a]);
  28906. if (s <= 0) {
  28907. o = a;
  28908. break
  28909. }
  28910. }
  28911. if (o === -1)
  28912. e[e.length] = t;
  28913. else {
  28914. for (var h = e.length; h > o; h--)
  28915. e[h] = e[h - 1];
  28916. e[o] = t
  28917. }
  28918. }
  28919. ,
  28920. n.prototype.setZoomingActive = function(e) {
  28921. e !== this.zoomingActive && (this.zoomingActive = e)
  28922. }
  28923. ,
  28924. t.exports = n
  28925. }
  28926. ).call(this, "/js/tile/TilePrioritizer.js")
  28927. }
  28928. , {
  28929. "../enum/DownloadStatus": 24,
  28930. "../enum/GLCubeFaces": 25,
  28931. "../enum/ModelManagerEvents": 33,
  28932. "../enum/PanoSizeClass": 36,
  28933. "../enum/Vectors": 50,
  28934. "../enum/Viewmode": 51,
  28935. "../objects/Panorama": 148,
  28936. "../settings": 166,
  28937. "../util/browser": 182,
  28938. "../util/logger": 189,
  28939. "../util/math": 190,
  28940. "./TileUtils": 174,
  28941. events: 202,
  28942. three: 217
  28943. }],
  28944. 173: [function(e, t, i) {
  28945. "use strict";
  28946. function n(e, t) {
  28947. this.levels = t,
  28948. this.tileSize = e,
  28949. this.root = null,
  28950. this.allNodes = [],
  28951. a(this)
  28952. }
  28953. function r(e, t) {
  28954. this.tree = e,
  28955. this.parent = t,
  28956. this.children = [],
  28957. this.id = ++u
  28958. }
  28959. function o(e, t, i, r, a, s, l, h) {
  28960. if (e) {
  28961. l = l || n.TraversalType.PreOrder;
  28962. var u = r * c + i;
  28963. if (l === n.TraversalType.PreOrder && (a && a(e, t, u, i, r),
  28964. s && s.push(e)),
  28965. e.children && 0 !== e.children.length) {
  28966. for (var d = r * c, p = i * c, f = 0; f < c; f++)
  28967. for (var g = 0; g < c; g++)
  28968. o(e.children[g * c + f], t + 1, p + f, d + g, a, s, l, h);
  28969. l === n.TraversalType.PostOrder && (a && a(e, t, u, i, r),
  28970. s && s.push(e))
  28971. }
  28972. }
  28973. }
  28974. function a(e) {
  28975. e.root = s(e, null, 0)
  28976. }
  28977. function s(e, t, i) {
  28978. if (i > e.levels)
  28979. return null;
  28980. var n = new r(e,t);
  28981. e.allNodes.push(n);
  28982. for (var o = 0; o < h; o++)
  28983. n.children[o] = s(e, n, i + 1);
  28984. return n
  28985. }
  28986. function l(e, t, i, n, r) {
  28987. if (!e)
  28988. return null;
  28989. if (0 === i)
  28990. return e;
  28991. if (!e.children || 0 === e.children.length)
  28992. return null;
  28993. var o = Math.pow(c, i)
  28994. , a = o / c
  28995. , s = n % a
  28996. , h = r % a
  28997. , u = Math.floor(r / a)
  28998. , d = Math.floor(n / a)
  28999. , p = u * c + d
  29000. , f = e.children[p];
  29001. return l(f, t + 1, i - 1, s, h)
  29002. }
  29003. var c = (e("three"),
  29004. e("./TileUtils"),
  29005. e("../objects/Panorama"),
  29006. e("../util/panorama"),
  29007. e("events").EventEmitter,
  29008. 2)
  29009. , h = c * c;
  29010. n.TraversalType = Object.freeze({
  29011. PreOrder: 0,
  29012. PostOrder: 1
  29013. });
  29014. var u = 0;
  29015. n.getLevelCountForSize = function(e, t) {
  29016. var i = 0;
  29017. for (t < e && (t = e); ; ) {
  29018. if (t /= c,
  29019. t < e)
  29020. break;
  29021. i++
  29022. }
  29023. return i
  29024. }
  29025. ,
  29026. n.getSizeForLevel = function(e, t) {
  29027. return Math.pow(c, t) * e
  29028. }
  29029. ,
  29030. n.prototype.getSubNode = function(e, t, i) {
  29031. (!t || e < this.tileSize) && (t = 0),
  29032. (!i || e < this.tileSize) && (i = 0),
  29033. e < this.tileSize && (e = this.tileSize);
  29034. var r = n.getLevelCountForSize(this.tileSize, e)
  29035. , o = l(this.root, 0, r, t, i);
  29036. return o
  29037. }
  29038. ,
  29039. n.prototype.breadthFirst = function(e) {
  29040. e = e || {};
  29041. var t = !!e.nullLevelEnd
  29042. , i = e.maxLevel
  29043. , n = e.minLevel
  29044. , r = e.callback
  29045. , o = e.saveVisited
  29046. , a = []
  29047. , s = {}
  29048. , l = 0
  29049. , c = 0;
  29050. for (a.push(this.root),
  29051. a.push(s); a.length > 0 && !(i && l > i); ) {
  29052. var h = a.shift();
  29053. if (h === s)
  29054. (!n || l >= n) && (r && t && r(null),
  29055. o && t && o.push(null)),
  29056. a.length > 0 && a.push(s),
  29057. l++,
  29058. c = 0;
  29059. else {
  29060. if (h.children)
  29061. for (var u = 0; u < h.children.length; u++) {
  29062. var d = h.children[u];
  29063. d && a.push(h.children[u])
  29064. }
  29065. var p = this.getFaceIndexFromNode(h);
  29066. (!n || l >= n) && (r && r(h, l, p),
  29067. o && o.push(h)),
  29068. c++
  29069. }
  29070. }
  29071. }
  29072. ,
  29073. n.prototype.getFaceIndexFromNode = function(e) {
  29074. if (!e)
  29075. return -1;
  29076. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  29077. var o = i.parent;
  29078. if (!o)
  29079. break;
  29080. for (var a = -1, s = 0; s < o.children.length; s++)
  29081. o.children[s] === i && (a = s);
  29082. var l = a % c
  29083. , h = Math.floor(a / c);
  29084. n = l * t + n,
  29085. r = h * t + r,
  29086. t *= c,
  29087. i = o
  29088. }
  29089. return r * t + n
  29090. }
  29091. ,
  29092. n.prototype.depthFirst = function(e, t, i) {
  29093. o(this.root, 0, 0, 0, e, t, i, this.tileSize)
  29094. }
  29095. ,
  29096. t.exports = n
  29097. }
  29098. , {
  29099. "../objects/Panorama": 148,
  29100. "../util/panorama": 191,
  29101. "./TileUtils": 174,
  29102. events: 202,
  29103. three: 217
  29104. }],
  29105. 174: [function(e, t, i) {
  29106. "use strict";
  29107. var n = e("../enum/GLCubeFaces")
  29108. , r = e("../util/MathLight")
  29109. , o = {};
  29110. o.TILE_SIZE = 512,
  29111. o.FACES_PER_PANO = 6,
  29112. o.LocationOnTile = {
  29113. Center: 0,
  29114. UpperLeft: 1,
  29115. UpperRight: 2,
  29116. LowerRight: 3,
  29117. LowerLeft: 4
  29118. },
  29119. o.getTileVector = function() {
  29120. return function(e, t, i, a, s, l, c, h) {
  29121. l = l || o.LocationOnTile.Center;
  29122. var u = e / t
  29123. , d = a / u;
  29124. s = -s + (u - 1);
  29125. var p = s / u
  29126. , f = t / e
  29127. , g = 2 * f
  29128. , m = g / 2
  29129. , v = 2 * d - 1 + m
  29130. , A = 2 * p - 1 + m;
  29131. switch (l) {
  29132. case o.LocationOnTile.UpperLeft:
  29133. v -= m,
  29134. A += m,
  29135. v += c * g;
  29136. break;
  29137. case o.LocationOnTile.UpperRight:
  29138. v += m,
  29139. A += m,
  29140. A -= c * g;
  29141. break;
  29142. case o.LocationOnTile.LowerRight:
  29143. v += m,
  29144. A -= m,
  29145. v -= c * g;
  29146. break;
  29147. case o.LocationOnTile.LowerLeft:
  29148. v -= m,
  29149. A -= m,
  29150. A += c * g;
  29151. break;
  29152. case o.LocationOnTile.Center:
  29153. }
  29154. switch (i) {
  29155. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  29156. r.setVector(h, -1, A, -v);
  29157. break;
  29158. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  29159. r.setVector(h, 1, A, v);
  29160. break;
  29161. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  29162. r.setVector(h, -v, 1, -A);
  29163. break;
  29164. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  29165. r.setVector(h, -v, -1, A);
  29166. break;
  29167. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  29168. r.setVector(h, -v, A, 1);
  29169. break;
  29170. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  29171. r.setVector(h, v, A, -1)
  29172. }
  29173. r.normalize(h)
  29174. }
  29175. }(),
  29176. o.getFaceForTile = function(e, t) {
  29177. var i = o.TILE_SIZE;
  29178. e < o.TILE_SIZE && (i = e);
  29179. var n = Math.floor(e / i)
  29180. , r = n * n;
  29181. return Math.floor(t / r)
  29182. }
  29183. ,
  29184. o.getTileLocation = function(e, t, i) {
  29185. var n = o.TILE_SIZE;
  29186. e < o.TILE_SIZE && (n = e);
  29187. var r = o.getFaceForTile(e, t)
  29188. , a = Math.floor(e / n)
  29189. , s = a * a
  29190. , l = t - r * s;
  29191. i.tileX = l % a,
  29192. i.tileY = Math.floor(l / a),
  29193. i.face = r,
  29194. i.faceTileIndex = l
  29195. }
  29196. ,
  29197. o.getTileCountForSize = function(e) {
  29198. if (e <= o.TILE_SIZE)
  29199. return o.FACES_PER_PANO;
  29200. var t = Math.floor(e / o.TILE_SIZE)
  29201. , i = t * t
  29202. , n = i * o.FACES_PER_PANO;
  29203. return n
  29204. }
  29205. ,
  29206. o.getRelativeDirection = function() {
  29207. var e = new r.Matrix4
  29208. , t = new r.Quaternion;
  29209. return function(i, n) {
  29210. t.copy(i),
  29211. t.inverse(),
  29212. e.makeRotationFromQuaternion(t),
  29213. e.applyToVector3(n),
  29214. r.normalize(n)
  29215. }
  29216. }(),
  29217. o.matchingTilesInDirection = function() {
  29218. var e = new r.Vector3
  29219. , t = new r.Vector3(0,0,-1)
  29220. , i = new r.Quaternion
  29221. , n = function(e, t) {
  29222. e.push({
  29223. face: t.face,
  29224. faceTileIndex: t.faceTileIndex,
  29225. tileX: t.tileX,
  29226. tileY: t.tileY
  29227. })
  29228. }
  29229. , a = function() {
  29230. var e = {
  29231. face: -1,
  29232. faceTileIndex: -1,
  29233. tileX: -1,
  29234. tileY: -1
  29235. };
  29236. return function(t, i, r) {
  29237. for (var a = o.getTileCountForSize(t), s = 0, l = 0; l < a; l++)
  29238. o.getTileLocation(t, l, e),
  29239. i && !i(e) || (s++,
  29240. r && n(r, e));
  29241. return s
  29242. }
  29243. }();
  29244. return function(n, s, l, c, h, u) {
  29245. var d = s < o.TILE_SIZE ? s : o.TILE_SIZE;
  29246. o.getTileCountForSize(s);
  29247. if (!c && !h)
  29248. return a(s, null, u);
  29249. var p = !!h;
  29250. if (h = h || c,
  29251. h = Math.max(0, Math.min(h, 360)),
  29252. c = Math.max(0, Math.min(c, 360)),
  29253. r.copyVector(l, e),
  29254. o.getRelativeDirection(n.quaternion, e),
  29255. p) {
  29256. i.setFromUnitVectors(e, t);
  29257. var f = function(e) {
  29258. return o.isTileWithinFrustum(s, d, e.face, e.tileX, e.tileY, i, c, h)
  29259. };
  29260. return a(s, f, u)
  29261. }
  29262. var g = function(t) {
  29263. return o.isTileWithinFOV(s, d, t.face, t.tileX, t.tileY, e, c)
  29264. };
  29265. return a(s, g, u)
  29266. }
  29267. }(),
  29268. o.isTileWithinFrustum = function() {
  29269. var e = new r.Vector3
  29270. , t = 1e-5;
  29271. return function(i, n, a, s, l, c, h, u) {
  29272. 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++)
  29273. if (o.getTileVector(i, n, m, s, l, b, 0, e),
  29274. r.applyQuaternionToVector(c, e),
  29275. e.z >= -t)
  29276. I++;
  29277. else {
  29278. var w = -1 / e.z
  29279. , _ = e.x * w
  29280. , T = e.y * w;
  29281. T > d ? v++ : T < p && A++,
  29282. _ > f ? y++ : _ < g && C++,
  29283. E++
  29284. }
  29285. return A !== E && v !== E && y !== E && C !== E
  29286. }
  29287. }(),
  29288. o.isTileWithinFOV = function() {
  29289. var e = new r.Vector3
  29290. , t = new r.Vector3(0,1,0)
  29291. , i = new r.Vector3(1,0,0);
  29292. return function(n, a, s, l, c, h, u) {
  29293. var d = o.mapFaceToCubemapFace(s);
  29294. if (r.cross(h, t, i),
  29295. o.getTileVector(n, a, d, l, c, o.LocationOnTile.Center, 0, e),
  29296. o.isWithinFOV(e, h, u, null))
  29297. return !0;
  29298. for (var p = u / 360, f = Math.floor(1 / p), g = 0, m = 0; m < f; m++) {
  29299. for (var v = o.LocationOnTile.UpperLeft; v <= o.LocationOnTile.LowerLeft; v++)
  29300. if (o.getTileVector(n, a, d, l, c, v, g, e),
  29301. o.isWithinFOV(e, h, u, null))
  29302. return !0;
  29303. g += p
  29304. }
  29305. return !1
  29306. }
  29307. }(),
  29308. o.isWithinFOV = function() {
  29309. var e = new r.Vector3
  29310. , t = new r.Vector3;
  29311. return function(i, n, o, a) {
  29312. if (r.copyVector(i, t),
  29313. a) {
  29314. r.copyVector(a, e),
  29315. r.normalize(e);
  29316. var s = r.dot(e, i);
  29317. e.x *= s,
  29318. e.y *= s,
  29319. e.z *= s,
  29320. r.subVector(t, e)
  29321. }
  29322. var l = o / 2 * r.RADIANS_PER_DEGREE
  29323. , c = Math.cos(l)
  29324. , h = r.dot(t, n);
  29325. return h >= c
  29326. }
  29327. }(),
  29328. o.mapFaceToCubemapFace = function() {
  29329. var e = {
  29330. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  29331. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  29332. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  29333. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  29334. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  29335. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  29336. };
  29337. return function(t) {
  29338. return e[t]
  29339. }
  29340. }(),
  29341. t.exports = o
  29342. }
  29343. , {
  29344. "../enum/GLCubeFaces": 25,
  29345. "../util/MathLight": 176
  29346. }],
  29347. 175: [function(e, t, i) {
  29348. (function(i) {
  29349. "use strict";
  29350. function n() {
  29351. this.list = [],
  29352. this.index = {},
  29353. Object.defineProperty(this, "length", {
  29354. get: function() {
  29355. return this.list.length
  29356. }
  29357. })
  29358. }
  29359. var r = (e("./common"),
  29360. e("./logger"));
  29361. new r(i);
  29362. n.prototype.forEach = function(e) {
  29363. this.list.forEach(e)
  29364. }
  29365. ,
  29366. n.prototype.add = function(e) {
  29367. this.list.push(e),
  29368. this.index[this.getIndex(e)] = e
  29369. }
  29370. ,
  29371. n.prototype.getIndex = function(e) {
  29372. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  29373. }
  29374. ,
  29375. n.prototype.extend = function(e) {
  29376. for (var t = 0; t < e.length; t++)
  29377. this.add(e[t])
  29378. }
  29379. ,
  29380. n.prototype.get = function(e) {
  29381. return this.index[e]
  29382. }
  29383. ,
  29384. n.prototype.first = function() {
  29385. return this.list[0]
  29386. }
  29387. ,
  29388. n.prototype.last = function() {
  29389. return this.list[this.list.length - 1]
  29390. }
  29391. ,
  29392. n.prototype.reIndex = function() {
  29393. this.index = {};
  29394. var e = this;
  29395. this.forEach(function(t) {
  29396. e.index[e.getIndex(t)] = t
  29397. })
  29398. }
  29399. ,
  29400. n.prototype.filter = function(e) {
  29401. var t = this.list.filter(e);
  29402. return this.reIndex(),
  29403. t
  29404. }
  29405. ,
  29406. n.prototype.reduce = function(e, t) {
  29407. return this.list.reduce(e, t)
  29408. }
  29409. ,
  29410. n.prototype.sort = function(e) {
  29411. return this.list.sort(e)
  29412. }
  29413. ,
  29414. n.prototype.indexOf = function(e) {
  29415. for (var t = 0; t < this.list.length; ++t)
  29416. if (this.list[t] === e)
  29417. return t;
  29418. return -1
  29419. }
  29420. ,
  29421. t.exports = n
  29422. }
  29423. ).call(this, "/js/util/IndexedCollection.js")
  29424. }
  29425. , {
  29426. "./common": 185,
  29427. "./logger": 189
  29428. }],
  29429. 176: [function(e, t, i) {
  29430. "use strict";
  29431. var n = e("../constants")
  29432. , r = {};
  29433. r.RADIANS_PER_DEGREE = Math.PI / 180,
  29434. r.DEGREES_PER_RADIAN = 180 / Math.PI,
  29435. r.Vector3 = function(e, t, i) {
  29436. this.x = e || 0,
  29437. this.y = t || 0,
  29438. this.z = i || 0
  29439. }
  29440. ,
  29441. r.Matrix4 = function() {
  29442. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  29443. arguments.length > 0 && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  29444. }
  29445. ,
  29446. r.Matrix4.prototype = {
  29447. identity: function() {
  29448. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  29449. this
  29450. },
  29451. copy: function(e) {
  29452. return this.elements.set(e.elements),
  29453. this
  29454. },
  29455. applyToVector3: function(e) {
  29456. var t = e.x
  29457. , i = e.y
  29458. , n = e.z
  29459. , r = this.elements;
  29460. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  29461. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  29462. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  29463. this
  29464. },
  29465. getInverse: function(e, t) {
  29466. var i = this.elements
  29467. , n = e.elements
  29468. , r = n[0]
  29469. , o = n[1]
  29470. , a = n[2]
  29471. , s = n[3]
  29472. , l = n[4]
  29473. , c = n[5]
  29474. , h = n[6]
  29475. , u = n[7]
  29476. , d = n[8]
  29477. , p = n[9]
  29478. , f = n[10]
  29479. , g = n[11]
  29480. , m = n[12]
  29481. , v = n[13]
  29482. , A = n[14]
  29483. , y = n[15]
  29484. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  29485. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  29486. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  29487. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  29488. , w = r * C + o * I + a * E + s * b;
  29489. if (0 === w) {
  29490. var _ = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  29491. if (t)
  29492. throw new Error(_);
  29493. return console.warn(_),
  29494. this.identity()
  29495. }
  29496. var T = 1 / w;
  29497. return i[0] = C * T,
  29498. i[1] = (v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y) * T,
  29499. i[2] = (c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y) * T,
  29500. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  29501. i[4] = I * T,
  29502. i[5] = (d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y) * T,
  29503. i[6] = (m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y) * T,
  29504. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  29505. i[8] = E * T,
  29506. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y) * T,
  29507. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y) * T,
  29508. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  29509. i[12] = b * T,
  29510. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A) * T,
  29511. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A) * T,
  29512. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  29513. this
  29514. },
  29515. makeRotationFromQuaternion: function(e) {
  29516. var t = this.elements
  29517. , i = e.x
  29518. , n = e.y
  29519. , r = e.z
  29520. , o = e.w
  29521. , a = i + i
  29522. , s = n + n
  29523. , l = r + r
  29524. , c = i * a
  29525. , h = i * s
  29526. , u = i * l
  29527. , d = n * s
  29528. , p = n * l
  29529. , f = r * l
  29530. , g = o * a
  29531. , m = o * s
  29532. , v = o * l;
  29533. return t[0] = 1 - (d + f),
  29534. t[4] = h - v,
  29535. t[8] = u + m,
  29536. t[1] = h + v,
  29537. t[5] = 1 - (c + f),
  29538. t[9] = p - g,
  29539. t[2] = u - m,
  29540. t[6] = p + g,
  29541. t[10] = 1 - (c + d),
  29542. t[3] = 0,
  29543. t[7] = 0,
  29544. t[11] = 0,
  29545. t[12] = 0,
  29546. t[13] = 0,
  29547. t[14] = 0,
  29548. t[15] = 1,
  29549. this
  29550. }
  29551. },
  29552. r.Quaternion = function(e, t, i, n) {
  29553. this._x = e || 0,
  29554. this._y = t || 0,
  29555. this._z = i || 0,
  29556. this._w = void 0 !== n ? n : 1
  29557. }
  29558. ,
  29559. r.Quaternion.prototype = {
  29560. get x() {
  29561. return this._x
  29562. },
  29563. set x(e) {
  29564. this._x = e
  29565. },
  29566. get y() {
  29567. return this._y
  29568. },
  29569. set y(e) {
  29570. this._y = e
  29571. },
  29572. get z() {
  29573. return this._z
  29574. },
  29575. set z(e) {
  29576. this._z = e
  29577. },
  29578. get w() {
  29579. return this._w
  29580. },
  29581. set w(e) {
  29582. this._w = e
  29583. },
  29584. copy: function(e) {
  29585. this._x = e.x,
  29586. this._y = e.y,
  29587. this._z = e.z,
  29588. this._w = e.w
  29589. },
  29590. inverse: function() {
  29591. return this.conjugate().normalize()
  29592. },
  29593. conjugate: function() {
  29594. return this._x *= -1,
  29595. this._y *= -1,
  29596. this._z *= -1,
  29597. this
  29598. },
  29599. length: function() {
  29600. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  29601. },
  29602. normalize: function() {
  29603. var e = this.length();
  29604. return 0 === e ? (this._x = 0,
  29605. this._y = 0,
  29606. this._z = 0,
  29607. this._w = 1) : (e = 1 / e,
  29608. this._x = this._x * e,
  29609. this._y = this._y * e,
  29610. this._z = this._z * e,
  29611. this._w = this._w * e),
  29612. this
  29613. },
  29614. setFromAxisAngle: function(e, t) {
  29615. var i = t / 2
  29616. , n = Math.sin(i);
  29617. return this._x = e.x * n,
  29618. this._y = e.y * n,
  29619. this._z = e.z * n,
  29620. this._w = Math.cos(i),
  29621. this
  29622. },
  29623. setFromUnitVectors: function() {
  29624. var e, t, i = 1e-6;
  29625. return function(n, o) {
  29626. return void 0 === e && (e = new r.Vector3),
  29627. t = r.dot(n, o) + 1,
  29628. t < i ? (t = 0,
  29629. 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),
  29630. this._x = e.x,
  29631. this._y = e.y,
  29632. this._z = e.z,
  29633. this._w = t,
  29634. this.normalize()
  29635. }
  29636. }(),
  29637. multiply: function(e) {
  29638. return this.multiplyQuaternions(this, e)
  29639. },
  29640. premultiply: function(e) {
  29641. return this.multiplyQuaternions(e, this)
  29642. },
  29643. multiplyQuaternions: function(e, t) {
  29644. var i = e._x
  29645. , n = e._y
  29646. , r = e._z
  29647. , o = e._w
  29648. , a = t._x
  29649. , s = t._y
  29650. , l = t._z
  29651. , c = t._w;
  29652. return this._x = i * c + o * a + n * l - r * s,
  29653. this._y = n * c + o * s + r * a - i * l,
  29654. this._z = r * c + o * l + i * s - n * a,
  29655. this._w = o * c - i * a - n * s - r * l,
  29656. this
  29657. }
  29658. },
  29659. r.convertWorkshopVector = function(e) {
  29660. return new r.Vector3(-e.x,e.y,e.z)
  29661. }
  29662. ,
  29663. r.convertWorkshopQuaternion = function(e) {
  29664. 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))
  29665. }
  29666. ;
  29667. r.convertWorkshopOrthoZoom = function(e) {//xzw
  29668. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / n.workshopApsect
  29669. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  29670. }
  29671. ,
  29672. r.convertWorkshopPanoramaQuaternion = function(e) {
  29673. 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))
  29674. }
  29675. ,
  29676. r.normalize = function(e) {
  29677. var t = e.x * e.x + e.y * e.y + e.z * e.z
  29678. , i = Math.sqrt(t);
  29679. e.x /= i,
  29680. e.y /= i,
  29681. e.z /= i
  29682. }
  29683. ,
  29684. r.dot = function(e, t) {
  29685. return e.x * t.x + e.y * t.y + e.z * t.z
  29686. }
  29687. ,
  29688. r.cross = function(e, t, i) {
  29689. var n = e.x
  29690. , r = e.y
  29691. , o = e.z;
  29692. i.x = r * t.z - o * t.y,
  29693. i.y = o * t.x - n * t.z,
  29694. i.z = n * t.y - r * t.x
  29695. }
  29696. ,
  29697. r.setVector = function(e, t, i, n) {
  29698. e.x = t,
  29699. e.y = i,
  29700. e.z = n
  29701. }
  29702. ,
  29703. r.copyVector = function(e, t) {
  29704. t.x = e.x,
  29705. t.y = e.y,
  29706. t.z = e.z
  29707. }
  29708. ,
  29709. r.addVector = function(e, t) {
  29710. e.x += t.x,
  29711. e.y += t.y,
  29712. e.z += t.z
  29713. }
  29714. ,
  29715. r.subVector = function(e, t) {
  29716. e.x -= t.x,
  29717. e.y -= t.y,
  29718. e.z -= t.z
  29719. }
  29720. ,
  29721. r.applyQuaternionToVector = function(e, t) {
  29722. var i = t.x
  29723. , n = t.y
  29724. , r = t.z
  29725. , o = e.x
  29726. , a = e.y
  29727. , s = e.z
  29728. , l = e.w
  29729. , c = l * i + a * r - s * n
  29730. , h = l * n + s * i - o * r
  29731. , u = l * r + o * n - a * i
  29732. , d = -o * i - a * n - s * r;
  29733. t.x = c * l + d * -o + h * -s - u * -a,
  29734. t.y = h * l + d * -a + u * -o - c * -s,
  29735. t.z = u * l + d * -s + c * -a - h * -o
  29736. }
  29737. ,
  29738. r.angleBetweenVectors = function(e, t) {
  29739. return Math.acos(r.dot(e, t))
  29740. }
  29741. ,
  29742. t.exports = r
  29743. }
  29744. , {
  29745. "../constants": 8
  29746. }],
  29747. 177: [function(e, t, i) {
  29748. (function(i) {
  29749. "use strict";
  29750. function n(e) {
  29751. this.cache = null,
  29752. this.expires = 0
  29753. }
  29754. function r() {
  29755. this.baseUrl = null,
  29756. this.cache = null,
  29757. this.expires = 0
  29758. }
  29759. function o() {
  29760. this.baseUrl = null,
  29761. this.expires = 0
  29762. }
  29763. function a(e) {
  29764. this.initialLoadingPromise = null,
  29765. this.endpoint = e + "?type=3",
  29766. this.urlContainer = null,
  29767. this.authorizationHeader = h.getAuthorizationHeader(),
  29768. this.containerClasses = [o, r, n]
  29769. }
  29770. var s = e("./ajax")
  29771. , l = e("./logger")
  29772. , c = e("../constants")
  29773. , h = e("./showcase")
  29774. , u = (e("../ab"),
  29775. new l(i));
  29776. n.prototype = {
  29777. version: 1,
  29778. validate: function(e) {
  29779. return "catalog.json"in e && Object.keys(e).length > 0
  29780. },
  29781. update: function(e) {
  29782. return this.cache = e,
  29783. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  29784. $.when()
  29785. },
  29786. get: function(e) {
  29787. return this.cache[e]
  29788. }
  29789. },
  29790. r.prototype = {
  29791. version: 2,
  29792. validate: function(e) {
  29793. return "catalog.json"in e && "base.url"in e && Object.keys(e).length > 1
  29794. },
  29795. update: function(e) {
  29796. return this.baseUrl = e["base.url"],
  29797. this.cache = e,
  29798. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  29799. $.when()
  29800. },
  29801. get: function(e) {
  29802. var t = this.cache[e];
  29803. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  29804. }
  29805. },
  29806. o.prototype = {
  29807. version: 3,
  29808. validate: function(e) {
  29809. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  29810. },
  29811. update: function(e) {
  29812. return this.baseUrl = e.templates[0],
  29813. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  29814. $.when()
  29815. },
  29816. get: function(e) {
  29817. return this.baseUrl.replace("{{filename}}", e)
  29818. }
  29819. },
  29820. a.prototype = {
  29821. init: function() {
  29822. return this.initialLoadingPromise ? this.initialLoadingPromise : (setInterval(function() {
  29823. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  29824. Date.now() + c.signedUrlRefreshBuffer > e && (u.debug("Refreshing urls..."),
  29825. this.refresh().done(function() {
  29826. u.debug("Refreshed")
  29827. }).fail(function() {
  29828. u.error("Failed url refresh, urls might go stale soon")
  29829. }))
  29830. }
  29831. .bind(this), c.signedUrlCheckInterval),
  29832. this.initialLoadingPromise = this.refresh(),
  29833. this.initialLoadingPromise)
  29834. },
  29835. refresh: function(e) { //已经在someData.js里加载过了 不用再加载file了吧
  29836. e = e || {};
  29837. /*var t = void 0 === e.cache || e.cache;
  29838. return s.get( this.endpoint , { //file
  29839. responseType: "json",
  29840. prefetchFrom: t ? "files" : null,
  29841. cache: t,
  29842. auth: this.authorizationHeader
  29843. }).then(function(e) {
  29844. if (this.urlContainer && this.urlContainer.validate(e))
  29845. return this.urlContainer.update(e);
  29846. for (var i = 0; i < this.containerClasses.length; i++) {
  29847. var n = this.containerClasses[i]
  29848. , r = new n;
  29849. if (r.validate(e))
  29850. return u.info("Using urls version " + r.version),
  29851. this.urlContainer = r,
  29852. this.urlContainer.update(e)
  29853. }
  29854. return t ? this.refresh({
  29855. cache: !1
  29856. }) : $.Deferred().reject("missing-urls")
  29857. }
  29858. .bind(this), function(e) {
  29859. return "loading-failed"
  29860. }) */
  29861. return $.Deferred().resolve();
  29862. },
  29863. get: function(e) {
  29864. //return this.urlContainer.get(e)
  29865. return window.DATA.files.templates[0].replace("{{filename}}", e)
  29866. }
  29867. },
  29868. t.exports = a
  29869. }
  29870. ).call(this, "/js/util/ModelUrls.js")
  29871. }
  29872. , {
  29873. "../ab": 3,
  29874. "../constants": 8,
  29875. "./ajax": 181,
  29876. "./logger": 189,
  29877. "./showcase": 193
  29878. }],
  29879. 178: [function(e, t, i) {
  29880. (function(i) {
  29881. "use strict";
  29882. function n() {
  29883. u.call(this),
  29884. this.neighbourMap = {},
  29885. this.map = null
  29886. }
  29887. var r = e("three")
  29888. , o = e("./common")
  29889. , a = e("../settings")
  29890. , s = e("../objects/Panorama")
  29891. , a = e("../settings")
  29892. , l = e("./aStar")
  29893. , c = e("./logger")
  29894. , h = new c(i)
  29895. , u = e("./IndexedCollection")
  29896. , d = e("./transitions");
  29897. o.inherit(n, u),
  29898. n.prototype.getIndex = function(e) {
  29899. return e.id
  29900. }
  29901. ,
  29902. n.prototype.find = function(e, t) {
  29903. var i = o.filterAll(this.list, e);
  29904. return 0 === i.length ? null : (t && t.forEach(function(e) {
  29905. i = o.stableSort(i, e)
  29906. }),
  29907. i[0])
  29908. }
  29909. /* n.prototype.sortByScore = function(e, t) {
  29910. var i = o.filterAll(this.list, e);
  29911. return 0 === i.length ? null : i = i.map(function(e) {
  29912. return {
  29913. pano: e,
  29914. score: t.reduce(function(t, i) {
  29915. return t + i(e)
  29916. }, 0)
  29917. }
  29918. }).sort(function(e, t) {
  29919. return t.score - e.score;
  29920. })
  29921. } */
  29922. ,
  29923. n.prototype.sortByScore = function( request, rank){
  29924. return common.sortByScore(this.list, request, rank)
  29925. }
  29926. ,
  29927. n.prototype.lowestByScore = function(e, t, i) {
  29928. return this.findRankedByScore(0, e, t, i)
  29929. }
  29930. ,
  29931. n.prototype.findRankedByScore = function(e, t, i, n) {
  29932. n && (n.candidates = null,
  29933. n.pano = null),
  29934. e || (e = 0);
  29935. var r = this.sortByScore(t, i);
  29936. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  29937. n.pano = r[e].item),
  29938. r[e].item)
  29939. }
  29940. ,
  29941. n.prototype.showPanoScores = function(e) {
  29942. this.list.forEach(function(e) {
  29943. e.removeTextSprite()
  29944. });
  29945. var t = 6344768;
  29946. e.forEach(function(e) {
  29947. e.pano.addTextSprite(e.score.toFixed(2), t),
  29948. t = 16428055
  29949. })
  29950. }
  29951. ,
  29952. n.prototype.isNeighbour = function(e, t) {
  29953. return this.neighbourMap[e.id][t.id]
  29954. }
  29955. ,
  29956. n.prototype.getNeighbours = function(e) {
  29957. return this.neighbourMap[e.id]
  29958. }
  29959. ,
  29960. n.prototype.setNeighbour = function(e, t, i) {
  29961. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  29962. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  29963. this.neighbourMap[e.id][e.id] = !0,
  29964. this.neighbourMap[t.id][t.id] = !0,
  29965. this.neighbourMap[e.id][t.id] = i,
  29966. this.neighbourMap[t.id][e.id] = i,
  29967. this.neighbourMap[e.id]
  29968. }
  29969. ,
  29970. n.prototype.findClosest = function(e, t) {
  29971. var i = [s.filters.isPanoAligned()];
  29972. return t && i.push(s.filters.inDirection(e, t, .75)),
  29973. this.find(i, [s.sortFunctions.distanceToPoint(e)])
  29974. }
  29975. ,
  29976. n.prototype.dualNeighbors = function(e, t) {
  29977. var i, n = [];
  29978. for (i in this.neighbourMap[e.id])
  29979. this.neighbourMap[t.id][i] && n.push(i);
  29980. return n
  29981. }
  29982. ,
  29983. n.prototype.populate_path_graph = function() {
  29984. 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;
  29985. for (e = 0; e < this.list.length; e += 1) {
  29986. o = this.list[e],
  29987. s = {},
  29988. l = !1,
  29989. i = o.neighbourPanos || o.findNeighourPanos();
  29990. for (t in i)
  29991. if (i[t]) {
  29992. a = this.index[t],
  29993. p.copy(o.floorPosition),
  29994. p.sub(a.floorPosition);
  29995. var m = Math.sqrt(p.x * p.x + p.z * p.z)
  29996. , v = (Math.abs(p.y) / Math.max(m, .01),
  29997. Math.max(0, Math.abs(p.y) - .2));
  29998. v > 0 ? (f += 1,
  29999. v = Math.pow(4 * v, 2),
  30000. m = Math.pow(m, 2),
  30001. n = Math.sqrt(v * v + m * m)) : (g += 1,
  30002. n = p.length()),
  30003. s[a.id] = n,
  30004. l = !0
  30005. }
  30006. l ? u[o.id] = s : d += 1
  30007. }
  30008. this.map = u,
  30009. h.info("graph ready in " + (Date.now() - c) + "ms, " + d + " had no neighbors")
  30010. }
  30011. ,
  30012. n.prototype.aStarSearch = function(e, t) {
  30013. var i = Date.now()
  30014. , n = new l({
  30015. start: e,
  30016. isEnd: function(e) {
  30017. return e === t
  30018. },
  30019. neighbor: function(e) {
  30020. var t = e.neighbourPanos || e.findNeighourPanos()
  30021. , i = [];
  30022. for (var n in t)
  30023. t[n] && i.push(this.index[n]); //add: t[n] &&
  30024. return i
  30025. }
  30026. .bind(this),
  30027. distance: function(e, t) {
  30028. var i = this.map[e.id]
  30029. , n = i[t.id];
  30030. return n
  30031. }
  30032. .bind(this),
  30033. heuristic: function(e, t) {
  30034. return 1
  30035. }
  30036. .bind(this),
  30037. hash: function(e) {
  30038. return e.id
  30039. },
  30040. timeout: 5e3
  30041. });
  30042. if (h.debug("A* search in " + (Date.now() - i) + "ms"),
  30043. "success" !== n.status)
  30044. return h.debug("Did not find A* path from " + e + " to " + t),
  30045. null;
  30046. h.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  30047. var r = [];
  30048. return n.path.forEach(function(e) {
  30049. r.push(e.id)
  30050. }),
  30051. r
  30052. }
  30053. ,
  30054. n.prototype.includeNodesNearPath = function() {
  30055. var e = new r.Vector3
  30056. , t = new r.Vector3
  30057. , i = new r.Vector3
  30058. , n = new r.Vector3
  30059. , o = new r.Vector3
  30060. , a = new r.Vector3
  30061. , s = new r.Vector3
  30062. , l = new r.Vector3
  30063. , c = []
  30064. , h = new r.Vector3
  30065. , u = new r.Vector3;
  30066. return function(r, d) {
  30067. if (r)
  30068. for (var p = function(e, t, i) {
  30069. return o.copy(t).sub(e),
  30070. o.dot(i)
  30071. }, f = function(e, t) {
  30072. return p(h, e.position, i) - p(h, t.position, i)
  30073. }, g = 0; g < r.length - 1; ) {
  30074. var m = r[g]
  30075. , v = r[g + 1]
  30076. , A = this.index[m]
  30077. , y = this.index[v];
  30078. h.copy(A.position),
  30079. u.copy(y.position),
  30080. c.length = 0,
  30081. e.copy(u).sub(h),
  30082. i.copy(e).normalize();
  30083. for (var C = 0; C < this.list.length; C++) {
  30084. var I = this.list[C];
  30085. o.copy(I.position).sub(h);
  30086. var E = o.dot(i);
  30087. if (E > 0) {
  30088. s.copy(i),
  30089. s.multiplyScalar(E),
  30090. a.copy(o),
  30091. a.sub(s);
  30092. var b = a.length();
  30093. if (b < d) {
  30094. t.copy(e).negate(),
  30095. n.copy(t).normalize(),
  30096. l.copy(I.position).sub(u);
  30097. var w = l.dot(n);
  30098. w > 0 && c.push(I)
  30099. }
  30100. }
  30101. }
  30102. if (c.length > 0) {
  30103. c.sort(f);
  30104. for (var _ = r.length + c.length - 1; _ >= g + c.length; _--)
  30105. r[_] = r[_ - c.length];
  30106. for (var T = 0; T < c.length; T++)
  30107. r[T + g + 1] = c[T].id
  30108. }
  30109. g += c.length + 1
  30110. }
  30111. }
  30112. }(),
  30113. /* n.prototype. = function(e, t) {
  30114. var i = void 0 === e ? a.panorama.markerOpacity : e
  30115. , n = this.list.findIndex(function(e) {
  30116. return e.marker
  30117. });
  30118. if (!(n < 0)) {
  30119. var r = this.list[n].marker.material.opacity;
  30120. if (r !== e) {
  30121. var o = i - r;
  30122. d.trigger({
  30123. func: function(e, t) {
  30124. var i = r + e * o;
  30125. this.forEach(function(e) {
  30126. e.marker && (e.marker.material.opacity = i)
  30127. })
  30128. }
  30129. .bind(this),
  30130. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  30131. name: "_fpm"
  30132. })
  30133. }
  30134. }
  30135. } */
  30136. n.prototype.fadeMarkerOpacity = function(e, t, gr) {
  30137. d.cancelById('fadeMarkerOpacity')
  30138. var n = this.list.findIndex(function (e) {
  30139. //why? 难道没有marker的pano吗 findeIndex:获取数组中函数返回值不为fasle的第一个元素索引位置
  30140. return e.marker
  30141. })
  30142. if (n < 0) {
  30143. //logger.info('marker findIndex<0')
  30144. return
  30145. }
  30146. var group
  30147. var tran = function (list, index) {
  30148. list.member = list.member.filter(function (m) {
  30149. return m.marker && m.marker.material.opacity != list.toOp
  30150. })
  30151. transitions.trigger({
  30152. func: function (e, t) {
  30153. //e:0-1
  30154. list.member.forEach(function (m) {
  30155. var o = m.marker.oldOpacity
  30156. var i = o + e * (list.toOp - o)
  30157. m.marker && (m.marker.material.opacity = i)
  30158. })
  30159. }.bind(this),
  30160. duration: void 0 == t ? a.markerOpacityTransitionTime : t,
  30161. name: '_fpm_' + index,
  30162. id: 'fadeMarkerOpacity',
  30163. })
  30164. }
  30165. this.forEach(function (e) {
  30166. //先记录旧的opacity
  30167. e.marker && (e.marker.oldOpacity = e.marker.material.opacity)
  30168. })
  30169. group = gr
  30170. /* if (e > 0 && gr) {
  30171. group = gr
  30172. } else {
  30173. group = [
  30174. {
  30175. member: this.list,
  30176. toOp: 0,
  30177. },
  30178. ]
  30179. } */
  30180. for (var i = 0; i < group.length; i++) {
  30181. tran(group[i], i)
  30182. }
  30183. }
  30184. ,
  30185. t.exports = n
  30186. }
  30187. ).call(this, "/js/util/PanoramaCollection.js")
  30188. }
  30189. , {
  30190. "../objects/Panorama": 148,
  30191. "../settings": 166,
  30192. "./IndexedCollection": 175,
  30193. "./aStar": 180,
  30194. "./common": 185,
  30195. "./logger": 189,
  30196. "./transitions": 195,
  30197. three: 217
  30198. }],
  30199. 179: [function(e, t, i) {
  30200. "use strict";
  30201. function n() {
  30202. this.actionSequence = [],
  30203. this.actionSequenceInProgress = !1
  30204. }
  30205. function r(e, t, i, n) {
  30206. s.trackAlways("zoom_" + e, {
  30207. from: t,
  30208. to: i,
  30209. pano: n
  30210. })
  30211. }
  30212. function o(e, t) {
  30213. r("initial", 1, e, t)
  30214. }
  30215. function a(e, t, i) {
  30216. r("followup", e, t, i)
  30217. }
  30218. var s = e("../analytics");
  30219. n.prototype.reset = function(e) {
  30220. this.actionSequenceInProgress = !1,
  30221. this.actionSequence.length = 0
  30222. }
  30223. ,
  30224. n.prototype.addZoomAction = function() {
  30225. var e = null
  30226. , t = null
  30227. , i = !1
  30228. , n = function() {
  30229. if (e = null,
  30230. this.actionSequence.length > 0) {
  30231. var i = this.actionSequence[0].start
  30232. , n = this.actionSequence[this.actionSequence.length - 1].end;
  30233. 1 === i ? o(n, t) : a(i, n, t)
  30234. }
  30235. this.reset()
  30236. };
  30237. return function(r, o, a) {
  30238. if (r !== o) {
  30239. i || (n = n.bind(this),
  30240. i = !0),
  30241. e && (window.clearTimeout(e),
  30242. e = null),
  30243. a === t && this.actionSequenceInProgress || (this.reset(),
  30244. t = a),
  30245. this.actionSequenceInProgress = !0;
  30246. var s = {
  30247. start: r,
  30248. end: o
  30249. };
  30250. this.actionSequence.push(s),
  30251. e = window.setTimeout(n, 150)
  30252. }
  30253. }
  30254. }(),
  30255. t.exports = n
  30256. }
  30257. , {
  30258. "../analytics": 4
  30259. }],
  30260. 180: [function(e, t, i) {
  30261. "use strict";
  30262. function n(e) {
  30263. void 0 === e.timeout && (e.timeout = 1 / 0);
  30264. var t = e.hash || o
  30265. , i = {
  30266. data: e.start,
  30267. g: 0,
  30268. h: e.heuristic(e.start)
  30269. }
  30270. , n = i;
  30271. i.f = i.h;
  30272. var h = new s
  30273. , u = new l(a)
  30274. , d = c();
  30275. u.push(i),
  30276. d.set(t(i.data), i);
  30277. for (var p = new Date; u.size(); ) {
  30278. if (new Date - p > e.timeout)
  30279. return {
  30280. status: "timeout",
  30281. cost: n.g,
  30282. path: r(n)
  30283. };
  30284. var f = u.pop();
  30285. if (d.delete(t(f.data)),
  30286. e.isEnd(f.data))
  30287. return {
  30288. status: "success",
  30289. cost: f.g,
  30290. path: r(f)
  30291. };
  30292. h.add(t(f.data));
  30293. for (var g = e.neighbor(f.data), m = 0; m < g.length; m++) {
  30294. var v = g[m];
  30295. if (!h.contains(t(v))) {
  30296. var A = f.g + e.distance(f.data, v)
  30297. , y = d.get(t(v))
  30298. , C = !1;
  30299. if (void 0 === y)
  30300. y = {
  30301. data: v
  30302. },
  30303. d.set(t(v), y);
  30304. else {
  30305. if (y.g < A)
  30306. continue;
  30307. C = !0
  30308. }
  30309. y.parent = f,
  30310. y.g = A,
  30311. y.h = e.heuristic(v),
  30312. y.f = A + y.h,
  30313. y.h < n.h && (n = y),
  30314. C ? u.heapify() : u.push(y)
  30315. }
  30316. }
  30317. }
  30318. return {
  30319. status: "noPath",
  30320. cost: n.g,
  30321. path: r(n)
  30322. }
  30323. }
  30324. function r(e) {
  30325. if (void 0 !== e.parent) {
  30326. var t = r(e.parent);
  30327. return t.push(e.data),
  30328. t
  30329. }
  30330. return [e.data]
  30331. }
  30332. function o(e) {
  30333. return e.toString()
  30334. }
  30335. function a(e, t) {
  30336. return e.f - t.f
  30337. }
  30338. var s = e("Set")
  30339. , l = e("heap")
  30340. , c = e("dict");
  30341. t.exports = n
  30342. }
  30343. , {
  30344. Set: 196,
  30345. dict: 210,
  30346. heap: 211
  30347. }],
  30348. 181: [function(e, t, i) {
  30349. (function(i) {
  30350. "use strict";
  30351. function n(e, t, i) {
  30352. var n = new XMLHttpRequest;
  30353. if (i && "withCredentials"in n)
  30354. n.open(e, t, i);
  30355. else if ("undefined" != typeof XDomainRequest)
  30356. n = new XDomainRequest,
  30357. n.open(e, t);
  30358. else {
  30359. if (i)
  30360. throw "Browser does not support CORS!";
  30361. n.open(e, t)
  30362. }
  30363. return n
  30364. }
  30365. function r(e, t, i) {
  30366. function o() {
  30367. u.warn("Retrying ", t),
  30368. r(e, t, i).done(c.resolve.bind(c)).progress(c.notify.bind(c)).fail(c.reject.bind(c))
  30369. }
  30370. function a(e, t) {
  30371. var i = e.response;
  30372. if ("json" === t && "object" != typeof i)
  30373. try {
  30374. i = JSON.parse(e.responseText)
  30375. } catch (e) {
  30376. return void c.reject({
  30377. error: "Failed parsing JSON"
  30378. })
  30379. }
  30380. else if ("image/jpeg" === t) {
  30381. var n = new Uint8Array(e.response)
  30382. , r = new Blob([n],{
  30383. type: "image/jpeg"
  30384. })
  30385. , o = URL.createObjectURL(r);
  30386. i = new Image,
  30387. i.src = o,
  30388. i.crossOrigin = "Anonymous",
  30389. i.onload = function() {
  30390. URL.revokeObjectURL(o)
  30391. }
  30392. }
  30393. return i
  30394. }
  30395. var s = n(e, t, !1);
  30396. if (i = i || {},
  30397. i.retries = void 0 !== i.retries ? i.retries : 0,
  30398. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  30399. i.responseType)
  30400. if (["arraybuffer", "text", "json"].indexOf(i.responseType) > -1)
  30401. s.responseType = i.responseType;
  30402. else {
  30403. if ("image/jpeg" !== i.responseType)
  30404. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  30405. s.responseType = "arraybuffer"
  30406. }
  30407. if ("json" === i.responseType && s.setRequestHeader("Accept", "application/json"),
  30408. i.auth && s.setRequestHeader("Authorization", i.auth),
  30409. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  30410. s.setRequestHeader("Content-Type", "application/json")),
  30411. "object" == typeof i.headers)
  30412. for (var l in i.headers)
  30413. s.setRequestHeader(l, i.headers[l]);
  30414. var c = $.Deferred();
  30415. return s.onreadystatechange = function(e) {
  30416. if (4 === this.readyState)
  30417. if (this.status >= 500 && this.status <= 600 && i.retry && i.retries < 3)
  30418. i.retries++,
  30419. setTimeout(o, 1e3);
  30420. else if (200 === this.status) {
  30421. var t = a(this, i.responseType);
  30422. c.resolve(t)
  30423. } else
  30424. c.reject(this)
  30425. }
  30426. ,
  30427. s.onprogress = function(e) {
  30428. c.notify(e)
  30429. }
  30430. ,
  30431. s.send(i.data),
  30432. c.promise()
  30433. }
  30434. function o(e) {
  30435. return Object.keys(e).sort().map(function(t) {
  30436. return {
  30437. key: t,
  30438. value: e[t]
  30439. }
  30440. })
  30441. }
  30442. function a(e, t) {
  30443. var i = t.responseType || null
  30444. , n = t.auth || null
  30445. , r = t.prefetchFrom || null
  30446. , a = e + "__" + i + "__" + n + "__" + r;
  30447. return t.headers && o(t.headers).forEach(function(e) {
  30448. a += "__" + e.key + ":" + e.value
  30449. }),
  30450. a
  30451. }
  30452. function s(e, t) {
  30453. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[a(e, t)] : null
  30454. }
  30455. function l(e, t, i) {
  30456. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[a(e, t)] = i)
  30457. }
  30458. var c = e("./logger")
  30459. , h = e("../ab")
  30460. , u = new c(i);
  30461. window.URL = window.URL || window.webkitURL,
  30462. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  30463. window.DATA = window.DATA || {}
  30464. /* setTimeout(function() {//MP-- xzw delete
  30465. window.MP_REQUEST_CACHE = null,
  30466. window.DATA = {}
  30467. }, 6e4),
  30468. window.onpageshow = function(e) {
  30469. e.persisted && (window.MP_REQUEST_CACHE = null,
  30470. window.DATA = {})
  30471. } */
  30472. ,
  30473. t.exports = {
  30474. get: function(e, t) {
  30475. t = t || {};
  30476. var i = void 0 === t.cache || t.cache;
  30477. if (i) {
  30478. var n = s(e, t);
  30479. if (n)
  30480. return n
  30481. }
  30482. var o;
  30483. return o = t.prefetchFrom && window.DATA[t.prefetchFrom] ? $.when(window.DATA[t.prefetchFrom]) : r("GET", e, t),
  30484. i && l(e, t, o),
  30485. o
  30486. },
  30487. post: function(e, t) {
  30488. return r("POST", e, t)
  30489. },
  30490. patch: function(e, t) {
  30491. return r("PATCH", e, t)
  30492. },
  30493. getImage: function(e, t) { //xzw改 遇到部分图片在ios16以上显示不出,ios18更严重。查阅解决方法为使用decode
  30494. function i() {
  30495. u.warn("Retrying ", e),
  30496. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  30497. }
  30498. var n = $.Deferred()
  30499. , r = new Image
  30500. , o = this;
  30501. e = h.changeIfImageOptimzing(e)
  30502. r.crossOrigin = "anonymous",
  30503. r.src = e
  30504. /* if(browser.texNeedDecode){//
  30505. r.decode().then((e) => {
  30506. let delay = Math.round(r.width * r.height / 30000)
  30507. browser.isMobile() && (delay *= 3)
  30508. //console.log('delay111111111111',delay)
  30509. setTimeout(()=>{n.resolve(r)}, delay ) //需延迟,否则报错 WebGL: INVALID_VALUE: texImage2D: bad image data,但延迟时间不定。 试过定时1秒后更新tex没用。 直接改图为rgb模式了
  30510. }).catch((error) => {
  30511. console.error('Image decoding failed:?!!!!', error);
  30512. });
  30513. }else{//原本的代码: */
  30514. null !== t && void 0 !== t || (t = 3)
  30515. r.onerror = function() {
  30516. t > 0 ? setTimeout(i, 1e3) : n.reject()
  30517. }
  30518. ,
  30519. r.onload = function() {
  30520. n.resolve(r)
  30521. }
  30522. //}
  30523. return n
  30524. /*
  30525. Safari 浏览器在 iOS 上有一个特殊的图像解码策略,称为“懒加载”或“延迟解码”。这意味着图像不会立即解码,而是在需要显示时才解码。这可能会导致某些情况下图像无法及时显示。
  30526. 使用 decode() 方法:如果你使用的是现代浏览器(如 Safari 14+),可以尝试使用 ImageBitmapRenderingContext 的 createImageBitmap() 和 decode() 方法来提前解码图像。
  30527. const image = new Image();
  30528. image.src = 'image.png';
  30529. image.decode().then(() => {
  30530. const texture = new THREE.Texture(image);
  30531. texture.needsUpdate = true;
  30532. }).catch((error) => {
  30533. console.error('Image decoding failed:', error);
  30534. });
  30535. */
  30536. }
  30537. }
  30538. }
  30539. ).call(this, "/js/util/ajax.js")
  30540. }
  30541. , {
  30542. "../ab": 3,
  30543. "./logger": 189
  30544. }],
  30545. 182: [function(e, t, i) {
  30546. "use strict";
  30547. function n(e, t) {
  30548. var i = window.navigator.userAgent
  30549. , n = i.match(e);
  30550. return n = n ? n[1].split(t) : [],
  30551. {
  30552. major: parseInt(n[0]) || 0,
  30553. minor: parseInt(n[1]) || 0,
  30554. patch: parseInt(n[2]) || 0
  30555. }
  30556. }
  30557. var r = e("../exception/DeviceMismatchException");
  30558. t.exports = {
  30559. supportsFullscreen: function() {
  30560. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  30561. },
  30562. isPointerLocked: function() {
  30563. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  30564. },
  30565. requestFullscreen: function(e, t) {
  30566. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  30567. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  30568. },
  30569. requestPointerLock: function() {
  30570. var e;
  30571. if (document.fullscreenElement)
  30572. e = document.fullscreenElement();
  30573. else if (document.mozFullscreenElement)
  30574. e = document.mozFullscreenElement();
  30575. else if (document.mozFullScreenElement)
  30576. e = document.mozFullScreenElement();
  30577. else {
  30578. if (!document.webkitFullscreenElement)
  30579. return;
  30580. e = document.webkitFullscreenElement()
  30581. }
  30582. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  30583. e.requestPointerLock(),
  30584. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  30585. },
  30586. exitPointerLock: function() {
  30587. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  30588. document.exitPointerLock()
  30589. },
  30590. exitFullscreen: function() {
  30591. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  30592. },
  30593. details: function() {
  30594. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  30595. return e ? {
  30596. name: e[1],
  30597. version: parseInt(e[2]),
  30598. platform: navigator.platform
  30599. } : {}
  30600. },
  30601. is: function(e) {
  30602. return this.details() && this.details().name === e
  30603. },
  30604. inIframe: function() {
  30605. return window.parent !== window
  30606. },
  30607. aspectRatio: function() {
  30608. var e = $("#player").width() / $("#player").height();
  30609. return isFinite(e) ? e : 0
  30610. },
  30611. userAgent: function() {
  30612. return window.navigator.userAgent
  30613. },
  30614. isLandscape: function() {
  30615. return this.isMobile && this.aspectRatio() > 1
  30616. },
  30617. isSmallScreen: function() {
  30618. var e = screen.width / window.devicePixelRatio;
  30619. return e < 240
  30620. },
  30621. detectIE: function() {
  30622. var e = window.navigator.userAgent
  30623. , t = e.indexOf("MSIE ");
  30624. return t !== -1 || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  30625. },
  30626. detectSafari: function() {
  30627. var e = window.navigator.userAgent
  30628. , t = e.indexOf("Safari");
  30629. return t !== -1 && !this.detectChrome()//因为 Chrome 的用户代理字符串中也包含 "Safari"。
  30630. },
  30631. SafariVersion: function() {//add
  30632. if(!this.detectSafari())return;
  30633. const match = window.navigator.userAgent.match(/Version\/(\d+)\.(\d+)/);
  30634. if (match) {
  30635. return {
  30636. major: parseInt(match[1], 10),
  30637. minor: parseInt(match[2], 10)
  30638. };
  30639. }
  30640. },
  30641. detectFirefox: function() {
  30642. var e = window.navigator.userAgent;
  30643. return e.indexOf("Firefox") !== -1
  30644. },
  30645. detectChrome: function() {
  30646. var e = window.navigator.userAgent;
  30647. return e.indexOf("Chrome") !== -1 && !this.detectOpera()
  30648. },
  30649. detectOpera: function() {
  30650. var e = window.navigator.userAgent;
  30651. return e.indexOf("OPR") !== -1
  30652. },
  30653. detectIOS: function() {
  30654. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  30655. },
  30656. detectIPad: function() {
  30657. var e = window.navigator.userAgent
  30658. , t = /iPad/;
  30659. return t.test(e)
  30660. },
  30661. detectIPod: function() {
  30662. var e = window.navigator.userAgent
  30663. , t = /iPod/;
  30664. return t.test(e)
  30665. },
  30666. detectIPhone: function() {
  30667. var e = window.navigator.userAgent
  30668. , t = /iPhone/;
  30669. return t.test(e)
  30670. },
  30671. detectAndroid: function() {
  30672. var e = window.navigator.userAgent;
  30673. return e.indexOf("Android") !== -1
  30674. },
  30675. detectAndroidMobile: function() {
  30676. var e = window.navigator.userAgent;
  30677. return this.detectAndroid() && e.indexOf("Mobile") !== -1
  30678. },
  30679. detectSamsungNative: function() {
  30680. var e = window.navigator.userAgent;
  30681. return e.indexOf("SM-G900H") !== -1 || e.indexOf("GT-I9500") !== -1 || e.indexOf("SM-N900") !== -1
  30682. },
  30683. detectSamsungS6: function() {
  30684. var e = window.navigator.userAgent;
  30685. return e.indexOf("SM-G92") !== -1
  30686. },
  30687. /************************************************************fyz改from徐世廷*************************************************************/
  30688. detectHUAWEI5X: function() {
  30689. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  30690. },
  30691. /*******************************************************************************************************************************/
  30692. detectWebVR: function() {
  30693. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  30694. },
  30695. getVRDisplay: function() {
  30696. var e = $.Deferred();
  30697. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(t) {
  30698. t.length >= 1 && e.resolve(t[0]),
  30699. e.reject(null)
  30700. }),
  30701. e) : e.reject(null)
  30702. },
  30703. iosVersion: function() {
  30704. if (!this.detectIOS())
  30705. throw new r("Did not detect an iDevice");
  30706. var e = /((?:\d+\_?){1,3}) like Mac OS/
  30707. , t = "_";
  30708. return n(e, t)
  30709. },
  30710. androidVersion: function() {
  30711. if (!this.detectAndroid())
  30712. throw new r("Did not detect an Android based device");
  30713. var e = /Android ((?:\d+\.?){1,3})/
  30714. , t = ".";
  30715. return n(e, t)
  30716. },
  30717. valueFromCookie: function(e, t) {
  30718. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  30719. if (!i)
  30720. return t;
  30721. var n = i[1];
  30722. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  30723. }
  30724. }
  30725. Object.assign(window.browser, t.exports)
  30726. t.exports = window.browser
  30727. //window.browser.texNeedDecode = true//browser.SafariVersion()?.major > 14
  30728. changeLog()
  30729. }
  30730. , {
  30731. "../exception/DeviceMismatchException": 56
  30732. }],
  30733. 183: [function(e, t, i) {
  30734. (function(i) {
  30735. "use strict";
  30736. function n(e, t) {
  30737. var i = r(t);
  30738. var replaceAll = function (str, f, e) {
  30739. //f全部替换成e
  30740. var reg = new RegExp(f, "g"); //创建正则RegExp对象
  30741. return str.replace(reg, e);
  30742. };
  30743. //获取方法:postFix = `&firstView=pano:${player.currentPano.id},qua:${math.toPrecision(player.quaternion.toArray(),4)}&qs=1`
  30744. var urlFirstView = c.valueFromHash('firstView');
  30745. if(urlFirstView){ //&firstView=pano:e98808cfdb894f33851c3b3d7d0a2679,qua:-0.01515,0.325382,0.0052157,0.9454&qs=1
  30746. try{
  30747. urlFirstView = replaceAll(urlFirstView, "pano:", '"pano":"')
  30748. if(urlFirstView.includes('qua')){
  30749. urlFirstView = replaceAll(urlFirstView, ",qua:", '","qua":[')
  30750. urlFirstView += ']'
  30751. }else{
  30752. urlFirstView+='"'
  30753. }
  30754. urlFirstView = "{"+urlFirstView+"}"
  30755. let info = JSON.parse(urlFirstView);
  30756. i.pano = t.index[info.pano] //panos.get(info.pano)
  30757. if(!i.pano){
  30758. urlFirstView = false
  30759. console.error('检测到firstView但是 找不到该pano')
  30760. }else{
  30761. if(info.qua){
  30762. i.quaternion = new THREE.Quaternion().fromArray(info.qua)
  30763. }else{
  30764. i.quaternion = new THREE.Quaternion()
  30765. }
  30766. i.zoom = -1;
  30767. i.mode = "panorama"
  30768. i.setByUrl = true
  30769. }
  30770. }catch(e){
  30771. urlFirstView = false
  30772. console.error('检测到firstView但是解析出错'+e)
  30773. }
  30774. }
  30775. if (Object.keys(i).length > 0)
  30776. return i;
  30777. if (e.heroImage)
  30778. i = o(e, t);
  30779. else if (window.DATA.camera_start) {
  30780. var n = window.DATA.camera_start;
  30781. try {
  30782. Object.keys(n).length > 0 && !l.isEmptyQuaternion(n.camera.quaternion) && (i.mode = h.convertWorkshopModeInt(n.mode),
  30783. i.position = n.camera.position,
  30784. //i.quaternion = n.camera.quaternion,
  30785. i.quaternion = new th.Quaternion().fromArray(n.camera.quaternion),//xzw
  30786. i.zoom = l.convertWorkshopOrthoZoom(n.camera.zoom),
  30787. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  30788. d.debug("Using camera_start"),
  30789. d.debug("Modeldata pano: ", i.pano.quaternion),
  30790. d.debug("Camera start pano: ", n.pano.quaternion)),
  30791. i.mode !== h.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility))
  30792. } catch (e) {
  30793. d.warn(e.message)
  30794. if(i.mode == "panorama" && !i.pano)i.pano = t.list[0]
  30795. }
  30796. }
  30797. if (e.outsideAllowed() || i.mode === h.PANORAMA || (i = {}),
  30798. i.mode === h.MESH && i.position && (i.mode = h.PANORAMA,
  30799. i.pano = t.findClosest(i.position),
  30800. i.quaternion = i.pano.quaternion),
  30801. 0 === Object.keys(i).length) {
  30802. var a = t.list[0];
  30803. a && (i.mode = h.PANORAMA,
  30804. i.pano = a,
  30805. i.position = a.position,
  30806. i.quaternion = a.quaternion,
  30807. d.info("Starting at 1st pano " + a.id))
  30808. }
  30809. return i.mode = i.mode || h.DOLLHOUSE,
  30810. i
  30811. }
  30812. function r(e) {
  30813. var t = c.valueFromHash("start", "")
  30814. , i = {};
  30815. if ("" !== t) {
  30816. d.debug("Start override found in parameters, trying to parse..."),
  30817. i = a(t) || {};
  30818. var n = c.valueFromHash("tag", null);
  30819. n && (i.tag = n),
  30820. i.panoId && (i.pano = e.get(i.panoId))
  30821. }
  30822. return i
  30823. }
  30824. function o(e, t) {
  30825. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  30826. return {};
  30827. var i = {}
  30828. , n = e.heroImage.metadata;
  30829. d.debug("Using start position from thumbnail image"),
  30830. i.position = n.camera_position,
  30831. i.quaternion = n.camera_quaternion;
  30832. try {
  30833. i.mode = h.convertWorkshopModeInt(n.camera_mode),
  30834. i.mode === h.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  30835. } catch (e) {
  30836. d.debug(e.message)
  30837. }
  30838. return i
  30839. }
  30840. function a(e) {
  30841. return s.deserialize(e)
  30842. }
  30843. var s = e("../controls/serializer")
  30844. , l = e("../util/math")
  30845. , c = e("./browser")
  30846. , h = e("../enum/Viewmode")
  30847. , u = e("../util/logger")
  30848. , th = e("three")//xzw
  30849. , d = new u(i);
  30850. t.exports = {
  30851. getStartCameraOptions: n
  30852. }
  30853. }
  30854. ).call(this, "/js/util/camera.js")
  30855. }
  30856. , {
  30857. "../controls/serializer": 14,
  30858. "../enum/Viewmode": 51,
  30859. "../util/logger": 189,
  30860. "../util/math": 190,
  30861. "./browser": 182,
  30862. "three": 217
  30863. }],
  30864. 184: [function(e, t, i) {
  30865. "use strict";
  30866. function n(e, t, i) {
  30867. return o(e.fov, t, i)
  30868. }
  30869. var r = e("./MathLight")
  30870. , o = function(e, t, i) {
  30871. var n = t
  30872. , o = i
  30873. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (n / o)) * r.DEGREES_PER_RADIAN;
  30874. return a
  30875. }
  30876. , a = function(e, t, i) {
  30877. var n = t
  30878. , o = i
  30879. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (o / n)) * r.DEGREES_PER_RADIAN;
  30880. return a
  30881. }
  30882. , s = function(e, t, i, n) {
  30883. var r = o(e, i, n);
  30884. return r > t ? a(t, i, n) : e
  30885. };
  30886. t.exports = {
  30887. clampVFOV: s,
  30888. getHFOVForCamera: n,
  30889. getHFOVFromVFOV: o,
  30890. getVFOVFromHFOV: a
  30891. }
  30892. window.MathLight = t.exports
  30893. MathLight.closeTo = function(e1,e2, precision){//xzw add 判断e1,e2是否接近
  30894. var prec = Math.pow(10, - (precision || 4));
  30895. var s1 = Math.abs(e1.x - e2.x) < prec && Math.abs(e1.y - e2.y) < prec && Math.abs(e1.z - e2.z) < prec
  30896. if(e1.w){
  30897. return s1 && Math.abs(e1.w - e2.w) < prec
  30898. }else return s1
  30899. }
  30900. }
  30901. , {
  30902. "./MathLight": 176
  30903. }],
  30904. 185: [function(e, t, i) {
  30905. "use strict";
  30906. var n = e("three");
  30907. t.exports = {
  30908. delayOneFrame: function(e) {
  30909. window.setTimeout(e, 1)
  30910. },
  30911. normalizeUrl: function(e) {
  30912. return e.replace("https://", "http://")
  30913. },
  30914. domainFromUrl: function(e) {
  30915. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  30916. return t ? t[3] : e
  30917. },
  30918. average: function(e, t) {
  30919. if (0 === e.length)
  30920. return null;
  30921. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  30922. var o = t ? e[r][t] : e[r];
  30923. i += o,
  30924. n++
  30925. }
  30926. return i / n
  30927. },
  30928. countUnique: function(e) {
  30929. for (var t = {}, i = 0; i < e.length; i++)
  30930. t[e[i]] = 1 + (t[e[i]] || 0);
  30931. return Object.keys(t).length
  30932. },
  30933. averageVectors: function(e, t) {
  30934. var i = new n.Vector3;
  30935. if (0 === e.length)
  30936. return i;
  30937. for (var r = 0, o = 0; o < e.length; o++) {
  30938. var a = t ? e[o][t] : e[o];
  30939. i.add(a),
  30940. r++
  30941. }
  30942. return i.divideScalar(r)
  30943. },
  30944. equalLists: function(e, t) {
  30945. if (e.length !== t.length)
  30946. return !1;
  30947. for (var i = 0; i < e.length; i++)
  30948. if (e[i] !== t[i])
  30949. return !1;
  30950. return !0
  30951. },
  30952. lowerMedian: function(e, t) {
  30953. if (0 === e.length)
  30954. return null;
  30955. t = t || 2,
  30956. e.sort(function(e, t) {
  30957. return e - t
  30958. });
  30959. var i = Math.floor(e.length / t);
  30960. return e[i]
  30961. },
  30962. stableSort: function(e, t) {
  30963. return e.map(function(e, t) {
  30964. return {
  30965. value: e,
  30966. index: t
  30967. }
  30968. }).sort(function(e, i) {
  30969. var n = t(e.value, i.value);
  30970. return 0 !== n ? n : e.index - i.index
  30971. }).map(function(e) {
  30972. return e.value
  30973. })
  30974. },
  30975. filterAll: function(e, t) {
  30976. return e.filter(function(e) {
  30977. return t.every(function(t) {
  30978. return t(e)
  30979. })
  30980. })
  30981. },
  30982. formatDate: function(e) {
  30983. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  30984. },
  30985. formatDatetime: function(e) {
  30986. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  30987. },
  30988. randomString: function(e) {
  30989. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  30990. t += i.charAt(Math.floor(Math.random() * i.length));
  30991. return t
  30992. },
  30993. uint8ToBase64: function(e, t) {
  30994. t && "number" == typeof t || (t = 8192);
  30995. for (var i = [], n = 0; n < e.length; n += t)
  30996. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  30997. return btoa(i.join(""))
  30998. },
  30999. uuid4: function e(t) {
  31000. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  31001. },
  31002. nth: function(e) {
  31003. return e %= 10,
  31004. 1 === e ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  31005. },
  31006. extendObject: function(e, t) {
  31007. return Object.keys(t).forEach(function(i) {
  31008. e[i] = t[i]
  31009. }),
  31010. e
  31011. },
  31012. deepExtend: function e(t) {
  31013. t = t || {};
  31014. for (var i = 1; i < arguments.length; i++) {
  31015. var n = arguments[i];
  31016. if (n)
  31017. for (var r in n)
  31018. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  31019. }
  31020. return t
  31021. },
  31022. inherit: function(e, t) {
  31023. e.prototype = Object.create(t.prototype),
  31024. e.prototype.constructor = e
  31025. },
  31026. extend: function(e, t) {
  31027. for (var i in t.prototype)
  31028. e.prototype[i] = t.prototype[i]
  31029. }
  31030. ,
  31031. getFileNameFromUrl:function(url){
  31032. return url.split('/').pop();
  31033. },
  31034. },
  31035. Math.sign = function(e) {
  31036. return e < 0 ? -1 : 1
  31037. }
  31038. window.common = t.exports
  31039. expandCommon(common)
  31040. }
  31041. , {
  31042. three: 217
  31043. }],
  31044. 186: [function(e, t, i) {
  31045. "use strict";
  31046. var n = {};
  31047. n.linearTween = function(e, t, i, n) {
  31048. return i * e / n + t
  31049. }
  31050. ,
  31051. n.easeInQuad = function(e, t, i, n) {
  31052. return e /= n,
  31053. i * e * e + t
  31054. }
  31055. ,
  31056. n.easeOutQuad = function(e, t, i, n) {
  31057. return e /= n,
  31058. -i * e * (e - 2) + t
  31059. }
  31060. ,
  31061. n.easeInOutQuad = function(e, t, i, n) {
  31062. return e /= n / 2,
  31063. e < 1 ? i / 2 * e * e + t : (e--,
  31064. -i / 2 * (e * (e - 2) - 1) + t)
  31065. }
  31066. ,
  31067. n.easeInCubic = function(e, t, i, n) {
  31068. return e /= n,
  31069. i * e * e * e + t
  31070. }
  31071. ,
  31072. n.easeOutCubic = function(e, t, i, n) {
  31073. return e /= n,
  31074. e--,
  31075. i * (e * e * e + 1) + t
  31076. }
  31077. ,
  31078. n.easeInOutCubic = function(e, t, i, n) {
  31079. return e /= n / 2,
  31080. e < 1 ? i / 2 * e * e * e + t : (e -= 2,
  31081. i / 2 * (e * e * e + 2) + t)
  31082. }
  31083. ,
  31084. n.easeInQuart = function(e, t, i, n) {
  31085. return e /= n,
  31086. i * e * e * e * e + t
  31087. }
  31088. ,
  31089. n.easeOutQuart = function(e, t, i, n) {
  31090. return e /= n,
  31091. e--,
  31092. -i * (e * e * e * e - 1) + t
  31093. }
  31094. ,
  31095. n.easeInOutQuart = function(e, t, i, n) {
  31096. return e /= n / 2,
  31097. e < 1 ? i / 2 * e * e * e * e + t : (e -= 2,
  31098. -i / 2 * (e * e * e * e - 2) + t)
  31099. }
  31100. ,
  31101. n.easeInQuint = function(e, t, i, n) {
  31102. return e /= n,
  31103. i * e * e * e * e * e + t
  31104. }
  31105. ,
  31106. n.easeOutQuint = function(e, t, i, n) {
  31107. return e /= n,
  31108. e--,
  31109. i * (e * e * e * e * e + 1) + t
  31110. }
  31111. ,
  31112. n.easeInOutQuint = function(e, t, i, n) {
  31113. return e /= n / 2,
  31114. e < 1 ? i / 2 * e * e * e * e * e + t : (e -= 2,
  31115. i / 2 * (e * e * e * e * e + 2) + t)
  31116. }
  31117. ,
  31118. n.easeInSine = function(e, t, i, n) {
  31119. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  31120. }
  31121. ,
  31122. n.easeOutSine = function(e, t, i, n) {
  31123. return i * Math.sin(e / n * (Math.PI / 2)) + t
  31124. }
  31125. ,
  31126. n.easeInOutSine = function(e, t, i, n) {
  31127. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  31128. }
  31129. ,
  31130. n.easeInExpo = function(e, t, i, n) {
  31131. return i * Math.pow(2, 10 * (e / n - 1)) + t
  31132. }
  31133. ,
  31134. n.easeOutExpo = function(e, t, i, n) {
  31135. return i * (-Math.pow(2, -10 * e / n) + 1) + t
  31136. }
  31137. ,
  31138. n.easeInOutExpo = function(e, t, i, n) {
  31139. return e /= n / 2,
  31140. e < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  31141. i / 2 * (-Math.pow(2, -10 * e) + 2) + t)
  31142. }
  31143. ,
  31144. n.easeInCirc = function(e, t, i, n) {
  31145. return e /= n,
  31146. -i * (Math.sqrt(1 - e * e) - 1) + t
  31147. }
  31148. ,
  31149. n.easeOutCirc = function(e, t, i, n) {
  31150. return e /= n,
  31151. e--,
  31152. i * Math.sqrt(1 - e * e) + t
  31153. }
  31154. ,
  31155. n.easeInOutCirc = function(e, t, i, n) {
  31156. return e /= n / 2,
  31157. e < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  31158. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  31159. }
  31160. ,
  31161. n.easeInElastic = function(e, t, i, n) {
  31162. var r = 1.70158
  31163. , o = 0
  31164. , a = i;
  31165. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  31166. a < Math.abs(i) ? (a = i,
  31167. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  31168. -(a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o)) + t)
  31169. }
  31170. ,
  31171. n.easeOutElastic = function(e, t, i, n) {
  31172. var r = 1.70158
  31173. , o = 0
  31174. , a = i;
  31175. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  31176. a < Math.abs(i) ? (a = i,
  31177. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  31178. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  31179. }
  31180. ,
  31181. n.easeInOutElastic = function(e, t, i, n) {
  31182. var r = 1.70158
  31183. , o = 0
  31184. , a = i;
  31185. return 0 === e ? t : 2 === (e /= n / 2) ? t + i : (o || (o = n * (.3 * 1.5)),
  31186. a < Math.abs(i) ? (a = i,
  31187. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  31188. 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)
  31189. }
  31190. ,
  31191. n.easeInBack = function(e, t, i, n, r) {
  31192. return void 0 === r && (r = 1.70158),
  31193. i * (e /= n) * e * ((r + 1) * e - r) + t
  31194. }
  31195. ,
  31196. n.easeOutBack = function(e, t, i, n, r) {
  31197. return void 0 === r && (r = 1.70158),
  31198. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  31199. }
  31200. ,
  31201. n.easeInOutBack = function(e, t, i, n, r) {
  31202. return void 0 === r && (r = 1.70158),
  31203. (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
  31204. }
  31205. ,
  31206. n.easeOutBounce = function(e, t, i, n) {
  31207. 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
  31208. }
  31209. ,
  31210. n.easeInBounce = function(e, t, i, r) {
  31211. return i - n.easeOutBounce(r - e, 0, i, r) + t
  31212. }
  31213. ,
  31214. n.easeInOutBounce = function(e, t, i, r) {
  31215. 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
  31216. }
  31217. ,
  31218. t.exports = n
  31219. window.easing = n
  31220. }
  31221. , {}],
  31222. 187: [function(e, t, i) {
  31223. "use strict";
  31224. function n() {
  31225. this.events = [],
  31226. this.valid = !1
  31227. }
  31228. var r = e("../enum/Joystick");
  31229. n.prototype.push = function(e, t) {
  31230. this.events.push({
  31231. direction: e,
  31232. pano: t
  31233. }),
  31234. this.valid = !0
  31235. }
  31236. ,
  31237. n.prototype.pop = function(e) {
  31238. var t = this.events.pop();
  31239. return this.events.length < 1 && (this.valid = !1),
  31240. t
  31241. }
  31242. ,
  31243. n.prototype.peek = function() {
  31244. return this.events.length ? this.events[this.events.length - 1] : {
  31245. direction: null,
  31246. pano: null
  31247. }
  31248. }
  31249. ,
  31250. n.prototype.invalidate = function() {
  31251. this.events = [],
  31252. this.valid = !1
  31253. }
  31254. ,
  31255. n.prototype.reversePano = function(e) {
  31256. if (!this.valid)
  31257. return null;
  31258. var t = this.peek();
  31259. return r.opposite(e) === t.direction ? (this.pop(),
  31260. t.pano) : null
  31261. }
  31262. ,
  31263. t.exports = n
  31264. }
  31265. , {
  31266. "../enum/Joystick": 29
  31267. }],
  31268. 188: [function(e, t, i) {
  31269. "use strict";
  31270. window.lerp = t.exports = {
  31271. vector: function(e, t) {
  31272. var i = e.clone();
  31273. return t = t.clone(),
  31274. function(n) {
  31275. e.set(i.x * (1 - n) + t.x * n, i.y * (1 - n) + t.y * n, i.z * (1 - n) + t.z * n)
  31276. }
  31277. },
  31278. quaternion: function(e, t) {
  31279. var i = e.clone();
  31280. return function(n) {
  31281. e.copy(i).slerp(t, n)
  31282. }
  31283. },
  31284. property: function(e, t, i, n) {
  31285. var r = e[t];
  31286. return function(o) {
  31287. e[t] = r * (1 - o) + i * o,
  31288. n && n(e[t])
  31289. }
  31290. },
  31291. uniform: function(e, t, i) {
  31292. var n = e.material.uniforms[t].value;
  31293. return function(r) {
  31294. e.material.uniforms[t] && (e.material.uniforms[t].value = n * (1 - r) + i * r)
  31295. }
  31296. },
  31297. matrix4: function(e, t) {
  31298. var i = e.clone();
  31299. return function(n) {
  31300. for (var r = e.elements, o = i.elements, a = t.elements, s = 0; s < 16; s++)
  31301. r[s] = o[s] * (1 - n) + a[s] * n
  31302. }
  31303. },
  31304. allUniforms: function(e, t, i) {
  31305. var n = e.map(function(e) {
  31306. return this.uniform(e, t, i)
  31307. }
  31308. .bind(this));
  31309. return function(e) {
  31310. n.forEach(function(t) {
  31311. t(e)
  31312. })
  31313. }
  31314. }
  31315. }
  31316. }
  31317. , {}],
  31318. 189: [function(e, t, i) {
  31319. "use strict";
  31320. function n(e) {
  31321. var t, i, o, a, s = e.split("/"), l = "[" + s[s.length - 1].replace(".js", "") + "]", c = {};
  31322. if (n.consoleEnabled) {
  31323. var h = function(e) {
  31324. $("#debug-console").append("<p>" + e + "</p>"),
  31325. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  31326. };
  31327. t = function(e) {
  31328. h(Array.prototype.slice.call(arguments).join(" "))
  31329. }
  31330. ,
  31331. i = function(e) {
  31332. h(Array.prototype.slice.call(arguments).join(" "))
  31333. }
  31334. ,
  31335. o = function(e) {
  31336. h("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  31337. }
  31338. ,
  31339. a = function(e) {
  31340. h("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  31341. }
  31342. } else
  31343. console.log ? (t = console.log,
  31344. i = console.info ? console.info : console.log,
  31345. o = console.warn ? console.warn : console.log,
  31346. a = console.error ? console.error : console.log) : t = i = o = a = function() {}
  31347. ;
  31348. var u = function(e) {
  31349. return [l, n.timestamp()].concat(Array.prototype.slice.call(e))
  31350. }
  31351. , d = function(t, i) {
  31352. if (r) {
  31353. var o = Array.prototype.slice.call(t).join(" ");
  31354. r.captureMessage(o, {
  31355. level: i,
  31356. path: e,
  31357. timestamp: n.timestamp()
  31358. })
  31359. }
  31360. }
  31361. , p = function(t, i) {
  31362. if (r) {
  31363. var o = Array.prototype.slice.call(t).join(" ");
  31364. r.captureException(new Error(o), {
  31365. level: i,
  31366. path: e,
  31367. timestamp: n.timestamp()
  31368. })
  31369. }
  31370. };
  31371. return {
  31372. debug: function() {
  31373. n.level >= n.levels.debug && t.apply(console, u(arguments))
  31374. },
  31375. info: function() {
  31376. n.level >= n.levels.info && i.apply(console, u(arguments))
  31377. },
  31378. warn: function() {
  31379. d(arguments, "warn"),
  31380. n.level >= n.levels.warn && o.apply(console, u(arguments))
  31381. },
  31382. error: function() {
  31383. p(arguments, "error"),
  31384. n.level >= n.levels.error && a.apply(console, u(arguments))
  31385. },
  31386. v3str: function(e, t) {
  31387. var i = void 0 === t ? 2 : t;
  31388. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  31389. },
  31390. eulstr: function(e, t) {
  31391. var i = void 0 === t ? 2 : t;
  31392. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  31393. },
  31394. time: function(e) {
  31395. n.level >= n.levels.debug && (c[e] = Date.now())
  31396. },
  31397. timeEnd: function(e) {
  31398. if (n.level >= n.levels.debug) {
  31399. var t = c[e];
  31400. if (!t)
  31401. return;
  31402. var i = (Date.now() - t) / 1e3;
  31403. this.debug(e, i + "s")
  31404. }
  31405. }
  31406. }
  31407. }
  31408. var r = window.Raven;
  31409. n.timestamp = function() {
  31410. return (Date.now() - window.navigationStart) / 1e3 + "s"
  31411. }
  31412. ,
  31413. n.levels = {
  31414. debug: 3,
  31415. info: 2,
  31416. warn: 1,
  31417. error: 0
  31418. },
  31419. n.level = n.levels.info,
  31420. t.exports = n
  31421. }
  31422. , {}],
  31423. 190: [function(e, t, i) {
  31424. "use strict";
  31425. var n = e("three")
  31426. , r = e("../enum/GLCubeFaces")
  31427. , o = e("../constants");
  31428. t.exports = {
  31429. convertVisionVector: function(e) {
  31430. return new n.Vector3(e.x,e.z,-e.y)
  31431. },
  31432. convertVisionQuaternion: function(e) {
  31433. 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)))
  31434. },
  31435. convertWorkshopVector: function(e) {
  31436. return new n.Vector3(-e.x,e.y,e.z)
  31437. },
  31438. convertWorkshopQuaternion: function(e) {
  31439. 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))
  31440. },
  31441. convertWorkshopPanoramaQuaternion: function(e) {
  31442. 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)))
  31443. },
  31444. convertWorkshopOrthoZoom: function(e) {// xzw
  31445. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / o.workshopApsect
  31446. //return e;
  31447. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  31448. },
  31449. toPrecision: function(e, t) {//xzw change
  31450. var f = function(e, t){
  31451. var i = Math.pow(10, t);
  31452. return Math.round(e * i) / i
  31453. }
  31454. if(e instanceof Array){
  31455. for(var s=0; s<e.length; s++){
  31456. e[s] = f(e[s],t);
  31457. }
  31458. return e;
  31459. }
  31460. else return f(e,t)
  31461. },
  31462. isEmptyQuaternion: function(e) {
  31463. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  31464. },
  31465. projectPositionToCanvas: function(e, t, i) {
  31466. i = i || new n.Vector3,
  31467. i.copy(e);
  31468. var r = .5 * $("#player").width()
  31469. , o = .5 * $("#player").height();
  31470. return i.project(t),
  31471. i.x = i.x * r + r,
  31472. i.y = -(i.y * o) + o,
  31473. i
  31474. },
  31475. convertScreenPositionToNDC: function(e, t, i) {
  31476. return i = i || new n.Vector2,
  31477. i.x = e / $("#player").width() * 2 - 1,
  31478. i.y = 2 * -(t / $("#player").height()) + 1,
  31479. i
  31480. },
  31481. constrainedTurn: function(e) {
  31482. var t = e % (2 * Math.PI);
  31483. return t = t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  31484. },
  31485. getFOVDotThreshold: function(e) {
  31486. return Math.cos(n.Math.degToRad(e / 2))
  31487. },
  31488. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  31489. switch (e) {
  31490. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  31491. i.set(1, t.y, t.x);
  31492. break;
  31493. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  31494. i.set(-1, t.y, -t.x);
  31495. break;
  31496. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  31497. i.set(-t.x, 1, -t.y);
  31498. break;
  31499. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  31500. i.set(-t.x, -1, t.y);
  31501. break;
  31502. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  31503. i.set(-t.x, t.y, 1);
  31504. break;
  31505. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  31506. i.set(t.x, t.y, -1)
  31507. }
  31508. n && i.normalize()
  31509. },
  31510. //add:
  31511. getPos2d : function(point, camera, dom){
  31512. var camera = camera ;
  31513. var dom = dom;
  31514. 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);
  31515. var x,y;
  31516. x = (pos.x + 1) / 2 * dom.clientWidth;
  31517. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  31518. var inSight = x <= dom.clientWidth && x >= 0
  31519. && y <= dom.clientHeight && y >= 0
  31520. return {
  31521. pos: new THREE.Vector2(x,y),
  31522. vector: pos,
  31523. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  31524. inSight : inSight //在屏幕范围内可见
  31525. };
  31526. },
  31527. getDirByLonLat: function(lon, lat) {
  31528. var dir = new THREE.Vector3();
  31529. var phi = THREE.Math.degToRad(90 - lat);
  31530. var theta = THREE.Math.degToRad(lon);
  31531. dir.x = Math.sin(phi) * Math.cos(theta);
  31532. dir.y = Math.cos(phi);
  31533. dir.z = Math.sin(phi) * Math.sin(theta);
  31534. return dir.negate();
  31535. }
  31536. }
  31537. window.math = t.exports
  31538. expandMath(math)
  31539. }
  31540. , {
  31541. "../constants": 8,
  31542. "../enum/GLCubeFaces": 25,
  31543. three: 217
  31544. }],
  31545. 191: [function(e, t, i) {
  31546. "use strict";
  31547. function n(e, t, i) {
  31548. return a.map(function(n, o) {
  31549. return e.get("pan/" + i + "/" + t + "_skybox" + r(n) + ".jpg")
  31550. }
  31551. .bind(this))
  31552. }
  31553. function r(e) {
  31554. return s[e]
  31555. }
  31556. var o = e("../enum/GLCubeFaces")
  31557. , a = [0, 1, 2, 3, 4, 5]
  31558. , s = {
  31559. 0: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  31560. 1: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  31561. 2: o.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  31562. 3: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  31563. 4: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  31564. 5: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  31565. };
  31566. t.exports = {
  31567. mapFaceToCubemapFace: r,
  31568. getCubemapUrls: n
  31569. }
  31570. }
  31571. , {
  31572. "../enum/GLCubeFaces": 25
  31573. }],
  31574. 192: [function(e, t, i) {
  31575. "use strict";
  31576. t.exports = {
  31577. captureErrors: function(e, t, i) {
  31578. if ("Raven"in window) {
  31579. Raven.config(e, t).install(),
  31580. i && Raven.setTagsContext(i);
  31581. var n = console.warn
  31582. , r = console.error;
  31583. console.warn = function() {
  31584. var e = Array.prototype.slice.call(arguments);
  31585. Raven.captureMessage(e.join(" "), {
  31586. level: "warning"
  31587. }),
  31588. n.apply(console, e)
  31589. }
  31590. ,
  31591. console.error = function() {
  31592. var e = Array.prototype.slice.call(arguments);
  31593. Raven.captureException(new Error(e.join(" ")), {
  31594. level: "error"
  31595. }),
  31596. r.apply(console, e)
  31597. }
  31598. } else
  31599. console.error("Raven not found, not capturing errors.")
  31600. }
  31601. }
  31602. }
  31603. , {}],
  31604. 193: [function(e, t, i) {
  31605. (function(i) {
  31606. "use strict";
  31607. var n = e("./browser")
  31608. , r = e("../constants")
  31609. , o = e("url")
  31610. , a = e("./logger")
  31611. , ss = e('three')
  31612. , s = new a(i)
  31613. , l = {
  31614. getAuthorizationHeader: function() {
  31615. var e = n.valueFromHash("auth");
  31616. if (e)
  31617. return e.replace(",", " ");
  31618. var t = n.valueFromCookie("token");
  31619. return t ? "Token " + t : null
  31620. },
  31621. parseSidUrl: function(e) {
  31622. var t, i;
  31623. t=g_Prefix;
  31624. if (e = e || "",
  31625. e.match(/^https?/)) {
  31626. var n = o.parse(e);
  31627. t = g_Prefix,
  31628. i = e
  31629. } else{
  31630. //xzw 原先的不能用
  31631. //t = window.location.protocol + "//" + window.location.host, //MP
  31632. t = g_Prefix
  31633. //i = t + "/api/player/models/" + e; //MP
  31634. i = t + "data/" + e;
  31635. }
  31636. return {
  31637. urlBase: t,
  31638. urlModel: i,
  31639. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  31640. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  31641. }
  31642. },
  31643. getModelIDFromQueryString: function() {
  31644. return n.valueFromHash("model") || n.valueFromHash("m")
  31645. },
  31646. /* normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  31647. e = JSON.parse(JSON.stringify(e));
  31648. var i = null;
  31649. if (e.images.forEach(function(n) {
  31650. if(!n.metadata) return;
  31651. if ("string" == typeof n.metadata)
  31652. try {
  31653. n.metadata = JSON.parse(n.metadata)
  31654. } catch (e) {
  31655. s.warn("Unable to parse image metadata"),
  31656. n.metadata = null
  31657. }
  31658. else{
  31659. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  31660. }
  31661. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  31662. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  31663. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  31664. }else{
  31665. n.metadata.camera_quaternion && (n.metadata.camera_quaternion = t.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  31666. n.metadata.camera_position && (n.metadata.camera_position = t.convertWorkshopVector(n.metadata.camera_position))
  31667. n.metadata.zoom = n.metadata.zoom || 1;
  31668. }
  31669. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  31670. }),
  31671. //icon初始视角的:
  31672. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  31673. var n = {};
  31674. n.pano = {
  31675. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  31676. position: t.convertWorkshopVector(i.scan_position),
  31677. uuid: i.scan_id
  31678. },
  31679. n.camera = {
  31680. quaternion: i.camera_quaternion,
  31681. position: i.camera_position
  31682. },
  31683. e.startPano = n
  31684. }
  31685. return e
  31686. },
  31687. */
  31688. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  31689. e = JSON.parse(JSON.stringify(e));
  31690. var i = null;
  31691. var deal = function(n) {
  31692. if(!n.metadata) return;
  31693. if ("string" == typeof n.metadata)
  31694. try {
  31695. n.metadata = JSON.parse(n.metadata)
  31696. } catch (e) {
  31697. s.warn("Unable to parse image metadata"),
  31698. n.metadata = null
  31699. }
  31700. else{
  31701. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  31702. }
  31703. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  31704. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  31705. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  31706. }else{
  31707. n.metadata.camera_position = new ss.Vector3().copy(n.metadata.camera_position)
  31708. n.metadata.camera_quaternion = new ss.Quaternion().copy(n.metadata.camera_quaternion)
  31709. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  31710. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  31711. }
  31712. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  31713. }
  31714. //改
  31715. e.images.forEach(info=>{
  31716. if(info.locations){
  31717. info.locations.forEach(a=>deal(a))
  31718. }else{
  31719. deal(info)
  31720. }
  31721. })
  31722. //icon初始视角的:
  31723. if(i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  31724. var n = {};
  31725. n.pano = {
  31726. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  31727. position: t.convertWorkshopVector(i.scan_position),
  31728. uuid: i.scan_id
  31729. },
  31730. n.camera = {
  31731. quaternion: i.camera_quaternion,
  31732. position: i.camera_position
  31733. },
  31734. e.startPano = n
  31735. }
  31736. return e
  31737. },
  31738. visionVersionToInt: function() {
  31739. var e = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join(""));
  31740. return function(t) {
  31741. if (!t)
  31742. throw new Error("Vision version is required");
  31743. var i = e.exec(t);
  31744. if (null === i)
  31745. throw new Error("String is not a vision version: " + t);
  31746. return parseInt(i[1])
  31747. }
  31748. }(),
  31749. modelDataPromisesTiles: function(e) {
  31750. var vision_version = e.vision_version || window.DATA.vision_version
  31751. if (vision_version)
  31752. try {
  31753. return l.visionVersionToInt(vision_version) >= l.visionVersionToInt(r.visionTilingStartVersion)
  31754. } catch (t) {
  31755. s.warn("Invalid vision version: " + vision_version)
  31756. }
  31757. // var t = e.created ? new Date(e.created) : null;
  31758. // return t && t >= r.visionTilingStartDate
  31759. return false
  31760. }
  31761. };
  31762. t.exports = l
  31763. }
  31764. ).call(this, "/js/util/showcase.js")
  31765. }
  31766. , {
  31767. "../constants": 8,
  31768. "./browser": 182,
  31769. "./logger": 189,
  31770. three:217,
  31771. url: 208
  31772. }],
  31773. 194: [function(e, t, i) {
  31774. "use strict";
  31775. var n = e("../util/ajax")
  31776. , r = e("three")
  31777. , o = e("../settings")
  31778. , a = {};
  31779. t.exports = {
  31780. load: function(e, t, i) {
  31781. var s = a[e];
  31782. return s ? (t && setTimeout(function() {
  31783. t(s)
  31784. }, 1),
  31785. s) : (s = new r.Texture,
  31786. o.minimalMemoryMode && (s.minFilter = r.LinearFilter,
  31787. s.magFilter = r.LinearFilter,
  31788. s.generateMipmaps = !1),
  31789. s.sourceFile = e,
  31790. a[e] = s,
  31791. n.getImage(e).then(function(e) {
  31792. s.image = e,
  31793. s.needsUpdate = !0,
  31794. t && t(s)
  31795. }).fail(i),
  31796. s)
  31797. },
  31798. loadBase64: function(e, t) {
  31799. t = t || "png";
  31800. var i = new r.Texture;
  31801. return i.image = document.createElement("img"),
  31802. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  31803. o.minimalMemoryMode && (i.minFilter = r.LinearFilter,
  31804. i.magFilter = r.LinearFilter,
  31805. i.generateMipmaps = !1),
  31806. i.needsUpdate = !0,
  31807. i
  31808. },
  31809. isLoaded: function(e) {
  31810. return !!a[e]
  31811. }
  31812. }
  31813. window.Texture = t.exports
  31814. }
  31815. , {
  31816. "../settings": 166,
  31817. "../util/ajax": 181,
  31818. three: 217
  31819. }],
  31820. 195: [function(e, t, i) {
  31821. "use strict";
  31822. var n = e("./easing");
  31823. window.transitions = t.exports = {
  31824. globalDone: null,
  31825. funcs: [],
  31826. counter: 0,
  31827. uniqueID: 0,
  31828. start: function(e, t, i, r, o, a, s) {
  31829. return r = r || 0,
  31830. this.funcs.push({
  31831. func: e,
  31832. current: -r * Math.abs(t),
  31833. duration: (1 - Math.max(r, 0)) * Math.abs(t),
  31834. done: i,
  31835. easing: o || n.linearTween,
  31836. cycling: t < 0,
  31837. running: !0,
  31838. debug: r < 0,
  31839. name: a || "T" + this.counter,
  31840. id: void 0 === s ? this.counter : s,
  31841. paused: !1
  31842. }),
  31843. e(0, 16),
  31844. this.counter += 1,
  31845. e
  31846. },
  31847. trigger: function(e) {
  31848. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  31849. , i = e.func || function() {}
  31850. , r = void 0 === e.duration ? 0 : e.duration;
  31851. void 0 !== e.cycling && e.cycling && (r = -Math.abs(r));
  31852. var o = e.done || null
  31853. , a = e.easing || n.linearTween
  31854. , s = e.name || "R" + this.counter
  31855. , l = void 0 === e.id ? this.counter : e.id;
  31856. return this.start(i, r, o, t, a, s, l)
  31857. },
  31858. setTimeout: function(e, t, i) {
  31859. var n = void 0 === i ? this.counter : i;
  31860. return this.trigger({
  31861. done: e,
  31862. duration: void 0 === t ? 0 : t,
  31863. name: "O" + this.counter,
  31864. id: n
  31865. })
  31866. },
  31867. pause: function() {
  31868. this.paused = !0
  31869. },
  31870. resume: function() {
  31871. this.paused = !1
  31872. },
  31873. update: function(e) {
  31874. this.funcs.forEach(function(t) {
  31875. if (!(t.paused || (t.current += 1e3 * e,
  31876. t.current < 0)))
  31877. if (t.current >= t.duration && !t.cycling) {
  31878. var i = t.easing(1, 0, 1, 1);
  31879. t.func(i, 1e3 * e),
  31880. t.done && t.done(),
  31881. t.running = !1
  31882. } else {
  31883. var n = t.easing(t.current % t.duration / t.duration, 0, 1, 1)
  31884. , r = t.func(n, 1e3 * e) || !1;
  31885. r && (t.done && t.done(),
  31886. t.running = !1)
  31887. }
  31888. });
  31889. var t = this.funcs.length;
  31890. this.funcs = this.funcs.filter(function(e) {
  31891. return e.running
  31892. });
  31893. var i = this.funcs.length;
  31894. if (t > 0 && 0 === i && this.globalDone) {
  31895. var n = this.globalDone;
  31896. this.globalDone = null,
  31897. n()
  31898. }
  31899. },
  31900. adjustSpeed: function(e, t) {
  31901. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  31902. var r = i[n];
  31903. r.duration /= t,
  31904. r.current /= t
  31905. }
  31906. },
  31907. getById: function(e) {
  31908. return this.funcs.filter(function(t) {
  31909. return e === t.id
  31910. })
  31911. },
  31912. get: function(e) {
  31913. for (var t = 0; t < this.funcs.length; t += 1)
  31914. if (this.funcs[t].func === e)
  31915. return this.funcs[t];
  31916. return null
  31917. },
  31918. isRunning: function(e) {
  31919. var t = this.get(e);
  31920. return null !== t && t.running
  31921. },
  31922. countActive: function() {
  31923. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  31924. e += this.funcs[t].running;
  31925. return e
  31926. },
  31927. listActive: function() {
  31928. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  31929. this.funcs[t].running && e.push(this.funcs[t].name);
  31930. return e
  31931. },
  31932. done: function(e) {
  31933. this.globalDone = e
  31934. },
  31935. cancelById: function(e) {
  31936. var t = void 0 === e ? 0 : e;
  31937. this.funcs = this.funcs.filter(function(e) {
  31938. return e.id !== t
  31939. })
  31940. },
  31941. cancel: function(e) {
  31942. this.funcs = this.funcs.filter(function(t) {
  31943. return t.func !== e
  31944. })
  31945. },
  31946. getUniqueId: function() {
  31947. return this.uniqueID -= 1,
  31948. this.uniqueID
  31949. }
  31950. }
  31951. }
  31952. , {
  31953. "./easing": 186
  31954. }],
  31955. 196: [function(e, t, i) {
  31956. function n(e) {
  31957. if (this.set = {},
  31958. this.infContains = function() {
  31959. return !0
  31960. }
  31961. ,
  31962. "object" == typeof e)
  31963. if (e instanceof Array)
  31964. for (var t = 0; t < e.length; t++)
  31965. this.set[e[t]] = !0;
  31966. else
  31967. this.set = e;
  31968. else if ("function" == typeof e)
  31969. this.infContains = e;
  31970. else if ("undefined" != typeof e)
  31971. throw new Error("set must be either an array or an object.")
  31972. }
  31973. t.exports = n,
  31974. n.prototype.contains = function(e) {
  31975. return !!this.set[e]
  31976. }
  31977. ,
  31978. n.prototype.has = n.prototype.contains,
  31979. n.prototype.add = function(e) {
  31980. if (1 == arguments.length)
  31981. this.set[e] = !0;
  31982. else
  31983. for (var t = 0; t < arguments.length; t++)
  31984. this.set[arguments[t]] = !0
  31985. }
  31986. ,
  31987. n.prototype.addAll = function(e) {
  31988. if ("object" != typeof e && !(e instanceof Array))
  31989. throw new Error("arr must be an array.");
  31990. for (var t = 0; t < e.length; t++)
  31991. this.add(e[t])
  31992. }
  31993. ,
  31994. n.prototype.remove = function(e) {
  31995. if (1 == arguments.length)
  31996. delete this.set[e];
  31997. else
  31998. for (var t = 0; t < arguments.length; t++)
  31999. delete this.set[arguments[t]]
  32000. }
  32001. ,
  32002. n.prototype.delete = n.prototype.remove,
  32003. n.prototype.clear = function() {
  32004. this.set = {}
  32005. }
  32006. ,
  32007. n.prototype.size = function() {
  32008. return Object.keys(this.set).length
  32009. }
  32010. ,
  32011. n.prototype.toString = function() {
  32012. return "{" + Object.keys(this.set).toString() + "}"
  32013. }
  32014. ,
  32015. n.prototype.toArray = function() {
  32016. return "undefined" == typeof this.set ? [] : Object.keys(this.set)
  32017. }
  32018. ,
  32019. n.prototype["*values"] = n.prototype.toArray
  32020. }
  32021. , {}],
  32022. 197: [function(e, t, i) {}
  32023. , {}],
  32024. 198: [function(e, t, i) {
  32025. (function(t) {
  32026. "use strict";
  32027. function n() {
  32028. try {
  32029. var e = new Uint8Array(1);
  32030. return e.__proto__ = {
  32031. __proto__: Uint8Array.prototype,
  32032. foo: function() {
  32033. return 42
  32034. }
  32035. },
  32036. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  32037. } catch (e) {
  32038. return !1
  32039. }
  32040. }
  32041. function r() {
  32042. return a.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  32043. }
  32044. function o(e, t) {
  32045. if (r() < t)
  32046. throw new RangeError("Invalid typed array length");
  32047. return a.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t),
  32048. e.__proto__ = a.prototype) : (null === e && (e = new a(t)),
  32049. e.length = t),
  32050. e
  32051. }
  32052. function a(e, t, i) {
  32053. if (!(a.TYPED_ARRAY_SUPPORT || this instanceof a))
  32054. return new a(e,t,i);
  32055. if ("number" == typeof e) {
  32056. if ("string" == typeof t)
  32057. throw new Error("If encoding is specified then the first argument must be a string");
  32058. return h(this, e)
  32059. }
  32060. return s(this, e, t, i)
  32061. }
  32062. function s(e, t, i, n) {
  32063. if ("number" == typeof t)
  32064. throw new TypeError('"value" argument must not be a number');
  32065. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? p(e, t, i, n) : "string" == typeof t ? u(e, t, i) : f(e, t)
  32066. }
  32067. function l(e) {
  32068. if ("number" != typeof e)
  32069. throw new TypeError('"size" argument must be a number');
  32070. if (e < 0)
  32071. throw new RangeError('"size" argument must not be negative')
  32072. }
  32073. function c(e, t, i, n) {
  32074. return l(t),
  32075. 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)
  32076. }
  32077. function h(e, t) {
  32078. if (l(t),
  32079. e = o(e, t < 0 ? 0 : 0 | g(t)),
  32080. !a.TYPED_ARRAY_SUPPORT)
  32081. for (var i = 0; i < t; ++i)
  32082. e[i] = 0;
  32083. return e
  32084. }
  32085. function u(e, t, i) {
  32086. if ("string" == typeof i && "" !== i || (i = "utf8"),
  32087. !a.isEncoding(i))
  32088. throw new TypeError('"encoding" must be a valid string encoding');
  32089. var n = 0 | v(t, i);
  32090. e = o(e, n);
  32091. var r = e.write(t, i);
  32092. return r !== n && (e = e.slice(0, r)),
  32093. e
  32094. }
  32095. function d(e, t) {
  32096. var i = t.length < 0 ? 0 : 0 | g(t.length);
  32097. e = o(e, i);
  32098. for (var n = 0; n < i; n += 1)
  32099. e[n] = 255 & t[n];
  32100. return e
  32101. }
  32102. function p(e, t, i, n) {
  32103. if (t.byteLength,
  32104. i < 0 || t.byteLength < i)
  32105. throw new RangeError("'offset' is out of bounds");
  32106. if (t.byteLength < i + (n || 0))
  32107. throw new RangeError("'length' is out of bounds");
  32108. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  32109. a.TYPED_ARRAY_SUPPORT ? (e = t,
  32110. e.__proto__ = a.prototype) : e = d(e, t),
  32111. e
  32112. }
  32113. function f(e, t) {
  32114. if (a.isBuffer(t)) {
  32115. var i = 0 | g(t.length);
  32116. return e = o(e, i),
  32117. 0 === e.length ? e : (t.copy(e, 0, 0, i),
  32118. e)
  32119. }
  32120. if (t) {
  32121. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  32122. return "number" != typeof t.length || K(t.length) ? o(e, 0) : d(e, t);
  32123. if ("Buffer" === t.type && $(t.data))
  32124. return d(e, t.data)
  32125. }
  32126. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  32127. }
  32128. function g(e) {
  32129. if (e >= r())
  32130. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + r().toString(16) + " bytes");
  32131. return 0 | e
  32132. }
  32133. function m(e) {
  32134. return +e != e && (e = 0),
  32135. a.alloc(+e)
  32136. }
  32137. function v(e, t) {
  32138. if (a.isBuffer(e))
  32139. return e.length;
  32140. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  32141. return e.byteLength;
  32142. "string" != typeof e && (e = "" + e);
  32143. var i = e.length;
  32144. if (0 === i)
  32145. return 0;
  32146. for (var n = !1; ; )
  32147. switch (t) {
  32148. case "ascii":
  32149. case "latin1":
  32150. case "binary":
  32151. return i;
  32152. case "utf8":
  32153. case "utf-8":
  32154. case void 0:
  32155. return j(e).length;
  32156. case "ucs2":
  32157. case "ucs-2":
  32158. case "utf16le":
  32159. case "utf-16le":
  32160. return 2 * i;
  32161. case "hex":
  32162. return i >>> 1;
  32163. case "base64":
  32164. return Z(e).length;
  32165. default:
  32166. if (n)
  32167. return j(e).length;
  32168. t = ("" + t).toLowerCase(),
  32169. n = !0
  32170. }
  32171. }
  32172. function A(e, t, i) {
  32173. var n = !1;
  32174. if ((void 0 === t || t < 0) && (t = 0),
  32175. t > this.length)
  32176. return "";
  32177. if ((void 0 === i || i > this.length) && (i = this.length),
  32178. i <= 0)
  32179. return "";
  32180. if (i >>>= 0,
  32181. t >>>= 0,
  32182. i <= t)
  32183. return "";
  32184. for (e || (e = "utf8"); ; )
  32185. switch (e) {
  32186. case "hex":
  32187. return L(this, t, i);
  32188. case "utf8":
  32189. case "utf-8":
  32190. return M(this, t, i);
  32191. case "ascii":
  32192. return P(this, t, i);
  32193. case "latin1":
  32194. case "binary":
  32195. return O(this, t, i);
  32196. case "base64":
  32197. return S(this, t, i);
  32198. case "ucs2":
  32199. case "ucs-2":
  32200. case "utf16le":
  32201. case "utf-16le":
  32202. return D(this, t, i);
  32203. default:
  32204. if (n)
  32205. throw new TypeError("Unknown encoding: " + e);
  32206. e = (e + "").toLowerCase(),
  32207. n = !0
  32208. }
  32209. }
  32210. function y(e, t, i) {
  32211. var n = e[t];
  32212. e[t] = e[i],
  32213. e[i] = n
  32214. }
  32215. function C(e, t, i, n, r) {
  32216. if (0 === e.length)
  32217. return -1;
  32218. if ("string" == typeof i ? (n = i,
  32219. i = 0) : i > 2147483647 ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  32220. i = +i,
  32221. isNaN(i) && (i = r ? 0 : e.length - 1),
  32222. i < 0 && (i = e.length + i),
  32223. i >= e.length) {
  32224. if (r)
  32225. return -1;
  32226. i = e.length - 1
  32227. } else if (i < 0) {
  32228. if (!r)
  32229. return -1;
  32230. i = 0
  32231. }
  32232. if ("string" == typeof t && (t = a.from(t, n)),
  32233. a.isBuffer(t))
  32234. return 0 === t.length ? -1 : I(e, t, i, n, r);
  32235. if ("number" == typeof t)
  32236. return t &= 255,
  32237. 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);
  32238. throw new TypeError("val must be string, number or Buffer")
  32239. }
  32240. function I(e, t, i, n, r) {
  32241. function o(e, t) {
  32242. return 1 === a ? e[t] : e.readUInt16BE(t * a)
  32243. }
  32244. var a = 1
  32245. , s = e.length
  32246. , l = t.length;
  32247. if (void 0 !== n && (n = String(n).toLowerCase(),
  32248. "ucs2" === n || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  32249. if (e.length < 2 || t.length < 2)
  32250. return -1;
  32251. a = 2,
  32252. s /= 2,
  32253. l /= 2,
  32254. i /= 2
  32255. }
  32256. var c;
  32257. if (r) {
  32258. var h = -1;
  32259. for (c = i; c < s; c++)
  32260. if (o(e, c) === o(t, h === -1 ? 0 : c - h)) {
  32261. if (h === -1 && (h = c),
  32262. c - h + 1 === l)
  32263. return h * a
  32264. } else
  32265. h !== -1 && (c -= c - h),
  32266. h = -1
  32267. } else
  32268. for (i + l > s && (i = s - l),
  32269. c = i; c >= 0; c--) {
  32270. for (var u = !0, d = 0; d < l; d++)
  32271. if (o(e, c + d) !== o(t, d)) {
  32272. u = !1;
  32273. break
  32274. }
  32275. if (u)
  32276. return c
  32277. }
  32278. return -1
  32279. }
  32280. function E(e, t, i, n) {
  32281. i = Number(i) || 0;
  32282. var r = e.length - i;
  32283. n ? (n = Number(n),
  32284. n > r && (n = r)) : n = r;
  32285. var o = t.length;
  32286. if (o % 2 !== 0)
  32287. throw new TypeError("Invalid hex string");
  32288. n > o / 2 && (n = o / 2);
  32289. for (var a = 0; a < n; ++a) {
  32290. var s = parseInt(t.substr(2 * a, 2), 16);
  32291. if (isNaN(s))
  32292. return a;
  32293. e[i + a] = s
  32294. }
  32295. return a
  32296. }
  32297. function b(e, t, i, n) {
  32298. return q(j(t, e.length - i), e, i, n)
  32299. }
  32300. function w(e, t, i, n) {
  32301. return q(Y(t), e, i, n)
  32302. }
  32303. function _(e, t, i, n) {
  32304. return w(e, t, i, n)
  32305. }
  32306. function T(e, t, i, n) {
  32307. return q(Z(t), e, i, n)
  32308. }
  32309. function x(e, t, i, n) {
  32310. return q(X(t, e.length - i), e, i, n)
  32311. }
  32312. function S(e, t, i) {
  32313. return 0 === t && i === e.length ? Q.fromByteArray(e) : Q.fromByteArray(e.slice(t, i))
  32314. }
  32315. function M(e, t, i) {
  32316. i = Math.min(e.length, i);
  32317. for (var n = [], r = t; r < i; ) {
  32318. var o = e[r]
  32319. , a = null
  32320. , s = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1;
  32321. if (r + s <= i) {
  32322. var l, c, h, u;
  32323. switch (s) {
  32324. case 1:
  32325. o < 128 && (a = o);
  32326. break;
  32327. case 2:
  32328. l = e[r + 1],
  32329. 128 === (192 & l) && (u = (31 & o) << 6 | 63 & l,
  32330. u > 127 && (a = u));
  32331. break;
  32332. case 3:
  32333. l = e[r + 1],
  32334. c = e[r + 2],
  32335. 128 === (192 & l) && 128 === (192 & c) && (u = (15 & o) << 12 | (63 & l) << 6 | 63 & c,
  32336. u > 2047 && (u < 55296 || u > 57343) && (a = u));
  32337. break;
  32338. case 4:
  32339. l = e[r + 1],
  32340. c = e[r + 2],
  32341. h = e[r + 3],
  32342. 128 === (192 & l) && 128 === (192 & c) && 128 === (192 & h) && (u = (15 & o) << 18 | (63 & l) << 12 | (63 & c) << 6 | 63 & h,
  32343. u > 65535 && u < 1114112 && (a = u))
  32344. }
  32345. }
  32346. null === a ? (a = 65533,
  32347. s = 1) : a > 65535 && (a -= 65536,
  32348. n.push(a >>> 10 & 1023 | 55296),
  32349. a = 56320 | 1023 & a),
  32350. n.push(a),
  32351. r += s
  32352. }
  32353. return R(n)
  32354. }
  32355. function R(e) {
  32356. var t = e.length;
  32357. if (t <= ee)
  32358. return String.fromCharCode.apply(String, e);
  32359. for (var i = "", n = 0; n < t; )
  32360. i += String.fromCharCode.apply(String, e.slice(n, n += ee));
  32361. return i
  32362. }
  32363. function P(e, t, i) {
  32364. var n = "";
  32365. i = Math.min(e.length, i);
  32366. for (var r = t; r < i; ++r)
  32367. n += String.fromCharCode(127 & e[r]);
  32368. return n
  32369. }
  32370. function O(e, t, i) {
  32371. var n = "";
  32372. i = Math.min(e.length, i);
  32373. for (var r = t; r < i; ++r)
  32374. n += String.fromCharCode(e[r]);
  32375. return n
  32376. }
  32377. function L(e, t, i) {
  32378. var n = e.length;
  32379. (!t || t < 0) && (t = 0),
  32380. (!i || i < 0 || i > n) && (i = n);
  32381. for (var r = "", o = t; o < i; ++o)
  32382. r += W(e[o]);
  32383. return r
  32384. }
  32385. function D(e, t, i) {
  32386. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  32387. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  32388. return r
  32389. }
  32390. function N(e, t, i) {
  32391. if (e % 1 !== 0 || e < 0)
  32392. throw new RangeError("offset is not uint");
  32393. if (e + t > i)
  32394. throw new RangeError("Trying to access beyond buffer length")
  32395. }
  32396. function B(e, t, i, n, r, o) {
  32397. if (!a.isBuffer(e))
  32398. throw new TypeError('"buffer" argument must be a Buffer instance');
  32399. if (t > r || t < o)
  32400. throw new RangeError('"value" argument is out of bounds');
  32401. if (i + n > e.length)
  32402. throw new RangeError("Index out of range")
  32403. }
  32404. function F(e, t, i, n) {
  32405. t < 0 && (t = 65535 + t + 1);
  32406. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  32407. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  32408. }
  32409. function V(e, t, i, n) {
  32410. t < 0 && (t = 4294967295 + t + 1);
  32411. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  32412. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  32413. }
  32414. function U(e, t, i, n, r, o) {
  32415. if (i + n > e.length)
  32416. throw new RangeError("Index out of range");
  32417. if (i < 0)
  32418. throw new RangeError("Index out of range")
  32419. }
  32420. function k(e, t, i, n, r) {
  32421. return r || U(e, t, i, 4, 3.4028234663852886e38, -3.4028234663852886e38),
  32422. J.write(e, t, i, n, 23, 4),
  32423. i + 4
  32424. }
  32425. function H(e, t, i, n, r) {
  32426. return r || U(e, t, i, 8, 1.7976931348623157e308, -1.7976931348623157e308),
  32427. J.write(e, t, i, n, 52, 8),
  32428. i + 8
  32429. }
  32430. function G(e) {
  32431. if (e = z(e).replace(te, ""),
  32432. e.length < 2)
  32433. return "";
  32434. for (; e.length % 4 !== 0; )
  32435. e += "=";
  32436. return e
  32437. }
  32438. function z(e) {
  32439. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  32440. }
  32441. function W(e) {
  32442. return e < 16 ? "0" + e.toString(16) : e.toString(16)
  32443. }
  32444. function j(e, t) {
  32445. t = t || 1 / 0;
  32446. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  32447. if (i = e.charCodeAt(a),
  32448. i > 55295 && i < 57344) {
  32449. if (!r) {
  32450. if (i > 56319) {
  32451. (t -= 3) > -1 && o.push(239, 191, 189);
  32452. continue
  32453. }
  32454. if (a + 1 === n) {
  32455. (t -= 3) > -1 && o.push(239, 191, 189);
  32456. continue
  32457. }
  32458. r = i;
  32459. continue
  32460. }
  32461. if (i < 56320) {
  32462. (t -= 3) > -1 && o.push(239, 191, 189),
  32463. r = i;
  32464. continue
  32465. }
  32466. i = (r - 55296 << 10 | i - 56320) + 65536
  32467. } else
  32468. r && (t -= 3) > -1 && o.push(239, 191, 189);
  32469. if (r = null,
  32470. i < 128) {
  32471. if ((t -= 1) < 0)
  32472. break;
  32473. o.push(i)
  32474. } else if (i < 2048) {
  32475. if ((t -= 2) < 0)
  32476. break;
  32477. o.push(i >> 6 | 192, 63 & i | 128)
  32478. } else if (i < 65536) {
  32479. if ((t -= 3) < 0)
  32480. break;
  32481. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  32482. } else {
  32483. if (!(i < 1114112))
  32484. throw new Error("Invalid code point");
  32485. if ((t -= 4) < 0)
  32486. break;
  32487. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  32488. }
  32489. }
  32490. return o
  32491. }
  32492. function Y(e) {
  32493. for (var t = [], i = 0; i < e.length; ++i)
  32494. t.push(255 & e.charCodeAt(i));
  32495. return t
  32496. }
  32497. function X(e, t) {
  32498. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  32499. i = e.charCodeAt(a),
  32500. n = i >> 8,
  32501. r = i % 256,
  32502. o.push(r),
  32503. o.push(n);
  32504. return o
  32505. }
  32506. function Z(e) {
  32507. return Q.toByteArray(G(e))
  32508. }
  32509. function q(e, t, i, n) {
  32510. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  32511. t[r + i] = e[r];
  32512. return r
  32513. }
  32514. function K(e) {
  32515. return e !== e
  32516. }
  32517. var Q = e("base64-js")
  32518. , J = e("ieee754")
  32519. , $ = e("isarray");
  32520. i.Buffer = a,
  32521. i.SlowBuffer = m,
  32522. i.INSPECT_MAX_BYTES = 50,
  32523. a.TYPED_ARRAY_SUPPORT = void 0 !== t.TYPED_ARRAY_SUPPORT ? t.TYPED_ARRAY_SUPPORT : n(),
  32524. i.kMaxLength = r(),
  32525. a.poolSize = 8192,
  32526. a._augment = function(e) {
  32527. return e.__proto__ = a.prototype,
  32528. e
  32529. }
  32530. ,
  32531. a.from = function(e, t, i) {
  32532. return s(null, e, t, i)
  32533. }
  32534. ,
  32535. a.TYPED_ARRAY_SUPPORT && (a.prototype.__proto__ = Uint8Array.prototype,
  32536. a.__proto__ = Uint8Array,
  32537. "undefined" != typeof Symbol && Symbol.species && a[Symbol.species] === a && Object.defineProperty(a, Symbol.species, {
  32538. value: null,
  32539. configurable: !0
  32540. })),
  32541. a.alloc = function(e, t, i) {
  32542. return c(null, e, t, i)
  32543. }
  32544. ,
  32545. a.allocUnsafe = function(e) {
  32546. return h(null, e)
  32547. }
  32548. ,
  32549. a.allocUnsafeSlow = function(e) {
  32550. return h(null, e)
  32551. }
  32552. ,
  32553. a.isBuffer = function(e) {
  32554. return !(null == e || !e._isBuffer)
  32555. }
  32556. ,
  32557. a.compare = function(e, t) {
  32558. if (!a.isBuffer(e) || !a.isBuffer(t))
  32559. throw new TypeError("Arguments must be Buffers");
  32560. if (e === t)
  32561. return 0;
  32562. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  32563. if (e[r] !== t[r]) {
  32564. i = e[r],
  32565. n = t[r];
  32566. break
  32567. }
  32568. return i < n ? -1 : n < i ? 1 : 0
  32569. }
  32570. ,
  32571. a.isEncoding = function(e) {
  32572. switch (String(e).toLowerCase()) {
  32573. case "hex":
  32574. case "utf8":
  32575. case "utf-8":
  32576. case "ascii":
  32577. case "latin1":
  32578. case "binary":
  32579. case "base64":
  32580. case "ucs2":
  32581. case "ucs-2":
  32582. case "utf16le":
  32583. case "utf-16le":
  32584. return !0;
  32585. default:
  32586. return !1
  32587. }
  32588. }
  32589. ,
  32590. a.concat = function(e, t) {
  32591. if (!$(e))
  32592. throw new TypeError('"list" argument must be an Array of Buffers');
  32593. if (0 === e.length)
  32594. return a.alloc(0);
  32595. var i;
  32596. if (void 0 === t)
  32597. for (t = 0,
  32598. i = 0; i < e.length; ++i)
  32599. t += e[i].length;
  32600. var n = a.allocUnsafe(t)
  32601. , r = 0;
  32602. for (i = 0; i < e.length; ++i) {
  32603. var o = e[i];
  32604. if (!a.isBuffer(o))
  32605. throw new TypeError('"list" argument must be an Array of Buffers');
  32606. o.copy(n, r),
  32607. r += o.length
  32608. }
  32609. return n
  32610. }
  32611. ,
  32612. a.byteLength = v,
  32613. a.prototype._isBuffer = !0,
  32614. a.prototype.swap16 = function() {
  32615. var e = this.length;
  32616. if (e % 2 !== 0)
  32617. throw new RangeError("Buffer size must be a multiple of 16-bits");
  32618. for (var t = 0; t < e; t += 2)
  32619. y(this, t, t + 1);
  32620. return this
  32621. }
  32622. ,
  32623. a.prototype.swap32 = function() {
  32624. var e = this.length;
  32625. if (e % 4 !== 0)
  32626. throw new RangeError("Buffer size must be a multiple of 32-bits");
  32627. for (var t = 0; t < e; t += 4)
  32628. y(this, t, t + 3),
  32629. y(this, t + 1, t + 2);
  32630. return this
  32631. }
  32632. ,
  32633. a.prototype.swap64 = function() {
  32634. var e = this.length;
  32635. if (e % 8 !== 0)
  32636. throw new RangeError("Buffer size must be a multiple of 64-bits");
  32637. for (var t = 0; t < e; t += 8)
  32638. y(this, t, t + 7),
  32639. y(this, t + 1, t + 6),
  32640. y(this, t + 2, t + 5),
  32641. y(this, t + 3, t + 4);
  32642. return this
  32643. }
  32644. ,
  32645. a.prototype.toString = function() {
  32646. var e = 0 | this.length;
  32647. return 0 === e ? "" : 0 === arguments.length ? M(this, 0, e) : A.apply(this, arguments)
  32648. }
  32649. ,
  32650. a.prototype.equals = function(e) {
  32651. if (!a.isBuffer(e))
  32652. throw new TypeError("Argument must be a Buffer");
  32653. return this === e || 0 === a.compare(this, e)
  32654. }
  32655. ,
  32656. a.prototype.inspect = function() {
  32657. var e = ""
  32658. , t = i.INSPECT_MAX_BYTES;
  32659. return this.length > 0 && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  32660. this.length > t && (e += " ... ")),
  32661. "<Buffer " + e + ">"
  32662. }
  32663. ,
  32664. a.prototype.compare = function(e, t, i, n, r) {
  32665. if (!a.isBuffer(e))
  32666. throw new TypeError("Argument must be a Buffer");
  32667. if (void 0 === t && (t = 0),
  32668. void 0 === i && (i = e ? e.length : 0),
  32669. void 0 === n && (n = 0),
  32670. void 0 === r && (r = this.length),
  32671. t < 0 || i > e.length || n < 0 || r > this.length)
  32672. throw new RangeError("out of range index");
  32673. if (n >= r && t >= i)
  32674. return 0;
  32675. if (n >= r)
  32676. return -1;
  32677. if (t >= i)
  32678. return 1;
  32679. if (t >>>= 0,
  32680. i >>>= 0,
  32681. n >>>= 0,
  32682. r >>>= 0,
  32683. this === e)
  32684. return 0;
  32685. 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)
  32686. if (c[u] !== h[u]) {
  32687. o = c[u],
  32688. s = h[u];
  32689. break
  32690. }
  32691. return o < s ? -1 : s < o ? 1 : 0
  32692. }
  32693. ,
  32694. a.prototype.includes = function(e, t, i) {
  32695. return this.indexOf(e, t, i) !== -1
  32696. }
  32697. ,
  32698. a.prototype.indexOf = function(e, t, i) {
  32699. return C(this, e, t, i, !0)
  32700. }
  32701. ,
  32702. a.prototype.lastIndexOf = function(e, t, i) {
  32703. return C(this, e, t, i, !1)
  32704. }
  32705. ,
  32706. a.prototype.write = function(e, t, i, n) {
  32707. if (void 0 === t)
  32708. n = "utf8",
  32709. i = this.length,
  32710. t = 0;
  32711. else if (void 0 === i && "string" == typeof t)
  32712. n = t,
  32713. i = this.length,
  32714. t = 0;
  32715. else {
  32716. if (!isFinite(t))
  32717. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  32718. t |= 0,
  32719. isFinite(i) ? (i |= 0,
  32720. void 0 === n && (n = "utf8")) : (n = i,
  32721. i = void 0)
  32722. }
  32723. var r = this.length - t;
  32724. if ((void 0 === i || i > r) && (i = r),
  32725. e.length > 0 && (i < 0 || t < 0) || t > this.length)
  32726. throw new RangeError("Attempt to write outside buffer bounds");
  32727. n || (n = "utf8");
  32728. for (var o = !1; ; )
  32729. switch (n) {
  32730. case "hex":
  32731. return E(this, e, t, i);
  32732. case "utf8":
  32733. case "utf-8":
  32734. return b(this, e, t, i);
  32735. case "ascii":
  32736. return w(this, e, t, i);
  32737. case "latin1":
  32738. case "binary":
  32739. return _(this, e, t, i);
  32740. case "base64":
  32741. return T(this, e, t, i);
  32742. case "ucs2":
  32743. case "ucs-2":
  32744. case "utf16le":
  32745. case "utf-16le":
  32746. return x(this, e, t, i);
  32747. default:
  32748. if (o)
  32749. throw new TypeError("Unknown encoding: " + n);
  32750. n = ("" + n).toLowerCase(),
  32751. o = !0
  32752. }
  32753. }
  32754. ,
  32755. a.prototype.toJSON = function() {
  32756. return {
  32757. type: "Buffer",
  32758. data: Array.prototype.slice.call(this._arr || this, 0)
  32759. }
  32760. }
  32761. ;
  32762. var ee = 4096;
  32763. a.prototype.slice = function(e, t) {
  32764. var i = this.length;
  32765. e = ~~e,
  32766. t = void 0 === t ? i : ~~t,
  32767. e < 0 ? (e += i,
  32768. e < 0 && (e = 0)) : e > i && (e = i),
  32769. t < 0 ? (t += i,
  32770. t < 0 && (t = 0)) : t > i && (t = i),
  32771. t < e && (t = e);
  32772. var n;
  32773. if (a.TYPED_ARRAY_SUPPORT)
  32774. n = this.subarray(e, t),
  32775. n.__proto__ = a.prototype;
  32776. else {
  32777. var r = t - e;
  32778. n = new a(r,void 0);
  32779. for (var o = 0; o < r; ++o)
  32780. n[o] = this[o + e]
  32781. }
  32782. return n
  32783. }
  32784. ,
  32785. a.prototype.readUIntLE = function(e, t, i) {
  32786. e |= 0,
  32787. t |= 0,
  32788. i || N(e, t, this.length);
  32789. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  32790. n += this[e + o] * r;
  32791. return n
  32792. }
  32793. ,
  32794. a.prototype.readUIntBE = function(e, t, i) {
  32795. e |= 0,
  32796. t |= 0,
  32797. i || N(e, t, this.length);
  32798. for (var n = this[e + --t], r = 1; t > 0 && (r *= 256); )
  32799. n += this[e + --t] * r;
  32800. return n
  32801. }
  32802. ,
  32803. a.prototype.readUInt8 = function(e, t) {
  32804. return t || N(e, 1, this.length),
  32805. this[e]
  32806. }
  32807. ,
  32808. a.prototype.readUInt16LE = function(e, t) {
  32809. return t || N(e, 2, this.length),
  32810. this[e] | this[e + 1] << 8
  32811. }
  32812. ,
  32813. a.prototype.readUInt16BE = function(e, t) {
  32814. return t || N(e, 2, this.length),
  32815. this[e] << 8 | this[e + 1]
  32816. }
  32817. ,
  32818. a.prototype.readUInt32LE = function(e, t) {
  32819. return t || N(e, 4, this.length),
  32820. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  32821. }
  32822. ,
  32823. a.prototype.readUInt32BE = function(e, t) {
  32824. return t || N(e, 4, this.length),
  32825. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  32826. }
  32827. ,
  32828. a.prototype.readIntLE = function(e, t, i) {
  32829. e |= 0,
  32830. t |= 0,
  32831. i || N(e, t, this.length);
  32832. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  32833. n += this[e + o] * r;
  32834. return r *= 128,
  32835. n >= r && (n -= Math.pow(2, 8 * t)),
  32836. n
  32837. }
  32838. ,
  32839. a.prototype.readIntBE = function(e, t, i) {
  32840. e |= 0,
  32841. t |= 0,
  32842. i || N(e, t, this.length);
  32843. for (var n = t, r = 1, o = this[e + --n]; n > 0 && (r *= 256); )
  32844. o += this[e + --n] * r;
  32845. return r *= 128,
  32846. o >= r && (o -= Math.pow(2, 8 * t)),
  32847. o
  32848. }
  32849. ,
  32850. a.prototype.readInt8 = function(e, t) {
  32851. return t || N(e, 1, this.length),
  32852. 128 & this[e] ? (255 - this[e] + 1) * -1 : this[e]
  32853. }
  32854. ,
  32855. a.prototype.readInt16LE = function(e, t) {
  32856. t || N(e, 2, this.length);
  32857. var i = this[e] | this[e + 1] << 8;
  32858. return 32768 & i ? 4294901760 | i : i
  32859. }
  32860. ,
  32861. a.prototype.readInt16BE = function(e, t) {
  32862. t || N(e, 2, this.length);
  32863. var i = this[e + 1] | this[e] << 8;
  32864. return 32768 & i ? 4294901760 | i : i
  32865. }
  32866. ,
  32867. a.prototype.readInt32LE = function(e, t) {
  32868. return t || N(e, 4, this.length),
  32869. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  32870. }
  32871. ,
  32872. a.prototype.readInt32BE = function(e, t) {
  32873. return t || N(e, 4, this.length),
  32874. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  32875. }
  32876. ,
  32877. a.prototype.readFloatLE = function(e, t) {
  32878. return t || N(e, 4, this.length),
  32879. J.read(this, e, !0, 23, 4)
  32880. }
  32881. ,
  32882. a.prototype.readFloatBE = function(e, t) {
  32883. return t || N(e, 4, this.length),
  32884. J.read(this, e, !1, 23, 4)
  32885. }
  32886. ,
  32887. a.prototype.readDoubleLE = function(e, t) {
  32888. return t || N(e, 8, this.length),
  32889. J.read(this, e, !0, 52, 8)
  32890. }
  32891. ,
  32892. a.prototype.readDoubleBE = function(e, t) {
  32893. return t || N(e, 8, this.length),
  32894. J.read(this, e, !1, 52, 8)
  32895. }
  32896. ,
  32897. a.prototype.writeUIntLE = function(e, t, i, n) {
  32898. if (e = +e,
  32899. t |= 0,
  32900. i |= 0,
  32901. !n) {
  32902. var r = Math.pow(2, 8 * i) - 1;
  32903. B(this, e, t, i, r, 0)
  32904. }
  32905. var o = 1
  32906. , a = 0;
  32907. for (this[t] = 255 & e; ++a < i && (o *= 256); )
  32908. this[t + a] = e / o & 255;
  32909. return t + i
  32910. }
  32911. ,
  32912. a.prototype.writeUIntBE = function(e, t, i, n) {
  32913. if (e = +e,
  32914. t |= 0,
  32915. i |= 0,
  32916. !n) {
  32917. var r = Math.pow(2, 8 * i) - 1;
  32918. B(this, e, t, i, r, 0)
  32919. }
  32920. var o = i - 1
  32921. , a = 1;
  32922. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  32923. this[t + o] = e / a & 255;
  32924. return t + i
  32925. }
  32926. ,
  32927. a.prototype.writeUInt8 = function(e, t, i) {
  32928. return e = +e,
  32929. t |= 0,
  32930. i || B(this, e, t, 1, 255, 0),
  32931. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  32932. this[t] = 255 & e,
  32933. t + 1
  32934. }
  32935. ,
  32936. a.prototype.writeUInt16LE = function(e, t, i) {
  32937. return e = +e,
  32938. t |= 0,
  32939. i || B(this, e, t, 2, 65535, 0),
  32940. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  32941. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  32942. t + 2
  32943. }
  32944. ,
  32945. a.prototype.writeUInt16BE = function(e, t, i) {
  32946. return e = +e,
  32947. t |= 0,
  32948. i || B(this, e, t, 2, 65535, 0),
  32949. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  32950. this[t + 1] = 255 & e) : F(this, e, t, !1),
  32951. t + 2
  32952. }
  32953. ,
  32954. a.prototype.writeUInt32LE = function(e, t, i) {
  32955. return e = +e,
  32956. t |= 0,
  32957. i || B(this, e, t, 4, 4294967295, 0),
  32958. a.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  32959. this[t + 2] = e >>> 16,
  32960. this[t + 1] = e >>> 8,
  32961. this[t] = 255 & e) : V(this, e, t, !0),
  32962. t + 4
  32963. }
  32964. ,
  32965. a.prototype.writeUInt32BE = function(e, t, i) {
  32966. return e = +e,
  32967. t |= 0,
  32968. i || B(this, e, t, 4, 4294967295, 0),
  32969. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  32970. this[t + 1] = e >>> 16,
  32971. this[t + 2] = e >>> 8,
  32972. this[t + 3] = 255 & e) : V(this, e, t, !1),
  32973. t + 4
  32974. }
  32975. ,
  32976. a.prototype.writeIntLE = function(e, t, i, n) {
  32977. if (e = +e,
  32978. t |= 0,
  32979. !n) {
  32980. var r = Math.pow(2, 8 * i - 1);
  32981. B(this, e, t, i, r - 1, -r)
  32982. }
  32983. var o = 0
  32984. , a = 1
  32985. , s = 0;
  32986. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  32987. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  32988. this[t + o] = (e / a >> 0) - s & 255;
  32989. return t + i
  32990. }
  32991. ,
  32992. a.prototype.writeIntBE = function(e, t, i, n) {
  32993. if (e = +e,
  32994. t |= 0,
  32995. !n) {
  32996. var r = Math.pow(2, 8 * i - 1);
  32997. B(this, e, t, i, r - 1, -r)
  32998. }
  32999. var o = i - 1
  33000. , a = 1
  33001. , s = 0;
  33002. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  33003. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  33004. this[t + o] = (e / a >> 0) - s & 255;
  33005. return t + i
  33006. }
  33007. ,
  33008. a.prototype.writeInt8 = function(e, t, i) {
  33009. return e = +e,
  33010. t |= 0,
  33011. i || B(this, e, t, 1, 127, -128),
  33012. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  33013. e < 0 && (e = 255 + e + 1),
  33014. this[t] = 255 & e,
  33015. t + 1
  33016. }
  33017. ,
  33018. a.prototype.writeInt16LE = function(e, t, i) {
  33019. return e = +e,
  33020. t |= 0,
  33021. i || B(this, e, t, 2, 32767, -32768),
  33022. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  33023. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  33024. t + 2
  33025. }
  33026. ,
  33027. a.prototype.writeInt16BE = function(e, t, i) {
  33028. return e = +e,
  33029. t |= 0,
  33030. i || B(this, e, t, 2, 32767, -32768),
  33031. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  33032. this[t + 1] = 255 & e) : F(this, e, t, !1),
  33033. t + 2
  33034. }
  33035. ,
  33036. a.prototype.writeInt32LE = function(e, t, i) {
  33037. return e = +e,
  33038. t |= 0,
  33039. i || B(this, e, t, 4, 2147483647, -2147483648),
  33040. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  33041. this[t + 1] = e >>> 8,
  33042. this[t + 2] = e >>> 16,
  33043. this[t + 3] = e >>> 24) : V(this, e, t, !0),
  33044. t + 4
  33045. }
  33046. ,
  33047. a.prototype.writeInt32BE = function(e, t, i) {
  33048. return e = +e,
  33049. t |= 0,
  33050. i || B(this, e, t, 4, 2147483647, -2147483648),
  33051. e < 0 && (e = 4294967295 + e + 1),
  33052. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  33053. this[t + 1] = e >>> 16,
  33054. this[t + 2] = e >>> 8,
  33055. this[t + 3] = 255 & e) : V(this, e, t, !1),
  33056. t + 4
  33057. }
  33058. ,
  33059. a.prototype.writeFloatLE = function(e, t, i) {
  33060. return k(this, e, t, !0, i)
  33061. }
  33062. ,
  33063. a.prototype.writeFloatBE = function(e, t, i) {
  33064. return k(this, e, t, !1, i)
  33065. }
  33066. ,
  33067. a.prototype.writeDoubleLE = function(e, t, i) {
  33068. return H(this, e, t, !0, i)
  33069. }
  33070. ,
  33071. a.prototype.writeDoubleBE = function(e, t, i) {
  33072. return H(this, e, t, !1, i)
  33073. }
  33074. ,
  33075. a.prototype.copy = function(e, t, i, n) {
  33076. if (i || (i = 0),
  33077. n || 0 === n || (n = this.length),
  33078. t >= e.length && (t = e.length),
  33079. t || (t = 0),
  33080. n > 0 && n < i && (n = i),
  33081. n === i)
  33082. return 0;
  33083. if (0 === e.length || 0 === this.length)
  33084. return 0;
  33085. if (t < 0)
  33086. throw new RangeError("targetStart out of bounds");
  33087. if (i < 0 || i >= this.length)
  33088. throw new RangeError("sourceStart out of bounds");
  33089. if (n < 0)
  33090. throw new RangeError("sourceEnd out of bounds");
  33091. n > this.length && (n = this.length),
  33092. e.length - t < n - i && (n = e.length - t + i);
  33093. var r, o = n - i;
  33094. if (this === e && i < t && t < n)
  33095. for (r = o - 1; r >= 0; --r)
  33096. e[r + t] = this[r + i];
  33097. else if (o < 1e3 || !a.TYPED_ARRAY_SUPPORT)
  33098. for (r = 0; r < o; ++r)
  33099. e[r + t] = this[r + i];
  33100. else
  33101. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  33102. return o
  33103. }
  33104. ,
  33105. a.prototype.fill = function(e, t, i, n) {
  33106. if ("string" == typeof e) {
  33107. if ("string" == typeof t ? (n = t,
  33108. t = 0,
  33109. i = this.length) : "string" == typeof i && (n = i,
  33110. i = this.length),
  33111. 1 === e.length) {
  33112. var r = e.charCodeAt(0);
  33113. r < 256 && (e = r)
  33114. }
  33115. if (void 0 !== n && "string" != typeof n)
  33116. throw new TypeError("encoding must be a string");
  33117. if ("string" == typeof n && !a.isEncoding(n))
  33118. throw new TypeError("Unknown encoding: " + n)
  33119. } else
  33120. "number" == typeof e && (e &= 255);
  33121. if (t < 0 || this.length < t || this.length < i)
  33122. throw new RangeError("Out of range index");
  33123. if (i <= t)
  33124. return this;
  33125. t >>>= 0,
  33126. i = void 0 === i ? this.length : i >>> 0,
  33127. e || (e = 0);
  33128. var o;
  33129. if ("number" == typeof e)
  33130. for (o = t; o < i; ++o)
  33131. this[o] = e;
  33132. else {
  33133. var s = a.isBuffer(e) ? e : j(new a(e,n).toString())
  33134. , l = s.length;
  33135. for (o = 0; o < i - t; ++o)
  33136. this[o + t] = s[o % l]
  33137. }
  33138. return this
  33139. }
  33140. ;
  33141. var te = /[^+\/0-9A-Za-z-_]/g
  33142. }
  33143. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  33144. }
  33145. , {
  33146. "base64-js": 199,
  33147. ieee754: 200,
  33148. isarray: 201
  33149. }],
  33150. 199: [function(e, t, i) {
  33151. "use strict";
  33152. function n(e) {
  33153. var t = e.length;
  33154. if (t % 4 > 0)
  33155. throw new Error("Invalid string. Length must be a multiple of 4");
  33156. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  33157. }
  33158. function r(e) {
  33159. return 3 * e.length / 4 - n(e)
  33160. }
  33161. function o(e) {
  33162. var t, i, r, o, a, s, l = e.length;
  33163. a = n(e),
  33164. s = new u(3 * l / 4 - a),
  33165. r = a > 0 ? l - 4 : l;
  33166. var c = 0;
  33167. for (t = 0,
  33168. i = 0; t < r; t += 4,
  33169. i += 3)
  33170. o = h[e.charCodeAt(t)] << 18 | h[e.charCodeAt(t + 1)] << 12 | h[e.charCodeAt(t + 2)] << 6 | h[e.charCodeAt(t + 3)],
  33171. s[c++] = o >> 16 & 255,
  33172. s[c++] = o >> 8 & 255,
  33173. s[c++] = 255 & o;
  33174. return 2 === a ? (o = h[e.charCodeAt(t)] << 2 | h[e.charCodeAt(t + 1)] >> 4,
  33175. s[c++] = 255 & o) : 1 === a && (o = h[e.charCodeAt(t)] << 10 | h[e.charCodeAt(t + 1)] << 4 | h[e.charCodeAt(t + 2)] >> 2,
  33176. s[c++] = o >> 8 & 255,
  33177. s[c++] = 255 & o),
  33178. s
  33179. }
  33180. function a(e) {
  33181. return c[e >> 18 & 63] + c[e >> 12 & 63] + c[e >> 6 & 63] + c[63 & e]
  33182. }
  33183. function s(e, t, i) {
  33184. for (var n, r = [], o = t; o < i; o += 3)
  33185. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  33186. r.push(a(n));
  33187. return r.join("")
  33188. }
  33189. function l(e) {
  33190. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 16383, l = 0, h = i - n; l < h; l += a)
  33191. o.push(s(e, l, l + a > h ? h : l + a));
  33192. return 1 === n ? (t = e[i - 1],
  33193. r += c[t >> 2],
  33194. r += c[t << 4 & 63],
  33195. r += "==") : 2 === n && (t = (e[i - 2] << 8) + e[i - 1],
  33196. r += c[t >> 10],
  33197. r += c[t >> 4 & 63],
  33198. r += c[t << 2 & 63],
  33199. r += "="),
  33200. o.push(r),
  33201. o.join("")
  33202. }
  33203. i.byteLength = r,
  33204. i.toByteArray = o,
  33205. i.fromByteArray = l;
  33206. for (var c = [], h = [], u = "undefined" != typeof Uint8Array ? Uint8Array : Array, d = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", p = 0, f = d.length; p < f; ++p)
  33207. c[p] = d[p],
  33208. h[d.charCodeAt(p)] = p;
  33209. h["-".charCodeAt(0)] = 62,
  33210. h["_".charCodeAt(0)] = 63
  33211. }
  33212. , {}],
  33213. 200: [function(e, t, i) {
  33214. i.read = function(e, t, i, n, r) {
  33215. 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];
  33216. for (u += d,
  33217. o = p & (1 << -h) - 1,
  33218. p >>= -h,
  33219. h += s; h > 0; o = 256 * o + e[t + u],
  33220. u += d,
  33221. h -= 8)
  33222. ;
  33223. for (a = o & (1 << -h) - 1,
  33224. o >>= -h,
  33225. h += n; h > 0; a = 256 * a + e[t + u],
  33226. u += d,
  33227. h -= 8)
  33228. ;
  33229. if (0 === o)
  33230. o = 1 - c;
  33231. else {
  33232. if (o === l)
  33233. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  33234. a += Math.pow(2, n),
  33235. o -= c
  33236. }
  33237. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  33238. }
  33239. ,
  33240. i.write = function(e, t, i, n, r, o) {
  33241. 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;
  33242. for (t = Math.abs(t),
  33243. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  33244. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  33245. t * (l = Math.pow(2, -a)) < 1 && (a--,
  33246. l *= 2),
  33247. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  33248. t * l >= 2 && (a++,
  33249. l /= 2),
  33250. a + u >= h ? (s = 0,
  33251. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  33252. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  33253. a = 0)); r >= 8; e[i + p] = 255 & s,
  33254. p += f,
  33255. s /= 256,
  33256. r -= 8)
  33257. ;
  33258. for (a = a << r | s,
  33259. c += r; c > 0; e[i + p] = 255 & a,
  33260. p += f,
  33261. a /= 256,
  33262. c -= 8)
  33263. ;
  33264. e[i + p - f] |= 128 * g
  33265. }
  33266. }
  33267. , {}],
  33268. 201: [function(e, t, i) {
  33269. var n = {}.toString;
  33270. t.exports = Array.isArray || function(e) {
  33271. return "[object Array]" == n.call(e)
  33272. }
  33273. }
  33274. , {}],
  33275. 202: [function(e, t, i) {
  33276. function n() {
  33277. this._events = this._events || {},
  33278. this._maxListeners = this._maxListeners || void 0
  33279. }
  33280. function r(e) {
  33281. return "function" == typeof e
  33282. }
  33283. function o(e) {
  33284. return "number" == typeof e
  33285. }
  33286. function a(e) {
  33287. return "object" == typeof e && null !== e
  33288. }
  33289. function s(e) {
  33290. return void 0 === e
  33291. }
  33292. t.exports = n,
  33293. n.EventEmitter = n,
  33294. n.prototype._events = void 0,
  33295. n.prototype._maxListeners = void 0,
  33296. n.defaultMaxListeners = 10,
  33297. n.prototype.setMaxListeners = function(e) {
  33298. if (!o(e) || e < 0 || isNaN(e))
  33299. throw TypeError("n must be a positive number");
  33300. return this._maxListeners = e,
  33301. this
  33302. }
  33303. ,
  33304. n.prototype.emit = function(e) {
  33305. var t, i, n, o, l, c;
  33306. if (this._events || (this._events = {}),
  33307. "error" === e && (!this._events.error || a(this._events.error) && !this._events.error.length)) {
  33308. if (t = arguments[1],
  33309. t instanceof Error)
  33310. throw t;
  33311. var h = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  33312. throw h.context = t,
  33313. h
  33314. }
  33315. if (i = this._events[e],
  33316. s(i))
  33317. return !1;
  33318. if (r(i))
  33319. switch (arguments.length) {
  33320. case 1:
  33321. i.call(this);
  33322. break;
  33323. case 2:
  33324. i.call(this, arguments[1]);
  33325. break;
  33326. case 3:
  33327. i.call(this, arguments[1], arguments[2]);
  33328. break;
  33329. default:
  33330. o = Array.prototype.slice.call(arguments, 1),
  33331. i.apply(this, o)
  33332. }
  33333. else if (a(i))
  33334. for (o = Array.prototype.slice.call(arguments, 1),
  33335. c = i.slice(),
  33336. n = c.length,
  33337. l = 0; l < n; l++)
  33338. c[l].apply(this, o);
  33339. return !0
  33340. }
  33341. ,
  33342. n.prototype.addListener = function(e, t) {
  33343. var i;
  33344. if (!r(t))
  33345. throw TypeError("listener must be a function");
  33346. return this._events || (this._events = {}),
  33347. this._events.newListener && this.emit("newListener", e, r(t.listener) ? t.listener : t),
  33348. this._events[e] ? a(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  33349. a(this._events[e]) && !this._events[e].warned && (i = s(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners,
  33350. i && i > 0 && this._events[e].length > i && (this._events[e].warned = !0,
  33351. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  33352. "function" == typeof console.trace && console.trace())),
  33353. this
  33354. }
  33355. ,
  33356. n.prototype.on = n.prototype.addListener,
  33357. n.prototype.once = function(e, t) {
  33358. function i() {
  33359. this.removeListener(e, i),
  33360. n || (n = !0,
  33361. t.apply(this, arguments))
  33362. }
  33363. if (!r(t))
  33364. throw TypeError("listener must be a function");
  33365. var n = !1;
  33366. return i.listener = t,
  33367. this.on(e, i),
  33368. this
  33369. }
  33370. ,
  33371. n.prototype.removeListener = function(e, t) {
  33372. var i, n, o, s;
  33373. if (!r(t))
  33374. throw TypeError("listener must be a function");
  33375. if (!this._events || !this._events[e])
  33376. return this;
  33377. if (i = this._events[e],
  33378. o = i.length,
  33379. n = -1,
  33380. i === t || r(i.listener) && i.listener === t)
  33381. delete this._events[e],
  33382. this._events.removeListener && this.emit("removeListener", e, t);
  33383. else if (a(i)) {
  33384. for (s = o; s-- > 0; )
  33385. if (i[s] === t || i[s].listener && i[s].listener === t) {
  33386. n = s;
  33387. break
  33388. }
  33389. if (n < 0)
  33390. return this;
  33391. 1 === i.length ? (i.length = 0,
  33392. delete this._events[e]) : i.splice(n, 1),
  33393. this._events.removeListener && this.emit("removeListener", e, t)
  33394. }
  33395. return this
  33396. }
  33397. ,
  33398. n.prototype.removeAllListeners = function(e) {
  33399. var t, i;
  33400. if (!this._events)
  33401. return this;
  33402. if (!this._events.removeListener)
  33403. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  33404. this;
  33405. if (0 === arguments.length) {
  33406. for (t in this._events)
  33407. "removeListener" !== t && this.removeAllListeners(t);
  33408. return this.removeAllListeners("removeListener"),
  33409. this._events = {},
  33410. this
  33411. }
  33412. if (i = this._events[e],
  33413. r(i))
  33414. this.removeListener(e, i);
  33415. else if (i)
  33416. for (; i.length; )
  33417. this.removeListener(e, i[i.length - 1]);
  33418. return delete this._events[e],
  33419. this
  33420. }
  33421. ,
  33422. n.prototype.listeners = function(e) {
  33423. var t;
  33424. return t = this._events && this._events[e] ? r(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  33425. }
  33426. ,
  33427. n.prototype.listenerCount = function(e) {
  33428. if (this._events) {
  33429. var t = this._events[e];
  33430. if (r(t))
  33431. return 1;
  33432. if (t)
  33433. return t.length
  33434. }
  33435. return 0
  33436. }
  33437. ,
  33438. n.listenerCount = function(e, t) {
  33439. return e.listenerCount(t)
  33440. }
  33441. }
  33442. , {}],
  33443. 203: [function(e, t, i) {
  33444. function n() {
  33445. throw new Error("setTimeout has not been defined")
  33446. }
  33447. function r() {
  33448. throw new Error("clearTimeout has not been defined")
  33449. }
  33450. function o(e) {
  33451. if (u === setTimeout)
  33452. return setTimeout(e, 0);
  33453. if ((u === n || !u) && setTimeout)
  33454. return u = setTimeout,
  33455. setTimeout(e, 0);
  33456. try {
  33457. return u(e, 0)
  33458. } catch (t) {
  33459. try {
  33460. return u.call(null, e, 0)
  33461. } catch (t) {
  33462. return u.call(this, e, 0)
  33463. }
  33464. }
  33465. }
  33466. function a(e) {
  33467. if (d === clearTimeout)
  33468. return clearTimeout(e);
  33469. if ((d === r || !d) && clearTimeout)
  33470. return d = clearTimeout,
  33471. clearTimeout(e);
  33472. try {
  33473. return d(e)
  33474. } catch (t) {
  33475. try {
  33476. return d.call(null, e)
  33477. } catch (t) {
  33478. return d.call(this, e)
  33479. }
  33480. }
  33481. }
  33482. function s() {
  33483. m && f && (m = !1,
  33484. f.length ? g = f.concat(g) : v = -1,
  33485. g.length && l())
  33486. }
  33487. function l() {
  33488. if (!m) {
  33489. var e = o(s);
  33490. m = !0;
  33491. for (var t = g.length; t; ) {
  33492. for (f = g,
  33493. g = []; ++v < t; )
  33494. f && f[v].run();
  33495. v = -1,
  33496. t = g.length
  33497. }
  33498. f = null,
  33499. m = !1,
  33500. a(e)
  33501. }
  33502. }
  33503. function c(e, t) {
  33504. this.fun = e,
  33505. this.array = t
  33506. }
  33507. function h() {}
  33508. var u, d, p = t.exports = {};
  33509. !function() {
  33510. try {
  33511. u = "function" == typeof setTimeout ? setTimeout : n
  33512. } catch (e) {
  33513. u = n
  33514. }
  33515. try {
  33516. d = "function" == typeof clearTimeout ? clearTimeout : r
  33517. } catch (e) {
  33518. d = r
  33519. }
  33520. }();
  33521. var f, g = [], m = !1, v = -1;
  33522. p.nextTick = function(e) {
  33523. var t = new Array(arguments.length - 1);
  33524. if (arguments.length > 1)
  33525. for (var i = 1; i < arguments.length; i++)
  33526. t[i - 1] = arguments[i];
  33527. g.push(new c(e,t)),
  33528. 1 !== g.length || m || o(l)
  33529. }
  33530. ,
  33531. c.prototype.run = function() {
  33532. this.fun.apply(null, this.array)
  33533. }
  33534. ,
  33535. p.title = "browser",
  33536. p.browser = !0,
  33537. p.env = {},
  33538. p.argv = [],
  33539. p.version = "",
  33540. p.versions = {},
  33541. p.on = h,
  33542. p.addListener = h,
  33543. p.once = h,
  33544. p.off = h,
  33545. p.removeListener = h,
  33546. p.removeAllListeners = h,
  33547. p.emit = h,
  33548. p.binding = function(e) {
  33549. throw new Error("process.binding is not supported")
  33550. }
  33551. ,
  33552. p.cwd = function() {
  33553. return "/"
  33554. }
  33555. ,
  33556. p.chdir = function(e) {
  33557. throw new Error("process.chdir is not supported")
  33558. }
  33559. ,
  33560. p.umask = function() {
  33561. return 0
  33562. }
  33563. }
  33564. , {}],
  33565. 204: [function(e, t, i) {
  33566. (function(e) {
  33567. !function(n) {
  33568. function r(e) {
  33569. throw new RangeError(L[e])
  33570. }
  33571. function o(e, t) {
  33572. for (var i = e.length, n = []; i--; )
  33573. n[i] = t(e[i]);
  33574. return n
  33575. }
  33576. function a(e, t) {
  33577. var i = e.split("@")
  33578. , n = "";
  33579. i.length > 1 && (n = i[0] + "@",
  33580. e = i[1]),
  33581. e = e.replace(O, ".");
  33582. var r = e.split(".")
  33583. , a = o(r, t).join(".");
  33584. return n + a
  33585. }
  33586. function s(e) {
  33587. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  33588. t = e.charCodeAt(r++),
  33589. t >= 55296 && t <= 56319 && r < o ? (i = e.charCodeAt(r++),
  33590. 56320 == (64512 & i) ? n.push(((1023 & t) << 10) + (1023 & i) + 65536) : (n.push(t),
  33591. r--)) : n.push(t);
  33592. return n
  33593. }
  33594. function l(e) {
  33595. return o(e, function(e) {
  33596. var t = "";
  33597. return e > 65535 && (e -= 65536,
  33598. t += B(e >>> 10 & 1023 | 55296),
  33599. e = 56320 | 1023 & e),
  33600. t += B(e)
  33601. }).join("")
  33602. }
  33603. function c(e) {
  33604. return e - 48 < 10 ? e - 22 : e - 65 < 26 ? e - 65 : e - 97 < 26 ? e - 97 : E
  33605. }
  33606. function h(e, t) {
  33607. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  33608. }
  33609. function u(e, t, i) {
  33610. var n = 0;
  33611. for (e = i ? N(e / T) : e >> 1,
  33612. e += N(e / t); e > D * w >> 1; n += E)
  33613. e = N(e / D);
  33614. return N(n + (D + 1) * e / (e + _))
  33615. }
  33616. function d(e) {
  33617. var t, i, n, o, a, s, h, d, p, f, g = [], m = e.length, v = 0, A = S, y = x;
  33618. for (i = e.lastIndexOf(M),
  33619. i < 0 && (i = 0),
  33620. n = 0; n < i; ++n)
  33621. e.charCodeAt(n) >= 128 && r("not-basic"),
  33622. g.push(e.charCodeAt(n));
  33623. for (o = i > 0 ? i + 1 : 0; o < m; ) {
  33624. for (a = v,
  33625. s = 1,
  33626. h = E; o >= m && r("invalid-input"),
  33627. d = c(e.charCodeAt(o++)),
  33628. (d >= E || d > N((I - v) / s)) && r("overflow"),
  33629. v += d * s,
  33630. p = h <= y ? b : h >= y + w ? w : h - y,
  33631. !(d < p); h += E)
  33632. f = E - p,
  33633. s > N(I / f) && r("overflow"),
  33634. s *= f;
  33635. t = g.length + 1,
  33636. y = u(v - a, t, 0 == a),
  33637. N(v / t) > I - A && r("overflow"),
  33638. A += N(v / t),
  33639. v %= t,
  33640. g.splice(v++, 0, A)
  33641. }
  33642. return l(g)
  33643. }
  33644. function p(e) {
  33645. var t, i, n, o, a, l, c, d, p, f, g, m, v, A, y, C = [];
  33646. for (e = s(e),
  33647. m = e.length,
  33648. t = S,
  33649. i = 0,
  33650. a = x,
  33651. l = 0; l < m; ++l)
  33652. g = e[l],
  33653. g < 128 && C.push(B(g));
  33654. for (n = o = C.length,
  33655. o && C.push(M); n < m; ) {
  33656. for (c = I,
  33657. l = 0; l < m; ++l)
  33658. g = e[l],
  33659. g >= t && g < c && (c = g);
  33660. for (v = n + 1,
  33661. c - t > N((I - i) / v) && r("overflow"),
  33662. i += (c - t) * v,
  33663. t = c,
  33664. l = 0; l < m; ++l)
  33665. if (g = e[l],
  33666. g < t && ++i > I && r("overflow"),
  33667. g == t) {
  33668. for (d = i,
  33669. p = E; f = p <= a ? b : p >= a + w ? w : p - a,
  33670. !(d < f); p += E)
  33671. y = d - f,
  33672. A = E - f,
  33673. C.push(B(h(f + y % A, 0))),
  33674. d = N(y / A);
  33675. C.push(B(h(d, 0))),
  33676. a = u(i, v, n == o),
  33677. i = 0,
  33678. ++n
  33679. }
  33680. ++i,
  33681. ++t
  33682. }
  33683. return C.join("")
  33684. }
  33685. function f(e) {
  33686. return a(e, function(e) {
  33687. return R.test(e) ? d(e.slice(4).toLowerCase()) : e
  33688. })
  33689. }
  33690. function g(e) {
  33691. return a(e, function(e) {
  33692. return P.test(e) ? "xn--" + p(e) : e
  33693. })
  33694. }
  33695. var m = "object" == typeof i && i && !i.nodeType && i
  33696. , v = "object" == typeof t && t && !t.nodeType && t
  33697. , A = "object" == typeof e && e;
  33698. A.global !== A && A.window !== A && A.self !== A || (n = A);
  33699. 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 = {
  33700. overflow: "Overflow: input needs wider integers to process",
  33701. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  33702. "invalid-input": "Invalid input"
  33703. }, D = E - b, N = Math.floor, B = String.fromCharCode;
  33704. if (y = {
  33705. version: "1.4.1",
  33706. ucs2: {
  33707. decode: s,
  33708. encode: l
  33709. },
  33710. decode: d,
  33711. encode: p,
  33712. toASCII: g,
  33713. toUnicode: f
  33714. },
  33715. "function" == typeof define && "object" == typeof define.amd && define.amd)
  33716. define("punycode", function() {
  33717. return y
  33718. });
  33719. else if (m && v)
  33720. if (t.exports == m)
  33721. v.exports = y;
  33722. else
  33723. for (C in y)
  33724. y.hasOwnProperty(C) && (m[C] = y[C]);
  33725. else
  33726. n.punycode = y
  33727. }(this)
  33728. }
  33729. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  33730. }
  33731. , {}],
  33732. 205: [function(e, t, i) {
  33733. "use strict";
  33734. function n(e, t) {
  33735. return Object.prototype.hasOwnProperty.call(e, t)
  33736. }
  33737. t.exports = function(e, t, i, o) {
  33738. t = t || "&",
  33739. i = i || "=";
  33740. var a = {};
  33741. if ("string" != typeof e || 0 === e.length)
  33742. return a;
  33743. var s = /\+/g;
  33744. e = e.split(t);
  33745. var l = 1e3;
  33746. o && "number" == typeof o.maxKeys && (l = o.maxKeys);
  33747. var c = e.length;
  33748. l > 0 && c > l && (c = l);
  33749. for (var h = 0; h < c; ++h) {
  33750. var u, d, p, f, g = e[h].replace(s, "%20"), m = g.indexOf(i);
  33751. m >= 0 ? (u = g.substr(0, m),
  33752. d = g.substr(m + 1)) : (u = g,
  33753. d = ""),
  33754. p = decodeURIComponent(u),
  33755. f = decodeURIComponent(d),
  33756. n(a, p) ? r(a[p]) ? a[p].push(f) : a[p] = [a[p], f] : a[p] = f
  33757. }
  33758. return a
  33759. }
  33760. ;
  33761. var r = Array.isArray || function(e) {
  33762. return "[object Array]" === Object.prototype.toString.call(e)
  33763. }
  33764. }
  33765. , {}],
  33766. 206: [function(e, t, i) {
  33767. "use strict";
  33768. function n(e, t) {
  33769. if (e.map)
  33770. return e.map(t);
  33771. for (var i = [], n = 0; n < e.length; n++)
  33772. i.push(t(e[n], n));
  33773. return i
  33774. }
  33775. var r = function(e) {
  33776. switch (typeof e) {
  33777. case "string":
  33778. return e;
  33779. case "boolean":
  33780. return e ? "true" : "false";
  33781. case "number":
  33782. return isFinite(e) ? e : "";
  33783. default:
  33784. return ""
  33785. }
  33786. };
  33787. t.exports = function(e, t, i, s) {
  33788. return t = t || "&",
  33789. i = i || "=",
  33790. null === e && (e = void 0),
  33791. "object" == typeof e ? n(a(e), function(a) {
  33792. var s = encodeURIComponent(r(a)) + i;
  33793. return o(e[a]) ? n(e[a], function(e) {
  33794. return s + encodeURIComponent(r(e))
  33795. }).join(t) : s + encodeURIComponent(r(e[a]))
  33796. }).join(t) : s ? encodeURIComponent(r(s)) + i + encodeURIComponent(r(e)) : ""
  33797. }
  33798. ;
  33799. var o = Array.isArray || function(e) {
  33800. return "[object Array]" === Object.prototype.toString.call(e)
  33801. }
  33802. , a = Object.keys || function(e) {
  33803. var t = [];
  33804. for (var i in e)
  33805. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  33806. return t
  33807. }
  33808. }
  33809. , {}],
  33810. 207: [function(e, t, i) {
  33811. "use strict";
  33812. i.decode = i.parse = e("./decode"),
  33813. i.encode = i.stringify = e("./encode")
  33814. }
  33815. , {
  33816. "./decode": 205,
  33817. "./encode": 206
  33818. }],
  33819. 208: [function(e, t, i) {
  33820. "use strict";
  33821. function n() {
  33822. this.protocol = null,
  33823. this.slashes = null,
  33824. this.auth = null,
  33825. this.host = null,
  33826. this.port = null,
  33827. this.hostname = null,
  33828. this.hash = null,
  33829. this.search = null,
  33830. this.query = null,
  33831. this.pathname = null,
  33832. this.path = null,
  33833. this.href = null
  33834. }
  33835. function r(e, t, i) {
  33836. if (e && c.isObject(e) && e instanceof n)
  33837. return e;
  33838. var r = new n;
  33839. return r.parse(e, t, i),
  33840. r
  33841. }
  33842. function o(e) {
  33843. return c.isString(e) && (e = r(e)),
  33844. e instanceof n ? e.format() : n.prototype.format.call(e)
  33845. }
  33846. function a(e, t) {
  33847. return r(e, !1, !0).resolve(t)
  33848. }
  33849. function s(e, t) {
  33850. return e ? r(e, !1, !0).resolveObject(t) : t
  33851. }
  33852. var l = e("punycode")
  33853. , c = e("./util");
  33854. i.parse = r,
  33855. i.resolve = a,
  33856. i.resolveObject = s,
  33857. i.format = o,
  33858. i.Url = n;
  33859. var h = /^([a-z0-9.+-]+:)/i
  33860. , u = /:[0-9]*$/
  33861. , d = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  33862. , p = ["<", ">", '"', "`", " ", "\r", "\n", "\t"]
  33863. , f = ["{", "}", "|", "\\", "^", "`"].concat(p)
  33864. , g = ["'"].concat(f)
  33865. , m = ["%", "/", "?", ";", "#"].concat(g)
  33866. , v = ["/", "?", "#"]
  33867. , A = 255
  33868. , y = /^[+a-z0-9A-Z_-]{0,63}$/
  33869. , C = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  33870. , I = {
  33871. javascript: !0,
  33872. "javascript:": !0
  33873. }
  33874. , E = {
  33875. javascript: !0,
  33876. "javascript:": !0
  33877. }
  33878. , b = {
  33879. http: !0,
  33880. https: !0,
  33881. ftp: !0,
  33882. gopher: !0,
  33883. file: !0,
  33884. "http:": !0,
  33885. "https:": !0,
  33886. "ftp:": !0,
  33887. "gopher:": !0,
  33888. "file:": !0
  33889. }
  33890. , w = e("querystring");
  33891. n.prototype.parse = function(e, t, i) {
  33892. if (!c.isString(e))
  33893. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  33894. var n = e.indexOf("?")
  33895. , r = n !== -1 && n < e.indexOf("#") ? "?" : "#"
  33896. , o = e.split(r)
  33897. , a = /\\/g;
  33898. o[0] = o[0].replace(a, "/"),
  33899. e = o.join(r);
  33900. var s = e;
  33901. if (s = s.trim(),
  33902. !i && 1 === e.split("#").length) {
  33903. var u = d.exec(s);
  33904. if (u)
  33905. return this.path = s,
  33906. this.href = s,
  33907. this.pathname = u[1],
  33908. u[2] ? (this.search = u[2],
  33909. t ? this.query = w.parse(this.search.substr(1)) : this.query = this.search.substr(1)) : t && (this.search = "",
  33910. this.query = {}),
  33911. this
  33912. }
  33913. var p = h.exec(s);
  33914. if (p) {
  33915. p = p[0];
  33916. var f = p.toLowerCase();
  33917. this.protocol = f,
  33918. s = s.substr(p.length)
  33919. }
  33920. if (i || p || s.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  33921. var _ = "//" === s.substr(0, 2);
  33922. !_ || p && E[p] || (s = s.substr(2),
  33923. this.slashes = !0)
  33924. }
  33925. if (!E[p] && (_ || p && !b[p])) {
  33926. for (var T = -1, x = 0; x < v.length; x++) {
  33927. var S = s.indexOf(v[x]);
  33928. S !== -1 && (T === -1 || S < T) && (T = S)
  33929. }
  33930. var M, R;
  33931. R = T === -1 ? s.lastIndexOf("@") : s.lastIndexOf("@", T),
  33932. R !== -1 && (M = s.slice(0, R),
  33933. s = s.slice(R + 1),
  33934. this.auth = decodeURIComponent(M)),
  33935. T = -1;
  33936. for (var x = 0; x < m.length; x++) {
  33937. var S = s.indexOf(m[x]);
  33938. S !== -1 && (T === -1 || S < T) && (T = S)
  33939. }
  33940. T === -1 && (T = s.length),
  33941. this.host = s.slice(0, T),
  33942. s = s.slice(T),
  33943. this.parseHost(),
  33944. this.hostname = this.hostname || "";
  33945. var P = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  33946. if (!P)
  33947. for (var O = this.hostname.split(/\./), x = 0, L = O.length; x < L; x++) {
  33948. var D = O[x];
  33949. if (D && !D.match(y)) {
  33950. for (var N = "", B = 0, F = D.length; B < F; B++)
  33951. N += D.charCodeAt(B) > 127 ? "x" : D[B];
  33952. if (!N.match(y)) {
  33953. var V = O.slice(0, x)
  33954. , U = O.slice(x + 1)
  33955. , k = D.match(C);
  33956. k && (V.push(k[1]),
  33957. U.unshift(k[2])),
  33958. U.length && (s = "/" + U.join(".") + s),
  33959. this.hostname = V.join(".");
  33960. break
  33961. }
  33962. }
  33963. }
  33964. this.hostname.length > A ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  33965. P || (this.hostname = l.toASCII(this.hostname));
  33966. var H = this.port ? ":" + this.port : ""
  33967. , G = this.hostname || "";
  33968. this.host = G + H,
  33969. this.href += this.host,
  33970. P && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  33971. "/" !== s[0] && (s = "/" + s))
  33972. }
  33973. if (!I[f])
  33974. for (var x = 0, L = g.length; x < L; x++) {
  33975. var z = g[x];
  33976. if (s.indexOf(z) !== -1) {
  33977. var W = encodeURIComponent(z);
  33978. W === z && (W = escape(z)),
  33979. s = s.split(z).join(W)
  33980. }
  33981. }
  33982. var j = s.indexOf("#");
  33983. j !== -1 && (this.hash = s.substr(j),
  33984. s = s.slice(0, j));
  33985. var Y = s.indexOf("?");
  33986. if (Y !== -1 ? (this.search = s.substr(Y),
  33987. this.query = s.substr(Y + 1),
  33988. t && (this.query = w.parse(this.query)),
  33989. s = s.slice(0, Y)) : t && (this.search = "",
  33990. this.query = {}),
  33991. s && (this.pathname = s),
  33992. b[f] && this.hostname && !this.pathname && (this.pathname = "/"),
  33993. this.pathname || this.search) {
  33994. var H = this.pathname || ""
  33995. , X = this.search || "";
  33996. this.path = H + X
  33997. }
  33998. return this.href = this.format(),
  33999. this
  34000. }
  34001. ,
  34002. n.prototype.format = function() {
  34003. var e = this.auth || "";
  34004. e && (e = encodeURIComponent(e),
  34005. e = e.replace(/%3A/i, ":"),
  34006. e += "@");
  34007. var t = this.protocol || ""
  34008. , i = this.pathname || ""
  34009. , n = this.hash || ""
  34010. , r = !1
  34011. , o = "";
  34012. this.host ? r = e + this.host : this.hostname && (r = e + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]"),
  34013. this.port && (r += ":" + this.port)),
  34014. this.query && c.isObject(this.query) && Object.keys(this.query).length && (o = w.stringify(this.query));
  34015. var a = this.search || o && "?" + o || "";
  34016. return t && ":" !== t.substr(-1) && (t += ":"),
  34017. this.slashes || (!t || b[t]) && r !== !1 ? (r = "//" + (r || ""),
  34018. i && "/" !== i.charAt(0) && (i = "/" + i)) : r || (r = ""),
  34019. n && "#" !== n.charAt(0) && (n = "#" + n),
  34020. a && "?" !== a.charAt(0) && (a = "?" + a),
  34021. i = i.replace(/[?#]/g, function(e) {
  34022. return encodeURIComponent(e)
  34023. }),
  34024. a = a.replace("#", "%23"),
  34025. t + r + i + a + n
  34026. }
  34027. ,
  34028. n.prototype.resolve = function(e) {
  34029. return this.resolveObject(r(e, !1, !0)).format()
  34030. }
  34031. ,
  34032. n.prototype.resolveObject = function(e) {
  34033. if (c.isString(e)) {
  34034. var t = new n;
  34035. t.parse(e, !1, !0),
  34036. e = t
  34037. }
  34038. for (var i = new n, r = Object.keys(this), o = 0; o < r.length; o++) {
  34039. var a = r[o];
  34040. i[a] = this[a]
  34041. }
  34042. if (i.hash = e.hash,
  34043. "" === e.href)
  34044. return i.href = i.format(),
  34045. i;
  34046. if (e.slashes && !e.protocol) {
  34047. for (var s = Object.keys(e), l = 0; l < s.length; l++) {
  34048. var h = s[l];
  34049. "protocol" !== h && (i[h] = e[h])
  34050. }
  34051. return b[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  34052. i.href = i.format(),
  34053. i
  34054. }
  34055. if (e.protocol && e.protocol !== i.protocol) {
  34056. if (!b[e.protocol]) {
  34057. for (var u = Object.keys(e), d = 0; d < u.length; d++) {
  34058. var p = u[d];
  34059. i[p] = e[p]
  34060. }
  34061. return i.href = i.format(),
  34062. i
  34063. }
  34064. if (i.protocol = e.protocol,
  34065. e.host || E[e.protocol])
  34066. i.pathname = e.pathname;
  34067. else {
  34068. for (var f = (e.pathname || "").split("/"); f.length && !(e.host = f.shift()); )
  34069. ;
  34070. e.host || (e.host = ""),
  34071. e.hostname || (e.hostname = ""),
  34072. "" !== f[0] && f.unshift(""),
  34073. f.length < 2 && f.unshift(""),
  34074. i.pathname = f.join("/")
  34075. }
  34076. if (i.search = e.search,
  34077. i.query = e.query,
  34078. i.host = e.host || "",
  34079. i.auth = e.auth,
  34080. i.hostname = e.hostname || e.host,
  34081. i.port = e.port,
  34082. i.pathname || i.search) {
  34083. var g = i.pathname || ""
  34084. , m = i.search || "";
  34085. i.path = g + m
  34086. }
  34087. return i.slashes = i.slashes || e.slashes,
  34088. i.href = i.format(),
  34089. i
  34090. }
  34091. var v = i.pathname && "/" === i.pathname.charAt(0)
  34092. , A = e.host || e.pathname && "/" === e.pathname.charAt(0)
  34093. , y = A || v || i.host && e.pathname
  34094. , C = y
  34095. , I = i.pathname && i.pathname.split("/") || []
  34096. , f = e.pathname && e.pathname.split("/") || []
  34097. , w = i.protocol && !b[i.protocol];
  34098. if (w && (i.hostname = "",
  34099. i.port = null,
  34100. i.host && ("" === I[0] ? I[0] = i.host : I.unshift(i.host)),
  34101. i.host = "",
  34102. e.protocol && (e.hostname = null,
  34103. e.port = null,
  34104. e.host && ("" === f[0] ? f[0] = e.host : f.unshift(e.host)),
  34105. e.host = null),
  34106. y = y && ("" === f[0] || "" === I[0])),
  34107. A)
  34108. i.host = e.host || "" === e.host ? e.host : i.host,
  34109. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  34110. i.search = e.search,
  34111. i.query = e.query,
  34112. I = f;
  34113. else if (f.length)
  34114. I || (I = []),
  34115. I.pop(),
  34116. I = I.concat(f),
  34117. i.search = e.search,
  34118. i.query = e.query;
  34119. else if (!c.isNullOrUndefined(e.search)) {
  34120. if (w) {
  34121. i.hostname = i.host = I.shift();
  34122. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  34123. _ && (i.auth = _.shift(),
  34124. i.host = i.hostname = _.shift())
  34125. }
  34126. return i.search = e.search,
  34127. i.query = e.query,
  34128. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  34129. i.href = i.format(),
  34130. i
  34131. }
  34132. if (!I.length)
  34133. return i.pathname = null,
  34134. i.search ? i.path = "/" + i.search : i.path = null,
  34135. i.href = i.format(),
  34136. i;
  34137. 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--)
  34138. T = I[M],
  34139. "." === T ? I.splice(M, 1) : ".." === T ? (I.splice(M, 1),
  34140. S++) : S && (I.splice(M, 1),
  34141. S--);
  34142. if (!y && !C)
  34143. for (; S--; S)
  34144. I.unshift("..");
  34145. !y || "" === I[0] || I[0] && "/" === I[0].charAt(0) || I.unshift(""),
  34146. x && "/" !== I.join("/").substr(-1) && I.push("");
  34147. var R = "" === I[0] || I[0] && "/" === I[0].charAt(0);
  34148. if (w) {
  34149. i.hostname = i.host = R ? "" : I.length ? I.shift() : "";
  34150. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  34151. _ && (i.auth = _.shift(),
  34152. i.host = i.hostname = _.shift())
  34153. }
  34154. return y = y || i.host && I.length,
  34155. y && !R && I.unshift(""),
  34156. I.length ? i.pathname = I.join("/") : (i.pathname = null,
  34157. i.path = null),
  34158. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  34159. i.auth = e.auth || i.auth,
  34160. i.slashes = i.slashes || e.slashes,
  34161. i.href = i.format(),
  34162. i
  34163. }
  34164. ,
  34165. n.prototype.parseHost = function() {
  34166. var e = this.host
  34167. , t = u.exec(e);
  34168. t && (t = t[0],
  34169. ":" !== t && (this.port = t.substr(1)),
  34170. e = e.substr(0, e.length - t.length)),
  34171. e && (this.hostname = e)
  34172. }
  34173. }
  34174. , {
  34175. "./util": 209,
  34176. punycode: 204,
  34177. querystring: 207
  34178. }],
  34179. 209: [function(e, t, i) {
  34180. "use strict";
  34181. t.exports = {
  34182. isString: function(e) {
  34183. return "string" == typeof e
  34184. },
  34185. isObject: function(e) {
  34186. return "object" == typeof e && null !== e
  34187. },
  34188. isNull: function(e) {
  34189. return null === e
  34190. },
  34191. isNullOrUndefined: function(e) {
  34192. return null == e
  34193. }
  34194. }
  34195. }
  34196. , {}],
  34197. 210: [function(e, t, i) {
  34198. "use strict";
  34199. function n(e) {
  34200. return l + e
  34201. }
  34202. function r(e) {
  34203. return e.substring(l.length)
  34204. }
  34205. function o(e, t) {
  34206. for (var i in t)
  34207. Object.defineProperty(e, i, {
  34208. value: t[i],
  34209. configurable: !0,
  34210. writable: !0
  34211. })
  34212. }
  34213. function a(e) {
  34214. if ("string" != typeof e)
  34215. throw new TypeError("key must be a string.")
  34216. }
  34217. var s = Object.prototype.hasOwnProperty
  34218. , l = "~";
  34219. t.exports = function(e) {
  34220. var t = Object.create(null)
  34221. , i = 0
  34222. , l = {};
  34223. return o(l, {
  34224. get: function(e, i) {
  34225. a(e);
  34226. var r = n(e);
  34227. return r in t ? t[r] : i
  34228. },
  34229. set: function(e, r) {
  34230. a(e);
  34231. var o = n(e);
  34232. return o in t || ++i,
  34233. t[o] = r
  34234. },
  34235. has: function(e) {
  34236. return a(e),
  34237. n(e)in t
  34238. },
  34239. delete: function(e) {
  34240. a(e);
  34241. var r = n(e);
  34242. return r in t && (--i,
  34243. delete t[r],
  34244. !0)
  34245. },
  34246. clear: function() {
  34247. t = Object.create(null),
  34248. i = 0
  34249. },
  34250. forEach: function(e, i) {
  34251. if ("function" != typeof e)
  34252. throw new TypeError("`callback` must be a function");
  34253. for (var n in t)
  34254. if (s.call(t, n)) {
  34255. var o = r(n)
  34256. , a = t[n];
  34257. e.call(i, a, o, l)
  34258. }
  34259. }
  34260. }),
  34261. Object.defineProperty(l, "size", {
  34262. get: function() {
  34263. return i
  34264. },
  34265. configurable: !0
  34266. }),
  34267. "object" == typeof e && null !== e && Object.keys(e).forEach(function(t) {
  34268. l.set(t, e[t])
  34269. }),
  34270. l
  34271. }
  34272. }
  34273. , {}],
  34274. 211: [function(e, t, i) {
  34275. t.exports = e("./lib/heap")
  34276. }
  34277. , {
  34278. "./lib/heap": 212
  34279. }],
  34280. 212: [function(e, t, i) {
  34281. (function() {
  34282. var e, n, r, o, a, s, l, c, h, u, d, p, f, g, m;
  34283. r = Math.floor,
  34284. u = Math.min,
  34285. n = function(e, t) {
  34286. return e < t ? -1 : e > t ? 1 : 0
  34287. }
  34288. ,
  34289. h = function(e, t, i, o, a) {
  34290. var s;
  34291. if (null == i && (i = 0),
  34292. null == a && (a = n),
  34293. i < 0)
  34294. throw new Error("lo must be non-negative");
  34295. for (null == o && (o = e.length); i < o; )
  34296. s = r((i + o) / 2),
  34297. a(t, e[s]) < 0 ? o = s : i = s + 1;
  34298. return [].splice.apply(e, [i, i - i].concat(t)),
  34299. t
  34300. }
  34301. ,
  34302. s = function(e, t, i) {
  34303. return null == i && (i = n),
  34304. e.push(t),
  34305. g(e, 0, e.length - 1, i)
  34306. }
  34307. ,
  34308. a = function(e, t) {
  34309. var i, r;
  34310. return null == t && (t = n),
  34311. i = e.pop(),
  34312. e.length ? (r = e[0],
  34313. e[0] = i,
  34314. m(e, 0, t)) : r = i,
  34315. r
  34316. }
  34317. ,
  34318. c = function(e, t, i) {
  34319. var r;
  34320. return null == i && (i = n),
  34321. r = e[0],
  34322. e[0] = t,
  34323. m(e, 0, i),
  34324. r
  34325. }
  34326. ,
  34327. l = function(e, t, i) {
  34328. var r;
  34329. return null == i && (i = n),
  34330. e.length && i(e[0], t) < 0 && (r = [e[0], t],
  34331. t = r[0],
  34332. e[0] = r[1],
  34333. m(e, 0, i)),
  34334. t
  34335. }
  34336. ,
  34337. o = function(e, t) {
  34338. var i, o, a, s, l, c;
  34339. for (null == t && (t = n),
  34340. s = function() {
  34341. c = [];
  34342. for (var t = 0, i = r(e.length / 2); 0 <= i ? t < i : t > i; 0 <= i ? t++ : t--)
  34343. c.push(t);
  34344. return c
  34345. }
  34346. .apply(this).reverse(),
  34347. l = [],
  34348. o = 0,
  34349. a = s.length; o < a; o++)
  34350. i = s[o],
  34351. l.push(m(e, i, t));
  34352. return l
  34353. }
  34354. ,
  34355. f = function(e, t, i) {
  34356. var r;
  34357. if (null == i && (i = n),
  34358. r = e.indexOf(t),
  34359. r !== -1)
  34360. return g(e, 0, r, i),
  34361. m(e, r, i)
  34362. }
  34363. ,
  34364. d = function(e, t, i) {
  34365. var r, a, s, c, h;
  34366. if (null == i && (i = n),
  34367. a = e.slice(0, t),
  34368. !a.length)
  34369. return a;
  34370. for (o(a, i),
  34371. h = e.slice(t),
  34372. s = 0,
  34373. c = h.length; s < c; s++)
  34374. r = h[s],
  34375. l(a, r, i);
  34376. return a.sort(i).reverse()
  34377. }
  34378. ,
  34379. p = function(e, t, i) {
  34380. var r, s, l, c, d, p, f, g, m, v;
  34381. if (null == i && (i = n),
  34382. 10 * t <= e.length) {
  34383. if (c = e.slice(0, t).sort(i),
  34384. !c.length)
  34385. return c;
  34386. for (l = c[c.length - 1],
  34387. g = e.slice(t),
  34388. d = 0,
  34389. f = g.length; d < f; d++)
  34390. r = g[d],
  34391. i(r, l) < 0 && (h(c, r, 0, null, i),
  34392. c.pop(),
  34393. l = c[c.length - 1]);
  34394. return c
  34395. }
  34396. for (o(e, i),
  34397. v = [],
  34398. s = p = 0,
  34399. m = u(t, e.length); 0 <= m ? p < m : p > m; s = 0 <= m ? ++p : --p)
  34400. v.push(a(e, i));
  34401. return v
  34402. }
  34403. ,
  34404. g = function(e, t, i, r) {
  34405. var o, a, s;
  34406. for (null == r && (r = n),
  34407. o = e[i]; i > t && (s = i - 1 >> 1,
  34408. a = e[s],
  34409. r(o, a) < 0); )
  34410. e[i] = a,
  34411. i = s;
  34412. return e[i] = o
  34413. }
  34414. ,
  34415. m = function(e, t, i) {
  34416. var r, o, a, s, l;
  34417. for (null == i && (i = n),
  34418. o = e.length,
  34419. l = t,
  34420. a = e[t],
  34421. r = 2 * t + 1; r < o; )
  34422. s = r + 1,
  34423. s < o && !(i(e[r], e[s]) < 0) && (r = s),
  34424. e[t] = e[r],
  34425. t = r,
  34426. r = 2 * t + 1;
  34427. return e[t] = a,
  34428. g(e, l, t, i)
  34429. }
  34430. ,
  34431. e = function() {
  34432. function e(e) {
  34433. this.cmp = null != e ? e : n,
  34434. this.nodes = []
  34435. }
  34436. return e.push = s,
  34437. e.pop = a,
  34438. e.replace = c,
  34439. e.pushpop = l,
  34440. e.heapify = o,
  34441. e.updateItem = f,
  34442. e.nlargest = d,
  34443. e.nsmallest = p,
  34444. e.prototype.push = function(e) {
  34445. return s(this.nodes, e, this.cmp)
  34446. }
  34447. ,
  34448. e.prototype.pop = function() {
  34449. return a(this.nodes, this.cmp)
  34450. }
  34451. ,
  34452. e.prototype.peek = function() {
  34453. return this.nodes[0]
  34454. }
  34455. ,
  34456. e.prototype.contains = function(e) {
  34457. return this.nodes.indexOf(e) !== -1
  34458. }
  34459. ,
  34460. e.prototype.replace = function(e) {
  34461. return c(this.nodes, e, this.cmp)
  34462. }
  34463. ,
  34464. e.prototype.pushpop = function(e) {
  34465. return l(this.nodes, e, this.cmp)
  34466. }
  34467. ,
  34468. e.prototype.heapify = function() {
  34469. return o(this.nodes, this.cmp)
  34470. }
  34471. ,
  34472. e.prototype.updateItem = function(e) {
  34473. return f(this.nodes, e, this.cmp)
  34474. }
  34475. ,
  34476. e.prototype.clear = function() {
  34477. return this.nodes = []
  34478. }
  34479. ,
  34480. e.prototype.empty = function() {
  34481. return 0 === this.nodes.length
  34482. }
  34483. ,
  34484. e.prototype.size = function() {
  34485. return this.nodes.length
  34486. }
  34487. ,
  34488. e.prototype.clone = function() {
  34489. var t;
  34490. return t = new e,
  34491. t.nodes = this.nodes.slice(0),
  34492. t
  34493. }
  34494. ,
  34495. e.prototype.toArray = function() {
  34496. return this.nodes.slice(0)
  34497. }
  34498. ,
  34499. e.prototype.insert = e.prototype.push,
  34500. e.prototype.top = e.prototype.peek,
  34501. e.prototype.front = e.prototype.peek,
  34502. e.prototype.has = e.prototype.contains,
  34503. e.prototype.copy = e.prototype.clone,
  34504. e
  34505. }(),
  34506. function(e, n) {
  34507. return "function" == typeof define && define.amd ? define([], n) : "object" == typeof i ? t.exports = n() : e.Heap = n()
  34508. }(this, function() {
  34509. return e
  34510. })
  34511. }
  34512. ).call(this)
  34513. }
  34514. , {}],
  34515. 213: [function(e, t, i) {
  34516. !function(e) {
  34517. function i() {}
  34518. function n(e, t) {
  34519. return function() {
  34520. e.apply(t, arguments)
  34521. }
  34522. }
  34523. function r(e) {
  34524. if ("object" != typeof this)
  34525. throw new TypeError("Promises must be constructed via new");
  34526. if ("function" != typeof e)
  34527. throw new TypeError("not a function");
  34528. this._state = 0,
  34529. this._handled = !1,
  34530. this._value = void 0,
  34531. this._deferreds = [],
  34532. h(e, this)
  34533. }
  34534. function o(e, t) {
  34535. for (; 3 === e._state; )
  34536. e = e._value;
  34537. return 0 === e._state ? void e._deferreds.push(t) : (e._handled = !0,
  34538. void r._immediateFn(function() {
  34539. var i = 1 === e._state ? t.onFulfilled : t.onRejected;
  34540. if (null === i)
  34541. return void (1 === e._state ? a : s)(t.promise, e._value);
  34542. var n;
  34543. try {
  34544. n = i(e._value)
  34545. } catch (e) {
  34546. return void s(t.promise, e)
  34547. }
  34548. a(t.promise, n)
  34549. }))
  34550. }
  34551. function a(e, t) {
  34552. try {
  34553. if (t === e)
  34554. throw new TypeError("A promise cannot be resolved with itself.");
  34555. if (t && ("object" == typeof t || "function" == typeof t)) {
  34556. var i = t.then;
  34557. if (t instanceof r)
  34558. return e._state = 3,
  34559. e._value = t,
  34560. void l(e);
  34561. if ("function" == typeof i)
  34562. return void h(n(i, t), e)
  34563. }
  34564. e._state = 1,
  34565. e._value = t,
  34566. l(e)
  34567. } catch (t) {
  34568. s(e, t)
  34569. }
  34570. }
  34571. function s(e, t) {
  34572. e._state = 2,
  34573. e._value = t,
  34574. l(e)
  34575. }
  34576. function l(e) {
  34577. 2 === e._state && 0 === e._deferreds.length && r._immediateFn(function() {
  34578. e._handled || r._unhandledRejectionFn(e._value)
  34579. });
  34580. for (var t = 0, i = e._deferreds.length; t < i; t++)
  34581. o(e, e._deferreds[t]);
  34582. e._deferreds = null
  34583. }
  34584. function c(e, t, i) {
  34585. this.onFulfilled = "function" == typeof e ? e : null,
  34586. this.onRejected = "function" == typeof t ? t : null,
  34587. this.promise = i
  34588. }
  34589. function h(e, t) {
  34590. var i = !1;
  34591. try {
  34592. e(function(e) {
  34593. i || (i = !0,
  34594. a(t, e))
  34595. }, function(e) {
  34596. i || (i = !0,
  34597. s(t, e))
  34598. })
  34599. } catch (e) {
  34600. if (i)
  34601. return;
  34602. i = !0,
  34603. s(t, e)
  34604. }
  34605. }
  34606. var u = setTimeout;
  34607. r.prototype.catch = function(e) {
  34608. return this.then(null, e)
  34609. }
  34610. ,
  34611. r.prototype.then = function(e, t) {
  34612. var n = new this.constructor(i);
  34613. return o(this, new c(e,t,n)),
  34614. n
  34615. }
  34616. ,
  34617. r.all = function(e) {
  34618. var t = Array.prototype.slice.call(e);
  34619. return new r(function(e, i) {
  34620. function n(o, a) {
  34621. try {
  34622. if (a && ("object" == typeof a || "function" == typeof a)) {
  34623. var s = a.then;
  34624. if ("function" == typeof s)
  34625. return void s.call(a, function(e) {
  34626. n(o, e)
  34627. }, i)
  34628. }
  34629. t[o] = a,
  34630. 0 === --r && e(t)
  34631. } catch (e) {
  34632. i(e)
  34633. }
  34634. }
  34635. if (0 === t.length)
  34636. return e([]);
  34637. for (var r = t.length, o = 0; o < t.length; o++)
  34638. n(o, t[o])
  34639. }
  34640. )
  34641. }
  34642. ,
  34643. r.resolve = function(e) {
  34644. return e && "object" == typeof e && e.constructor === r ? e : new r(function(t) {
  34645. t(e)
  34646. }
  34647. )
  34648. }
  34649. ,
  34650. r.reject = function(e) {
  34651. return new r(function(t, i) {
  34652. i(e)
  34653. }
  34654. )
  34655. }
  34656. ,
  34657. r.race = function(e) {
  34658. return new r(function(t, i) {
  34659. for (var n = 0, r = e.length; n < r; n++)
  34660. e[n].then(t, i)
  34661. }
  34662. )
  34663. }
  34664. ,
  34665. r._immediateFn = "function" == typeof setImmediate && function(e) {
  34666. setImmediate(e)
  34667. }
  34668. || function(e) {
  34669. u(e, 0)
  34670. }
  34671. ,
  34672. r._unhandledRejectionFn = function(e) {
  34673. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  34674. }
  34675. ,
  34676. r._setImmediateFn = function(e) {
  34677. r._immediateFn = e
  34678. }
  34679. ,
  34680. r._setUnhandledRejectionFn = function(e) {
  34681. r._unhandledRejectionFn = e
  34682. }
  34683. ,
  34684. "undefined" != typeof t && t.exports ? t.exports = r : e.Promise || (e.Promise = r)
  34685. }(this)
  34686. }
  34687. , {}],
  34688. 214: [function(e, t, i) {
  34689. (function(i) {
  34690. !function(i, n) {
  34691. "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)
  34692. }(this, function(t, n) {
  34693. "use strict";
  34694. var r = {};
  34695. return r.ByteBuffer = t,
  34696. r.Long = t.Long || null,
  34697. r.VERSION = "5.0.1",
  34698. r.WIRE_TYPES = {},
  34699. r.WIRE_TYPES.VARINT = 0,
  34700. r.WIRE_TYPES.BITS64 = 1,
  34701. r.WIRE_TYPES.LDELIM = 2,
  34702. r.WIRE_TYPES.STARTGROUP = 3,
  34703. r.WIRE_TYPES.ENDGROUP = 4,
  34704. r.WIRE_TYPES.BITS32 = 5,
  34705. r.PACKABLE_WIRE_TYPES = [r.WIRE_TYPES.VARINT, r.WIRE_TYPES.BITS64, r.WIRE_TYPES.BITS32],
  34706. r.TYPES = {
  34707. int32: {
  34708. name: "int32",
  34709. wireType: r.WIRE_TYPES.VARINT,
  34710. defaultValue: 0
  34711. },
  34712. uint32: {
  34713. name: "uint32",
  34714. wireType: r.WIRE_TYPES.VARINT,
  34715. defaultValue: 0
  34716. },
  34717. sint32: {
  34718. name: "sint32",
  34719. wireType: r.WIRE_TYPES.VARINT,
  34720. defaultValue: 0
  34721. },
  34722. int64: {
  34723. name: "int64",
  34724. wireType: r.WIRE_TYPES.VARINT,
  34725. defaultValue: r.Long ? r.Long.ZERO : void 0
  34726. },
  34727. uint64: {
  34728. name: "uint64",
  34729. wireType: r.WIRE_TYPES.VARINT,
  34730. defaultValue: r.Long ? r.Long.UZERO : void 0
  34731. },
  34732. sint64: {
  34733. name: "sint64",
  34734. wireType: r.WIRE_TYPES.VARINT,
  34735. defaultValue: r.Long ? r.Long.ZERO : void 0
  34736. },
  34737. bool: {
  34738. name: "bool",
  34739. wireType: r.WIRE_TYPES.VARINT,
  34740. defaultValue: !1
  34741. },
  34742. double: {
  34743. name: "double",
  34744. wireType: r.WIRE_TYPES.BITS64,
  34745. defaultValue: 0
  34746. },
  34747. string: {
  34748. name: "string",
  34749. wireType: r.WIRE_TYPES.LDELIM,
  34750. defaultValue: ""
  34751. },
  34752. bytes: {
  34753. name: "bytes",
  34754. wireType: r.WIRE_TYPES.LDELIM,
  34755. defaultValue: null
  34756. },
  34757. fixed32: {
  34758. name: "fixed32",
  34759. wireType: r.WIRE_TYPES.BITS32,
  34760. defaultValue: 0
  34761. },
  34762. sfixed32: {
  34763. name: "sfixed32",
  34764. wireType: r.WIRE_TYPES.BITS32,
  34765. defaultValue: 0
  34766. },
  34767. fixed64: {
  34768. name: "fixed64",
  34769. wireType: r.WIRE_TYPES.BITS64,
  34770. defaultValue: r.Long ? r.Long.UZERO : void 0
  34771. },
  34772. sfixed64: {
  34773. name: "sfixed64",
  34774. wireType: r.WIRE_TYPES.BITS64,
  34775. defaultValue: r.Long ? r.Long.ZERO : void 0
  34776. },
  34777. float: {
  34778. name: "float",
  34779. wireType: r.WIRE_TYPES.BITS32,
  34780. defaultValue: 0
  34781. },
  34782. enum: {
  34783. name: "enum",
  34784. wireType: r.WIRE_TYPES.VARINT,
  34785. defaultValue: 0
  34786. },
  34787. message: {
  34788. name: "message",
  34789. wireType: r.WIRE_TYPES.LDELIM,
  34790. defaultValue: null
  34791. },
  34792. group: {
  34793. name: "group",
  34794. wireType: r.WIRE_TYPES.STARTGROUP,
  34795. defaultValue: null
  34796. }
  34797. },
  34798. 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],
  34799. r.ID_MIN = 1,
  34800. r.ID_MAX = 536870911,
  34801. r.convertFieldsToCamelCase = !1,
  34802. r.populateAccessors = !0,
  34803. r.populateDefaults = !0,
  34804. r.Util = function() {
  34805. var t = {};
  34806. return t.IS_NODE = !("object" != typeof i || i + "" != "[object process]" || i.browser),
  34807. t.XHR = function() {
  34808. for (var e = [function() {
  34809. return new XMLHttpRequest
  34810. }
  34811. , function() {
  34812. return new ActiveXObject("Msxml2.XMLHTTP")
  34813. }
  34814. , function() {
  34815. return new ActiveXObject("Msxml3.XMLHTTP")
  34816. }
  34817. , function() {
  34818. return new ActiveXObject("Microsoft.XMLHTTP")
  34819. }
  34820. ], t = null, i = 0; i < e.length; i++) {
  34821. try {
  34822. t = e[i]()
  34823. } catch (e) {
  34824. continue
  34825. }
  34826. break
  34827. }
  34828. if (!t)
  34829. throw Error("XMLHttpRequest is not supported");
  34830. return t
  34831. }
  34832. ,
  34833. t.fetch = function(i, n) {
  34834. if (n && "function" != typeof n && (n = null),
  34835. t.IS_NODE) {
  34836. var r = e("fs");
  34837. if (n)
  34838. r.readFile(i, function(e, t) {
  34839. n(e ? null : "" + t)
  34840. });
  34841. else
  34842. try {
  34843. return r.readFileSync(i)
  34844. } catch (e) {
  34845. return null
  34846. }
  34847. } else {
  34848. var o = t.XHR();
  34849. if (o.open("GET", i, !!n),
  34850. o.setRequestHeader("Accept", "text/plain"),
  34851. "function" == typeof o.overrideMimeType && o.overrideMimeType("text/plain"),
  34852. !n)
  34853. return o.send(null),
  34854. 200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null;
  34855. if (o.onreadystatechange = function() {
  34856. 4 == o.readyState && n(200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null)
  34857. }
  34858. ,
  34859. 4 == o.readyState)
  34860. return;
  34861. o.send(null)
  34862. }
  34863. }
  34864. ,
  34865. t.toCamelCase = function(e) {
  34866. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  34867. return t.toUpperCase()
  34868. })
  34869. }
  34870. ,
  34871. t
  34872. }(),
  34873. r.Lang = {
  34874. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  34875. RULE: /^(?:required|optional|repeated|map)$/,
  34876. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  34877. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  34878. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  34879. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  34880. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  34881. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  34882. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  34883. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  34884. NUMBER_OCT: /^0[0-7]+$/,
  34885. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  34886. BOOL: /^(?:true|false)$/i,
  34887. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  34888. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  34889. WHITESPACE: /\s/,
  34890. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  34891. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  34892. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  34893. },
  34894. r.DotProto = function(e, t) {
  34895. function i(e, i) {
  34896. var n = -1
  34897. , r = 1;
  34898. if ("-" == e.charAt(0) && (r = -1,
  34899. e = e.substring(1)),
  34900. t.NUMBER_DEC.test(e))
  34901. n = parseInt(e);
  34902. else if (t.NUMBER_HEX.test(e))
  34903. n = parseInt(e.substring(2), 16);
  34904. else {
  34905. if (!t.NUMBER_OCT.test(e))
  34906. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  34907. n = parseInt(e.substring(1), 8)
  34908. }
  34909. if (n = r * n | 0,
  34910. !i && n < 0)
  34911. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  34912. return n
  34913. }
  34914. function n(e) {
  34915. var i = 1;
  34916. if ("-" == e.charAt(0) && (i = -1,
  34917. e = e.substring(1)),
  34918. t.NUMBER_DEC.test(e))
  34919. return i * parseInt(e, 10);
  34920. if (t.NUMBER_HEX.test(e))
  34921. return i * parseInt(e.substring(2), 16);
  34922. if (t.NUMBER_OCT.test(e))
  34923. return i * parseInt(e.substring(1), 8);
  34924. if ("inf" === e)
  34925. return i * (1 / 0);
  34926. if ("nan" === e)
  34927. return NaN;
  34928. if (t.NUMBER_FLT.test(e))
  34929. return i * parseFloat(e);
  34930. throw Error("illegal number value: " + (i < 0 ? "-" : "") + e)
  34931. }
  34932. function r(e, t, i) {
  34933. "undefined" == typeof e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  34934. e[t].push(i))
  34935. }
  34936. var o = {}
  34937. , a = function(e) {
  34938. this.source = e + "",
  34939. this.index = 0,
  34940. this.line = 1,
  34941. this.stack = [],
  34942. this._stringOpen = null
  34943. }
  34944. , s = a.prototype;
  34945. s._readString = function() {
  34946. var e = '"' === this._stringOpen ? t.STRING_DQ : t.STRING_SQ;
  34947. e.lastIndex = this.index - 1;
  34948. var i = e.exec(this.source);
  34949. if (!i)
  34950. throw Error("unterminated string");
  34951. return this.index = e.lastIndex,
  34952. this.stack.push(this._stringOpen),
  34953. this._stringOpen = null,
  34954. i[1]
  34955. }
  34956. ,
  34957. s.next = function() {
  34958. if (this.stack.length > 0)
  34959. return this.stack.shift();
  34960. if (this.index >= this.source.length)
  34961. return null;
  34962. if (null !== this._stringOpen)
  34963. return this._readString();
  34964. var e, i, n;
  34965. do {
  34966. for (e = !1; t.WHITESPACE.test(n = this.source.charAt(this.index)); )
  34967. if ("\n" === n && ++this.line,
  34968. ++this.index === this.source.length)
  34969. return null;
  34970. if ("/" === this.source.charAt(this.index))
  34971. if (++this.index,
  34972. "/" === this.source.charAt(this.index)) {
  34973. for (; "\n" !== this.source.charAt(++this.index); )
  34974. if (this.index == this.source.length)
  34975. return null;
  34976. ++this.index,
  34977. ++this.line,
  34978. e = !0
  34979. } else {
  34980. if ("*" !== (n = this.source.charAt(this.index)))
  34981. return "/";
  34982. do {
  34983. if ("\n" === n && ++this.line,
  34984. ++this.index === this.source.length)
  34985. return null;
  34986. i = n,
  34987. n = this.source.charAt(this.index)
  34988. } while ("*" !== i || "/" !== n);++this.index,
  34989. e = !0
  34990. }
  34991. } while (e);if (this.index === this.source.length)
  34992. return null;
  34993. var r = this.index;
  34994. t.DELIM.lastIndex = 0;
  34995. var o = t.DELIM.test(this.source.charAt(r++));
  34996. if (!o)
  34997. for (; r < this.source.length && !t.DELIM.test(this.source.charAt(r)); )
  34998. ++r;
  34999. var a = this.source.substring(this.index, this.index = r);
  35000. return '"' !== a && "'" !== a || (this._stringOpen = a),
  35001. a
  35002. }
  35003. ,
  35004. s.peek = function() {
  35005. if (0 === this.stack.length) {
  35006. var e = this.next();
  35007. if (null === e)
  35008. return null;
  35009. this.stack.push(e)
  35010. }
  35011. return this.stack[0]
  35012. }
  35013. ,
  35014. s.skip = function(e) {
  35015. var t = this.next();
  35016. if (t !== e)
  35017. throw Error("illegal '" + t + "', '" + e + "' expected")
  35018. }
  35019. ,
  35020. s.omit = function(e) {
  35021. return this.peek() === e && (this.next(),
  35022. !0)
  35023. }
  35024. ,
  35025. s.toString = function() {
  35026. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  35027. }
  35028. ,
  35029. o.Tokenizer = a;
  35030. var l = function(e) {
  35031. this.tn = new a(e),
  35032. this.proto3 = !1
  35033. }
  35034. , c = l.prototype;
  35035. return c.parse = function() {
  35036. var e, i, n = {
  35037. name: "[ROOT]",
  35038. package: null,
  35039. messages: [],
  35040. enums: [],
  35041. imports: [],
  35042. options: {},
  35043. services: []
  35044. }, r = !0;
  35045. try {
  35046. for (; e = this.tn.next(); )
  35047. switch (e) {
  35048. case "package":
  35049. if (!r || null !== n.package)
  35050. throw Error("unexpected 'package'");
  35051. if (e = this.tn.next(),
  35052. !t.TYPEREF.test(e))
  35053. throw Error("illegal package name: " + e);
  35054. this.tn.skip(";"),
  35055. n.package = e;
  35056. break;
  35057. case "import":
  35058. if (!r)
  35059. throw Error("unexpected 'import'");
  35060. e = this.tn.peek(),
  35061. ("public" === e || (i = "weak" === e)) && this.tn.next(),
  35062. e = this._readString(),
  35063. this.tn.skip(";"),
  35064. i || n.imports.push(e);
  35065. break;
  35066. case "syntax":
  35067. if (!r)
  35068. throw Error("unexpected 'syntax'");
  35069. this.tn.skip("="),
  35070. "proto3" === (n.syntax = this._readString()) && (this.proto3 = !0),
  35071. this.tn.skip(";");
  35072. break;
  35073. case "message":
  35074. this._parseMessage(n, null),
  35075. r = !1;
  35076. break;
  35077. case "enum":
  35078. this._parseEnum(n),
  35079. r = !1;
  35080. break;
  35081. case "option":
  35082. this._parseOption(n);
  35083. break;
  35084. case "service":
  35085. this._parseService(n);
  35086. break;
  35087. case "extend":
  35088. this._parseExtend(n);
  35089. break;
  35090. default:
  35091. throw Error("unexpected '" + e + "'")
  35092. }
  35093. } catch (e) {
  35094. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  35095. e
  35096. }
  35097. return delete n.name,
  35098. n
  35099. }
  35100. ,
  35101. l.parse = function(e) {
  35102. return new l(e).parse()
  35103. }
  35104. ,
  35105. c._readString = function() {
  35106. var e, t, i = "";
  35107. do {
  35108. if (t = this.tn.next(),
  35109. "'" !== t && '"' !== t)
  35110. throw Error("illegal string delimiter: " + t);
  35111. i += this.tn.next(),
  35112. this.tn.skip(t),
  35113. e = this.tn.peek()
  35114. } while ('"' === e || '"' === e);return i
  35115. }
  35116. ,
  35117. c._readValue = function(e) {
  35118. var i = this.tn.peek();
  35119. if ('"' === i || "'" === i)
  35120. return this._readString();
  35121. if (this.tn.next(),
  35122. t.NUMBER.test(i))
  35123. return n(i);
  35124. if (t.BOOL.test(i))
  35125. return "true" === i.toLowerCase();
  35126. if (e && t.TYPEREF.test(i))
  35127. return i;
  35128. throw Error("illegal value: " + i)
  35129. }
  35130. ,
  35131. c._parseOption = function(e, i) {
  35132. var n = this.tn.next()
  35133. , r = !1;
  35134. if ("(" === n && (r = !0,
  35135. n = this.tn.next()),
  35136. !t.TYPEREF.test(n))
  35137. throw Error("illegal option name: " + n);
  35138. var o = n;
  35139. r && (this.tn.skip(")"),
  35140. o = "(" + o + ")",
  35141. n = this.tn.peek(),
  35142. t.FQTYPEREF.test(n) && (o += n,
  35143. this.tn.next())),
  35144. this.tn.skip("="),
  35145. this._parseOptionValue(e, o),
  35146. i || this.tn.skip(";")
  35147. }
  35148. ,
  35149. c._parseOptionValue = function(e, i) {
  35150. var n = this.tn.peek();
  35151. if ("{" !== n)
  35152. r(e.options, i, this._readValue(!0));
  35153. else
  35154. for (this.tn.skip("{"); "}" !== (n = this.tn.next()); ) {
  35155. if (!t.NAME.test(n))
  35156. throw Error("illegal option name: " + i + "." + n);
  35157. this.tn.omit(":") ? r(e.options, i + "." + n, this._readValue(!0)) : this._parseOptionValue(e, i + "." + n)
  35158. }
  35159. }
  35160. ,
  35161. c._parseService = function(e) {
  35162. var i = this.tn.next();
  35163. if (!t.NAME.test(i))
  35164. throw Error("illegal service name at line " + this.tn.line + ": " + i);
  35165. var n = i
  35166. , r = {
  35167. name: n,
  35168. rpc: {},
  35169. options: {}
  35170. };
  35171. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  35172. if ("option" === i)
  35173. this._parseOption(r);
  35174. else {
  35175. if ("rpc" !== i)
  35176. throw Error("illegal service token: " + i);
  35177. this._parseServiceRPC(r)
  35178. }
  35179. this.tn.omit(";"),
  35180. e.services.push(r)
  35181. }
  35182. ,
  35183. c._parseServiceRPC = function(e) {
  35184. var i = "rpc"
  35185. , n = this.tn.next();
  35186. if (!t.NAME.test(n))
  35187. throw Error("illegal rpc service method name: " + n);
  35188. var r = n
  35189. , o = {
  35190. request: null,
  35191. response: null,
  35192. request_stream: !1,
  35193. response_stream: !1,
  35194. options: {}
  35195. };
  35196. if (this.tn.skip("("),
  35197. n = this.tn.next(),
  35198. "stream" === n.toLowerCase() && (o.request_stream = !0,
  35199. n = this.tn.next()),
  35200. !t.TYPEREF.test(n))
  35201. throw Error("illegal rpc service request type: " + n);
  35202. if (o.request = n,
  35203. this.tn.skip(")"),
  35204. n = this.tn.next(),
  35205. "returns" !== n.toLowerCase())
  35206. throw Error("illegal rpc service request type delimiter: " + n);
  35207. if (this.tn.skip("("),
  35208. n = this.tn.next(),
  35209. "stream" === n.toLowerCase() && (o.response_stream = !0,
  35210. n = this.tn.next()),
  35211. o.response = n,
  35212. this.tn.skip(")"),
  35213. n = this.tn.peek(),
  35214. "{" === n) {
  35215. for (this.tn.next(); "}" !== (n = this.tn.next()); ) {
  35216. if ("option" !== n)
  35217. throw Error("illegal rpc service token: " + n);
  35218. this._parseOption(o)
  35219. }
  35220. this.tn.omit(";")
  35221. } else
  35222. this.tn.skip(";");
  35223. "undefined" == typeof e[i] && (e[i] = {}),
  35224. e[i][r] = o
  35225. }
  35226. ,
  35227. c._parseMessage = function(e, n) {
  35228. var r = !!n
  35229. , o = this.tn.next()
  35230. , a = {
  35231. name: "",
  35232. fields: [],
  35233. enums: [],
  35234. messages: [],
  35235. options: {},
  35236. services: [],
  35237. oneofs: {}
  35238. };
  35239. if (!t.NAME.test(o))
  35240. throw Error("illegal " + (r ? "group" : "message") + " name: " + o);
  35241. for (a.name = o,
  35242. r && (this.tn.skip("="),
  35243. n.id = i(this.tn.next()),
  35244. a.isGroup = !0),
  35245. o = this.tn.peek(),
  35246. "[" === o && n && this._parseFieldOptions(n),
  35247. this.tn.skip("{"); "}" !== (o = this.tn.next()); )
  35248. if (t.RULE.test(o))
  35249. this._parseMessageField(a, o);
  35250. else if ("oneof" === o)
  35251. this._parseMessageOneOf(a);
  35252. else if ("enum" === o)
  35253. this._parseEnum(a);
  35254. else if ("message" === o)
  35255. this._parseMessage(a);
  35256. else if ("option" === o)
  35257. this._parseOption(a);
  35258. else if ("service" === o)
  35259. this._parseService(a);
  35260. else if ("extensions" === o)
  35261. a.extensions = this._parseExtensionRanges();
  35262. else if ("reserved" === o)
  35263. this._parseIgnored();
  35264. else if ("extend" === o)
  35265. this._parseExtend(a);
  35266. else {
  35267. if (!t.TYPEREF.test(o))
  35268. throw Error("illegal message token: " + o);
  35269. if (!this.proto3)
  35270. throw Error("illegal field rule: " + o);
  35271. this._parseMessageField(a, "optional", o)
  35272. }
  35273. return this.tn.omit(";"),
  35274. e.messages.push(a),
  35275. a
  35276. }
  35277. ,
  35278. c._parseIgnored = function() {
  35279. for (; ";" !== this.tn.peek(); )
  35280. this.tn.next();
  35281. this.tn.skip(";")
  35282. }
  35283. ,
  35284. c._parseMessageField = function(e, n, r) {
  35285. if (!t.RULE.test(n))
  35286. throw Error("illegal message field rule: " + n);
  35287. var o, a = {
  35288. rule: n,
  35289. type: "",
  35290. name: "",
  35291. options: {},
  35292. id: 0
  35293. };
  35294. if ("map" === n) {
  35295. if (r)
  35296. throw Error("illegal type: " + r);
  35297. if (this.tn.skip("<"),
  35298. o = this.tn.next(),
  35299. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  35300. throw Error("illegal message field type: " + o);
  35301. if (a.keytype = o,
  35302. this.tn.skip(","),
  35303. o = this.tn.next(),
  35304. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  35305. throw Error("illegal message field: " + o);
  35306. if (a.type = o,
  35307. this.tn.skip(">"),
  35308. o = this.tn.next(),
  35309. !t.NAME.test(o))
  35310. throw Error("illegal message field name: " + o);
  35311. a.name = o,
  35312. this.tn.skip("="),
  35313. a.id = i(this.tn.next()),
  35314. o = this.tn.peek(),
  35315. "[" === o && this._parseFieldOptions(a),
  35316. this.tn.skip(";")
  35317. } else if (r = "undefined" != typeof r ? r : this.tn.next(),
  35318. "group" === r) {
  35319. var s = this._parseMessage(e, a);
  35320. if (!/^[A-Z]/.test(s.name))
  35321. throw Error("illegal group name: " + s.name);
  35322. a.type = s.name,
  35323. a.name = s.name.toLowerCase(),
  35324. this.tn.omit(";")
  35325. } else {
  35326. if (!t.TYPE.test(r) && !t.TYPEREF.test(r))
  35327. throw Error("illegal message field type: " + r);
  35328. if (a.type = r,
  35329. o = this.tn.next(),
  35330. !t.NAME.test(o))
  35331. throw Error("illegal message field name: " + o);
  35332. a.name = o,
  35333. this.tn.skip("="),
  35334. a.id = i(this.tn.next()),
  35335. o = this.tn.peek(),
  35336. "[" === o && this._parseFieldOptions(a),
  35337. this.tn.skip(";")
  35338. }
  35339. return e.fields.push(a),
  35340. a
  35341. }
  35342. ,
  35343. c._parseMessageOneOf = function(e) {
  35344. var i = this.tn.next();
  35345. if (!t.NAME.test(i))
  35346. throw Error("illegal oneof name: " + i);
  35347. var n, r = i, o = [];
  35348. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  35349. n = this._parseMessageField(e, "optional", i),
  35350. n.oneof = r,
  35351. o.push(n.id);
  35352. this.tn.omit(";"),
  35353. e.oneofs[r] = o
  35354. }
  35355. ,
  35356. c._parseFieldOptions = function(e) {
  35357. this.tn.skip("[");
  35358. for (var t, i = !0; "]" !== (t = this.tn.peek()); )
  35359. i || this.tn.skip(","),
  35360. this._parseOption(e, !0),
  35361. i = !1;
  35362. this.tn.next()
  35363. }
  35364. ,
  35365. c._parseEnum = function(e) {
  35366. var n = {
  35367. name: "",
  35368. values: [],
  35369. options: {}
  35370. }
  35371. , r = this.tn.next();
  35372. if (!t.NAME.test(r))
  35373. throw Error("illegal name: " + r);
  35374. for (n.name = r,
  35375. this.tn.skip("{"); "}" !== (r = this.tn.next()); )
  35376. if ("option" === r)
  35377. this._parseOption(n);
  35378. else {
  35379. if (!t.NAME.test(r))
  35380. throw Error("illegal name: " + r);
  35381. this.tn.skip("=");
  35382. var o = {
  35383. name: r,
  35384. id: i(this.tn.next(), !0)
  35385. };
  35386. r = this.tn.peek(),
  35387. "[" === r && this._parseFieldOptions({
  35388. options: {}
  35389. }),
  35390. this.tn.skip(";"),
  35391. n.values.push(o)
  35392. }
  35393. this.tn.omit(";"),
  35394. e.enums.push(n)
  35395. }
  35396. ,
  35397. c._parseExtensionRanges = function() {
  35398. var t, i, r, o = [];
  35399. do {
  35400. for (i = []; ; ) {
  35401. switch (t = this.tn.next()) {
  35402. case "min":
  35403. r = e.ID_MIN;
  35404. break;
  35405. case "max":
  35406. r = e.ID_MAX;
  35407. break;
  35408. default:
  35409. r = n(t)
  35410. }
  35411. if (i.push(r),
  35412. 2 === i.length)
  35413. break;
  35414. if ("to" !== this.tn.peek()) {
  35415. i.push(r);
  35416. break
  35417. }
  35418. this.tn.next()
  35419. }
  35420. o.push(i)
  35421. } while (this.tn.omit(","));return this.tn.skip(";"),
  35422. o
  35423. }
  35424. ,
  35425. c._parseExtend = function(e) {
  35426. var i = this.tn.next();
  35427. if (!t.TYPEREF.test(i))
  35428. throw Error("illegal extend reference: " + i);
  35429. var n = {
  35430. ref: i,
  35431. fields: []
  35432. };
  35433. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  35434. if (t.RULE.test(i))
  35435. this._parseMessageField(n, i);
  35436. else {
  35437. if (!t.TYPEREF.test(i))
  35438. throw Error("illegal extend token: " + i);
  35439. if (!this.proto3)
  35440. throw Error("illegal field rule: " + i);
  35441. this._parseMessageField(n, "optional", i)
  35442. }
  35443. return this.tn.omit(";"),
  35444. e.messages.push(n),
  35445. n
  35446. }
  35447. ,
  35448. c.toString = function() {
  35449. return "Parser at line " + this.tn.line
  35450. }
  35451. ,
  35452. o.Parser = l,
  35453. o
  35454. }(r, r.Lang),
  35455. r.Reflect = function(e) {
  35456. function i(i) {
  35457. if ("string" == typeof i && (i = e.TYPES[i]),
  35458. "undefined" == typeof i.defaultValue)
  35459. throw Error("default value for type " + i.name + " is not supported");
  35460. return i == e.TYPES.bytes ? new t(0) : i.defaultValue
  35461. }
  35462. function n(t, i) {
  35463. if (t && "number" == typeof t.low && "number" == typeof t.high && "boolean" == typeof t.unsigned && t.low === t.low && t.high === t.high)
  35464. return new e.Long(t.low,t.high,"undefined" == typeof i ? t.unsigned : i);
  35465. if ("string" == typeof t)
  35466. return e.Long.fromString(t, i || !1, 10);
  35467. if ("number" == typeof t)
  35468. return e.Long.fromNumber(t, i || !1);
  35469. throw Error("not convertible to Long")
  35470. }
  35471. function r(t, i) {
  35472. var n = i.readVarint32()
  35473. , o = 7 & n
  35474. , a = n >>> 3;
  35475. switch (o) {
  35476. case e.WIRE_TYPES.VARINT:
  35477. do
  35478. n = i.readUint8();
  35479. while (128 === (128 & n));break;
  35480. case e.WIRE_TYPES.BITS64:
  35481. i.offset += 8;
  35482. break;
  35483. case e.WIRE_TYPES.LDELIM:
  35484. n = i.readVarint32(),
  35485. i.offset += n;
  35486. break;
  35487. case e.WIRE_TYPES.STARTGROUP:
  35488. r(a, i);
  35489. break;
  35490. case e.WIRE_TYPES.ENDGROUP:
  35491. if (a === t)
  35492. return !1;
  35493. throw Error("Illegal GROUPEND after unknown group: " + a + " (" + t + " expected)");
  35494. case e.WIRE_TYPES.BITS32:
  35495. i.offset += 4;
  35496. break;
  35497. default:
  35498. throw Error("Illegal wire type in unknown group " + t + ": " + o)
  35499. }
  35500. return !0
  35501. }
  35502. var o = {}
  35503. , a = function(e, t, i) {
  35504. this.builder = e,
  35505. this.parent = t,
  35506. this.name = i,
  35507. this.className
  35508. }
  35509. , s = a.prototype;
  35510. s.fqn = function() {
  35511. for (var e = this.name, t = this; ; ) {
  35512. if (t = t.parent,
  35513. null == t)
  35514. break;
  35515. e = t.name + "." + e
  35516. }
  35517. return e
  35518. }
  35519. ,
  35520. s.toString = function(e) {
  35521. return (e ? this.className + " " : "") + this.fqn()
  35522. }
  35523. ,
  35524. s.build = function() {
  35525. throw Error(this.toString(!0) + " cannot be built directly")
  35526. }
  35527. ,
  35528. o.T = a;
  35529. var l = function(e, t, i, n, r) {
  35530. a.call(this, e, t, i),
  35531. this.className = "Namespace",
  35532. this.children = [],
  35533. this.options = n || {},
  35534. this.syntax = r || "proto2"
  35535. }
  35536. , c = l.prototype = Object.create(a.prototype);
  35537. c.getChildren = function(e) {
  35538. if (e = e || null,
  35539. null == e)
  35540. return this.children.slice();
  35541. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  35542. this.children[i]instanceof e && t.push(this.children[i]);
  35543. return t
  35544. }
  35545. ,
  35546. c.addChild = function(e) {
  35547. var t;
  35548. if (t = this.getChild(e.name))
  35549. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  35550. t.name = t.originalName;
  35551. else {
  35552. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  35553. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  35554. e.name = e.originalName
  35555. }
  35556. this.children.push(e)
  35557. }
  35558. ,
  35559. c.getChild = function(e) {
  35560. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  35561. if (this.children[i][t] === e)
  35562. return this.children[i];
  35563. return null
  35564. }
  35565. ,
  35566. c.resolve = function(e, t) {
  35567. var i = "string" == typeof e ? e.split(".") : e
  35568. , n = this
  35569. , r = 0;
  35570. if ("" === i[r]) {
  35571. for (; null !== n.parent; )
  35572. n = n.parent;
  35573. r++
  35574. }
  35575. var a;
  35576. do {
  35577. do {
  35578. if (!(n instanceof o.Namespace)) {
  35579. n = null;
  35580. break
  35581. }
  35582. if (a = n.getChild(i[r]),
  35583. !a || !(a instanceof o.T) || t && !(a instanceof o.Namespace)) {
  35584. n = null;
  35585. break
  35586. }
  35587. n = a,
  35588. r++
  35589. } while (r < i.length);if (null != n)
  35590. break;
  35591. if (null !== this.parent)
  35592. return this.parent.resolve(e, t)
  35593. } while (null != n);return n
  35594. }
  35595. ,
  35596. c.qn = function(e) {
  35597. var t = []
  35598. , i = e;
  35599. do
  35600. t.unshift(i.name),
  35601. i = i.parent;
  35602. while (null !== i);for (var n = 1; n <= t.length; n++) {
  35603. var r = t.slice(t.length - n);
  35604. if (e === this.resolve(r, e instanceof o.Namespace))
  35605. return r.join(".")
  35606. }
  35607. return e.fqn()
  35608. }
  35609. ,
  35610. c.build = function() {
  35611. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  35612. e = i[n],
  35613. e instanceof l && (t[e.name] = e.build());
  35614. return Object.defineProperty && Object.defineProperty(t, "$options", {
  35615. value: this.buildOpt()
  35616. }),
  35617. t
  35618. }
  35619. ,
  35620. c.buildOpt = function() {
  35621. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  35622. var r = t[i]
  35623. , o = this.options[t[i]];
  35624. e[r] = o
  35625. }
  35626. return e
  35627. }
  35628. ,
  35629. c.getOption = function(e) {
  35630. return "undefined" == typeof e ? this.options : "undefined" != typeof this.options[e] ? this.options[e] : null
  35631. }
  35632. ,
  35633. o.Namespace = l;
  35634. var h = function(t, i, n, r) {
  35635. if (this.type = t,
  35636. this.resolvedType = i,
  35637. this.isMapKey = n,
  35638. this.syntax = r,
  35639. n && e.MAP_KEY_TYPES.indexOf(t) < 0)
  35640. throw Error("Invalid map key type: " + t.name)
  35641. }
  35642. , u = h.prototype;
  35643. h.defaultFieldValue = i,
  35644. u.verifyValue = function(i) {
  35645. function r(e, t) {
  35646. throw Error("Illegal value for " + o.toString(!0) + " of type " + o.type.name + ": " + e + " (" + t + ")")
  35647. }
  35648. var o = this;
  35649. switch (this.type) {
  35650. case e.TYPES.int32:
  35651. case e.TYPES.sint32:
  35652. case e.TYPES.sfixed32:
  35653. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  35654. i > 4294967295 ? 0 | i : i;
  35655. case e.TYPES.uint32:
  35656. case e.TYPES.fixed32:
  35657. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  35658. i < 0 ? i >>> 0 : i;
  35659. case e.TYPES.int64:
  35660. case e.TYPES.sint64:
  35661. case e.TYPES.sfixed64:
  35662. if (e.Long)
  35663. try {
  35664. return n(i, !1)
  35665. } catch (e) {
  35666. r(typeof i, e.message)
  35667. }
  35668. else
  35669. r(typeof i, "requires Long.js");
  35670. case e.TYPES.uint64:
  35671. case e.TYPES.fixed64:
  35672. if (e.Long)
  35673. try {
  35674. return n(i, !0)
  35675. } catch (e) {
  35676. r(typeof i, e.message)
  35677. }
  35678. else
  35679. r(typeof i, "requires Long.js");
  35680. case e.TYPES.bool:
  35681. return "boolean" != typeof i && r(typeof i, "not a boolean"),
  35682. i;
  35683. case e.TYPES.float:
  35684. case e.TYPES.double:
  35685. return "number" != typeof i && r(typeof i, "not a number"),
  35686. i;
  35687. case e.TYPES.string:
  35688. return "string" == typeof i || i && i instanceof String || r(typeof i, "not a string"),
  35689. "" + i;
  35690. case e.TYPES.bytes:
  35691. return t.isByteBuffer(i) ? i : t.wrap(i, "base64");
  35692. case e.TYPES.enum:
  35693. var a = this.resolvedType.getChildren(e.Reflect.Enum.Value);
  35694. for (l = 0; l < a.length; l++) {
  35695. if (a[l].name == i)
  35696. return a[l].id;
  35697. if (a[l].id == i)
  35698. return a[l].id
  35699. }
  35700. if ("proto3" === this.syntax)
  35701. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  35702. (i > 4294967295 || i < 0) && r(typeof i, "not in range for uint32"),
  35703. i;
  35704. r(i, "not a valid enum value");
  35705. case e.TYPES.group:
  35706. case e.TYPES.message:
  35707. if (i && "object" == typeof i || r(typeof i, "object expected"),
  35708. i instanceof this.resolvedType.clazz)
  35709. return i;
  35710. if (i instanceof e.Builder.Message) {
  35711. var s = {};
  35712. for (var l in i)
  35713. i.hasOwnProperty(l) && (s[l] = i[l]);
  35714. i = s
  35715. }
  35716. return new this.resolvedType.clazz(i)
  35717. }
  35718. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + i + " (undefined type " + this.type + ")")
  35719. }
  35720. ,
  35721. u.calculateLength = function(i, n) {
  35722. if (null === n)
  35723. return 0;
  35724. var r;
  35725. switch (this.type) {
  35726. case e.TYPES.int32:
  35727. return n < 0 ? t.calculateVarint64(n) : t.calculateVarint32(n);
  35728. case e.TYPES.uint32:
  35729. return t.calculateVarint32(n);
  35730. case e.TYPES.sint32:
  35731. return t.calculateVarint32(t.zigZagEncode32(n));
  35732. case e.TYPES.fixed32:
  35733. case e.TYPES.sfixed32:
  35734. case e.TYPES.float:
  35735. return 4;
  35736. case e.TYPES.int64:
  35737. case e.TYPES.uint64:
  35738. return t.calculateVarint64(n);
  35739. case e.TYPES.sint64:
  35740. return t.calculateVarint64(t.zigZagEncode64(n));
  35741. case e.TYPES.fixed64:
  35742. case e.TYPES.sfixed64:
  35743. return 8;
  35744. case e.TYPES.bool:
  35745. return 1;
  35746. case e.TYPES.enum:
  35747. return t.calculateVarint32(n);
  35748. case e.TYPES.double:
  35749. return 8;
  35750. case e.TYPES.string:
  35751. return r = t.calculateUTF8Bytes(n),
  35752. t.calculateVarint32(r) + r;
  35753. case e.TYPES.bytes:
  35754. if (n.remaining() < 0)
  35755. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  35756. return t.calculateVarint32(n.remaining()) + n.remaining();
  35757. case e.TYPES.message:
  35758. return r = this.resolvedType.calculate(n),
  35759. t.calculateVarint32(r) + r;
  35760. case e.TYPES.group:
  35761. return r = this.resolvedType.calculate(n),
  35762. r + t.calculateVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP)
  35763. }
  35764. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  35765. }
  35766. ,
  35767. u.encodeValue = function(i, n, r) {
  35768. if (null === n)
  35769. return r;
  35770. switch (this.type) {
  35771. case e.TYPES.int32:
  35772. n < 0 ? r.writeVarint64(n) : r.writeVarint32(n);
  35773. break;
  35774. case e.TYPES.uint32:
  35775. r.writeVarint32(n);
  35776. break;
  35777. case e.TYPES.sint32:
  35778. r.writeVarint32ZigZag(n);
  35779. break;
  35780. case e.TYPES.fixed32:
  35781. r.writeUint32(n);
  35782. break;
  35783. case e.TYPES.sfixed32:
  35784. r.writeInt32(n);
  35785. break;
  35786. case e.TYPES.int64:
  35787. case e.TYPES.uint64:
  35788. r.writeVarint64(n);
  35789. break;
  35790. case e.TYPES.sint64:
  35791. r.writeVarint64ZigZag(n);
  35792. break;
  35793. case e.TYPES.fixed64:
  35794. r.writeUint64(n);
  35795. break;
  35796. case e.TYPES.sfixed64:
  35797. r.writeInt64(n);
  35798. break;
  35799. case e.TYPES.bool:
  35800. "string" == typeof n ? r.writeVarint32("false" === n.toLowerCase() ? 0 : !!n) : r.writeVarint32(n ? 1 : 0);
  35801. break;
  35802. case e.TYPES.enum:
  35803. r.writeVarint32(n);
  35804. break;
  35805. case e.TYPES.float:
  35806. r.writeFloat32(n);
  35807. break;
  35808. case e.TYPES.double:
  35809. r.writeFloat64(n);
  35810. break;
  35811. case e.TYPES.string:
  35812. r.writeVString(n);
  35813. break;
  35814. case e.TYPES.bytes:
  35815. if (n.remaining() < 0)
  35816. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  35817. var o = n.offset;
  35818. r.writeVarint32(n.remaining()),
  35819. r.append(n),
  35820. n.offset = o;
  35821. break;
  35822. case e.TYPES.message:
  35823. var a = (new t).LE();
  35824. this.resolvedType.encode(n, a),
  35825. r.writeVarint32(a.offset),
  35826. r.append(a.flip());
  35827. break;
  35828. case e.TYPES.group:
  35829. this.resolvedType.encode(n, r),
  35830. r.writeVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP);
  35831. break;
  35832. default:
  35833. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  35834. }
  35835. return r
  35836. }
  35837. ,
  35838. u.decode = function(t, i, n) {
  35839. if (i != this.type.wireType)
  35840. throw Error("Unexpected wire type for element");
  35841. var r, o;
  35842. switch (this.type) {
  35843. case e.TYPES.int32:
  35844. return 0 | t.readVarint32();
  35845. case e.TYPES.uint32:
  35846. return t.readVarint32() >>> 0;
  35847. case e.TYPES.sint32:
  35848. return 0 | t.readVarint32ZigZag();
  35849. case e.TYPES.fixed32:
  35850. return t.readUint32() >>> 0;
  35851. case e.TYPES.sfixed32:
  35852. return 0 | t.readInt32();
  35853. case e.TYPES.int64:
  35854. return t.readVarint64();
  35855. case e.TYPES.uint64:
  35856. return t.readVarint64().toUnsigned();
  35857. case e.TYPES.sint64:
  35858. return t.readVarint64ZigZag();
  35859. case e.TYPES.fixed64:
  35860. return t.readUint64();
  35861. case e.TYPES.sfixed64:
  35862. return t.readInt64();
  35863. case e.TYPES.bool:
  35864. return !!t.readVarint32();
  35865. case e.TYPES.enum:
  35866. return t.readVarint32();
  35867. case e.TYPES.float:
  35868. return t.readFloat();
  35869. case e.TYPES.double:
  35870. return t.readDouble();
  35871. case e.TYPES.string:
  35872. return t.readVString();
  35873. case e.TYPES.bytes:
  35874. if (o = t.readVarint32(),
  35875. t.remaining() < o)
  35876. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + t.remaining());
  35877. return r = t.clone(),
  35878. r.limit = r.offset + o,
  35879. t.offset += o,
  35880. r;
  35881. case e.TYPES.message:
  35882. return o = t.readVarint32(),
  35883. this.resolvedType.decode(t, o);
  35884. case e.TYPES.group:
  35885. return this.resolvedType.decode(t, -1, n)
  35886. }
  35887. throw Error("[INTERNAL] Illegal decode type")
  35888. }
  35889. ,
  35890. u.valueFromString = function(i) {
  35891. if (!this.isMapKey)
  35892. throw Error("valueFromString() called on non-map-key element");
  35893. switch (this.type) {
  35894. case e.TYPES.int32:
  35895. case e.TYPES.sint32:
  35896. case e.TYPES.sfixed32:
  35897. case e.TYPES.uint32:
  35898. case e.TYPES.fixed32:
  35899. return this.verifyValue(parseInt(i));
  35900. case e.TYPES.int64:
  35901. case e.TYPES.sint64:
  35902. case e.TYPES.sfixed64:
  35903. case e.TYPES.uint64:
  35904. case e.TYPES.fixed64:
  35905. return this.verifyValue(i);
  35906. case e.TYPES.bool:
  35907. return "true" === i;
  35908. case e.TYPES.string:
  35909. return this.verifyValue(i);
  35910. case e.TYPES.bytes:
  35911. return t.fromBinary(i)
  35912. }
  35913. }
  35914. ,
  35915. u.valueToString = function(t) {
  35916. if (!this.isMapKey)
  35917. throw Error("valueToString() called on non-map-key element");
  35918. return this.type === e.TYPES.bytes ? t.toString("binary") : t.toString()
  35919. }
  35920. ,
  35921. o.Element = h;
  35922. var d = function(e, t, i, n, r, o) {
  35923. l.call(this, e, t, i, n, o),
  35924. this.className = "Message",
  35925. this.extensions = void 0,
  35926. this.clazz = null,
  35927. this.isGroup = !!r,
  35928. this._fields = null,
  35929. this._fieldsById = null,
  35930. this._fieldsByName = null
  35931. }
  35932. , p = d.prototype = Object.create(l.prototype);
  35933. p.build = function(i) {
  35934. if (this.clazz && !i)
  35935. return this.clazz;
  35936. var n = function(e, i) {
  35937. function n(i, r, o, a) {
  35938. if (null === i || "object" != typeof i) {
  35939. if (a && a instanceof e.Reflect.Enum) {
  35940. var s = e.Reflect.Enum.getName(a.object, i);
  35941. if (null !== s)
  35942. return s
  35943. }
  35944. return i
  35945. }
  35946. if (t.isByteBuffer(i))
  35947. return r ? i.toBase64() : i.toBuffer();
  35948. if (e.Long.isLong(i))
  35949. return o ? i.toString() : e.Long.fromValue(i);
  35950. var l;
  35951. if (Array.isArray(i))
  35952. return l = [],
  35953. i.forEach(function(e, t) {
  35954. l[t] = n(e, r, o, a)
  35955. }),
  35956. l;
  35957. if (l = {},
  35958. i instanceof e.Map) {
  35959. for (var c = i.entries(), h = c.next(); !h.done; h = c.next())
  35960. l[i.keyElem.valueToString(h.value[0])] = n(h.value[1], r, o, i.valueElem.resolvedType);
  35961. return l
  35962. }
  35963. var u = i.$type
  35964. , d = void 0;
  35965. for (var p in i)
  35966. i.hasOwnProperty(p) && (u && (d = u.getChild(p)) ? l[p] = n(i[p], r, o, d.resolvedType) : l[p] = n(i[p], r, o));
  35967. return l
  35968. }
  35969. var r = i.getChildren(e.Reflect.Message.Field)
  35970. , o = i.getChildren(e.Reflect.Message.OneOf)
  35971. , a = function(n, s) {
  35972. e.Builder.Message.call(this);
  35973. for (var l = 0, c = o.length; l < c; ++l)
  35974. this[o[l].name] = null;
  35975. for (l = 0,
  35976. c = r.length; l < c; ++l) {
  35977. var h = r[l];
  35978. this[h.name] = h.repeated ? [] : h.map ? new e.Map(h) : null,
  35979. !h.required && "proto3" !== i.syntax || null === h.defaultValue || (this[h.name] = h.defaultValue)
  35980. }
  35981. if (arguments.length > 0) {
  35982. var u;
  35983. 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)
  35984. for (l = 0,
  35985. c = arguments.length; l < c; ++l)
  35986. "undefined" != typeof (u = arguments[l]) && this.$set(r[l].name, u);
  35987. else
  35988. this.$set(n)
  35989. }
  35990. }
  35991. , s = a.prototype = Object.create(e.Builder.Message.prototype);
  35992. s.add = function(t, n, r) {
  35993. var o = i._fieldsByName[t];
  35994. if (!r) {
  35995. if (!o)
  35996. throw Error(this + "#" + t + " is undefined");
  35997. if (!(o instanceof e.Reflect.Message.Field))
  35998. throw Error(this + "#" + t + " is not a field: " + o.toString(!0));
  35999. if (!o.repeated)
  36000. throw Error(this + "#" + t + " is not a repeated field");
  36001. n = o.verifyValue(n, !0)
  36002. }
  36003. return null === this[t] && (this[t] = []),
  36004. this[t].push(n),
  36005. this
  36006. }
  36007. ,
  36008. s.$add = s.add,
  36009. s.set = function(t, n, r) {
  36010. if (t && "object" == typeof t) {
  36011. r = n;
  36012. for (var o in t)
  36013. t.hasOwnProperty(o) && "undefined" != typeof (n = t[o]) && this.$set(o, n, r);
  36014. return this
  36015. }
  36016. var a = i._fieldsByName[t];
  36017. if (r)
  36018. this[t] = n;
  36019. else {
  36020. if (!a)
  36021. throw Error(this + "#" + t + " is not a field: undefined");
  36022. if (!(a instanceof e.Reflect.Message.Field))
  36023. throw Error(this + "#" + t + " is not a field: " + a.toString(!0));
  36024. this[a.name] = n = a.verifyValue(n)
  36025. }
  36026. if (a && a.oneof) {
  36027. var s = this[a.oneof.name];
  36028. null !== n ? (null !== s && s !== a.name && (this[s] = null),
  36029. this[a.oneof.name] = a.name) : s === t && (this[a.oneof.name] = null)
  36030. }
  36031. return this
  36032. }
  36033. ,
  36034. s.$set = s.set,
  36035. s.get = function(t, n) {
  36036. if (n)
  36037. return this[t];
  36038. var r = i._fieldsByName[t];
  36039. if (!(r && r instanceof e.Reflect.Message.Field))
  36040. throw Error(this + "#" + t + " is not a field: undefined");
  36041. if (!(r instanceof e.Reflect.Message.Field))
  36042. throw Error(this + "#" + t + " is not a field: " + r.toString(!0));
  36043. return this[r.name]
  36044. }
  36045. ,
  36046. s.$get = s.get;
  36047. for (var l = 0; l < r.length; l++) {
  36048. var c = r[l];
  36049. c instanceof e.Reflect.Message.ExtensionField || i.builder.options.populateAccessors && function(e) {
  36050. var t = e.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  36051. return e.toUpperCase().replace("_", "")
  36052. });
  36053. t = t.substring(0, 1).toUpperCase() + t.substring(1);
  36054. var n = e.originalName.replace(/([A-Z])/g, function(e) {
  36055. return "_" + e
  36056. })
  36057. , r = function(t, i) {
  36058. return this[e.name] = i ? t : e.verifyValue(t),
  36059. this
  36060. }
  36061. , o = function() {
  36062. return this[e.name]
  36063. };
  36064. null === i.getChild("set" + t) && (s["set" + t] = r),
  36065. null === i.getChild("set_" + n) && (s["set_" + n] = r),
  36066. null === i.getChild("get" + t) && (s["get" + t] = o),
  36067. null === i.getChild("get_" + n) && (s["get_" + n] = o)
  36068. }(c)
  36069. }
  36070. s.encode = function(e, n) {
  36071. "boolean" == typeof e && (n = e,
  36072. e = void 0);
  36073. var r = !1;
  36074. e || (e = new t,
  36075. r = !0);
  36076. var o = e.littleEndian;
  36077. try {
  36078. return i.encode(this, e.LE(), n),
  36079. (r ? e.flip() : e).LE(o)
  36080. } catch (t) {
  36081. throw e.LE(o),
  36082. t
  36083. }
  36084. }
  36085. ,
  36086. a.encode = function(e, t, i) {
  36087. return new a(e).encode(t, i)
  36088. }
  36089. ,
  36090. s.calculate = function() {
  36091. return i.calculate(this)
  36092. }
  36093. ,
  36094. s.encodeDelimited = function(e, n) {
  36095. var r = !1;
  36096. e || (e = new t,
  36097. r = !0);
  36098. var o = (new t).LE();
  36099. return i.encode(this, o, n).flip(),
  36100. e.writeVarint32(o.remaining()),
  36101. e.append(o),
  36102. r ? e.flip() : e
  36103. }
  36104. ,
  36105. s.encodeAB = function() {
  36106. try {
  36107. return this.encode().toArrayBuffer()
  36108. } catch (e) {
  36109. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  36110. e
  36111. }
  36112. }
  36113. ,
  36114. s.toArrayBuffer = s.encodeAB,
  36115. s.encodeNB = function() {
  36116. try {
  36117. return this.encode().toBuffer()
  36118. } catch (e) {
  36119. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  36120. e
  36121. }
  36122. }
  36123. ,
  36124. s.toBuffer = s.encodeNB,
  36125. s.encode64 = function() {
  36126. try {
  36127. return this.encode().toBase64()
  36128. } catch (e) {
  36129. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  36130. e
  36131. }
  36132. }
  36133. ,
  36134. s.toBase64 = s.encode64,
  36135. s.encodeHex = function() {
  36136. try {
  36137. return this.encode().toHex()
  36138. } catch (e) {
  36139. throw e.encoded && (e.encoded = e.encoded.toHex()),
  36140. e
  36141. }
  36142. }
  36143. ,
  36144. s.toHex = s.encodeHex,
  36145. s.toRaw = function(e, t) {
  36146. return n(this, !!e, !!t, this.$type)
  36147. }
  36148. ,
  36149. s.encodeJSON = function() {
  36150. return JSON.stringify(n(this, !0, !0, this.$type))
  36151. }
  36152. ,
  36153. a.decode = function(e, n, r) {
  36154. "string" == typeof n && (r = n,
  36155. n = -1),
  36156. "string" == typeof e && (e = t.wrap(e, r ? r : "base64")),
  36157. e = t.isByteBuffer(e) ? e : t.wrap(e);
  36158. var o = e.littleEndian;
  36159. try {
  36160. var a = i.decode(e.LE());
  36161. return e.LE(o),
  36162. a
  36163. } catch (t) {
  36164. throw e.LE(o),
  36165. t
  36166. }
  36167. }
  36168. ,
  36169. a.decodeDelimited = function(e, n) {
  36170. if ("string" == typeof e && (e = t.wrap(e, n ? n : "base64")),
  36171. e = t.isByteBuffer(e) ? e : t.wrap(e),
  36172. e.remaining() < 1)
  36173. return null;
  36174. var r = e.offset
  36175. , o = e.readVarint32();
  36176. if (e.remaining() < o)
  36177. return e.offset = r,
  36178. null;
  36179. try {
  36180. var a = i.decode(e.slice(e.offset, e.offset + o).LE());
  36181. return e.offset += o,
  36182. a
  36183. } catch (t) {
  36184. throw e.offset += o,
  36185. t
  36186. }
  36187. }
  36188. ,
  36189. a.decode64 = function(e) {
  36190. return a.decode(e, "base64")
  36191. }
  36192. ,
  36193. a.decodeHex = function(e) {
  36194. return a.decode(e, "hex")
  36195. }
  36196. ,
  36197. a.decodeJSON = function(e) {
  36198. return new a(JSON.parse(e))
  36199. }
  36200. ,
  36201. s.toString = function() {
  36202. return i.toString()
  36203. }
  36204. ;
  36205. return Object.defineProperty && (Object.defineProperty(a, "$options", {
  36206. value: i.buildOpt()
  36207. }),
  36208. Object.defineProperty(s, "$options", {
  36209. value: a.$options
  36210. }),
  36211. Object.defineProperty(a, "$type", {
  36212. value: i
  36213. }),
  36214. Object.defineProperty(s, "$type", {
  36215. value: i
  36216. })),
  36217. a
  36218. }(e, this);
  36219. this._fields = [],
  36220. this._fieldsById = {},
  36221. this._fieldsByName = {};
  36222. for (var r, o = 0, a = this.children.length; o < a; o++)
  36223. if (r = this.children[o],
  36224. r instanceof A || r instanceof d || r instanceof E) {
  36225. if (n.hasOwnProperty(r.name))
  36226. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + r.toString(!0) + " cannot override static property '" + r.name + "'");
  36227. n[r.name] = r.build()
  36228. } else if (r instanceof d.Field)
  36229. r.build(),
  36230. this._fields.push(r),
  36231. this._fieldsById[r.id] = r,
  36232. this._fieldsByName[r.name] = r;
  36233. else if (!(r instanceof d.OneOf || r instanceof I))
  36234. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[o].toString(!0));
  36235. return this.clazz = n
  36236. }
  36237. ,
  36238. p.encode = function(e, t, i) {
  36239. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  36240. n = this._fields[a],
  36241. r = e[n.name],
  36242. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  36243. if (null !== o) {
  36244. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  36245. throw l.encoded = t,
  36246. l
  36247. }
  36248. return t
  36249. }
  36250. ,
  36251. p.calculate = function(e) {
  36252. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  36253. if (t = this._fields[r],
  36254. i = e[t.name],
  36255. t.required && null === i)
  36256. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  36257. n += t.calculate(i, e)
  36258. }
  36259. return n
  36260. }
  36261. ,
  36262. p.decode = function(t, i, n) {
  36263. i = "number" == typeof i ? i : -1;
  36264. for (var o, a, s, l, c = t.offset, h = new this.clazz; t.offset < c + i || i === -1 && t.remaining() > 0; ) {
  36265. if (o = t.readVarint32(),
  36266. a = 7 & o,
  36267. s = o >>> 3,
  36268. a === e.WIRE_TYPES.ENDGROUP) {
  36269. if (s !== n)
  36270. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + s + " (" + (n ? n + " expected" : "not a group") + ")");
  36271. break
  36272. }
  36273. if (l = this._fieldsById[s]) {
  36274. if (l.repeated && !l.options.packed)
  36275. h[l.name].push(l.decode(a, t));
  36276. else if (l.map) {
  36277. var u = l.decode(a, t);
  36278. h[l.name].set(u[0], u[1])
  36279. } else if (h[l.name] = l.decode(a, t),
  36280. l.oneof) {
  36281. var d = h[l.oneof.name];
  36282. null !== d && d !== l.name && (h[d] = null),
  36283. h[l.oneof.name] = l.name
  36284. }
  36285. } else
  36286. switch (a) {
  36287. case e.WIRE_TYPES.VARINT:
  36288. t.readVarint32();
  36289. break;
  36290. case e.WIRE_TYPES.BITS32:
  36291. t.offset += 4;
  36292. break;
  36293. case e.WIRE_TYPES.BITS64:
  36294. t.offset += 8;
  36295. break;
  36296. case e.WIRE_TYPES.LDELIM:
  36297. var p = t.readVarint32();
  36298. t.offset += p;
  36299. break;
  36300. case e.WIRE_TYPES.STARTGROUP:
  36301. for (; r(s, t); )
  36302. ;
  36303. break;
  36304. default:
  36305. throw Error("Illegal wire type for unknown field " + s + " in " + this.toString(!0) + "#decode: " + a)
  36306. }
  36307. }
  36308. for (var f = 0, g = this._fields.length; f < g; ++f)
  36309. if (l = this._fields[f],
  36310. null === h[l.name])
  36311. if ("proto3" === this.syntax)
  36312. h[l.name] = l.defaultValue;
  36313. else {
  36314. if (l.required) {
  36315. var m = Error("Missing at least one required field for " + this.toString(!0) + ": " + l.name);
  36316. throw m.decoded = h,
  36317. m
  36318. }
  36319. e.populateDefaults && null !== l.defaultValue && (h[l.name] = l.defaultValue)
  36320. }
  36321. return h
  36322. }
  36323. ,
  36324. o.Message = d;
  36325. var f = function(t, i, n, r, o, s, l, c, h, u) {
  36326. a.call(this, t, i, s),
  36327. this.className = "Message.Field",
  36328. this.required = "required" === n,
  36329. this.repeated = "repeated" === n,
  36330. this.map = "map" === n,
  36331. this.keyType = r || null,
  36332. this.type = o,
  36333. this.resolvedType = null,
  36334. this.id = l,
  36335. this.options = c || {},
  36336. this.defaultValue = null,
  36337. this.oneof = h || null,
  36338. this.syntax = u || "proto2",
  36339. this.originalName = this.name,
  36340. this.element = null,
  36341. this.keyElement = null,
  36342. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = e.Util.toCamelCase(this.name))
  36343. }
  36344. , g = f.prototype = Object.create(a.prototype);
  36345. g.build = function() {
  36346. this.element = new h(this.type,this.resolvedType,!1,this.syntax),
  36347. this.map && (this.keyElement = new h(this.keyType,void 0,!0,this.syntax)),
  36348. "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)
  36349. }
  36350. ,
  36351. g.verifyValue = function(t, i) {
  36352. function n(e, t) {
  36353. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  36354. }
  36355. i = i || !1;
  36356. var r = this;
  36357. if (null === t)
  36358. return this.required && n(typeof t, "required"),
  36359. "proto3" === this.syntax && this.type !== e.TYPES.message && n(typeof t, "proto3 field without field presence cannot be null"),
  36360. null;
  36361. var o;
  36362. if (this.repeated && !i) {
  36363. Array.isArray(t) || (t = [t]);
  36364. var a = [];
  36365. for (o = 0; o < t.length; o++)
  36366. a.push(this.element.verifyValue(t[o]));
  36367. return a
  36368. }
  36369. return this.map && !i ? t instanceof e.Map ? t : (t instanceof Object || n(typeof t, "expected ProtoBuf.Map or raw object for map field"),
  36370. new e.Map(this,t)) : (!this.repeated && Array.isArray(t) && n(typeof t, "no array expected"),
  36371. this.element.verifyValue(t))
  36372. }
  36373. ,
  36374. g.hasWirePresence = function(t, i) {
  36375. if ("proto3" !== this.syntax)
  36376. return null !== t;
  36377. if (this.oneof && i[this.oneof.name] === this.name)
  36378. return !0;
  36379. switch (this.type) {
  36380. case e.TYPES.int32:
  36381. case e.TYPES.sint32:
  36382. case e.TYPES.sfixed32:
  36383. case e.TYPES.uint32:
  36384. case e.TYPES.fixed32:
  36385. return 0 !== t;
  36386. case e.TYPES.int64:
  36387. case e.TYPES.sint64:
  36388. case e.TYPES.sfixed64:
  36389. case e.TYPES.uint64:
  36390. case e.TYPES.fixed64:
  36391. return 0 !== t.low || 0 !== t.high;
  36392. case e.TYPES.bool:
  36393. return t;
  36394. case e.TYPES.float:
  36395. case e.TYPES.double:
  36396. return 0 !== t;
  36397. case e.TYPES.string:
  36398. return t.length > 0;
  36399. case e.TYPES.bytes:
  36400. return t.remaining() > 0;
  36401. case e.TYPES.enum:
  36402. return 0 !== t;
  36403. case e.TYPES.message:
  36404. return null !== t;
  36405. default:
  36406. return !0
  36407. }
  36408. }
  36409. ,
  36410. g.encode = function(i, n, r) {
  36411. if (null === this.type || "object" != typeof this.type)
  36412. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  36413. if (null === i || this.repeated && 0 == i.length)
  36414. return n;
  36415. try {
  36416. if (this.repeated) {
  36417. var o;
  36418. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  36419. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36420. n.ensureCapacity(n.offset += 1);
  36421. var a = n.offset;
  36422. for (o = 0; o < i.length; o++)
  36423. this.element.encodeValue(this.id, i[o], n);
  36424. var s = n.offset - a
  36425. , l = t.calculateVarint32(s);
  36426. if (l > 1) {
  36427. var c = n.slice(a, n.offset);
  36428. a += l - 1,
  36429. n.offset = a,
  36430. n.append(c)
  36431. }
  36432. n.writeVarint32(s, a - l)
  36433. } else
  36434. for (o = 0; o < i.length; o++)
  36435. n.writeVarint32(this.id << 3 | this.type.wireType),
  36436. this.element.encodeValue(this.id, i[o], n)
  36437. } else
  36438. this.map ? i.forEach(function(i, r, o) {
  36439. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, r) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  36440. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36441. n.writeVarint32(a),
  36442. n.writeVarint32(8 | this.keyType.wireType),
  36443. this.keyElement.encodeValue(1, r, n),
  36444. n.writeVarint32(16 | this.type.wireType),
  36445. this.element.encodeValue(2, i, n)
  36446. }, this) : this.hasWirePresence(i, r) && (n.writeVarint32(this.id << 3 | this.type.wireType),
  36447. this.element.encodeValue(this.id, i, n))
  36448. } catch (e) {
  36449. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  36450. }
  36451. return n
  36452. }
  36453. ,
  36454. g.calculate = function(i, n) {
  36455. if (i = this.verifyValue(i),
  36456. null === this.type || "object" != typeof this.type)
  36457. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  36458. if (null === i || this.repeated && 0 == i.length)
  36459. return 0;
  36460. var r = 0;
  36461. try {
  36462. if (this.repeated) {
  36463. var o, a;
  36464. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  36465. for (r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36466. a = 0,
  36467. o = 0; o < i.length; o++)
  36468. a += this.element.calculateLength(this.id, i[o]);
  36469. r += t.calculateVarint32(a),
  36470. r += a
  36471. } else
  36472. for (o = 0; o < i.length; o++)
  36473. r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  36474. r += this.element.calculateLength(this.id, i[o])
  36475. } else
  36476. this.map ? i.forEach(function(i, n, o) {
  36477. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, n) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  36478. r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36479. r += t.calculateVarint32(a),
  36480. r += a
  36481. }, this) : this.hasWirePresence(i, n) && (r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  36482. r += this.element.calculateLength(this.id, i))
  36483. } catch (e) {
  36484. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  36485. }
  36486. return r
  36487. }
  36488. ,
  36489. g.decode = function(t, i, n) {
  36490. 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;
  36491. if (!a)
  36492. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + t + " (" + this.type.wireType + " expected)");
  36493. if (t == e.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0 && !n) {
  36494. o = i.readVarint32(),
  36495. o = i.offset + o;
  36496. for (var s = []; i.offset < o; )
  36497. s.push(this.decode(this.type.wireType, i, !0));
  36498. return s
  36499. }
  36500. if (this.map) {
  36501. var l = h.defaultFieldValue(this.keyType);
  36502. if (r = h.defaultFieldValue(this.type),
  36503. o = i.readVarint32(),
  36504. i.remaining() < o)
  36505. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + i.remaining());
  36506. var c = i.clone();
  36507. for (c.limit = c.offset + o,
  36508. i.offset += o; c.remaining() > 0; ) {
  36509. var u = c.readVarint32();
  36510. t = 7 & u;
  36511. var d = u >>> 3;
  36512. if (1 === d)
  36513. l = this.keyElement.decode(c, t, d);
  36514. else {
  36515. if (2 !== d)
  36516. throw Error("Unexpected tag in map field key/value submessage");
  36517. r = this.element.decode(c, t, d)
  36518. }
  36519. }
  36520. return [l, r]
  36521. }
  36522. return this.element.decode(i, t, this.id)
  36523. }
  36524. ,
  36525. o.Message.Field = f;
  36526. var m = function(e, t, i, n, r, o, a) {
  36527. f.call(this, e, t, i, null, n, r, o, a),
  36528. this.extension
  36529. };
  36530. m.prototype = Object.create(f.prototype),
  36531. o.Message.ExtensionField = m;
  36532. var v = function(e, t, i) {
  36533. a.call(this, e, t, i),
  36534. this.fields = []
  36535. };
  36536. o.Message.OneOf = v;
  36537. var A = function(e, t, i, n, r) {
  36538. l.call(this, e, t, i, n, r),
  36539. this.className = "Enum",
  36540. this.object = null
  36541. };
  36542. A.getName = function(e, t) {
  36543. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  36544. if (e[i = n[r]] === t)
  36545. return i;
  36546. return null
  36547. }
  36548. ;
  36549. var y = A.prototype = Object.create(l.prototype);
  36550. y.build = function(t) {
  36551. if (this.object && !t)
  36552. return this.object;
  36553. for (var i = new e.Builder.Enum, n = this.getChildren(A.Value), r = 0, o = n.length; r < o; ++r)
  36554. i[n[r].name] = n[r].id;
  36555. return Object.defineProperty && Object.defineProperty(i, "$options", {
  36556. value: this.buildOpt(),
  36557. enumerable: !1
  36558. }),
  36559. this.object = i
  36560. }
  36561. ,
  36562. o.Enum = A;
  36563. var C = function(e, t, i, n) {
  36564. a.call(this, e, t, i),
  36565. this.className = "Enum.Value",
  36566. this.id = n
  36567. };
  36568. C.prototype = Object.create(a.prototype),
  36569. o.Enum.Value = C;
  36570. var I = function(e, t, i, n) {
  36571. a.call(this, e, t, i),
  36572. this.field = n
  36573. };
  36574. I.prototype = Object.create(a.prototype),
  36575. o.Extension = I;
  36576. var E = function(e, t, i, n) {
  36577. l.call(this, e, t, i, n),
  36578. this.className = "Service",
  36579. this.clazz = null
  36580. }
  36581. , b = E.prototype = Object.create(l.prototype);
  36582. b.build = function(i) {
  36583. return this.clazz && !i ? this.clazz : this.clazz = function(e, i) {
  36584. for (var n = function(t) {
  36585. e.Builder.Service.call(this),
  36586. this.rpcImpl = t || function(e, t, i) {
  36587. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  36588. }
  36589. }, r = n.prototype = Object.create(e.Builder.Service.prototype), o = i.getChildren(e.Reflect.Service.RPCMethod), a = 0; a < o.length; a++)
  36590. !function(e) {
  36591. r[e.name] = function(n, r) {
  36592. try {
  36593. try {
  36594. n = e.resolvedRequestType.clazz.decode(t.wrap(n))
  36595. } catch (e) {
  36596. if (!(e instanceof TypeError))
  36597. throw e
  36598. }
  36599. if (null === n || "object" != typeof n)
  36600. throw Error("Illegal arguments");
  36601. n instanceof e.resolvedRequestType.clazz || (n = new e.resolvedRequestType.clazz(n)),
  36602. this.rpcImpl(e.fqn(), n, function(t, n) {
  36603. if (t)
  36604. return void r(t);
  36605. null === n && (n = "");
  36606. try {
  36607. n = e.resolvedResponseType.clazz.decode(n)
  36608. } catch (e) {}
  36609. 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))
  36610. })
  36611. } catch (e) {
  36612. setTimeout(r.bind(this, e), 0)
  36613. }
  36614. }
  36615. ,
  36616. n[e.name] = function(t, i, r) {
  36617. new n(t)[e.name](i, r)
  36618. }
  36619. ,
  36620. Object.defineProperty && (Object.defineProperty(n[e.name], "$options", {
  36621. value: e.buildOpt()
  36622. }),
  36623. Object.defineProperty(r[e.name], "$options", {
  36624. value: n[e.name].$options
  36625. }))
  36626. }(o[a]);
  36627. return Object.defineProperty && (Object.defineProperty(n, "$options", {
  36628. value: i.buildOpt()
  36629. }),
  36630. Object.defineProperty(r, "$options", {
  36631. value: n.$options
  36632. }),
  36633. Object.defineProperty(n, "$type", {
  36634. value: i
  36635. }),
  36636. Object.defineProperty(r, "$type", {
  36637. value: i
  36638. })),
  36639. n
  36640. }(e, this)
  36641. }
  36642. ,
  36643. o.Service = E;
  36644. var w = function(e, t, i, n) {
  36645. a.call(this, e, t, i),
  36646. this.className = "Service.Method",
  36647. this.options = n || {}
  36648. }
  36649. , _ = w.prototype = Object.create(a.prototype);
  36650. _.buildOpt = c.buildOpt,
  36651. o.Service.Method = w;
  36652. var T = function(e, t, i, n, r, o, a, s) {
  36653. w.call(this, e, t, i, s),
  36654. this.className = "Service.RPCMethod",
  36655. this.requestName = n,
  36656. this.responseName = r,
  36657. this.requestStream = o,
  36658. this.responseStream = a,
  36659. this.resolvedRequestType = null,
  36660. this.resolvedResponseType = null
  36661. };
  36662. return T.prototype = Object.create(w.prototype),
  36663. o.Service.RPCMethod = T,
  36664. o
  36665. }(r),
  36666. r.Builder = function(t, i, n) {
  36667. function r(e) {
  36668. e.messages && e.messages.forEach(function(t) {
  36669. t.syntax = e.syntax,
  36670. r(t)
  36671. }),
  36672. e.enums && e.enums.forEach(function(t) {
  36673. t.syntax = e.syntax
  36674. })
  36675. }
  36676. var o = function(e) {
  36677. this.ns = new n.Namespace(this,null,""),
  36678. this.ptr = this.ns,
  36679. this.resolved = !1,
  36680. this.result = null,
  36681. this.files = {},
  36682. this.importRoot = null,
  36683. this.options = e || {}
  36684. }
  36685. , a = o.prototype;
  36686. return o.isMessage = function(e) {
  36687. return "string" == typeof e.name && ("undefined" == typeof e.values && "undefined" == typeof e.rpc)
  36688. }
  36689. ,
  36690. o.isMessageField = function(e) {
  36691. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && "undefined" != typeof e.id
  36692. }
  36693. ,
  36694. o.isEnum = function(e) {
  36695. return "string" == typeof e.name && !("undefined" == typeof e.values || !Array.isArray(e.values) || 0 === e.values.length)
  36696. }
  36697. ,
  36698. o.isService = function(e) {
  36699. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  36700. }
  36701. ,
  36702. o.isExtend = function(e) {
  36703. return "string" == typeof e.ref
  36704. }
  36705. ,
  36706. a.reset = function() {
  36707. return this.ptr = this.ns,
  36708. this
  36709. }
  36710. ,
  36711. a.define = function(e) {
  36712. if ("string" != typeof e || !i.TYPEREF.test(e))
  36713. throw Error("illegal namespace: " + e);
  36714. return e.split(".").forEach(function(e) {
  36715. var t = this.ptr.getChild(e);
  36716. null === t && this.ptr.addChild(t = new n.Namespace(this,this.ptr,e)),
  36717. this.ptr = t
  36718. }, this),
  36719. this
  36720. }
  36721. ,
  36722. a.create = function(e) {
  36723. if (!e)
  36724. return this;
  36725. if (Array.isArray(e)) {
  36726. if (0 === e.length)
  36727. return this;
  36728. e = e.slice()
  36729. } else
  36730. e = [e];
  36731. for (var i = [e]; i.length > 0; ) {
  36732. if (e = i.pop(),
  36733. !Array.isArray(e))
  36734. throw Error("not a valid namespace: " + JSON.stringify(e));
  36735. for (; e.length > 0; ) {
  36736. var r = e.shift();
  36737. if (o.isMessage(r)) {
  36738. var a = new n.Message(this,this.ptr,r.name,r.options,r.isGroup,r.syntax)
  36739. , s = {};
  36740. r.oneofs && Object.keys(r.oneofs).forEach(function(e) {
  36741. a.addChild(s[e] = new n.Message.OneOf(this,a,e))
  36742. }, this),
  36743. r.fields && r.fields.forEach(function(e) {
  36744. if (null !== a.getChild(0 | e.id))
  36745. throw Error("duplicate or invalid field id in " + a.name + ": " + e.id);
  36746. if (e.options && "object" != typeof e.options)
  36747. throw Error("illegal field options in " + a.name + "#" + e.name);
  36748. var t = null;
  36749. if ("string" == typeof e.oneof && !(t = s[e.oneof]))
  36750. throw Error("illegal oneof in " + a.name + "#" + e.name + ": " + e.oneof);
  36751. e = new n.Message.Field(this,a,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,r.syntax),
  36752. t && t.fields.push(e),
  36753. a.addChild(e)
  36754. }, this);
  36755. var l = [];
  36756. if (r.enums && r.enums.forEach(function(e) {
  36757. l.push(e)
  36758. }),
  36759. r.messages && r.messages.forEach(function(e) {
  36760. l.push(e)
  36761. }),
  36762. r.services && r.services.forEach(function(e) {
  36763. l.push(e)
  36764. }),
  36765. r.extensions && ("number" == typeof r.extensions[0] ? a.extensions = [r.extensions] : a.extensions = r.extensions),
  36766. this.ptr.addChild(a),
  36767. l.length > 0) {
  36768. i.push(e),
  36769. e = l,
  36770. l = null,
  36771. this.ptr = a,
  36772. a = null;
  36773. continue
  36774. }
  36775. l = null
  36776. } else if (o.isEnum(r))
  36777. a = new n.Enum(this,this.ptr,r.name,r.options,r.syntax),
  36778. r.values.forEach(function(e) {
  36779. a.addChild(new n.Enum.Value(this,a,e.name,e.id))
  36780. }, this),
  36781. this.ptr.addChild(a);
  36782. else if (o.isService(r))
  36783. a = new n.Service(this,this.ptr,r.name,r.options),
  36784. Object.keys(r.rpc).forEach(function(e) {
  36785. var t = r.rpc[e];
  36786. a.addChild(new n.Service.RPCMethod(this,a,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  36787. }, this),
  36788. this.ptr.addChild(a);
  36789. else {
  36790. if (!o.isExtend(r))
  36791. throw Error("not a valid definition: " + JSON.stringify(r));
  36792. if (a = this.ptr.resolve(r.ref, !0))
  36793. r.fields.forEach(function(e) {
  36794. if (null !== a.getChild(0 | e.id))
  36795. throw Error("duplicate extended field id in " + a.name + ": " + e.id);
  36796. if (a.extensions) {
  36797. var i = !1;
  36798. if (a.extensions.forEach(function(t) {
  36799. e.id >= t[0] && e.id <= t[1] && (i = !0)
  36800. }),
  36801. !i)
  36802. throw Error("illegal extended field id in " + a.name + ": " + e.id + " (not within valid ranges)")
  36803. }
  36804. var r = e.name;
  36805. this.options.convertFieldsToCamelCase && (r = t.Util.toCamelCase(r));
  36806. var o = new n.Message.ExtensionField(this,a,e.rule,e.type,this.ptr.fqn() + "." + r,e.id,e.options)
  36807. , s = new n.Extension(this,this.ptr,e.name,o);
  36808. o.extension = s,
  36809. this.ptr.addChild(s),
  36810. a.addChild(o)
  36811. }, this);
  36812. else if (!/\.?google\.protobuf\./.test(r.ref))
  36813. throw Error("extended message " + r.ref + " is not defined")
  36814. }
  36815. r = null,
  36816. a = null
  36817. }
  36818. e = null,
  36819. this.ptr = this.ptr.parent
  36820. }
  36821. return this.resolved = !1,
  36822. this.result = null,
  36823. this
  36824. }
  36825. ,
  36826. a.import = function(i, n) {
  36827. var o = "/";
  36828. if ("string" == typeof n) {
  36829. if (t.Util.IS_NODE && (n = e("path").resolve(n)),
  36830. this.files[n] === !0)
  36831. return this.reset();
  36832. this.files[n] = !0
  36833. } else if ("object" == typeof n) {
  36834. var a = n.root;
  36835. t.Util.IS_NODE && (a = e("path").resolve(a)),
  36836. (a.indexOf("\\") >= 0 || n.file.indexOf("\\") >= 0) && (o = "\\");
  36837. var s = a + o + n.file;
  36838. if (this.files[s] === !0)
  36839. return this.reset();
  36840. this.files[s] = !0
  36841. }
  36842. if (i.imports && i.imports.length > 0) {
  36843. var l, c = !1;
  36844. "object" == typeof n ? (this.importRoot = n.root,
  36845. c = !0,
  36846. l = this.importRoot,
  36847. n = n.file,
  36848. (l.indexOf("\\") >= 0 || n.indexOf("\\") >= 0) && (o = "\\")) : "string" == typeof n ? this.importRoot ? l = this.importRoot : n.indexOf("/") >= 0 ? (l = n.replace(/\/[^\/]*$/, ""),
  36849. "" === l && (l = "/")) : n.indexOf("\\") >= 0 ? (l = n.replace(/\\[^\\]*$/, ""),
  36850. o = "\\") : l = "." : l = null;
  36851. for (var h = 0; h < i.imports.length; h++)
  36852. if ("string" == typeof i.imports[h]) {
  36853. if (!l)
  36854. throw Error("cannot determine import root");
  36855. var u = i.imports[h];
  36856. if ("google/protobuf/descriptor.proto" === u)
  36857. continue;
  36858. if (u = l + o + u,
  36859. this.files[u] === !0)
  36860. continue;
  36861. /\.proto$/i.test(u) && !t.DotProto && (u = u.replace(/\.proto$/, ".json"));
  36862. var d = t.Util.fetch(u);
  36863. if (null === d)
  36864. throw Error("failed to import '" + u + "' in '" + n + "': file not found");
  36865. /\.json$/i.test(u) ? this.import(JSON.parse(d + ""), u) : this.import(t.DotProto.Parser.parse(d), u)
  36866. } else
  36867. n ? /\.(\w+)$/.test(n) ? this.import(i.imports[h], n.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  36868. return t + "_import" + h + "." + i
  36869. })) : this.import(i.imports[h], n + "_import" + h) : this.import(i.imports[h]);
  36870. c && (this.importRoot = null)
  36871. }
  36872. i.package && this.define(i.package),
  36873. i.syntax && r(i);
  36874. var p = this.ptr;
  36875. return i.options && Object.keys(i.options).forEach(function(e) {
  36876. p.options[e] = i.options[e]
  36877. }),
  36878. i.messages && (this.create(i.messages),
  36879. this.ptr = p),
  36880. i.enums && (this.create(i.enums),
  36881. this.ptr = p),
  36882. i.services && (this.create(i.services),
  36883. this.ptr = p),
  36884. i.extends && this.create(i.extends),
  36885. this.reset()
  36886. }
  36887. ,
  36888. a.resolveAll = function() {
  36889. var e;
  36890. if (null == this.ptr || "object" == typeof this.ptr.type)
  36891. return this;
  36892. if (this.ptr instanceof n.Namespace)
  36893. this.ptr.children.forEach(function(e) {
  36894. this.ptr = e,
  36895. this.resolveAll()
  36896. }, this);
  36897. else if (this.ptr instanceof n.Message.Field) {
  36898. if (i.TYPE.test(this.ptr.type))
  36899. this.ptr.type = t.TYPES[this.ptr.type];
  36900. else {
  36901. if (!i.TYPEREF.test(this.ptr.type))
  36902. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  36903. if (e = (this.ptr instanceof n.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0),
  36904. !e)
  36905. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  36906. if (this.ptr.resolvedType = e,
  36907. e instanceof n.Enum) {
  36908. if (this.ptr.type = t.TYPES.enum,
  36909. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  36910. throw Error("proto3 message cannot reference proto2 enum")
  36911. } else {
  36912. if (!(e instanceof n.Message))
  36913. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  36914. this.ptr.type = e.isGroup ? t.TYPES.group : t.TYPES.message
  36915. }
  36916. }
  36917. if (this.ptr.map) {
  36918. if (!i.TYPE.test(this.ptr.keyType))
  36919. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  36920. this.ptr.keyType = t.TYPES[this.ptr.keyType]
  36921. }
  36922. } else if (this.ptr instanceof t.Reflect.Service.Method) {
  36923. if (!(this.ptr instanceof t.Reflect.Service.RPCMethod))
  36924. throw Error("illegal service type in " + this.ptr.toString(!0));
  36925. if (e = this.ptr.parent.resolve(this.ptr.requestName, !0),
  36926. !(e && e instanceof t.Reflect.Message))
  36927. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  36928. if (this.ptr.resolvedRequestType = e,
  36929. e = this.ptr.parent.resolve(this.ptr.responseName, !0),
  36930. !(e && e instanceof t.Reflect.Message))
  36931. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  36932. this.ptr.resolvedResponseType = e
  36933. } else if (!(this.ptr instanceof t.Reflect.Message.OneOf || this.ptr instanceof t.Reflect.Extension || this.ptr instanceof t.Reflect.Enum.Value))
  36934. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  36935. return this.reset()
  36936. }
  36937. ,
  36938. a.build = function(e) {
  36939. if (this.reset(),
  36940. this.resolved || (this.resolveAll(),
  36941. this.resolved = !0,
  36942. this.result = null),
  36943. null === this.result && (this.result = this.ns.build()),
  36944. !e)
  36945. return this.result;
  36946. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  36947. if (!i[t[n]]) {
  36948. i = null;
  36949. break
  36950. }
  36951. i = i[t[n]]
  36952. }
  36953. return i
  36954. }
  36955. ,
  36956. a.lookup = function(e, t) {
  36957. return e ? this.ns.resolve(e, t) : this.ns
  36958. }
  36959. ,
  36960. a.toString = function() {
  36961. return "Builder"
  36962. }
  36963. ,
  36964. o.Message = function() {}
  36965. ,
  36966. o.Enum = function() {}
  36967. ,
  36968. o.Service = function() {}
  36969. ,
  36970. o
  36971. }(r, r.Lang, r.Reflect),
  36972. r.Map = function(e, t) {
  36973. function i(e) {
  36974. var t = 0;
  36975. return {
  36976. next: function() {
  36977. return t < e.length ? {
  36978. done: !1,
  36979. value: e[t++]
  36980. } : {
  36981. done: !0
  36982. }
  36983. }
  36984. }
  36985. }
  36986. var n = function(e, i) {
  36987. if (!e.map)
  36988. throw Error("field is not a map");
  36989. if (this.field = e,
  36990. this.keyElem = new t.Element(e.keyType,null,!0,e.syntax),
  36991. this.valueElem = new t.Element(e.type,e.resolvedType,!1,e.syntax),
  36992. this.map = {},
  36993. Object.defineProperty(this, "size", {
  36994. get: function() {
  36995. return Object.keys(this.map).length
  36996. }
  36997. }),
  36998. i)
  36999. for (var n = Object.keys(i), r = 0; r < n.length; r++) {
  37000. var o = this.keyElem.valueFromString(n[r])
  37001. , a = this.valueElem.verifyValue(i[n[r]]);
  37002. this.map[this.keyElem.valueToString(o)] = {
  37003. key: o,
  37004. value: a
  37005. }
  37006. }
  37007. }
  37008. , r = n.prototype;
  37009. return r.clear = function() {
  37010. this.map = {}
  37011. }
  37012. ,
  37013. r.delete = function(e) {
  37014. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  37015. , i = t in this.map;
  37016. return delete this.map[t],
  37017. i
  37018. }
  37019. ,
  37020. r.entries = function() {
  37021. for (var e, t = [], n = Object.keys(this.map), r = 0; r < n.length; r++)
  37022. t.push([(e = this.map[n[r]]).key, e.value]);
  37023. return i(t)
  37024. }
  37025. ,
  37026. r.keys = function() {
  37027. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  37028. e.push(this.map[t[n]].key);
  37029. return i(e)
  37030. }
  37031. ,
  37032. r.values = function() {
  37033. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  37034. e.push(this.map[t[n]].value);
  37035. return i(e)
  37036. }
  37037. ,
  37038. r.forEach = function(e, t) {
  37039. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  37040. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  37041. }
  37042. ,
  37043. r.set = function(e, t) {
  37044. var i = this.keyElem.verifyValue(e)
  37045. , n = this.valueElem.verifyValue(t);
  37046. return this.map[this.keyElem.valueToString(i)] = {
  37047. key: i,
  37048. value: n
  37049. },
  37050. this
  37051. }
  37052. ,
  37053. r.get = function(e) {
  37054. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  37055. if (t in this.map)
  37056. return this.map[t].value
  37057. }
  37058. ,
  37059. r.has = function(e) {
  37060. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  37061. return t in this.map
  37062. }
  37063. ,
  37064. n
  37065. }(r, r.Reflect),
  37066. r.loadProto = function(e, t, i) {
  37067. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  37068. t = void 0),
  37069. r.loadJson(r.DotProto.Parser.parse(e), t, i)
  37070. }
  37071. ,
  37072. r.protoFromString = r.loadProto,
  37073. r.loadProtoFile = function(e, t, i) {
  37074. if (t && "object" == typeof t ? (i = t,
  37075. t = null) : t && "function" == typeof t || (t = null),
  37076. t)
  37077. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  37078. if (null === n)
  37079. return void t(Error("Failed to fetch file"));
  37080. try {
  37081. t(null, r.loadProto(n, i, e))
  37082. } catch (e) {
  37083. t(e)
  37084. }
  37085. });
  37086. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  37087. return null === n ? null : r.loadProto(n, i, e)
  37088. }
  37089. ,
  37090. r.protoFromFile = r.loadProtoFile,
  37091. r.newBuilder = function(e) {
  37092. return e = e || {},
  37093. "undefined" == typeof e.convertFieldsToCamelCase && (e.convertFieldsToCamelCase = r.convertFieldsToCamelCase),
  37094. "undefined" == typeof e.populateAccessors && (e.populateAccessors = r.populateAccessors),
  37095. new r.Builder(e)
  37096. }
  37097. ,
  37098. r.loadJson = function(e, t, i) {
  37099. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  37100. t = null),
  37101. t && "object" == typeof t || (t = r.newBuilder()),
  37102. "string" == typeof e && (e = JSON.parse(e)),
  37103. t.import(e, i),
  37104. t.resolveAll(),
  37105. t
  37106. }
  37107. ,
  37108. r.loadJsonFile = function(e, t, i) {
  37109. if (t && "object" == typeof t ? (i = t,
  37110. t = null) : t && "function" == typeof t || (t = null),
  37111. t)
  37112. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  37113. if (null === n)
  37114. return void t(Error("Failed to fetch file"));
  37115. try {
  37116. t(null, r.loadJson(JSON.parse(n), i, e))
  37117. } catch (e) {
  37118. t(e)
  37119. }
  37120. });
  37121. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  37122. return null === n ? null : r.loadJson(JSON.parse(n), i, e)
  37123. }
  37124. ,
  37125. r
  37126. })
  37127. }
  37128. ).call(this, e("_process"))
  37129. }
  37130. , {
  37131. _process: 203,
  37132. bytebuffer: 215,
  37133. fs: 197,
  37134. path: 197
  37135. }],
  37136. 215: [function(e, t, i) {
  37137. !function(i, n) {
  37138. "function" == typeof define && define.amd ? define(["long"], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = function() {
  37139. var t;
  37140. try {
  37141. t = e("long")
  37142. } catch (e) {}
  37143. return n(t)
  37144. }() : (i.dcodeIO = i.dcodeIO || {}).ByteBuffer = n(i.dcodeIO.Long)
  37145. }(this, function(e) {
  37146. "use strict";
  37147. function t(e) {
  37148. var t = 0;
  37149. return function() {
  37150. return t < e.length ? e.charCodeAt(t++) : null
  37151. }
  37152. }
  37153. function i() {
  37154. var e = []
  37155. , t = [];
  37156. return function() {
  37157. return 0 === arguments.length ? t.join("") + l.apply(String, e) : (e.length + arguments.length > 1024 && (t.push(l.apply(String, e)),
  37158. e.length = 0),
  37159. void Array.prototype.push.apply(e, arguments))
  37160. }
  37161. }
  37162. function n(e, t, i, n, r) {
  37163. 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];
  37164. for (u += d,
  37165. o = p & (1 << -h) - 1,
  37166. p >>= -h,
  37167. h += s; h > 0; o = 256 * o + e[t + u],
  37168. u += d,
  37169. h -= 8)
  37170. ;
  37171. for (a = o & (1 << -h) - 1,
  37172. o >>= -h,
  37173. h += n; h > 0; a = 256 * a + e[t + u],
  37174. u += d,
  37175. h -= 8)
  37176. ;
  37177. if (0 === o)
  37178. o = 1 - c;
  37179. else {
  37180. if (o === l)
  37181. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  37182. a += Math.pow(2, n),
  37183. o -= c
  37184. }
  37185. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  37186. }
  37187. function r(e, t, i, n, r, o) {
  37188. 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;
  37189. for (t = Math.abs(t),
  37190. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  37191. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  37192. t * (l = Math.pow(2, -a)) < 1 && (a--,
  37193. l *= 2),
  37194. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  37195. t * l >= 2 && (a++,
  37196. l /= 2),
  37197. a + u >= h ? (s = 0,
  37198. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  37199. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  37200. a = 0)); r >= 8; e[i + p] = 255 & s,
  37201. p += f,
  37202. s /= 256,
  37203. r -= 8)
  37204. ;
  37205. for (a = a << r | s,
  37206. c += r; c > 0; e[i + p] = 255 & a,
  37207. p += f,
  37208. a /= 256,
  37209. c -= 8)
  37210. ;
  37211. e[i + p - f] |= 128 * g
  37212. }
  37213. var o = function(e, t, i) {
  37214. if ("undefined" == typeof e && (e = o.DEFAULT_CAPACITY),
  37215. "undefined" == typeof t && (t = o.DEFAULT_ENDIAN),
  37216. "undefined" == typeof i && (i = o.DEFAULT_NOASSERT),
  37217. !i) {
  37218. if (e |= 0,
  37219. e < 0)
  37220. throw RangeError("Illegal capacity");
  37221. t = !!t,
  37222. i = !!i
  37223. }
  37224. this.buffer = 0 === e ? s : new ArrayBuffer(e),
  37225. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  37226. this.offset = 0,
  37227. this.markedOffset = -1,
  37228. this.limit = e,
  37229. this.littleEndian = t,
  37230. this.noAssert = i
  37231. };
  37232. o.VERSION = "5.0.1",
  37233. o.LITTLE_ENDIAN = !0,
  37234. o.BIG_ENDIAN = !1,
  37235. o.DEFAULT_CAPACITY = 16,
  37236. o.DEFAULT_ENDIAN = o.BIG_ENDIAN,
  37237. o.DEFAULT_NOASSERT = !1,
  37238. o.Long = e || null;
  37239. var a = o.prototype;
  37240. a.__isByteBuffer__,
  37241. Object.defineProperty(a, "__isByteBuffer__", {
  37242. value: !0,
  37243. enumerable: !1,
  37244. configurable: !1
  37245. });
  37246. var s = new ArrayBuffer(0)
  37247. , l = String.fromCharCode;
  37248. o.accessor = function() {
  37249. return Uint8Array
  37250. }
  37251. ,
  37252. o.allocate = function(e, t, i) {
  37253. return new o(e,t,i)
  37254. }
  37255. ,
  37256. o.concat = function(e, t, i, n) {
  37257. "boolean" != typeof t && "string" == typeof t || (n = i,
  37258. i = t,
  37259. t = void 0);
  37260. for (var r, a = 0, s = 0, l = e.length; s < l; ++s)
  37261. o.isByteBuffer(e[s]) || (e[s] = o.wrap(e[s], t)),
  37262. r = e[s].limit - e[s].offset,
  37263. r > 0 && (a += r);
  37264. if (0 === a)
  37265. return new o(0,i,n);
  37266. var c, h = new o(a,i,n);
  37267. for (s = 0; s < l; )
  37268. c = e[s++],
  37269. r = c.limit - c.offset,
  37270. r <= 0 || (h.view.set(c.view.subarray(c.offset, c.limit), h.offset),
  37271. h.offset += r);
  37272. return h.limit = h.offset,
  37273. h.offset = 0,
  37274. h
  37275. }
  37276. ,
  37277. o.isByteBuffer = function(e) {
  37278. return (e && e.__isByteBuffer__) === !0
  37279. }
  37280. ,
  37281. o.type = function() {
  37282. return ArrayBuffer
  37283. }
  37284. ,
  37285. o.wrap = function(e, t, i, n) {
  37286. if ("string" != typeof t && (n = i,
  37287. i = t,
  37288. t = void 0),
  37289. "string" == typeof e)
  37290. switch ("undefined" == typeof t && (t = "utf8"),
  37291. t) {
  37292. case "base64":
  37293. return o.fromBase64(e, i);
  37294. case "hex":
  37295. return o.fromHex(e, i);
  37296. case "binary":
  37297. return o.fromBinary(e, i);
  37298. case "utf8":
  37299. return o.fromUTF8(e, i);
  37300. case "debug":
  37301. return o.fromDebug(e, i);
  37302. default:
  37303. throw Error("Unsupported encoding: " + t)
  37304. }
  37305. if (null === e || "object" != typeof e)
  37306. throw TypeError("Illegal buffer");
  37307. var r;
  37308. if (o.isByteBuffer(e))
  37309. return r = a.clone.call(e),
  37310. r.markedOffset = -1,
  37311. r;
  37312. if (e instanceof Uint8Array)
  37313. r = new o(0,i,n),
  37314. e.length > 0 && (r.buffer = e.buffer,
  37315. r.offset = e.byteOffset,
  37316. r.limit = e.byteOffset + e.byteLength,
  37317. r.view = new Uint8Array(e.buffer));
  37318. else if (e instanceof ArrayBuffer)
  37319. r = new o(0,i,n),
  37320. e.byteLength > 0 && (r.buffer = e,
  37321. r.offset = 0,
  37322. r.limit = e.byteLength,
  37323. r.view = e.byteLength > 0 ? new Uint8Array(e) : null);
  37324. else {
  37325. if ("[object Array]" !== Object.prototype.toString.call(e))
  37326. throw TypeError("Illegal buffer");
  37327. r = new o(e.length,i,n),
  37328. r.limit = e.length;
  37329. for (var s = 0; s < e.length; ++s)
  37330. r.view[s] = e[s]
  37331. }
  37332. return r
  37333. }
  37334. ,
  37335. a.writeBitSet = function(e, t) {
  37336. var i = "undefined" == typeof t;
  37337. if (i && (t = this.offset),
  37338. !this.noAssert) {
  37339. if (!(e instanceof Array))
  37340. throw TypeError("Illegal BitSet: Not an array");
  37341. if ("number" != typeof t || t % 1 !== 0)
  37342. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37343. if (t >>>= 0,
  37344. t < 0 || t + 0 > this.buffer.byteLength)
  37345. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37346. }
  37347. var n, r = t, o = e.length, a = o >> 3, s = 0;
  37348. for (t += this.writeVarint32(o, t); a--; )
  37349. 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,
  37350. this.writeByte(n, t++);
  37351. if (s < o) {
  37352. var l = 0;
  37353. for (n = 0; s < o; )
  37354. n |= (1 & !!e[s++]) << l++;
  37355. this.writeByte(n, t++)
  37356. }
  37357. return i ? (this.offset = t,
  37358. this) : t - r
  37359. }
  37360. ,
  37361. a.readBitSet = function(e) {
  37362. var t = "undefined" == typeof e;
  37363. t && (e = this.offset);
  37364. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  37365. for (e += n.length; o--; )
  37366. i = this.readByte(e++),
  37367. s[a++] = !!(1 & i),
  37368. s[a++] = !!(2 & i),
  37369. s[a++] = !!(4 & i),
  37370. s[a++] = !!(8 & i),
  37371. s[a++] = !!(16 & i),
  37372. s[a++] = !!(32 & i),
  37373. s[a++] = !!(64 & i),
  37374. s[a++] = !!(128 & i);
  37375. if (a < r) {
  37376. var l = 0;
  37377. for (i = this.readByte(e++); a < r; )
  37378. s[a++] = !!(i >> l++ & 1)
  37379. }
  37380. return t && (this.offset = e),
  37381. s
  37382. }
  37383. ,
  37384. a.readBytes = function(e, t) {
  37385. var i = "undefined" == typeof t;
  37386. if (i && (t = this.offset),
  37387. !this.noAssert) {
  37388. if ("number" != typeof t || t % 1 !== 0)
  37389. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37390. if (t >>>= 0,
  37391. t < 0 || t + e > this.buffer.byteLength)
  37392. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  37393. }
  37394. var n = this.slice(t, t + e);
  37395. return i && (this.offset += e),
  37396. n
  37397. }
  37398. ,
  37399. a.writeBytes = a.append,
  37400. a.writeInt8 = function(e, t) {
  37401. var i = "undefined" == typeof t;
  37402. if (i && (t = this.offset),
  37403. !this.noAssert) {
  37404. if ("number" != typeof e || e % 1 !== 0)
  37405. throw TypeError("Illegal value: " + e + " (not an integer)");
  37406. if (e |= 0,
  37407. "number" != typeof t || t % 1 !== 0)
  37408. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37409. if (t >>>= 0,
  37410. t < 0 || t + 0 > this.buffer.byteLength)
  37411. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37412. }
  37413. t += 1;
  37414. var n = this.buffer.byteLength;
  37415. return t > n && this.resize((n *= 2) > t ? n : t),
  37416. t -= 1,
  37417. this.view[t] = e,
  37418. i && (this.offset += 1),
  37419. this
  37420. }
  37421. ,
  37422. a.writeByte = a.writeInt8,
  37423. a.readInt8 = function(e) {
  37424. var t = "undefined" == typeof e;
  37425. if (t && (e = this.offset),
  37426. !this.noAssert) {
  37427. if ("number" != typeof e || e % 1 !== 0)
  37428. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37429. if (e >>>= 0,
  37430. e < 0 || e + 1 > this.buffer.byteLength)
  37431. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37432. }
  37433. var i = this.view[e];
  37434. return 128 === (128 & i) && (i = -(255 - i + 1)),
  37435. t && (this.offset += 1),
  37436. i
  37437. }
  37438. ,
  37439. a.readByte = a.readInt8,
  37440. a.writeUint8 = function(e, t) {
  37441. var i = "undefined" == typeof t;
  37442. if (i && (t = this.offset),
  37443. !this.noAssert) {
  37444. if ("number" != typeof e || e % 1 !== 0)
  37445. throw TypeError("Illegal value: " + e + " (not an integer)");
  37446. if (e >>>= 0,
  37447. "number" != typeof t || t % 1 !== 0)
  37448. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37449. if (t >>>= 0,
  37450. t < 0 || t + 0 > this.buffer.byteLength)
  37451. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37452. }
  37453. t += 1;
  37454. var n = this.buffer.byteLength;
  37455. return t > n && this.resize((n *= 2) > t ? n : t),
  37456. t -= 1,
  37457. this.view[t] = e,
  37458. i && (this.offset += 1),
  37459. this
  37460. }
  37461. ,
  37462. a.writeUInt8 = a.writeUint8,
  37463. a.readUint8 = function(e) {
  37464. var t = "undefined" == typeof e;
  37465. if (t && (e = this.offset),
  37466. !this.noAssert) {
  37467. if ("number" != typeof e || e % 1 !== 0)
  37468. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37469. if (e >>>= 0,
  37470. e < 0 || e + 1 > this.buffer.byteLength)
  37471. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37472. }
  37473. var i = this.view[e];
  37474. return t && (this.offset += 1),
  37475. i
  37476. }
  37477. ,
  37478. a.readUInt8 = a.readUint8,
  37479. a.writeInt16 = function(e, t) {
  37480. var i = "undefined" == typeof t;
  37481. if (i && (t = this.offset),
  37482. !this.noAssert) {
  37483. if ("number" != typeof e || e % 1 !== 0)
  37484. throw TypeError("Illegal value: " + e + " (not an integer)");
  37485. if (e |= 0,
  37486. "number" != typeof t || t % 1 !== 0)
  37487. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37488. if (t >>>= 0,
  37489. t < 0 || t + 0 > this.buffer.byteLength)
  37490. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37491. }
  37492. t += 2;
  37493. var n = this.buffer.byteLength;
  37494. return t > n && this.resize((n *= 2) > t ? n : t),
  37495. t -= 2,
  37496. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  37497. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  37498. this.view[t + 1] = 255 & e),
  37499. i && (this.offset += 2),
  37500. this
  37501. }
  37502. ,
  37503. a.writeShort = a.writeInt16,
  37504. a.readInt16 = function(e) {
  37505. var t = "undefined" == typeof e;
  37506. if (t && (e = this.offset),
  37507. !this.noAssert) {
  37508. if ("number" != typeof e || e % 1 !== 0)
  37509. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37510. if (e >>>= 0,
  37511. e < 0 || e + 2 > this.buffer.byteLength)
  37512. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  37513. }
  37514. var i = 0;
  37515. return this.littleEndian ? (i = this.view[e],
  37516. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  37517. i |= this.view[e + 1]),
  37518. 32768 === (32768 & i) && (i = -(65535 - i + 1)),
  37519. t && (this.offset += 2),
  37520. i
  37521. }
  37522. ,
  37523. a.readShort = a.readInt16,
  37524. a.writeUint16 = function(e, t) {
  37525. var i = "undefined" == typeof t;
  37526. if (i && (t = this.offset),
  37527. !this.noAssert) {
  37528. if ("number" != typeof e || e % 1 !== 0)
  37529. throw TypeError("Illegal value: " + e + " (not an integer)");
  37530. if (e >>>= 0,
  37531. "number" != typeof t || t % 1 !== 0)
  37532. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37533. if (t >>>= 0,
  37534. t < 0 || t + 0 > this.buffer.byteLength)
  37535. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37536. }
  37537. t += 2;
  37538. var n = this.buffer.byteLength;
  37539. return t > n && this.resize((n *= 2) > t ? n : t),
  37540. t -= 2,
  37541. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  37542. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  37543. this.view[t + 1] = 255 & e),
  37544. i && (this.offset += 2),
  37545. this
  37546. }
  37547. ,
  37548. a.writeUInt16 = a.writeUint16,
  37549. a.readUint16 = function(e) {
  37550. var t = "undefined" == typeof e;
  37551. if (t && (e = this.offset),
  37552. !this.noAssert) {
  37553. if ("number" != typeof e || e % 1 !== 0)
  37554. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37555. if (e >>>= 0,
  37556. e < 0 || e + 2 > this.buffer.byteLength)
  37557. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  37558. }
  37559. var i = 0;
  37560. return this.littleEndian ? (i = this.view[e],
  37561. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  37562. i |= this.view[e + 1]),
  37563. t && (this.offset += 2),
  37564. i
  37565. }
  37566. ,
  37567. a.readUInt16 = a.readUint16,
  37568. a.writeInt32 = function(e, t) {
  37569. var i = "undefined" == typeof t;
  37570. if (i && (t = this.offset),
  37571. !this.noAssert) {
  37572. if ("number" != typeof e || e % 1 !== 0)
  37573. throw TypeError("Illegal value: " + e + " (not an integer)");
  37574. if (e |= 0,
  37575. "number" != typeof t || t % 1 !== 0)
  37576. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37577. if (t >>>= 0,
  37578. t < 0 || t + 0 > this.buffer.byteLength)
  37579. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37580. }
  37581. t += 4;
  37582. var n = this.buffer.byteLength;
  37583. return t > n && this.resize((n *= 2) > t ? n : t),
  37584. t -= 4,
  37585. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  37586. this.view[t + 2] = e >>> 16 & 255,
  37587. this.view[t + 1] = e >>> 8 & 255,
  37588. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  37589. this.view[t + 1] = e >>> 16 & 255,
  37590. this.view[t + 2] = e >>> 8 & 255,
  37591. this.view[t + 3] = 255 & e),
  37592. i && (this.offset += 4),
  37593. this
  37594. }
  37595. ,
  37596. a.writeInt = a.writeInt32,
  37597. a.readInt32 = function(e) {
  37598. var t = "undefined" == typeof e;
  37599. if (t && (e = this.offset),
  37600. !this.noAssert) {
  37601. if ("number" != typeof e || e % 1 !== 0)
  37602. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37603. if (e >>>= 0,
  37604. e < 0 || e + 4 > this.buffer.byteLength)
  37605. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  37606. }
  37607. var i = 0;
  37608. return this.littleEndian ? (i = this.view[e + 2] << 16,
  37609. i |= this.view[e + 1] << 8,
  37610. i |= this.view[e],
  37611. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  37612. i |= this.view[e + 2] << 8,
  37613. i |= this.view[e + 3],
  37614. i += this.view[e] << 24 >>> 0),
  37615. i |= 0,
  37616. t && (this.offset += 4),
  37617. i
  37618. }
  37619. ,
  37620. a.readInt = a.readInt32,
  37621. a.writeUint32 = function(e, t) {
  37622. var i = "undefined" == typeof t;
  37623. if (i && (t = this.offset),
  37624. !this.noAssert) {
  37625. if ("number" != typeof e || e % 1 !== 0)
  37626. throw TypeError("Illegal value: " + e + " (not an integer)");
  37627. if (e >>>= 0,
  37628. "number" != typeof t || t % 1 !== 0)
  37629. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37630. if (t >>>= 0,
  37631. t < 0 || t + 0 > this.buffer.byteLength)
  37632. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37633. }
  37634. t += 4;
  37635. var n = this.buffer.byteLength;
  37636. return t > n && this.resize((n *= 2) > t ? n : t),
  37637. t -= 4,
  37638. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  37639. this.view[t + 2] = e >>> 16 & 255,
  37640. this.view[t + 1] = e >>> 8 & 255,
  37641. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  37642. this.view[t + 1] = e >>> 16 & 255,
  37643. this.view[t + 2] = e >>> 8 & 255,
  37644. this.view[t + 3] = 255 & e),
  37645. i && (this.offset += 4),
  37646. this
  37647. }
  37648. ,
  37649. a.writeUInt32 = a.writeUint32,
  37650. a.readUint32 = function(e) {
  37651. var t = "undefined" == typeof e;
  37652. if (t && (e = this.offset),
  37653. !this.noAssert) {
  37654. if ("number" != typeof e || e % 1 !== 0)
  37655. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37656. if (e >>>= 0,
  37657. e < 0 || e + 4 > this.buffer.byteLength)
  37658. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  37659. }
  37660. var i = 0;
  37661. return this.littleEndian ? (i = this.view[e + 2] << 16,
  37662. i |= this.view[e + 1] << 8,
  37663. i |= this.view[e],
  37664. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  37665. i |= this.view[e + 2] << 8,
  37666. i |= this.view[e + 3],
  37667. i += this.view[e] << 24 >>> 0),
  37668. t && (this.offset += 4),
  37669. i
  37670. }
  37671. ,
  37672. a.readUInt32 = a.readUint32,
  37673. e && (a.writeInt64 = function(t, i) {
  37674. var n = "undefined" == typeof i;
  37675. if (n && (i = this.offset),
  37676. !this.noAssert) {
  37677. if ("number" == typeof t)
  37678. t = e.fromNumber(t);
  37679. else if ("string" == typeof t)
  37680. t = e.fromString(t);
  37681. else if (!(t && t instanceof e))
  37682. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  37683. if ("number" != typeof i || i % 1 !== 0)
  37684. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37685. if (i >>>= 0,
  37686. i < 0 || i + 0 > this.buffer.byteLength)
  37687. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37688. }
  37689. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  37690. i += 8;
  37691. var r = this.buffer.byteLength;
  37692. i > r && this.resize((r *= 2) > i ? r : i),
  37693. i -= 8;
  37694. var o = t.low
  37695. , a = t.high;
  37696. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  37697. this.view[i + 2] = o >>> 16 & 255,
  37698. this.view[i + 1] = o >>> 8 & 255,
  37699. this.view[i] = 255 & o,
  37700. i += 4,
  37701. this.view[i + 3] = a >>> 24 & 255,
  37702. this.view[i + 2] = a >>> 16 & 255,
  37703. this.view[i + 1] = a >>> 8 & 255,
  37704. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  37705. this.view[i + 1] = a >>> 16 & 255,
  37706. this.view[i + 2] = a >>> 8 & 255,
  37707. this.view[i + 3] = 255 & a,
  37708. i += 4,
  37709. this.view[i] = o >>> 24 & 255,
  37710. this.view[i + 1] = o >>> 16 & 255,
  37711. this.view[i + 2] = o >>> 8 & 255,
  37712. this.view[i + 3] = 255 & o),
  37713. n && (this.offset += 8),
  37714. this
  37715. }
  37716. ,
  37717. a.writeLong = a.writeInt64,
  37718. a.readInt64 = function(t) {
  37719. var i = "undefined" == typeof t;
  37720. if (i && (t = this.offset),
  37721. !this.noAssert) {
  37722. if ("number" != typeof t || t % 1 !== 0)
  37723. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37724. if (t >>>= 0,
  37725. t < 0 || t + 8 > this.buffer.byteLength)
  37726. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  37727. }
  37728. var n = 0
  37729. , r = 0;
  37730. this.littleEndian ? (n = this.view[t + 2] << 16,
  37731. n |= this.view[t + 1] << 8,
  37732. n |= this.view[t],
  37733. n += this.view[t + 3] << 24 >>> 0,
  37734. t += 4,
  37735. r = this.view[t + 2] << 16,
  37736. r |= this.view[t + 1] << 8,
  37737. r |= this.view[t],
  37738. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  37739. r |= this.view[t + 2] << 8,
  37740. r |= this.view[t + 3],
  37741. r += this.view[t] << 24 >>> 0,
  37742. t += 4,
  37743. n = this.view[t + 1] << 16,
  37744. n |= this.view[t + 2] << 8,
  37745. n |= this.view[t + 3],
  37746. n += this.view[t] << 24 >>> 0);
  37747. var o = new e(n,r,!1);
  37748. return i && (this.offset += 8),
  37749. o
  37750. }
  37751. ,
  37752. a.readLong = a.readInt64,
  37753. a.writeUint64 = function(t, i) {
  37754. var n = "undefined" == typeof i;
  37755. if (n && (i = this.offset),
  37756. !this.noAssert) {
  37757. if ("number" == typeof t)
  37758. t = e.fromNumber(t);
  37759. else if ("string" == typeof t)
  37760. t = e.fromString(t);
  37761. else if (!(t && t instanceof e))
  37762. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  37763. if ("number" != typeof i || i % 1 !== 0)
  37764. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37765. if (i >>>= 0,
  37766. i < 0 || i + 0 > this.buffer.byteLength)
  37767. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37768. }
  37769. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  37770. i += 8;
  37771. var r = this.buffer.byteLength;
  37772. i > r && this.resize((r *= 2) > i ? r : i),
  37773. i -= 8;
  37774. var o = t.low
  37775. , a = t.high;
  37776. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  37777. this.view[i + 2] = o >>> 16 & 255,
  37778. this.view[i + 1] = o >>> 8 & 255,
  37779. this.view[i] = 255 & o,
  37780. i += 4,
  37781. this.view[i + 3] = a >>> 24 & 255,
  37782. this.view[i + 2] = a >>> 16 & 255,
  37783. this.view[i + 1] = a >>> 8 & 255,
  37784. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  37785. this.view[i + 1] = a >>> 16 & 255,
  37786. this.view[i + 2] = a >>> 8 & 255,
  37787. this.view[i + 3] = 255 & a,
  37788. i += 4,
  37789. this.view[i] = o >>> 24 & 255,
  37790. this.view[i + 1] = o >>> 16 & 255,
  37791. this.view[i + 2] = o >>> 8 & 255,
  37792. this.view[i + 3] = 255 & o),
  37793. n && (this.offset += 8),
  37794. this
  37795. }
  37796. ,
  37797. a.writeUInt64 = a.writeUint64,
  37798. a.readUint64 = function(t) {
  37799. var i = "undefined" == typeof t;
  37800. if (i && (t = this.offset),
  37801. !this.noAssert) {
  37802. if ("number" != typeof t || t % 1 !== 0)
  37803. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37804. if (t >>>= 0,
  37805. t < 0 || t + 8 > this.buffer.byteLength)
  37806. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  37807. }
  37808. var n = 0
  37809. , r = 0;
  37810. this.littleEndian ? (n = this.view[t + 2] << 16,
  37811. n |= this.view[t + 1] << 8,
  37812. n |= this.view[t],
  37813. n += this.view[t + 3] << 24 >>> 0,
  37814. t += 4,
  37815. r = this.view[t + 2] << 16,
  37816. r |= this.view[t + 1] << 8,
  37817. r |= this.view[t],
  37818. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  37819. r |= this.view[t + 2] << 8,
  37820. r |= this.view[t + 3],
  37821. r += this.view[t] << 24 >>> 0,
  37822. t += 4,
  37823. n = this.view[t + 1] << 16,
  37824. n |= this.view[t + 2] << 8,
  37825. n |= this.view[t + 3],
  37826. n += this.view[t] << 24 >>> 0);
  37827. var o = new e(n,r,!0);
  37828. return i && (this.offset += 8),
  37829. o
  37830. }
  37831. ,
  37832. a.readUInt64 = a.readUint64),
  37833. a.writeFloat32 = function(e, t) {
  37834. var i = "undefined" == typeof t;
  37835. if (i && (t = this.offset),
  37836. !this.noAssert) {
  37837. if ("number" != typeof e)
  37838. throw TypeError("Illegal value: " + e + " (not a number)");
  37839. if ("number" != typeof t || t % 1 !== 0)
  37840. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37841. if (t >>>= 0,
  37842. t < 0 || t + 0 > this.buffer.byteLength)
  37843. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37844. }
  37845. t += 4;
  37846. var n = this.buffer.byteLength;
  37847. return t > n && this.resize((n *= 2) > t ? n : t),
  37848. t -= 4,
  37849. r(this.view, e, t, this.littleEndian, 23, 4),
  37850. i && (this.offset += 4),
  37851. this
  37852. }
  37853. ,
  37854. a.writeFloat = a.writeFloat32,
  37855. a.readFloat32 = function(e) {
  37856. var t = "undefined" == typeof e;
  37857. if (t && (e = this.offset),
  37858. !this.noAssert) {
  37859. if ("number" != typeof e || e % 1 !== 0)
  37860. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37861. if (e >>>= 0,
  37862. e < 0 || e + 4 > this.buffer.byteLength)
  37863. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  37864. }
  37865. var i = n(this.view, e, this.littleEndian, 23, 4);
  37866. return t && (this.offset += 4),
  37867. i
  37868. }
  37869. ,
  37870. a.readFloat = a.readFloat32,
  37871. a.writeFloat64 = function(e, t) {
  37872. var i = "undefined" == typeof t;
  37873. if (i && (t = this.offset),
  37874. !this.noAssert) {
  37875. if ("number" != typeof e)
  37876. throw TypeError("Illegal value: " + e + " (not a number)");
  37877. if ("number" != typeof t || t % 1 !== 0)
  37878. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37879. if (t >>>= 0,
  37880. t < 0 || t + 0 > this.buffer.byteLength)
  37881. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37882. }
  37883. t += 8;
  37884. var n = this.buffer.byteLength;
  37885. return t > n && this.resize((n *= 2) > t ? n : t),
  37886. t -= 8,
  37887. r(this.view, e, t, this.littleEndian, 52, 8),
  37888. i && (this.offset += 8),
  37889. this
  37890. }
  37891. ,
  37892. a.writeDouble = a.writeFloat64,
  37893. a.readFloat64 = function(e) {
  37894. var t = "undefined" == typeof e;
  37895. if (t && (e = this.offset),
  37896. !this.noAssert) {
  37897. if ("number" != typeof e || e % 1 !== 0)
  37898. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37899. if (e >>>= 0,
  37900. e < 0 || e + 8 > this.buffer.byteLength)
  37901. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  37902. }
  37903. var i = n(this.view, e, this.littleEndian, 52, 8);
  37904. return t && (this.offset += 8),
  37905. i
  37906. }
  37907. ,
  37908. a.readDouble = a.readFloat64,
  37909. o.MAX_VARINT32_BYTES = 5,
  37910. o.calculateVarint32 = function(e) {
  37911. return e >>>= 0,
  37912. e < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  37913. }
  37914. ,
  37915. o.zigZagEncode32 = function(e) {
  37916. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  37917. }
  37918. ,
  37919. o.zigZagDecode32 = function(e) {
  37920. return e >>> 1 ^ -(1 & e) | 0
  37921. }
  37922. ,
  37923. a.writeVarint32 = function(e, t) {
  37924. var i = "undefined" == typeof t;
  37925. if (i && (t = this.offset),
  37926. !this.noAssert) {
  37927. if ("number" != typeof e || e % 1 !== 0)
  37928. throw TypeError("Illegal value: " + e + " (not an integer)");
  37929. if (e |= 0,
  37930. "number" != typeof t || t % 1 !== 0)
  37931. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37932. if (t >>>= 0,
  37933. t < 0 || t + 0 > this.buffer.byteLength)
  37934. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37935. }
  37936. var n, r = o.calculateVarint32(e);
  37937. t += r;
  37938. var a = this.buffer.byteLength;
  37939. for (t > a && this.resize((a *= 2) > t ? a : t),
  37940. t -= r,
  37941. e >>>= 0; e >= 128; )
  37942. n = 127 & e | 128,
  37943. this.view[t++] = n,
  37944. e >>>= 7;
  37945. return this.view[t++] = e,
  37946. i ? (this.offset = t,
  37947. this) : r
  37948. }
  37949. ,
  37950. a.writeVarint32ZigZag = function(e, t) {
  37951. return this.writeVarint32(o.zigZagEncode32(e), t)
  37952. }
  37953. ,
  37954. a.readVarint32 = function(e) {
  37955. var t = "undefined" == typeof e;
  37956. if (t && (e = this.offset),
  37957. !this.noAssert) {
  37958. if ("number" != typeof e || e % 1 !== 0)
  37959. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37960. if (e >>>= 0,
  37961. e < 0 || e + 1 > this.buffer.byteLength)
  37962. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37963. }
  37964. var i, n = 0, r = 0;
  37965. do {
  37966. if (!this.noAssert && e > this.limit) {
  37967. var o = Error("Truncated");
  37968. throw o.truncated = !0,
  37969. o
  37970. }
  37971. i = this.view[e++],
  37972. n < 5 && (r |= (127 & i) << 7 * n),
  37973. ++n
  37974. } while (0 !== (128 & i));return r |= 0,
  37975. t ? (this.offset = e,
  37976. r) : {
  37977. value: r,
  37978. length: n
  37979. }
  37980. }
  37981. ,
  37982. a.readVarint32ZigZag = function(e) {
  37983. var t = this.readVarint32(e);
  37984. return "object" == typeof t ? t.value = o.zigZagDecode32(t.value) : t = o.zigZagDecode32(t),
  37985. t
  37986. }
  37987. ,
  37988. e && (o.MAX_VARINT64_BYTES = 10,
  37989. o.calculateVarint64 = function(t) {
  37990. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t));
  37991. var i = t.toInt() >>> 0
  37992. , n = t.shiftRightUnsigned(28).toInt() >>> 0
  37993. , r = t.shiftRightUnsigned(56).toInt() >>> 0;
  37994. 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
  37995. }
  37996. ,
  37997. o.zigZagEncode64 = function(t) {
  37998. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  37999. t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()
  38000. }
  38001. ,
  38002. o.zigZagDecode64 = function(t) {
  38003. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  38004. t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()
  38005. }
  38006. ,
  38007. a.writeVarint64 = function(t, i) {
  38008. var n = "undefined" == typeof i;
  38009. if (n && (i = this.offset),
  38010. !this.noAssert) {
  38011. if ("number" == typeof t)
  38012. t = e.fromNumber(t);
  38013. else if ("string" == typeof t)
  38014. t = e.fromString(t);
  38015. else if (!(t && t instanceof e))
  38016. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  38017. if ("number" != typeof i || i % 1 !== 0)
  38018. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38019. if (i >>>= 0,
  38020. i < 0 || i + 0 > this.buffer.byteLength)
  38021. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38022. }
  38023. "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned());
  38024. var r = o.calculateVarint64(t)
  38025. , a = t.toInt() >>> 0
  38026. , s = t.shiftRightUnsigned(28).toInt() >>> 0
  38027. , l = t.shiftRightUnsigned(56).toInt() >>> 0;
  38028. i += r;
  38029. var c = this.buffer.byteLength;
  38030. switch (i > c && this.resize((c *= 2) > i ? c : i),
  38031. i -= r,
  38032. r) {
  38033. case 10:
  38034. this.view[i + 9] = l >>> 7 & 1;
  38035. case 9:
  38036. this.view[i + 8] = 9 !== r ? 128 | l : 127 & l;
  38037. case 8:
  38038. this.view[i + 7] = 8 !== r ? s >>> 21 | 128 : s >>> 21 & 127;
  38039. case 7:
  38040. this.view[i + 6] = 7 !== r ? s >>> 14 | 128 : s >>> 14 & 127;
  38041. case 6:
  38042. this.view[i + 5] = 6 !== r ? s >>> 7 | 128 : s >>> 7 & 127;
  38043. case 5:
  38044. this.view[i + 4] = 5 !== r ? 128 | s : 127 & s;
  38045. case 4:
  38046. this.view[i + 3] = 4 !== r ? a >>> 21 | 128 : a >>> 21 & 127;
  38047. case 3:
  38048. this.view[i + 2] = 3 !== r ? a >>> 14 | 128 : a >>> 14 & 127;
  38049. case 2:
  38050. this.view[i + 1] = 2 !== r ? a >>> 7 | 128 : a >>> 7 & 127;
  38051. case 1:
  38052. this.view[i] = 1 !== r ? 128 | a : 127 & a
  38053. }
  38054. return n ? (this.offset += r,
  38055. this) : r
  38056. }
  38057. ,
  38058. a.writeVarint64ZigZag = function(e, t) {
  38059. return this.writeVarint64(o.zigZagEncode64(e), t)
  38060. }
  38061. ,
  38062. a.readVarint64 = function(t) {
  38063. var i = "undefined" == typeof t;
  38064. if (i && (t = this.offset),
  38065. !this.noAssert) {
  38066. if ("number" != typeof t || t % 1 !== 0)
  38067. throw TypeError("Illegal offset: " + t + " (not an integer)");
  38068. if (t >>>= 0,
  38069. t < 0 || t + 1 > this.buffer.byteLength)
  38070. throw RangeError("Illegal offset: 0 <= " + t + " (+1) <= " + this.buffer.byteLength)
  38071. }
  38072. var n = t
  38073. , r = 0
  38074. , o = 0
  38075. , a = 0
  38076. , s = 0;
  38077. if (s = this.view[t++],
  38078. r = 127 & s,
  38079. 128 & s && (s = this.view[t++],
  38080. r |= (127 & s) << 7,
  38081. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38082. r |= (127 & s) << 14,
  38083. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38084. r |= (127 & s) << 21,
  38085. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38086. o = 127 & s,
  38087. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38088. o |= (127 & s) << 7,
  38089. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38090. o |= (127 & s) << 14,
  38091. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38092. o |= (127 & s) << 21,
  38093. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38094. a = 127 & s,
  38095. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38096. a |= (127 & s) << 7,
  38097. 128 & s || this.noAssert && "undefined" == typeof s))))))))))
  38098. throw Error("Buffer overrun");
  38099. var l = e.fromBits(r | o << 28, o >>> 4 | a << 24, !1);
  38100. return i ? (this.offset = t,
  38101. l) : {
  38102. value: l,
  38103. length: t - n
  38104. }
  38105. }
  38106. ,
  38107. a.readVarint64ZigZag = function(t) {
  38108. var i = this.readVarint64(t);
  38109. return i && i.value instanceof e ? i.value = o.zigZagDecode64(i.value) : i = o.zigZagDecode64(i),
  38110. i
  38111. }
  38112. ),
  38113. a.writeCString = function(e, i) {
  38114. var n = "undefined" == typeof i;
  38115. n && (i = this.offset);
  38116. var r, o = e.length;
  38117. if (!this.noAssert) {
  38118. if ("string" != typeof e)
  38119. throw TypeError("Illegal str: Not a string");
  38120. for (r = 0; r < o; ++r)
  38121. if (0 === e.charCodeAt(r))
  38122. throw RangeError("Illegal str: Contains NULL-characters");
  38123. if ("number" != typeof i || i % 1 !== 0)
  38124. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38125. if (i >>>= 0,
  38126. i < 0 || i + 0 > this.buffer.byteLength)
  38127. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38128. }
  38129. o = h.calculateUTF16asUTF8(t(e))[1],
  38130. i += o + 1;
  38131. var a = this.buffer.byteLength;
  38132. return i > a && this.resize((a *= 2) > i ? a : i),
  38133. i -= o + 1,
  38134. h.encodeUTF16toUTF8(t(e), function(e) {
  38135. this.view[i++] = e
  38136. }
  38137. .bind(this)),
  38138. this.view[i++] = 0,
  38139. n ? (this.offset = i,
  38140. this) : o
  38141. }
  38142. ,
  38143. a.readCString = function(e) {
  38144. var t = "undefined" == typeof e;
  38145. if (t && (e = this.offset),
  38146. !this.noAssert) {
  38147. if ("number" != typeof e || e % 1 !== 0)
  38148. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38149. if (e >>>= 0,
  38150. e < 0 || e + 1 > this.buffer.byteLength)
  38151. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  38152. }
  38153. var n, r = e, o = -1;
  38154. return h.decodeUTF8toUTF16(function() {
  38155. if (0 === o)
  38156. return null;
  38157. if (e >= this.limit)
  38158. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  38159. return o = this.view[e++],
  38160. 0 === o ? null : o
  38161. }
  38162. .bind(this), n = i(), !0),
  38163. t ? (this.offset = e,
  38164. n()) : {
  38165. string: n(),
  38166. length: e - r
  38167. }
  38168. }
  38169. ,
  38170. a.writeIString = function(e, i) {
  38171. var n = "undefined" == typeof i;
  38172. if (n && (i = this.offset),
  38173. !this.noAssert) {
  38174. if ("string" != typeof e)
  38175. throw TypeError("Illegal str: Not a string");
  38176. if ("number" != typeof i || i % 1 !== 0)
  38177. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38178. if (i >>>= 0,
  38179. i < 0 || i + 0 > this.buffer.byteLength)
  38180. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38181. }
  38182. var r, o = i;
  38183. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  38184. i += 4 + r;
  38185. var a = this.buffer.byteLength;
  38186. if (i > a && this.resize((a *= 2) > i ? a : i),
  38187. i -= 4 + r,
  38188. this.littleEndian ? (this.view[i + 3] = r >>> 24 & 255,
  38189. this.view[i + 2] = r >>> 16 & 255,
  38190. this.view[i + 1] = r >>> 8 & 255,
  38191. this.view[i] = 255 & r) : (this.view[i] = r >>> 24 & 255,
  38192. this.view[i + 1] = r >>> 16 & 255,
  38193. this.view[i + 2] = r >>> 8 & 255,
  38194. this.view[i + 3] = 255 & r),
  38195. i += 4,
  38196. h.encodeUTF16toUTF8(t(e), function(e) {
  38197. this.view[i++] = e
  38198. }
  38199. .bind(this)),
  38200. i !== o + 4 + r)
  38201. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + 4 + r));
  38202. return n ? (this.offset = i,
  38203. this) : i - o
  38204. }
  38205. ,
  38206. a.readIString = function(e) {
  38207. var t = "undefined" == typeof e;
  38208. if (t && (e = this.offset),
  38209. !this.noAssert) {
  38210. if ("number" != typeof e || e % 1 !== 0)
  38211. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38212. if (e >>>= 0,
  38213. e < 0 || e + 4 > this.buffer.byteLength)
  38214. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  38215. }
  38216. var i = e
  38217. , n = this.readUint32(e)
  38218. , r = this.readUTF8String(n, o.METRICS_BYTES, e += 4);
  38219. return e += r.length,
  38220. t ? (this.offset = e,
  38221. r.string) : {
  38222. string: r.string,
  38223. length: e - i
  38224. }
  38225. }
  38226. ,
  38227. o.METRICS_CHARS = "c",
  38228. o.METRICS_BYTES = "b",
  38229. a.writeUTF8String = function(e, i) {
  38230. var n = "undefined" == typeof i;
  38231. if (n && (i = this.offset),
  38232. !this.noAssert) {
  38233. if ("number" != typeof i || i % 1 !== 0)
  38234. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38235. if (i >>>= 0,
  38236. i < 0 || i + 0 > this.buffer.byteLength)
  38237. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38238. }
  38239. var r, o = i;
  38240. r = h.calculateUTF16asUTF8(t(e))[1],
  38241. i += r;
  38242. var a = this.buffer.byteLength;
  38243. return i > a && this.resize((a *= 2) > i ? a : i),
  38244. i -= r,
  38245. h.encodeUTF16toUTF8(t(e), function(e) {
  38246. this.view[i++] = e
  38247. }
  38248. .bind(this)),
  38249. n ? (this.offset = i,
  38250. this) : i - o
  38251. }
  38252. ,
  38253. a.writeString = a.writeUTF8String,
  38254. o.calculateUTF8Chars = function(e) {
  38255. return h.calculateUTF16asUTF8(t(e))[0]
  38256. }
  38257. ,
  38258. o.calculateUTF8Bytes = function(e) {
  38259. return h.calculateUTF16asUTF8(t(e))[1]
  38260. }
  38261. ,
  38262. o.calculateString = o.calculateUTF8Bytes,
  38263. a.readUTF8String = function(e, t, n) {
  38264. "number" == typeof t && (n = t,
  38265. t = void 0);
  38266. var r = "undefined" == typeof n;
  38267. if (r && (n = this.offset),
  38268. "undefined" == typeof t && (t = o.METRICS_CHARS),
  38269. !this.noAssert) {
  38270. if ("number" != typeof e || e % 1 !== 0)
  38271. throw TypeError("Illegal length: " + e + " (not an integer)");
  38272. if (e |= 0,
  38273. "number" != typeof n || n % 1 !== 0)
  38274. throw TypeError("Illegal offset: " + n + " (not an integer)");
  38275. if (n >>>= 0,
  38276. n < 0 || n + 0 > this.buffer.byteLength)
  38277. throw RangeError("Illegal offset: 0 <= " + n + " (+0) <= " + this.buffer.byteLength)
  38278. }
  38279. var a, s = 0, l = n;
  38280. if (t === o.METRICS_CHARS) {
  38281. if (a = i(),
  38282. h.decodeUTF8(function() {
  38283. return s < e && n < this.limit ? this.view[n++] : null
  38284. }
  38285. .bind(this), function(e) {
  38286. ++s,
  38287. h.UTF8toUTF16(e, a)
  38288. }),
  38289. s !== e)
  38290. throw RangeError("Illegal range: Truncated data, " + s + " == " + e);
  38291. return r ? (this.offset = n,
  38292. a()) : {
  38293. string: a(),
  38294. length: n - l
  38295. }
  38296. }
  38297. if (t === o.METRICS_BYTES) {
  38298. if (!this.noAssert) {
  38299. if ("number" != typeof n || n % 1 !== 0)
  38300. throw TypeError("Illegal offset: " + n + " (not an integer)");
  38301. if (n >>>= 0,
  38302. n < 0 || n + e > this.buffer.byteLength)
  38303. throw RangeError("Illegal offset: 0 <= " + n + " (+" + e + ") <= " + this.buffer.byteLength)
  38304. }
  38305. var c = n + e;
  38306. if (h.decodeUTF8toUTF16(function() {
  38307. return n < c ? this.view[n++] : null
  38308. }
  38309. .bind(this), a = i(), this.noAssert),
  38310. n !== c)
  38311. throw RangeError("Illegal range: Truncated data, " + n + " == " + c);
  38312. return r ? (this.offset = n,
  38313. a()) : {
  38314. string: a(),
  38315. length: n - l
  38316. }
  38317. }
  38318. throw TypeError("Unsupported metrics: " + t)
  38319. }
  38320. ,
  38321. a.readString = a.readUTF8String,
  38322. a.writeVString = function(e, i) {
  38323. var n = "undefined" == typeof i;
  38324. if (n && (i = this.offset),
  38325. !this.noAssert) {
  38326. if ("string" != typeof e)
  38327. throw TypeError("Illegal str: Not a string");
  38328. if ("number" != typeof i || i % 1 !== 0)
  38329. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38330. if (i >>>= 0,
  38331. i < 0 || i + 0 > this.buffer.byteLength)
  38332. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38333. }
  38334. var r, a, s = i;
  38335. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  38336. a = o.calculateVarint32(r),
  38337. i += a + r;
  38338. var l = this.buffer.byteLength;
  38339. if (i > l && this.resize((l *= 2) > i ? l : i),
  38340. i -= a + r,
  38341. i += this.writeVarint32(r, i),
  38342. h.encodeUTF16toUTF8(t(e), function(e) {
  38343. this.view[i++] = e
  38344. }
  38345. .bind(this)),
  38346. i !== s + r + a)
  38347. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + r + a));
  38348. return n ? (this.offset = i,
  38349. this) : i - s
  38350. }
  38351. ,
  38352. a.readVString = function(e) {
  38353. var t = "undefined" == typeof e;
  38354. if (t && (e = this.offset),
  38355. !this.noAssert) {
  38356. if ("number" != typeof e || e % 1 !== 0)
  38357. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38358. if (e >>>= 0,
  38359. e < 0 || e + 1 > this.buffer.byteLength)
  38360. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  38361. }
  38362. var i = e
  38363. , n = this.readVarint32(e)
  38364. , r = this.readUTF8String(n.value, o.METRICS_BYTES, e += n.length);
  38365. return e += r.length,
  38366. t ? (this.offset = e,
  38367. r.string) : {
  38368. string: r.string,
  38369. length: e - i
  38370. }
  38371. }
  38372. ,
  38373. a.append = function(e, t, i) {
  38374. "number" != typeof t && "string" == typeof t || (i = t,
  38375. t = void 0);
  38376. var n = "undefined" == typeof i;
  38377. if (n && (i = this.offset),
  38378. !this.noAssert) {
  38379. if ("number" != typeof i || i % 1 !== 0)
  38380. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38381. if (i >>>= 0,
  38382. i < 0 || i + 0 > this.buffer.byteLength)
  38383. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38384. }
  38385. e instanceof o || (e = o.wrap(e, t));
  38386. var r = e.limit - e.offset;
  38387. if (r <= 0)
  38388. return this;
  38389. i += r;
  38390. var a = this.buffer.byteLength;
  38391. return i > a && this.resize((a *= 2) > i ? a : i),
  38392. i -= r,
  38393. this.view.set(e.view.subarray(e.offset, e.limit), i),
  38394. e.offset += r,
  38395. n && (this.offset += r),
  38396. this
  38397. }
  38398. ,
  38399. a.appendTo = function(e, t) {
  38400. return e.append(this, t),
  38401. this
  38402. }
  38403. ,
  38404. a.assert = function(e) {
  38405. return this.noAssert = !e,
  38406. this
  38407. }
  38408. ,
  38409. a.capacity = function() {
  38410. return this.buffer.byteLength
  38411. }
  38412. ,
  38413. a.clear = function() {
  38414. return this.offset = 0,
  38415. this.limit = this.buffer.byteLength,
  38416. this.markedOffset = -1,
  38417. this
  38418. }
  38419. ,
  38420. a.clone = function(e) {
  38421. var t = new o(0,this.littleEndian,this.noAssert);
  38422. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  38423. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  38424. t.view = this.view),
  38425. t.offset = this.offset,
  38426. t.markedOffset = this.markedOffset,
  38427. t.limit = this.limit,
  38428. t
  38429. }
  38430. ,
  38431. a.compact = function(e, t) {
  38432. if ("undefined" == typeof e && (e = this.offset),
  38433. "undefined" == typeof t && (t = this.limit),
  38434. !this.noAssert) {
  38435. if ("number" != typeof e || e % 1 !== 0)
  38436. throw TypeError("Illegal begin: Not an integer");
  38437. if (e >>>= 0,
  38438. "number" != typeof t || t % 1 !== 0)
  38439. throw TypeError("Illegal end: Not an integer");
  38440. if (t >>>= 0,
  38441. e < 0 || e > t || t > this.buffer.byteLength)
  38442. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38443. }
  38444. if (0 === e && t === this.buffer.byteLength)
  38445. return this;
  38446. var i = t - e;
  38447. if (0 === i)
  38448. return this.buffer = s,
  38449. this.view = null,
  38450. this.markedOffset >= 0 && (this.markedOffset -= e),
  38451. this.offset = 0,
  38452. this.limit = 0,
  38453. this;
  38454. var n = new ArrayBuffer(i)
  38455. , r = new Uint8Array(n);
  38456. return r.set(this.view.subarray(e, t)),
  38457. this.buffer = n,
  38458. this.view = r,
  38459. this.markedOffset >= 0 && (this.markedOffset -= e),
  38460. this.offset = 0,
  38461. this.limit = i,
  38462. this
  38463. }
  38464. ,
  38465. a.copy = function(e, t) {
  38466. if ("undefined" == typeof e && (e = this.offset),
  38467. "undefined" == typeof t && (t = this.limit),
  38468. !this.noAssert) {
  38469. if ("number" != typeof e || e % 1 !== 0)
  38470. throw TypeError("Illegal begin: Not an integer");
  38471. if (e >>>= 0,
  38472. "number" != typeof t || t % 1 !== 0)
  38473. throw TypeError("Illegal end: Not an integer");
  38474. if (t >>>= 0,
  38475. e < 0 || e > t || t > this.buffer.byteLength)
  38476. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38477. }
  38478. if (e === t)
  38479. return new o(0,this.littleEndian,this.noAssert);
  38480. var i = t - e
  38481. , n = new o(i,this.littleEndian,this.noAssert);
  38482. return n.offset = 0,
  38483. n.limit = i,
  38484. n.markedOffset >= 0 && (n.markedOffset -= e),
  38485. this.copyTo(n, 0, e, t),
  38486. n
  38487. }
  38488. ,
  38489. a.copyTo = function(e, t, i, n) {
  38490. var r, a;
  38491. if (!this.noAssert && !o.isByteBuffer(e))
  38492. throw TypeError("Illegal target: Not a ByteBuffer");
  38493. if (t = (a = "undefined" == typeof t) ? e.offset : 0 | t,
  38494. i = (r = "undefined" == typeof i) ? this.offset : 0 | i,
  38495. n = "undefined" == typeof n ? this.limit : 0 | n,
  38496. t < 0 || t > e.buffer.byteLength)
  38497. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  38498. if (i < 0 || n > this.buffer.byteLength)
  38499. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  38500. var s = n - i;
  38501. return 0 === s ? e : (e.ensureCapacity(t + s),
  38502. e.view.set(this.view.subarray(i, n), t),
  38503. r && (this.offset += s),
  38504. a && (e.offset += s),
  38505. this)
  38506. }
  38507. ,
  38508. a.ensureCapacity = function(e) {
  38509. var t = this.buffer.byteLength;
  38510. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  38511. }
  38512. ,
  38513. a.fill = function(e, t, i) {
  38514. var n = "undefined" == typeof t;
  38515. if (n && (t = this.offset),
  38516. "string" == typeof e && e.length > 0 && (e = e.charCodeAt(0)),
  38517. "undefined" == typeof t && (t = this.offset),
  38518. "undefined" == typeof i && (i = this.limit),
  38519. !this.noAssert) {
  38520. if ("number" != typeof e || e % 1 !== 0)
  38521. throw TypeError("Illegal value: " + e + " (not an integer)");
  38522. if (e |= 0,
  38523. "number" != typeof t || t % 1 !== 0)
  38524. throw TypeError("Illegal begin: Not an integer");
  38525. if (t >>>= 0,
  38526. "number" != typeof i || i % 1 !== 0)
  38527. throw TypeError("Illegal end: Not an integer");
  38528. if (i >>>= 0,
  38529. t < 0 || t > i || i > this.buffer.byteLength)
  38530. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  38531. }
  38532. if (t >= i)
  38533. return this;
  38534. for (; t < i; )
  38535. this.view[t++] = e;
  38536. return n && (this.offset = t),
  38537. this
  38538. }
  38539. ,
  38540. a.flip = function() {
  38541. return this.limit = this.offset,
  38542. this.offset = 0,
  38543. this
  38544. }
  38545. ,
  38546. a.mark = function(e) {
  38547. if (e = "undefined" == typeof e ? this.offset : e,
  38548. !this.noAssert) {
  38549. if ("number" != typeof e || e % 1 !== 0)
  38550. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38551. if (e >>>= 0,
  38552. e < 0 || e + 0 > this.buffer.byteLength)
  38553. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  38554. }
  38555. return this.markedOffset = e,
  38556. this
  38557. }
  38558. ,
  38559. a.order = function(e) {
  38560. if (!this.noAssert && "boolean" != typeof e)
  38561. throw TypeError("Illegal littleEndian: Not a boolean");
  38562. return this.littleEndian = !!e,
  38563. this
  38564. }
  38565. ,
  38566. a.LE = function(e) {
  38567. return this.littleEndian = "undefined" == typeof e || !!e,
  38568. this
  38569. }
  38570. ,
  38571. a.BE = function(e) {
  38572. return this.littleEndian = "undefined" != typeof e && !e,
  38573. this
  38574. }
  38575. ,
  38576. a.prepend = function(e, t, i) {
  38577. "number" != typeof t && "string" == typeof t || (i = t,
  38578. t = void 0);
  38579. var n = "undefined" == typeof i;
  38580. if (n && (i = this.offset),
  38581. !this.noAssert) {
  38582. if ("number" != typeof i || i % 1 !== 0)
  38583. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38584. if (i >>>= 0,
  38585. i < 0 || i + 0 > this.buffer.byteLength)
  38586. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38587. }
  38588. e instanceof o || (e = o.wrap(e, t));
  38589. var r = e.limit - e.offset;
  38590. if (r <= 0)
  38591. return this;
  38592. var a = r - i;
  38593. if (a > 0) {
  38594. var s = new ArrayBuffer(this.buffer.byteLength + a)
  38595. , l = new Uint8Array(s);
  38596. l.set(this.view.subarray(i, this.buffer.byteLength), r),
  38597. this.buffer = s,
  38598. this.view = l,
  38599. this.offset += a,
  38600. this.markedOffset >= 0 && (this.markedOffset += a),
  38601. this.limit += a,
  38602. i += a
  38603. } else {
  38604. new Uint8Array(this.buffer)
  38605. }
  38606. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  38607. e.offset = e.limit,
  38608. n && (this.offset -= r),
  38609. this
  38610. }
  38611. ,
  38612. a.prependTo = function(e, t) {
  38613. return e.prepend(this, t),
  38614. this
  38615. }
  38616. ,
  38617. a.printDebug = function(e) {
  38618. "function" != typeof e && (e = console.log.bind(console)),
  38619. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  38620. }
  38621. ,
  38622. a.remaining = function() {
  38623. return this.limit - this.offset
  38624. }
  38625. ,
  38626. a.reset = function() {
  38627. return this.markedOffset >= 0 ? (this.offset = this.markedOffset,
  38628. this.markedOffset = -1) : this.offset = 0,
  38629. this
  38630. }
  38631. ,
  38632. a.resize = function(e) {
  38633. if (!this.noAssert) {
  38634. if ("number" != typeof e || e % 1 !== 0)
  38635. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  38636. if (e |= 0,
  38637. e < 0)
  38638. throw RangeError("Illegal capacity: 0 <= " + e)
  38639. }
  38640. if (this.buffer.byteLength < e) {
  38641. var t = new ArrayBuffer(e)
  38642. , i = new Uint8Array(t);
  38643. i.set(this.view),
  38644. this.buffer = t,
  38645. this.view = i
  38646. }
  38647. return this
  38648. }
  38649. ,
  38650. a.reverse = function(e, t) {
  38651. if ("undefined" == typeof e && (e = this.offset),
  38652. "undefined" == typeof t && (t = this.limit),
  38653. !this.noAssert) {
  38654. if ("number" != typeof e || e % 1 !== 0)
  38655. throw TypeError("Illegal begin: Not an integer");
  38656. if (e >>>= 0,
  38657. "number" != typeof t || t % 1 !== 0)
  38658. throw TypeError("Illegal end: Not an integer");
  38659. if (t >>>= 0,
  38660. e < 0 || e > t || t > this.buffer.byteLength)
  38661. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38662. }
  38663. return e === t ? this : (Array.prototype.reverse.call(this.view.subarray(e, t)),
  38664. this)
  38665. }
  38666. ,
  38667. a.skip = function(e) {
  38668. if (!this.noAssert) {
  38669. if ("number" != typeof e || e % 1 !== 0)
  38670. throw TypeError("Illegal length: " + e + " (not an integer)");
  38671. e |= 0
  38672. }
  38673. var t = this.offset + e;
  38674. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  38675. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  38676. return this.offset = t,
  38677. this
  38678. }
  38679. ,
  38680. a.slice = function(e, t) {
  38681. if ("undefined" == typeof e && (e = this.offset),
  38682. "undefined" == typeof t && (t = this.limit),
  38683. !this.noAssert) {
  38684. if ("number" != typeof e || e % 1 !== 0)
  38685. throw TypeError("Illegal begin: Not an integer");
  38686. if (e >>>= 0,
  38687. "number" != typeof t || t % 1 !== 0)
  38688. throw TypeError("Illegal end: Not an integer");
  38689. if (t >>>= 0,
  38690. e < 0 || e > t || t > this.buffer.byteLength)
  38691. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38692. }
  38693. var i = this.clone();
  38694. return i.offset = e,
  38695. i.limit = t,
  38696. i
  38697. }
  38698. ,
  38699. a.toBuffer = function(e) {
  38700. var t = this.offset
  38701. , i = this.limit;
  38702. if (!this.noAssert) {
  38703. if ("number" != typeof t || t % 1 !== 0)
  38704. throw TypeError("Illegal offset: Not an integer");
  38705. if (t >>>= 0,
  38706. "number" != typeof i || i % 1 !== 0)
  38707. throw TypeError("Illegal limit: Not an integer");
  38708. if (i >>>= 0,
  38709. t < 0 || t > i || i > this.buffer.byteLength)
  38710. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  38711. }
  38712. if (!e && 0 === t && i === this.buffer.byteLength)
  38713. return this.buffer;
  38714. if (t === i)
  38715. return s;
  38716. var n = new ArrayBuffer(i - t);
  38717. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  38718. n
  38719. }
  38720. ,
  38721. a.toArrayBuffer = a.toBuffer,
  38722. a.toString = function(e, t, i) {
  38723. if ("undefined" == typeof e)
  38724. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  38725. switch ("number" == typeof e && (e = "utf8",
  38726. t = e,
  38727. i = t),
  38728. e) {
  38729. case "utf8":
  38730. return this.toUTF8(t, i);
  38731. case "base64":
  38732. return this.toBase64(t, i);
  38733. case "hex":
  38734. return this.toHex(t, i);
  38735. case "binary":
  38736. return this.toBinary(t, i);
  38737. case "debug":
  38738. return this.toDebug();
  38739. case "columns":
  38740. return this.toColumns();
  38741. default:
  38742. throw Error("Unsupported encoding: " + e)
  38743. }
  38744. }
  38745. ;
  38746. var c = function() {
  38747. 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)
  38748. i[t[n]] = n;
  38749. return e.encode = function(e, i) {
  38750. for (var n, r; null !== (n = e()); )
  38751. i(t[n >> 2 & 63]),
  38752. r = (3 & n) << 4,
  38753. null !== (n = e()) ? (r |= n >> 4 & 15,
  38754. i(t[63 & (r | n >> 4 & 15)]),
  38755. r = (15 & n) << 2,
  38756. null !== (n = e()) ? (i(t[63 & (r | n >> 6 & 3)]),
  38757. i(t[63 & n])) : (i(t[63 & r]),
  38758. i(61))) : (i(t[63 & r]),
  38759. i(61),
  38760. i(61))
  38761. }
  38762. ,
  38763. e.decode = function(e, t) {
  38764. function n(e) {
  38765. throw Error("Illegal character code: " + e)
  38766. }
  38767. for (var r, o, a; null !== (r = e()); )
  38768. if (o = i[r],
  38769. "undefined" == typeof o && n(r),
  38770. null !== (r = e()) && (a = i[r],
  38771. "undefined" == typeof a && n(r),
  38772. t(o << 2 >>> 0 | (48 & a) >> 4),
  38773. null !== (r = e()))) {
  38774. if (o = i[r],
  38775. "undefined" == typeof o) {
  38776. if (61 === r)
  38777. break;
  38778. n(r)
  38779. }
  38780. if (t((15 & a) << 4 >>> 0 | (60 & o) >> 2),
  38781. null !== (r = e())) {
  38782. if (a = i[r],
  38783. "undefined" == typeof a) {
  38784. if (61 === r)
  38785. break;
  38786. n(r)
  38787. }
  38788. t((3 & o) << 6 >>> 0 | a)
  38789. }
  38790. }
  38791. }
  38792. ,
  38793. e.test = function(e) {
  38794. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  38795. }
  38796. ,
  38797. e
  38798. }();
  38799. a.toBase64 = function(e, t) {
  38800. if ("undefined" == typeof e && (e = this.offset),
  38801. "undefined" == typeof t && (t = this.limit),
  38802. e |= 0,
  38803. t |= 0,
  38804. e < 0 || t > this.capacity || e > t)
  38805. throw RangeError("begin, end");
  38806. var n;
  38807. return c.encode(function() {
  38808. return e < t ? this.view[e++] : null
  38809. }
  38810. .bind(this), n = i()),
  38811. n()
  38812. }
  38813. ,
  38814. o.fromBase64 = function(e, i) {
  38815. if ("string" != typeof e)
  38816. throw TypeError("str");
  38817. var n = new o(e.length / 4 * 3,i)
  38818. , r = 0;
  38819. return c.decode(t(e), function(e) {
  38820. n.view[r++] = e
  38821. }),
  38822. n.limit = r,
  38823. n
  38824. }
  38825. ,
  38826. o.btoa = function(e) {
  38827. return o.fromBinary(e).toBase64()
  38828. }
  38829. ,
  38830. o.atob = function(e) {
  38831. return o.fromBase64(e).toBinary()
  38832. }
  38833. ,
  38834. a.toBinary = function(e, t) {
  38835. if ("undefined" == typeof e && (e = this.offset),
  38836. "undefined" == typeof t && (t = this.limit),
  38837. e |= 0,
  38838. t |= 0,
  38839. e < 0 || t > this.capacity() || e > t)
  38840. throw RangeError("begin, end");
  38841. if (e === t)
  38842. return "";
  38843. for (var i = [], n = []; e < t; )
  38844. i.push(this.view[e++]),
  38845. i.length >= 1024 && (n.push(String.fromCharCode.apply(String, i)),
  38846. i = []);
  38847. return n.join("") + String.fromCharCode.apply(String, i)
  38848. }
  38849. ,
  38850. o.fromBinary = function(e, t) {
  38851. if ("string" != typeof e)
  38852. throw TypeError("str");
  38853. for (var i, n = 0, r = e.length, a = new o(r,t); n < r; ) {
  38854. if (i = e.charCodeAt(n),
  38855. i > 255)
  38856. throw RangeError("illegal char code: " + i);
  38857. a.view[n++] = i
  38858. }
  38859. return a.limit = r,
  38860. a
  38861. }
  38862. ,
  38863. a.toDebug = function(e) {
  38864. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  38865. if (i !== -1 && (t = this.view[i],
  38866. r += t < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  38867. e && (o += t > 32 && t < 127 ? String.fromCharCode(t) : ".")),
  38868. ++i,
  38869. e && i > 0 && i % 16 === 0 && i !== n) {
  38870. for (; r.length < 51; )
  38871. r += " ";
  38872. a += r + o + "\n",
  38873. r = o = ""
  38874. }
  38875. 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 ? " " : ""
  38876. }
  38877. if (e && " " !== r) {
  38878. for (; r.length < 51; )
  38879. r += " ";
  38880. a += r + o + "\n"
  38881. }
  38882. return e ? a : r
  38883. }
  38884. ,
  38885. o.fromDebug = function(e, t, i) {
  38886. 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; ) {
  38887. switch (n = e.charAt(l++)) {
  38888. case "!":
  38889. if (!i) {
  38890. if (u || d || p) {
  38891. f = !0;
  38892. break
  38893. }
  38894. u = d = p = !0
  38895. }
  38896. s.offset = s.markedOffset = s.limit = c,
  38897. h = !1;
  38898. break;
  38899. case "|":
  38900. if (!i) {
  38901. if (u || p) {
  38902. f = !0;
  38903. break
  38904. }
  38905. u = p = !0
  38906. }
  38907. s.offset = s.limit = c,
  38908. h = !1;
  38909. break;
  38910. case "[":
  38911. if (!i) {
  38912. if (u || d) {
  38913. f = !0;
  38914. break
  38915. }
  38916. u = d = !0
  38917. }
  38918. s.offset = s.markedOffset = c,
  38919. h = !1;
  38920. break;
  38921. case "<":
  38922. if (!i) {
  38923. if (u) {
  38924. f = !0;
  38925. break
  38926. }
  38927. u = !0
  38928. }
  38929. s.offset = c,
  38930. h = !1;
  38931. break;
  38932. case "]":
  38933. if (!i) {
  38934. if (p || d) {
  38935. f = !0;
  38936. break
  38937. }
  38938. p = d = !0
  38939. }
  38940. s.limit = s.markedOffset = c,
  38941. h = !1;
  38942. break;
  38943. case ">":
  38944. if (!i) {
  38945. if (p) {
  38946. f = !0;
  38947. break
  38948. }
  38949. p = !0
  38950. }
  38951. s.limit = c,
  38952. h = !1;
  38953. break;
  38954. case "'":
  38955. if (!i) {
  38956. if (d) {
  38957. f = !0;
  38958. break
  38959. }
  38960. d = !0
  38961. }
  38962. s.markedOffset = c,
  38963. h = !1;
  38964. break;
  38965. case " ":
  38966. h = !1;
  38967. break;
  38968. default:
  38969. if (!i && h) {
  38970. f = !0;
  38971. break
  38972. }
  38973. if (r = parseInt(n + e.charAt(l++), 16),
  38974. !i && (isNaN(r) || r < 0 || r > 255))
  38975. throw TypeError("Illegal str: Not a debug encoded string");
  38976. s.view[c++] = r,
  38977. h = !0
  38978. }
  38979. if (f)
  38980. throw TypeError("Illegal str: Invalid symbol at " + l)
  38981. }
  38982. if (!i) {
  38983. if (!u || !p)
  38984. throw TypeError("Illegal str: Missing offset or limit");
  38985. if (c < s.buffer.byteLength)
  38986. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + c + " < " + a)
  38987. }
  38988. return s
  38989. }
  38990. ,
  38991. a.toHex = function(e, t) {
  38992. if (e = "undefined" == typeof e ? this.offset : e,
  38993. t = "undefined" == typeof t ? this.limit : t,
  38994. !this.noAssert) {
  38995. if ("number" != typeof e || e % 1 !== 0)
  38996. throw TypeError("Illegal begin: Not an integer");
  38997. if (e >>>= 0,
  38998. "number" != typeof t || t % 1 !== 0)
  38999. throw TypeError("Illegal end: Not an integer");
  39000. if (t >>>= 0,
  39001. e < 0 || e > t || t > this.buffer.byteLength)
  39002. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  39003. }
  39004. for (var i, n = new Array(t - e); e < t; )
  39005. i = this.view[e++],
  39006. i < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  39007. return n.join("")
  39008. }
  39009. ,
  39010. o.fromHex = function(e, t, i) {
  39011. if (!i) {
  39012. if ("string" != typeof e)
  39013. throw TypeError("Illegal str: Not a string");
  39014. if (e.length % 2 !== 0)
  39015. throw TypeError("Illegal str: Length not a multiple of 2")
  39016. }
  39017. for (var n, r = e.length, a = new o(r / 2 | 0,t), s = 0, l = 0; s < r; s += 2) {
  39018. if (n = parseInt(e.substring(s, s + 2), 16),
  39019. !i && (!isFinite(n) || n < 0 || n > 255))
  39020. throw TypeError("Illegal str: Contains non-hex characters");
  39021. a.view[l++] = n
  39022. }
  39023. return a.limit = l,
  39024. a
  39025. }
  39026. ;
  39027. var h = function() {
  39028. var e = {};
  39029. return e.MAX_CODEPOINT = 1114111,
  39030. e.encodeUTF8 = function(e, t) {
  39031. var i = null;
  39032. for ("number" == typeof e && (i = e,
  39033. e = function() {
  39034. return null
  39035. }
  39036. ); null !== i || null !== (i = e()); )
  39037. i < 128 ? t(127 & i) : i < 2048 ? (t(i >> 6 & 31 | 192),
  39038. t(63 & i | 128)) : i < 65536 ? (t(i >> 12 & 15 | 224),
  39039. t(i >> 6 & 63 | 128),
  39040. t(63 & i | 128)) : (t(i >> 18 & 7 | 240),
  39041. t(i >> 12 & 63 | 128),
  39042. t(i >> 6 & 63 | 128),
  39043. t(63 & i | 128)),
  39044. i = null
  39045. }
  39046. ,
  39047. e.decodeUTF8 = function(e, t) {
  39048. for (var i, n, r, o, a = function(e) {
  39049. e = e.slice(0, e.indexOf(null));
  39050. var t = Error(e.toString());
  39051. throw t.name = "TruncatedError",
  39052. t.bytes = e,
  39053. t
  39054. }; null !== (i = e()); )
  39055. if (0 === (128 & i))
  39056. t(i);
  39057. else if (192 === (224 & i))
  39058. null === (n = e()) && a([i, n]),
  39059. t((31 & i) << 6 | 63 & n);
  39060. else if (224 === (240 & i))
  39061. (null === (n = e()) || null === (r = e())) && a([i, n, r]),
  39062. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  39063. else {
  39064. if (240 !== (248 & i))
  39065. throw RangeError("Illegal starting byte: " + i);
  39066. (null === (n = e()) || null === (r = e()) || null === (o = e())) && a([i, n, r, o]),
  39067. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  39068. }
  39069. }
  39070. ,
  39071. e.UTF16toUTF8 = function(e, t) {
  39072. for (var i, n = null; ; ) {
  39073. if (null === (i = null !== n ? n : e()))
  39074. break;
  39075. i >= 55296 && i <= 57343 && null !== (n = e()) && n >= 56320 && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  39076. n = null) : t(i)
  39077. }
  39078. null !== n && t(n)
  39079. }
  39080. ,
  39081. e.UTF8toUTF16 = function(e, t) {
  39082. var i = null;
  39083. for ("number" == typeof e && (i = e,
  39084. e = function() {
  39085. return null
  39086. }
  39087. ); null !== i || null !== (i = e()); )
  39088. i <= 65535 ? t(i) : (i -= 65536,
  39089. t((i >> 10) + 55296),
  39090. t(i % 1024 + 56320)),
  39091. i = null
  39092. }
  39093. ,
  39094. e.encodeUTF16toUTF8 = function(t, i) {
  39095. e.UTF16toUTF8(t, function(t) {
  39096. e.encodeUTF8(t, i)
  39097. })
  39098. }
  39099. ,
  39100. e.decodeUTF8toUTF16 = function(t, i) {
  39101. e.decodeUTF8(t, function(t) {
  39102. e.UTF8toUTF16(t, i)
  39103. })
  39104. }
  39105. ,
  39106. e.calculateCodePoint = function(e) {
  39107. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  39108. }
  39109. ,
  39110. e.calculateUTF8 = function(e) {
  39111. for (var t, i = 0; null !== (t = e()); )
  39112. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  39113. return i
  39114. }
  39115. ,
  39116. e.calculateUTF16asUTF8 = function(t) {
  39117. var i = 0
  39118. , n = 0;
  39119. return e.UTF16toUTF8(t, function(e) {
  39120. ++i,
  39121. n += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  39122. }),
  39123. [i, n]
  39124. }
  39125. ,
  39126. e
  39127. }();
  39128. return a.toUTF8 = function(e, t) {
  39129. if ("undefined" == typeof e && (e = this.offset),
  39130. "undefined" == typeof t && (t = this.limit),
  39131. !this.noAssert) {
  39132. if ("number" != typeof e || e % 1 !== 0)
  39133. throw TypeError("Illegal begin: Not an integer");
  39134. if (e >>>= 0,
  39135. "number" != typeof t || t % 1 !== 0)
  39136. throw TypeError("Illegal end: Not an integer");
  39137. if (t >>>= 0,
  39138. e < 0 || e > t || t > this.buffer.byteLength)
  39139. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  39140. }
  39141. var n;
  39142. try {
  39143. h.decodeUTF8toUTF16(function() {
  39144. return e < t ? this.view[e++] : null
  39145. }
  39146. .bind(this), n = i())
  39147. } catch (i) {
  39148. if (e !== t)
  39149. throw RangeError("Illegal range: Truncated data, " + e + " != " + t)
  39150. }
  39151. return n()
  39152. }
  39153. ,
  39154. o.fromUTF8 = function(e, i, n) {
  39155. if (!n && "string" != typeof e)
  39156. throw TypeError("Illegal str: Not a string");
  39157. var r = new o(h.calculateUTF16asUTF8(t(e), !0)[1],i,n)
  39158. , a = 0;
  39159. return h.encodeUTF16toUTF8(t(e), function(e) {
  39160. r.view[a++] = e
  39161. }),
  39162. r.limit = a,
  39163. r
  39164. }
  39165. ,
  39166. o
  39167. })
  39168. }
  39169. , {
  39170. long: 216
  39171. }],
  39172. 216: [function(e, t, i) {
  39173. !function(i, n) {
  39174. "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()
  39175. }(this, function() {
  39176. "use strict";
  39177. function e(e, t, i) {
  39178. this.low = 0 | e,
  39179. this.high = 0 | t,
  39180. this.unsigned = !!i
  39181. }
  39182. function t(e) {
  39183. return (e && e.__isLong__) === !0
  39184. }
  39185. function i(e, t) {
  39186. var i, n, o;
  39187. return t ? (e >>>= 0,
  39188. (o = 0 <= e && e < 256) && (n = l[e]) ? n : (i = r(e, (0 | e) < 0 ? -1 : 0, !0),
  39189. o && (l[e] = i),
  39190. i)) : (e |= 0,
  39191. (o = -128 <= e && e < 128) && (n = s[e]) ? n : (i = r(e, e < 0 ? -1 : 0, !1),
  39192. o && (s[e] = i),
  39193. i))
  39194. }
  39195. function n(e, t) {
  39196. if (isNaN(e) || !isFinite(e))
  39197. return t ? m : g;
  39198. if (t) {
  39199. if (e < 0)
  39200. return m;
  39201. if (e >= d)
  39202. return I
  39203. } else {
  39204. if (e <= -p)
  39205. return E;
  39206. if (e + 1 >= p)
  39207. return C
  39208. }
  39209. return e < 0 ? n(-e, t).neg() : r(e % u | 0, e / u | 0, t)
  39210. }
  39211. function r(t, i, n) {
  39212. return new e(t,i,n)
  39213. }
  39214. function o(e, t, i) {
  39215. if (0 === e.length)
  39216. throw Error("empty string");
  39217. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  39218. return g;
  39219. if ("number" == typeof t ? (i = t,
  39220. t = !1) : t = !!t,
  39221. i = i || 10,
  39222. i < 2 || 36 < i)
  39223. throw RangeError("radix");
  39224. var r;
  39225. if ((r = e.indexOf("-")) > 0)
  39226. throw Error("interior hyphen");
  39227. if (0 === r)
  39228. return o(e.substring(1), t, i).neg();
  39229. for (var a = n(c(i, 8)), s = g, l = 0; l < e.length; l += 8) {
  39230. var h = Math.min(8, e.length - l)
  39231. , u = parseInt(e.substring(l, l + h), i);
  39232. if (h < 8) {
  39233. var d = n(c(i, h));
  39234. s = s.mul(d).add(n(u))
  39235. } else
  39236. s = s.mul(a),
  39237. s = s.add(n(u))
  39238. }
  39239. return s.unsigned = t,
  39240. s
  39241. }
  39242. function a(t) {
  39243. return t instanceof e ? t : "number" == typeof t ? n(t) : "string" == typeof t ? o(t) : r(t.low, t.high, t.unsigned)
  39244. }
  39245. e.prototype.__isLong__,
  39246. Object.defineProperty(e.prototype, "__isLong__", {
  39247. value: !0,
  39248. enumerable: !1,
  39249. configurable: !1
  39250. }),
  39251. e.isLong = t;
  39252. var s = {}
  39253. , l = {};
  39254. e.fromInt = i,
  39255. e.fromNumber = n,
  39256. e.fromBits = r;
  39257. var c = Math.pow;
  39258. e.fromString = o,
  39259. e.fromValue = a;
  39260. var h = 1 << 24
  39261. , u = 4294967296
  39262. , d = 0x10000000000000000
  39263. , p = d / 2
  39264. , f = i(h)
  39265. , g = i(0);
  39266. e.ZERO = g;
  39267. var m = i(0, !0);
  39268. e.UZERO = m;
  39269. var v = i(1);
  39270. e.ONE = v;
  39271. var A = i(1, !0);
  39272. e.UONE = A;
  39273. var y = i(-1);
  39274. e.NEG_ONE = y;
  39275. var C = r(-1, 2147483647, !1);
  39276. e.MAX_VALUE = C;
  39277. var I = r(-1, -1, !0);
  39278. e.MAX_UNSIGNED_VALUE = I;
  39279. var E = r(0, -2147483648, !1);
  39280. e.MIN_VALUE = E;
  39281. var b = e.prototype;
  39282. return b.toInt = function() {
  39283. return this.unsigned ? this.low >>> 0 : this.low
  39284. }
  39285. ,
  39286. b.toNumber = function() {
  39287. return this.unsigned ? (this.high >>> 0) * u + (this.low >>> 0) : this.high * u + (this.low >>> 0)
  39288. }
  39289. ,
  39290. b.toString = function(e) {
  39291. if (e = e || 10,
  39292. e < 2 || 36 < e)
  39293. throw RangeError("radix");
  39294. if (this.isZero())
  39295. return "0";
  39296. if (this.isNegative()) {
  39297. if (this.eq(E)) {
  39298. var t = n(e)
  39299. , i = this.div(t)
  39300. , r = i.mul(t).sub(this);
  39301. return i.toString(e) + r.toInt().toString(e)
  39302. }
  39303. return "-" + this.neg().toString(e)
  39304. }
  39305. for (var o = n(c(e, 6), this.unsigned), a = this, s = ""; ; ) {
  39306. var l = a.div(o)
  39307. , h = a.sub(l.mul(o)).toInt() >>> 0
  39308. , u = h.toString(e);
  39309. if (a = l,
  39310. a.isZero())
  39311. return u + s;
  39312. for (; u.length < 6; )
  39313. u = "0" + u;
  39314. s = "" + u + s
  39315. }
  39316. }
  39317. ,
  39318. b.getHighBits = function() {
  39319. return this.high
  39320. }
  39321. ,
  39322. b.getHighBitsUnsigned = function() {
  39323. return this.high >>> 0
  39324. }
  39325. ,
  39326. b.getLowBits = function() {
  39327. return this.low
  39328. }
  39329. ,
  39330. b.getLowBitsUnsigned = function() {
  39331. return this.low >>> 0
  39332. }
  39333. ,
  39334. b.getNumBitsAbs = function() {
  39335. if (this.isNegative())
  39336. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  39337. for (var e = 0 != this.high ? this.high : this.low, t = 31; t > 0 && 0 == (e & 1 << t); t--)
  39338. ;
  39339. return 0 != this.high ? t + 33 : t + 1
  39340. }
  39341. ,
  39342. b.isZero = function() {
  39343. return 0 === this.high && 0 === this.low
  39344. }
  39345. ,
  39346. b.isNegative = function() {
  39347. return !this.unsigned && this.high < 0
  39348. }
  39349. ,
  39350. b.isPositive = function() {
  39351. return this.unsigned || this.high >= 0
  39352. }
  39353. ,
  39354. b.isOdd = function() {
  39355. return 1 === (1 & this.low)
  39356. }
  39357. ,
  39358. b.isEven = function() {
  39359. return 0 === (1 & this.low)
  39360. }
  39361. ,
  39362. b.equals = function(e) {
  39363. return t(e) || (e = a(e)),
  39364. (this.unsigned === e.unsigned || this.high >>> 31 !== 1 || e.high >>> 31 !== 1) && (this.high === e.high && this.low === e.low)
  39365. }
  39366. ,
  39367. b.eq = b.equals,
  39368. b.notEquals = function(e) {
  39369. return !this.eq(e)
  39370. }
  39371. ,
  39372. b.neq = b.notEquals,
  39373. b.lessThan = function(e) {
  39374. return this.comp(e) < 0
  39375. }
  39376. ,
  39377. b.lt = b.lessThan,
  39378. b.lessThanOrEqual = function(e) {
  39379. return this.comp(e) <= 0
  39380. }
  39381. ,
  39382. b.lte = b.lessThanOrEqual,
  39383. b.greaterThan = function(e) {
  39384. return this.comp(e) > 0
  39385. }
  39386. ,
  39387. b.gt = b.greaterThan,
  39388. b.greaterThanOrEqual = function(e) {
  39389. return this.comp(e) >= 0
  39390. }
  39391. ,
  39392. b.gte = b.greaterThanOrEqual,
  39393. b.compare = function(e) {
  39394. if (t(e) || (e = a(e)),
  39395. this.eq(e))
  39396. return 0;
  39397. var i = this.isNegative()
  39398. , n = e.isNegative();
  39399. 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
  39400. }
  39401. ,
  39402. b.comp = b.compare,
  39403. b.negate = function() {
  39404. return !this.unsigned && this.eq(E) ? E : this.not().add(v)
  39405. }
  39406. ,
  39407. b.neg = b.negate,
  39408. b.add = function(e) {
  39409. t(e) || (e = a(e));
  39410. var i = this.high >>> 16
  39411. , n = 65535 & this.high
  39412. , o = this.low >>> 16
  39413. , s = 65535 & this.low
  39414. , l = e.high >>> 16
  39415. , c = 65535 & e.high
  39416. , h = e.low >>> 16
  39417. , u = 65535 & e.low
  39418. , d = 0
  39419. , p = 0
  39420. , f = 0
  39421. , g = 0;
  39422. return g += s + u,
  39423. f += g >>> 16,
  39424. g &= 65535,
  39425. f += o + h,
  39426. p += f >>> 16,
  39427. f &= 65535,
  39428. p += n + c,
  39429. d += p >>> 16,
  39430. p &= 65535,
  39431. d += i + l,
  39432. d &= 65535,
  39433. r(f << 16 | g, d << 16 | p, this.unsigned)
  39434. }
  39435. ,
  39436. b.subtract = function(e) {
  39437. return t(e) || (e = a(e)),
  39438. this.add(e.neg())
  39439. }
  39440. ,
  39441. b.sub = b.subtract,
  39442. b.multiply = function(e) {
  39443. if (this.isZero())
  39444. return g;
  39445. if (t(e) || (e = a(e)),
  39446. e.isZero())
  39447. return g;
  39448. if (this.eq(E))
  39449. return e.isOdd() ? E : g;
  39450. if (e.eq(E))
  39451. return this.isOdd() ? E : g;
  39452. if (this.isNegative())
  39453. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  39454. if (e.isNegative())
  39455. return this.mul(e.neg()).neg();
  39456. if (this.lt(f) && e.lt(f))
  39457. return n(this.toNumber() * e.toNumber(), this.unsigned);
  39458. var i = this.high >>> 16
  39459. , o = 65535 & this.high
  39460. , s = this.low >>> 16
  39461. , l = 65535 & this.low
  39462. , c = e.high >>> 16
  39463. , h = 65535 & e.high
  39464. , u = e.low >>> 16
  39465. , d = 65535 & e.low
  39466. , p = 0
  39467. , m = 0
  39468. , v = 0
  39469. , A = 0;
  39470. return A += l * d,
  39471. v += A >>> 16,
  39472. A &= 65535,
  39473. v += s * d,
  39474. m += v >>> 16,
  39475. v &= 65535,
  39476. v += l * u,
  39477. m += v >>> 16,
  39478. v &= 65535,
  39479. m += o * d,
  39480. p += m >>> 16,
  39481. m &= 65535,
  39482. m += s * u,
  39483. p += m >>> 16,
  39484. m &= 65535,
  39485. m += l * h,
  39486. p += m >>> 16,
  39487. m &= 65535,
  39488. p += i * d + o * u + s * h + l * c,
  39489. p &= 65535,
  39490. r(v << 16 | A, p << 16 | m, this.unsigned)
  39491. }
  39492. ,
  39493. b.mul = b.multiply,
  39494. b.divide = function(e) {
  39495. if (t(e) || (e = a(e)),
  39496. e.isZero())
  39497. throw Error("division by zero");
  39498. if (this.isZero())
  39499. return this.unsigned ? m : g;
  39500. var i, r, o;
  39501. if (this.unsigned) {
  39502. if (e.unsigned || (e = e.toUnsigned()),
  39503. e.gt(this))
  39504. return m;
  39505. if (e.gt(this.shru(1)))
  39506. return A;
  39507. o = m
  39508. } else {
  39509. if (this.eq(E)) {
  39510. if (e.eq(v) || e.eq(y))
  39511. return E;
  39512. if (e.eq(E))
  39513. return v;
  39514. var s = this.shr(1);
  39515. return i = s.div(e).shl(1),
  39516. i.eq(g) ? e.isNegative() ? v : y : (r = this.sub(e.mul(i)),
  39517. o = i.add(r.div(e)))
  39518. }
  39519. if (e.eq(E))
  39520. return this.unsigned ? m : g;
  39521. if (this.isNegative())
  39522. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  39523. if (e.isNegative())
  39524. return this.div(e.neg()).neg();
  39525. o = g
  39526. }
  39527. for (r = this; r.gte(e); ) {
  39528. i = Math.max(1, Math.floor(r.toNumber() / e.toNumber()));
  39529. 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); )
  39530. i -= h,
  39531. u = n(i, this.unsigned),
  39532. d = u.mul(e);
  39533. u.isZero() && (u = v),
  39534. o = o.add(u),
  39535. r = r.sub(d)
  39536. }
  39537. return o
  39538. }
  39539. ,
  39540. b.div = b.divide,
  39541. b.modulo = function(e) {
  39542. return t(e) || (e = a(e)),
  39543. this.sub(this.div(e).mul(e))
  39544. }
  39545. ,
  39546. b.mod = b.modulo,
  39547. b.not = function() {
  39548. return r(~this.low, ~this.high, this.unsigned)
  39549. }
  39550. ,
  39551. b.and = function(e) {
  39552. return t(e) || (e = a(e)),
  39553. r(this.low & e.low, this.high & e.high, this.unsigned)
  39554. }
  39555. ,
  39556. b.or = function(e) {
  39557. return t(e) || (e = a(e)),
  39558. r(this.low | e.low, this.high | e.high, this.unsigned)
  39559. }
  39560. ,
  39561. b.xor = function(e) {
  39562. return t(e) || (e = a(e)),
  39563. r(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  39564. }
  39565. ,
  39566. b.shiftLeft = function(e) {
  39567. return t(e) && (e = e.toInt()),
  39568. 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)
  39569. }
  39570. ,
  39571. b.shl = b.shiftLeft,
  39572. b.shiftRight = function(e) {
  39573. return t(e) && (e = e.toInt()),
  39574. 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)
  39575. }
  39576. ,
  39577. b.shr = b.shiftRight,
  39578. b.shiftRightUnsigned = function(e) {
  39579. if (t(e) && (e = e.toInt()),
  39580. e &= 63,
  39581. 0 === e)
  39582. return this;
  39583. var i = this.high;
  39584. if (e < 32) {
  39585. var n = this.low;
  39586. return r(n >>> e | i << 32 - e, i >>> e, this.unsigned)
  39587. }
  39588. return 32 === e ? r(i, 0, this.unsigned) : r(i >>> e - 32, 0, this.unsigned)
  39589. }
  39590. ,
  39591. b.shru = b.shiftRightUnsigned,
  39592. b.toSigned = function() {
  39593. return this.unsigned ? r(this.low, this.high, !1) : this
  39594. }
  39595. ,
  39596. b.toUnsigned = function() {
  39597. return this.unsigned ? this : r(this.low, this.high, !0)
  39598. }
  39599. ,
  39600. b.toBytes = function(e) {
  39601. return e ? this.toBytesLE() : this.toBytesBE()
  39602. }
  39603. ,
  39604. b.toBytesLE = function() {
  39605. var e = this.high
  39606. , t = this.low;
  39607. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  39608. }
  39609. ,
  39610. b.toBytesBE = function() {
  39611. var e = this.high
  39612. , t = this.low;
  39613. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  39614. }
  39615. ,
  39616. e
  39617. })
  39618. }
  39619. , {}],
  39620. 217: [function(e, t, i) {
  39621. var n = {
  39622. REVISION: "75"
  39623. };
  39624. "function" == typeof define && define.amd ? define("three", n) : "undefined" != typeof i && "undefined" != typeof t && (t.exports = n),
  39625. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  39626. void 0 === Math.sign && (Math.sign = function(e) {
  39627. return e < 0 ? -1 : e > 0 ? 1 : +e
  39628. }
  39629. ),
  39630. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  39631. get: function() {
  39632. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  39633. }
  39634. }),
  39635. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  39636. writable: !0,
  39637. configurable: !0,
  39638. value: function(e) {
  39639. "use strict";
  39640. if (void 0 === e || null === e)
  39641. throw new TypeError("Cannot convert first argument to object");
  39642. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  39643. var r = arguments[i];
  39644. if (void 0 !== r && null !== r) {
  39645. r = Object(r);
  39646. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  39647. var l = o[a]
  39648. , c = Object.getOwnPropertyDescriptor(r, l);
  39649. void 0 !== c && c.enumerable && (t[l] = r[l])
  39650. }
  39651. }
  39652. }
  39653. return t
  39654. }
  39655. }),
  39656. n.MOUSE = {
  39657. LEFT: 0,
  39658. MIDDLE: 1,
  39659. RIGHT: 2
  39660. },
  39661. n.CullFaceNone = 0,
  39662. n.CullFaceBack = 1,
  39663. n.CullFaceFront = 2,
  39664. n.CullFaceFrontBack = 3,
  39665. n.FrontFaceDirectionCW = 0,
  39666. n.FrontFaceDirectionCCW = 1,
  39667. n.BasicShadowMap = 0,
  39668. n.PCFShadowMap = 1,
  39669. n.PCFSoftShadowMap = 2,
  39670. n.FrontSide = 0,
  39671. n.BackSide = 1,
  39672. n.DoubleSide = 2,
  39673. n.FlatShading = 1,
  39674. n.SmoothShading = 2,
  39675. n.NoColors = 0,
  39676. n.FaceColors = 1,
  39677. n.VertexColors = 2,
  39678. n.NoBlending = 0,
  39679. n.NormalBlending = 1,
  39680. n.AdditiveBlending = 2,
  39681. n.SubtractiveBlending = 3,
  39682. n.MultiplyBlending = 4,
  39683. n.CustomBlending = 5,
  39684. n.AddEquation = 100,
  39685. n.SubtractEquation = 101,
  39686. n.ReverseSubtractEquation = 102,
  39687. n.MinEquation = 103,
  39688. n.MaxEquation = 104,
  39689. n.ZeroFactor = 200,
  39690. n.OneFactor = 201,
  39691. n.SrcColorFactor = 202,
  39692. n.OneMinusSrcColorFactor = 203,
  39693. n.SrcAlphaFactor = 204,
  39694. n.OneMinusSrcAlphaFactor = 205,
  39695. n.DstAlphaFactor = 206,
  39696. n.OneMinusDstAlphaFactor = 207,
  39697. n.DstColorFactor = 208,
  39698. n.OneMinusDstColorFactor = 209,
  39699. n.SrcAlphaSaturateFactor = 210,
  39700. n.NeverDepth = 0,
  39701. n.AlwaysDepth = 1,
  39702. n.LessDepth = 2,
  39703. n.LessEqualDepth = 3,
  39704. n.EqualDepth = 4,
  39705. n.GreaterEqualDepth = 5,
  39706. n.GreaterDepth = 6,
  39707. n.NotEqualDepth = 7,
  39708. n.MultiplyOperation = 0,
  39709. n.MixOperation = 1,
  39710. n.AddOperation = 2,
  39711. n.NoToneMapping = 0,
  39712. n.LinearToneMapping = 1,
  39713. n.ReinhardToneMapping = 2,
  39714. n.Uncharted2ToneMapping = 3,
  39715. n.CineonToneMapping = 4,
  39716. n.UVMapping = 300,
  39717. n.CubeReflectionMapping = 301,
  39718. n.CubeRefractionMapping = 302,
  39719. n.EquirectangularReflectionMapping = 303,
  39720. n.EquirectangularRefractionMapping = 304,
  39721. n.SphericalReflectionMapping = 305,
  39722. n.CubeUVReflectionMapping = 306,
  39723. n.CubeUVRefractionMapping = 307,
  39724. n.RepeatWrapping = 1e3,
  39725. n.ClampToEdgeWrapping = 1001,
  39726. n.MirroredRepeatWrapping = 1002,
  39727. n.NearestFilter = 1003,
  39728. n.NearestMipMapNearestFilter = 1004,
  39729. n.NearestMipMapLinearFilter = 1005,
  39730. n.LinearFilter = 1006,
  39731. n.LinearMipMapNearestFilter = 1007,
  39732. n.LinearMipMapLinearFilter = 1008,
  39733. n.UnsignedByteType = 1009,
  39734. n.ByteType = 1010,
  39735. n.ShortType = 1011,
  39736. n.UnsignedShortType = 1012,
  39737. n.IntType = 1013,
  39738. n.UnsignedIntType = 1014,
  39739. n.FloatType = 1015,
  39740. n.HalfFloatType = 1025,
  39741. n.UnsignedShort4444Type = 1016,
  39742. n.UnsignedShort5551Type = 1017,
  39743. n.UnsignedShort565Type = 1018,
  39744. n.AlphaFormat = 1019,
  39745. n.RGBFormat = 1020,
  39746. n.RGBAFormat = 1021,
  39747. n.LuminanceFormat = 1022,
  39748. n.LuminanceAlphaFormat = 1023,
  39749. n.RGBEFormat = n.RGBAFormat,
  39750. n.RGB_S3TC_DXT1_Format = 2001,
  39751. n.RGBA_S3TC_DXT1_Format = 2002,
  39752. n.RGBA_S3TC_DXT3_Format = 2003,
  39753. n.RGBA_S3TC_DXT5_Format = 2004,
  39754. n.RGB_PVRTC_4BPPV1_Format = 2100,
  39755. n.RGB_PVRTC_2BPPV1_Format = 2101,
  39756. n.RGBA_PVRTC_4BPPV1_Format = 2102,
  39757. n.RGBA_PVRTC_2BPPV1_Format = 2103,
  39758. n.RGB_ETC1_Format = 2151,
  39759. n.LoopOnce = 2200,
  39760. n.LoopRepeat = 2201,
  39761. n.LoopPingPong = 2202,
  39762. n.InterpolateDiscrete = 2300,
  39763. n.InterpolateLinear = 2301,
  39764. n.InterpolateSmooth = 2302,
  39765. n.ZeroCurvatureEnding = 2400,
  39766. n.ZeroSlopeEnding = 2401,
  39767. n.WrapAroundEnding = 2402,
  39768. n.TrianglesDrawMode = 0,
  39769. n.TriangleStripDrawMode = 1,
  39770. n.TriangleFanDrawMode = 2,
  39771. n.LinearEncoding = 3e3,
  39772. n.sRGBEncoding = 3001,
  39773. n.GammaEncoding = 3007,
  39774. n.RGBEEncoding = 3002,
  39775. n.LogLuvEncoding = 3003,
  39776. n.RGBM7Encoding = 3004,
  39777. n.RGBM16Encoding = 3005,
  39778. n.RGBDEncoding = 3006,
  39779. n.Color = function(e) {
  39780. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  39781. }
  39782. ,
  39783. n.Color.prototype = {
  39784. constructor: n.Color,
  39785. r: 1,
  39786. g: 1,
  39787. b: 1,
  39788. set: function(e) {
  39789. return e instanceof n.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  39790. this
  39791. },
  39792. setScalar: function(e) {
  39793. this.r = e,
  39794. this.g = e,
  39795. this.b = e
  39796. },
  39797. setHex: function(e) {
  39798. return e = Math.floor(e),
  39799. this.r = (e >> 16 & 255) / 255,
  39800. this.g = (e >> 8 & 255) / 255,
  39801. this.b = (255 & e) / 255,
  39802. this
  39803. },
  39804. setRGB: function(e, t, i) {
  39805. return this.r = e,
  39806. this.g = t,
  39807. this.b = i,
  39808. this
  39809. },
  39810. setHSL: function() {
  39811. function e(e, t, i) {
  39812. return i < 0 && (i += 1),
  39813. i > 1 && (i -= 1),
  39814. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  39815. }
  39816. return function(t, i, r) {
  39817. if (t = n.Math.euclideanModulo(t, 1),
  39818. i = n.Math.clamp(i, 0, 1),
  39819. r = n.Math.clamp(r, 0, 1),
  39820. 0 === i)
  39821. this.r = this.g = this.b = r;
  39822. else {
  39823. var o = r <= .5 ? r * (1 + i) : r + i - r * i
  39824. , a = 2 * r - o;
  39825. this.r = e(a, o, t + 1 / 3),
  39826. this.g = e(a, o, t),
  39827. this.b = e(a, o, t - 1 / 3)
  39828. }
  39829. return this
  39830. }
  39831. }(),
  39832. setStyle: function(e) {
  39833. function t(t) {
  39834. void 0 !== t && parseFloat(t) < 1 && console.warn("THREE.Color: Alpha component of " + e + " will be ignored.")
  39835. }
  39836. var i;
  39837. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)) {
  39838. var r, o = i[1], a = i[2];
  39839. switch (o) {
  39840. case "rgb":
  39841. case "rgba":
  39842. if (r = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  39843. return this.r = Math.min(255, parseInt(r[1], 10)) / 255,
  39844. this.g = Math.min(255, parseInt(r[2], 10)) / 255,
  39845. this.b = Math.min(255, parseInt(r[3], 10)) / 255,
  39846. t(r[5]),
  39847. this;
  39848. if (r = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  39849. return this.r = Math.min(100, parseInt(r[1], 10)) / 100,
  39850. this.g = Math.min(100, parseInt(r[2], 10)) / 100,
  39851. this.b = Math.min(100, parseInt(r[3], 10)) / 100,
  39852. t(r[5]),
  39853. this;
  39854. break;
  39855. case "hsl":
  39856. case "hsla":
  39857. if (r = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)) {
  39858. var s = parseFloat(r[1]) / 360
  39859. , l = parseInt(r[2], 10) / 100
  39860. , c = parseInt(r[3], 10) / 100;
  39861. return t(r[5]),
  39862. this.setHSL(s, l, c)
  39863. }
  39864. }
  39865. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(e)) {
  39866. var h = i[1]
  39867. , u = h.length;
  39868. if (3 === u)
  39869. return this.r = parseInt(h.charAt(0) + h.charAt(0), 16) / 255,
  39870. this.g = parseInt(h.charAt(1) + h.charAt(1), 16) / 255,
  39871. this.b = parseInt(h.charAt(2) + h.charAt(2), 16) / 255,
  39872. this;
  39873. if (6 === u)
  39874. return this.r = parseInt(h.charAt(0) + h.charAt(1), 16) / 255,
  39875. this.g = parseInt(h.charAt(2) + h.charAt(3), 16) / 255,
  39876. this.b = parseInt(h.charAt(4) + h.charAt(5), 16) / 255,
  39877. this
  39878. }
  39879. if (e && e.length > 0) {
  39880. var h = n.ColorKeywords[e];
  39881. void 0 !== h ? this.setHex(h) : console.warn("THREE.Color: Unknown color " + e)
  39882. }
  39883. return this
  39884. },
  39885. clone: function() {
  39886. return new this.constructor(this.r,this.g,this.b)
  39887. },
  39888. copy: function(e) {
  39889. return this.r = e.r,
  39890. this.g = e.g,
  39891. this.b = e.b,
  39892. this
  39893. },
  39894. copyGammaToLinear: function(e, t) {
  39895. return void 0 === t && (t = 2),
  39896. this.r = Math.pow(e.r, t),
  39897. this.g = Math.pow(e.g, t),
  39898. this.b = Math.pow(e.b, t),
  39899. this
  39900. },
  39901. copyLinearToGamma: function(e, t) {
  39902. void 0 === t && (t = 2);
  39903. var i = t > 0 ? 1 / t : 1;
  39904. return this.r = Math.pow(e.r, i),
  39905. this.g = Math.pow(e.g, i),
  39906. this.b = Math.pow(e.b, i),
  39907. this
  39908. },
  39909. convertGammaToLinear: function() {
  39910. var e = this.r
  39911. , t = this.g
  39912. , i = this.b;
  39913. return this.r = e * e,
  39914. this.g = t * t,
  39915. this.b = i * i,
  39916. this
  39917. },
  39918. convertLinearToGamma: function() {
  39919. return this.r = Math.sqrt(this.r),
  39920. this.g = Math.sqrt(this.g),
  39921. this.b = Math.sqrt(this.b),
  39922. this
  39923. },
  39924. getHex: function() {
  39925. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  39926. },
  39927. getHexString: function() {
  39928. return ("000000" + this.getHex().toString(16)).slice(-6)
  39929. },
  39930. getHSL: function(e) {
  39931. var t, i, n = e || {
  39932. h: 0,
  39933. s: 0,
  39934. l: 0
  39935. }, 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;
  39936. if (l === s)
  39937. t = 0,
  39938. i = 0;
  39939. else {
  39940. var h = s - l;
  39941. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  39942. s) {
  39943. case r:
  39944. t = (o - a) / h + (o < a ? 6 : 0);
  39945. break;
  39946. case o:
  39947. t = (a - r) / h + 2;
  39948. break;
  39949. case a:
  39950. t = (r - o) / h + 4
  39951. }
  39952. t /= 6
  39953. }
  39954. return n.h = t,
  39955. n.s = i,
  39956. n.l = c,
  39957. n
  39958. },
  39959. getStyle: function() {
  39960. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  39961. },
  39962. offsetHSL: function(e, t, i) {
  39963. var n = this.getHSL();
  39964. return n.h += e,
  39965. n.s += t,
  39966. n.l += i,
  39967. this.setHSL(n.h, n.s, n.l),
  39968. this
  39969. },
  39970. add: function(e) {
  39971. return this.r += e.r,
  39972. this.g += e.g,
  39973. this.b += e.b,
  39974. this
  39975. },
  39976. addColors: function(e, t) {
  39977. return this.r = e.r + t.r,
  39978. this.g = e.g + t.g,
  39979. this.b = e.b + t.b,
  39980. this
  39981. },
  39982. addScalar: function(e) {
  39983. return this.r += e,
  39984. this.g += e,
  39985. this.b += e,
  39986. this
  39987. },
  39988. multiply: function(e) {
  39989. return this.r *= e.r,
  39990. this.g *= e.g,
  39991. this.b *= e.b,
  39992. this
  39993. },
  39994. multiplyScalar: function(e) {
  39995. return this.r *= e,
  39996. this.g *= e,
  39997. this.b *= e,
  39998. this
  39999. },
  40000. lerp: function(e, t) {
  40001. return this.r += (e.r - this.r) * t,
  40002. this.g += (e.g - this.g) * t,
  40003. this.b += (e.b - this.b) * t,
  40004. this
  40005. },
  40006. equals: function(e) {
  40007. return e.r === this.r && e.g === this.g && e.b === this.b
  40008. },
  40009. fromArray: function(e, t) {
  40010. return void 0 === t && (t = 0),
  40011. this.r = e[t],
  40012. this.g = e[t + 1],
  40013. this.b = e[t + 2],
  40014. this
  40015. },
  40016. toArray: function(e, t) {
  40017. return void 0 === e && (e = []),
  40018. void 0 === t && (t = 0),
  40019. e[t] = this.r,
  40020. e[t + 1] = this.g,
  40021. e[t + 2] = this.b,
  40022. e
  40023. }
  40024. },
  40025. n.ColorKeywords = {
  40026. aliceblue: 15792383,
  40027. antiquewhite: 16444375,
  40028. aqua: 65535,
  40029. aquamarine: 8388564,
  40030. azure: 15794175,
  40031. beige: 16119260,
  40032. bisque: 16770244,
  40033. black: 0,
  40034. blanchedalmond: 16772045,
  40035. blue: 255,
  40036. blueviolet: 9055202,
  40037. brown: 10824234,
  40038. burlywood: 14596231,
  40039. cadetblue: 6266528,
  40040. chartreuse: 8388352,
  40041. chocolate: 13789470,
  40042. coral: 16744272,
  40043. cornflowerblue: 6591981,
  40044. cornsilk: 16775388,
  40045. crimson: 14423100,
  40046. cyan: 65535,
  40047. darkblue: 139,
  40048. darkcyan: 35723,
  40049. darkgoldenrod: 12092939,
  40050. darkgray: 11119017,
  40051. darkgreen: 25600,
  40052. darkgrey: 11119017,
  40053. darkkhaki: 12433259,
  40054. darkmagenta: 9109643,
  40055. darkolivegreen: 5597999,
  40056. darkorange: 16747520,
  40057. darkorchid: 10040012,
  40058. darkred: 9109504,
  40059. darksalmon: 15308410,
  40060. darkseagreen: 9419919,
  40061. darkslateblue: 4734347,
  40062. darkslategray: 3100495,
  40063. darkslategrey: 3100495,
  40064. darkturquoise: 52945,
  40065. darkviolet: 9699539,
  40066. deeppink: 16716947,
  40067. deepskyblue: 49151,
  40068. dimgray: 6908265,
  40069. dimgrey: 6908265,
  40070. dodgerblue: 2003199,
  40071. firebrick: 11674146,
  40072. floralwhite: 16775920,
  40073. forestgreen: 2263842,
  40074. fuchsia: 16711935,
  40075. gainsboro: 14474460,
  40076. ghostwhite: 16316671,
  40077. gold: 16766720,
  40078. goldenrod: 14329120,
  40079. gray: 8421504,
  40080. green: 32768,
  40081. greenyellow: 11403055,
  40082. grey: 8421504,
  40083. honeydew: 15794160,
  40084. hotpink: 16738740,
  40085. indianred: 13458524,
  40086. indigo: 4915330,
  40087. ivory: 16777200,
  40088. khaki: 15787660,
  40089. lavender: 15132410,
  40090. lavenderblush: 16773365,
  40091. lawngreen: 8190976,
  40092. lemonchiffon: 16775885,
  40093. lightblue: 11393254,
  40094. lightcoral: 15761536,
  40095. lightcyan: 14745599,
  40096. lightgoldenrodyellow: 16448210,
  40097. lightgray: 13882323,
  40098. lightgreen: 9498256,
  40099. lightgrey: 13882323,
  40100. lightpink: 16758465,
  40101. lightsalmon: 16752762,
  40102. lightseagreen: 2142890,
  40103. lightskyblue: 8900346,
  40104. lightslategray: 7833753,
  40105. lightslategrey: 7833753,
  40106. lightsteelblue: 11584734,
  40107. lightyellow: 16777184,
  40108. lime: 65280,
  40109. limegreen: 3329330,
  40110. linen: 16445670,
  40111. magenta: 16711935,
  40112. maroon: 8388608,
  40113. mediumaquamarine: 6737322,
  40114. mediumblue: 205,
  40115. mediumorchid: 12211667,
  40116. mediumpurple: 9662683,
  40117. mediumseagreen: 3978097,
  40118. mediumslateblue: 8087790,
  40119. mediumspringgreen: 64154,
  40120. mediumturquoise: 4772300,
  40121. mediumvioletred: 13047173,
  40122. midnightblue: 1644912,
  40123. mintcream: 16121850,
  40124. mistyrose: 16770273,
  40125. moccasin: 16770229,
  40126. navajowhite: 16768685,
  40127. navy: 128,
  40128. oldlace: 16643558,
  40129. olive: 8421376,
  40130. olivedrab: 7048739,
  40131. orange: 16753920,
  40132. orangered: 16729344,
  40133. orchid: 14315734,
  40134. palegoldenrod: 15657130,
  40135. palegreen: 10025880,
  40136. paleturquoise: 11529966,
  40137. palevioletred: 14381203,
  40138. papayawhip: 16773077,
  40139. peachpuff: 16767673,
  40140. peru: 13468991,
  40141. pink: 16761035,
  40142. plum: 14524637,
  40143. powderblue: 11591910,
  40144. purple: 8388736,
  40145. red: 16711680,
  40146. rosybrown: 12357519,
  40147. royalblue: 4286945,
  40148. saddlebrown: 9127187,
  40149. salmon: 16416882,
  40150. sandybrown: 16032864,
  40151. seagreen: 3050327,
  40152. seashell: 16774638,
  40153. sienna: 10506797,
  40154. silver: 12632256,
  40155. skyblue: 8900331,
  40156. slateblue: 6970061,
  40157. slategray: 7372944,
  40158. slategrey: 7372944,
  40159. snow: 16775930,
  40160. springgreen: 65407,
  40161. steelblue: 4620980,
  40162. tan: 13808780,
  40163. teal: 32896,
  40164. thistle: 14204888,
  40165. tomato: 16737095,
  40166. turquoise: 4251856,
  40167. violet: 15631086,
  40168. wheat: 16113331,
  40169. white: 16777215,
  40170. whitesmoke: 16119285,
  40171. yellow: 16776960,
  40172. yellowgreen: 10145074
  40173. },
  40174. n.Quaternion = function(e, t, i, n) {
  40175. this._x = e || 0,
  40176. this._y = t || 0,
  40177. this._z = i || 0,
  40178. this._w = void 0 !== n ? n : 1
  40179. }
  40180. ,
  40181. n.Quaternion.prototype = {
  40182. constructor: n.Quaternion,
  40183. get x() {
  40184. return this._x
  40185. },
  40186. set x(e) {
  40187. this._x = e,
  40188. this.onChangeCallback()
  40189. },
  40190. get y() {
  40191. return this._y
  40192. },
  40193. set y(e) {
  40194. this._y = e,
  40195. this.onChangeCallback()
  40196. },
  40197. get z() {
  40198. return this._z
  40199. },
  40200. set z(e) {
  40201. this._z = e,
  40202. this.onChangeCallback()
  40203. },
  40204. get w() {
  40205. return this._w
  40206. },
  40207. set w(e) {
  40208. this._w = e,
  40209. this.onChangeCallback()
  40210. },
  40211. set: function(e, t, i, n) {
  40212. return this._x = e,
  40213. this._y = t,
  40214. this._z = i,
  40215. this._w = n,
  40216. this.onChangeCallback(),
  40217. this
  40218. },
  40219. clone: function() {
  40220. return new this.constructor(this._x,this._y,this._z,this._w)
  40221. },
  40222. copy: function(e) {
  40223. return this._x = e.x,
  40224. this._y = e.y,
  40225. this._z = e.z,
  40226. this._w = e.w,
  40227. this.onChangeCallback(),
  40228. this
  40229. },
  40230. setFromEuler: function(e, t) {
  40231. if (e instanceof n.Euler == !1)
  40232. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  40233. var i = Math.cos(e._x / 2)
  40234. , r = Math.cos(e._y / 2)
  40235. , o = Math.cos(e._z / 2)
  40236. , a = Math.sin(e._x / 2)
  40237. , s = Math.sin(e._y / 2)
  40238. , l = Math.sin(e._z / 2)
  40239. , c = e.order;
  40240. return "XYZ" === c ? (this._x = a * r * o + i * s * l,
  40241. this._y = i * s * o - a * r * l,
  40242. this._z = i * r * l + a * s * o,
  40243. this._w = i * r * o - a * s * l) : "YXZ" === c ? (this._x = a * r * o + i * s * l,
  40244. this._y = i * s * o - a * r * l,
  40245. this._z = i * r * l - a * s * o,
  40246. this._w = i * r * o + a * s * l) : "ZXY" === c ? (this._x = a * r * o - i * s * l,
  40247. this._y = i * s * o + a * r * l,
  40248. this._z = i * r * l + a * s * o,
  40249. this._w = i * r * o - a * s * l) : "ZYX" === c ? (this._x = a * r * o - i * s * l,
  40250. this._y = i * s * o + a * r * l,
  40251. this._z = i * r * l - a * s * o,
  40252. this._w = i * r * o + a * s * l) : "YZX" === c ? (this._x = a * r * o + i * s * l,
  40253. this._y = i * s * o + a * r * l,
  40254. this._z = i * r * l - a * s * o,
  40255. this._w = i * r * o - a * s * l) : "XZY" === c && (this._x = a * r * o - i * s * l,
  40256. this._y = i * s * o - a * r * l,
  40257. this._z = i * r * l + a * s * o,
  40258. this._w = i * r * o + a * s * l),
  40259. t !== !1 && this.onChangeCallback(),
  40260. this
  40261. },
  40262. setFromAxisAngle: function(e, t) {
  40263. var i = t / 2
  40264. , n = Math.sin(i);
  40265. return this._x = e.x * n,
  40266. this._y = e.y * n,
  40267. this._z = e.z * n,
  40268. this._w = Math.cos(i),
  40269. this.onChangeCallback(),
  40270. this
  40271. },
  40272. setFromRotationMatrix: function(e) {
  40273. 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;
  40274. return d > 0 ? (t = .5 / Math.sqrt(d + 1),
  40275. this._w = .25 / t,
  40276. this._x = (h - l) * t,
  40277. this._y = (o - c) * t,
  40278. this._z = (a - r) * t) : n > s && n > u ? (t = 2 * Math.sqrt(1 + n - s - u),
  40279. this._w = (h - l) / t,
  40280. this._x = .25 * t,
  40281. this._y = (r + a) / t,
  40282. this._z = (o + c) / t) : s > u ? (t = 2 * Math.sqrt(1 + s - n - u),
  40283. this._w = (o - c) / t,
  40284. this._x = (r + a) / t,
  40285. this._y = .25 * t,
  40286. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  40287. this._w = (a - r) / t,
  40288. this._x = (o + c) / t,
  40289. this._y = (l + h) / t,
  40290. this._z = .25 * t),
  40291. this.onChangeCallback(),
  40292. this
  40293. },
  40294. setFromUnitVectors: function() {
  40295. var e, t, i = 1e-6;
  40296. return function(r, o) {
  40297. return void 0 === e && (e = new n.Vector3),
  40298. t = r.dot(o) + 1,
  40299. t < i ? (t = 0,
  40300. 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),
  40301. this._x = e.x,
  40302. this._y = e.y,
  40303. this._z = e.z,
  40304. this._w = t,
  40305. this.normalize(),
  40306. this
  40307. }
  40308. }(),
  40309. inverse: function() {
  40310. return this.conjugate().normalize(),
  40311. this
  40312. },
  40313. conjugate: function() {
  40314. return this._x *= -1,
  40315. this._y *= -1,
  40316. this._z *= -1,
  40317. this.onChangeCallback(),
  40318. this
  40319. },
  40320. dot: function(e) {
  40321. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  40322. },
  40323. lengthSq: function() {
  40324. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  40325. },
  40326. length: function() {
  40327. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  40328. },
  40329. normalize: function() {
  40330. var e = this.length();
  40331. return 0 === e ? (this._x = 0,
  40332. this._y = 0,
  40333. this._z = 0,
  40334. this._w = 1) : (e = 1 / e,
  40335. this._x = this._x * e,
  40336. this._y = this._y * e,
  40337. this._z = this._z * e,
  40338. this._w = this._w * e),
  40339. this.onChangeCallback(),
  40340. this
  40341. },
  40342. multiply: function(e, t) {
  40343. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  40344. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  40345. },
  40346. multiplyQuaternions: function(e, t) {
  40347. var i = e._x
  40348. , n = e._y
  40349. , r = e._z
  40350. , o = e._w
  40351. , a = t._x
  40352. , s = t._y
  40353. , l = t._z
  40354. , c = t._w;
  40355. return this._x = i * c + o * a + n * l - r * s,
  40356. this._y = n * c + o * s + r * a - i * l,
  40357. this._z = r * c + o * l + i * s - n * a,
  40358. this._w = o * c - i * a - n * s - r * l,
  40359. this.onChangeCallback(),
  40360. this
  40361. },
  40362. slerp: function(e, t) {
  40363. if (0 === t)
  40364. return this;
  40365. if (1 === t)
  40366. return this.copy(e);
  40367. var i = this._x
  40368. , n = this._y
  40369. , r = this._z
  40370. , o = this._w
  40371. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  40372. if (a < 0 ? (this._w = -e._w,
  40373. this._x = -e._x,
  40374. this._y = -e._y,
  40375. this._z = -e._z,
  40376. a = -a) : this.copy(e),
  40377. a >= 1)
  40378. return this._w = o,
  40379. this._x = i,
  40380. this._y = n,
  40381. this._z = r,
  40382. this;
  40383. var s = Math.sqrt(1 - a * a);
  40384. if (Math.abs(s) < .001)
  40385. return this._w = .5 * (o + this._w),
  40386. this._x = .5 * (i + this._x),
  40387. this._y = .5 * (n + this._y),
  40388. this._z = .5 * (r + this._z),
  40389. this;
  40390. var l = Math.atan2(s, a)
  40391. , c = Math.sin((1 - t) * l) / s
  40392. , h = Math.sin(t * l) / s;
  40393. return this._w = o * c + this._w * h,
  40394. this._x = i * c + this._x * h,
  40395. this._y = n * c + this._y * h,
  40396. this._z = r * c + this._z * h,
  40397. this.onChangeCallback(),
  40398. this
  40399. },
  40400. equals: function(e) {
  40401. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  40402. },
  40403. fromArray: function(e, t) {
  40404. return void 0 === t && (t = 0),
  40405. this._x = e[t],
  40406. this._y = e[t + 1],
  40407. this._z = e[t + 2],
  40408. this._w = e[t + 3],
  40409. this.onChangeCallback(),
  40410. this
  40411. },
  40412. toArray: function(e, t) {
  40413. return void 0 === e && (e = []),
  40414. void 0 === t && (t = 0),
  40415. e[t] = this._x,
  40416. e[t + 1] = this._y,
  40417. e[t + 2] = this._z,
  40418. e[t + 3] = this._w,
  40419. e
  40420. },
  40421. onChange: function(e) {
  40422. return this.onChangeCallback = e,
  40423. this
  40424. },
  40425. onChangeCallback: function() {}
  40426. },
  40427. Object.assign(n.Quaternion, {
  40428. slerp: function(e, t, i, n) {
  40429. return i.copy(e).slerp(t, n)
  40430. },
  40431. slerpFlat: function(e, t, i, n, r, o, a) {
  40432. var s = i[n + 0]
  40433. , l = i[n + 1]
  40434. , c = i[n + 2]
  40435. , h = i[n + 3]
  40436. , u = r[o + 0]
  40437. , d = r[o + 1]
  40438. , p = r[o + 2]
  40439. , f = r[o + 3];
  40440. if (h !== f || s !== u || l !== d || c !== p) {
  40441. var g = 1 - a
  40442. , m = s * u + l * d + c * p + h * f
  40443. , v = m >= 0 ? 1 : -1
  40444. , A = 1 - m * m;
  40445. if (A > Number.EPSILON) {
  40446. var y = Math.sqrt(A)
  40447. , C = Math.atan2(y, m * v);
  40448. g = Math.sin(g * C) / y,
  40449. a = Math.sin(a * C) / y
  40450. }
  40451. var I = a * v;
  40452. if (s = s * g + u * I,
  40453. l = l * g + d * I,
  40454. c = c * g + p * I,
  40455. h = h * g + f * I,
  40456. g === 1 - a) {
  40457. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  40458. s *= E,
  40459. l *= E,
  40460. c *= E,
  40461. h *= E
  40462. }
  40463. }
  40464. e[t] = s,
  40465. e[t + 1] = l,
  40466. e[t + 2] = c,
  40467. e[t + 3] = h
  40468. }
  40469. }),
  40470. n.Vector2 = function(e, t) {
  40471. this.x = e || 0,
  40472. this.y = t || 0
  40473. }
  40474. ,
  40475. n.Vector2.prototype = {
  40476. constructor: n.Vector2,
  40477. get width() {
  40478. return this.x
  40479. },
  40480. set width(e) {
  40481. this.x = e
  40482. },
  40483. get height() {
  40484. return this.y
  40485. },
  40486. set height(e) {
  40487. this.y = e
  40488. },
  40489. set: function(e, t) {
  40490. return this.x = e,
  40491. this.y = t,
  40492. this
  40493. },
  40494. setScalar: function(e) {
  40495. return this.x = e,
  40496. this.y = e,
  40497. this
  40498. },
  40499. setX: function(e) {
  40500. return this.x = e,
  40501. this
  40502. },
  40503. setY: function(e) {
  40504. return this.y = e,
  40505. this
  40506. },
  40507. setComponent: function(e, t) {
  40508. switch (e) {
  40509. case 0:
  40510. this.x = t;
  40511. break;
  40512. case 1:
  40513. this.y = t;
  40514. break;
  40515. default:
  40516. throw new Error("index is out of range: " + e)
  40517. }
  40518. },
  40519. getComponent: function(e) {
  40520. switch (e) {
  40521. case 0:
  40522. return this.x;
  40523. case 1:
  40524. return this.y;
  40525. default:
  40526. throw new Error("index is out of range: " + e)
  40527. }
  40528. },
  40529. clone: function() {
  40530. return new this.constructor(this.x,this.y)
  40531. },
  40532. copy: function(e) {
  40533. return this.x = e.x,
  40534. this.y = e.y,
  40535. this
  40536. },
  40537. add: function(e, t) {
  40538. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  40539. this.addVectors(e, t)) : (this.x += e.x,
  40540. this.y += e.y,
  40541. this)
  40542. },
  40543. addScalar: function(e) {
  40544. return this.x += e,
  40545. this.y += e,
  40546. this
  40547. },
  40548. addVectors: function(e, t) {
  40549. return this.x = e.x + t.x,
  40550. this.y = e.y + t.y,
  40551. this
  40552. },
  40553. addScaledVector: function(e, t) {
  40554. return this.x += e.x * t,
  40555. this.y += e.y * t,
  40556. this
  40557. },
  40558. sub: function(e, t) {
  40559. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  40560. this.subVectors(e, t)) : (this.x -= e.x,
  40561. this.y -= e.y,
  40562. this)
  40563. },
  40564. subScalar: function(e) {
  40565. return this.x -= e,
  40566. this.y -= e,
  40567. this
  40568. },
  40569. subVectors: function(e, t) {
  40570. return this.x = e.x - t.x,
  40571. this.y = e.y - t.y,
  40572. this
  40573. },
  40574. multiply: function(e) {
  40575. return this.x *= e.x,
  40576. this.y *= e.y,
  40577. this
  40578. },
  40579. multiplyScalar: function(e) {
  40580. return isFinite(e) ? (this.x *= e,
  40581. this.y *= e) : (this.x = 0,
  40582. this.y = 0),
  40583. this
  40584. },
  40585. divide: function(e) {
  40586. return this.x /= e.x,
  40587. this.y /= e.y,
  40588. this
  40589. },
  40590. divideScalar: function(e) {
  40591. return this.multiplyScalar(1 / e)
  40592. },
  40593. min: function(e) {
  40594. return this.x = Math.min(this.x, e.x),
  40595. this.y = Math.min(this.y, e.y),
  40596. this
  40597. },
  40598. max: function(e) {
  40599. return this.x = Math.max(this.x, e.x),
  40600. this.y = Math.max(this.y, e.y),
  40601. this
  40602. },
  40603. clamp: function(e, t) {
  40604. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  40605. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  40606. this
  40607. },
  40608. clampScalar: function() {
  40609. var e, t;
  40610. return function(i, r) {
  40611. return void 0 === e && (e = new n.Vector2,
  40612. t = new n.Vector2),
  40613. e.set(i, i),
  40614. t.set(r, r),
  40615. this.clamp(e, t)
  40616. }
  40617. }(),
  40618. clampLength: function(e, t) {
  40619. var i = this.length();
  40620. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  40621. this
  40622. },
  40623. floor: function() {
  40624. return this.x = Math.floor(this.x),
  40625. this.y = Math.floor(this.y),
  40626. this
  40627. },
  40628. ceil: function() {
  40629. return this.x = Math.ceil(this.x),
  40630. this.y = Math.ceil(this.y),
  40631. this
  40632. },
  40633. round: function() {
  40634. return this.x = Math.round(this.x),
  40635. this.y = Math.round(this.y),
  40636. this
  40637. },
  40638. roundToZero: function() {
  40639. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  40640. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  40641. this
  40642. },
  40643. negate: function() {
  40644. return this.x = -this.x,
  40645. this.y = -this.y,
  40646. this
  40647. },
  40648. dot: function(e) {
  40649. return this.x * e.x + this.y * e.y
  40650. },
  40651. lengthSq: function() {
  40652. return this.x * this.x + this.y * this.y
  40653. },
  40654. length: function() {
  40655. return Math.sqrt(this.x * this.x + this.y * this.y)
  40656. },
  40657. lengthManhattan: function() {
  40658. return Math.abs(this.x) + Math.abs(this.y)
  40659. },
  40660. normalize: function() {
  40661. return this.divideScalar(this.length())
  40662. },
  40663. angle: function() {
  40664. var e = Math.atan2(this.y, this.x);
  40665. return e < 0 && (e += 2 * Math.PI),
  40666. e
  40667. },
  40668. distanceTo: function(e) {
  40669. return Math.sqrt(this.distanceToSquared(e))
  40670. },
  40671. distanceToSquared: function(e) {
  40672. var t = this.x - e.x
  40673. , i = this.y - e.y;
  40674. return t * t + i * i
  40675. },
  40676. setLength: function(e) {
  40677. return this.multiplyScalar(e / this.length())
  40678. },
  40679. lerp: function(e, t) {
  40680. return this.x += (e.x - this.x) * t,
  40681. this.y += (e.y - this.y) * t,
  40682. this
  40683. },
  40684. lerpVectors: function(e, t, i) {
  40685. return this.subVectors(t, e).multiplyScalar(i).add(e),
  40686. this
  40687. },
  40688. equals: function(e) {
  40689. return e.x === this.x && e.y === this.y
  40690. },
  40691. fromArray: function(e, t) {
  40692. return void 0 === t && (t = 0),
  40693. this.x = e[t],
  40694. this.y = e[t + 1],
  40695. this
  40696. },
  40697. toArray: function(e, t) {
  40698. return void 0 === e && (e = []),
  40699. void 0 === t && (t = 0),
  40700. e[t] = this.x,
  40701. e[t + 1] = this.y,
  40702. e
  40703. },
  40704. fromAttribute: function(e, t, i) {
  40705. return void 0 === i && (i = 0),
  40706. t = t * e.itemSize + i,
  40707. this.x = e.array[t],
  40708. this.y = e.array[t + 1],
  40709. this
  40710. },
  40711. rotateAround: function(e, t) {
  40712. var i = Math.cos(t)
  40713. , n = Math.sin(t)
  40714. , r = this.x - e.x
  40715. , o = this.y - e.y;
  40716. return this.x = r * i - o * n + e.x,
  40717. this.y = r * n + o * i + e.y,
  40718. this
  40719. }
  40720. },
  40721. n.Vector3 = function(e, t, i) {
  40722. this.x = e || 0,
  40723. this.y = t || 0,
  40724. this.z = i || 0
  40725. }
  40726. ,
  40727. n.Vector3.prototype = {
  40728. constructor: n.Vector3,
  40729. set: function(e, t, i) {
  40730. return this.x = e,
  40731. this.y = t,
  40732. this.z = i,
  40733. this
  40734. },
  40735. setScalar: function(e) {
  40736. return this.x = e,
  40737. this.y = e,
  40738. this.z = e,
  40739. this
  40740. },
  40741. setX: function(e) {
  40742. return this.x = e,
  40743. this
  40744. },
  40745. setY: function(e) {
  40746. return this.y = e,
  40747. this
  40748. },
  40749. setZ: function(e) {
  40750. return this.z = e,
  40751. this
  40752. },
  40753. setComponent: function(e, t) {
  40754. switch (e) {
  40755. case 0:
  40756. this.x = t;
  40757. break;
  40758. case 1:
  40759. this.y = t;
  40760. break;
  40761. case 2:
  40762. this.z = t;
  40763. break;
  40764. default:
  40765. throw new Error("index is out of range: " + e)
  40766. }
  40767. },
  40768. getComponent: function(e) {
  40769. switch (e) {
  40770. case 0:
  40771. return this.x;
  40772. case 1:
  40773. return this.y;
  40774. case 2:
  40775. return this.z;
  40776. default:
  40777. throw new Error("index is out of range: " + e)
  40778. }
  40779. },
  40780. clone: function() {
  40781. return new this.constructor(this.x,this.y,this.z)
  40782. },
  40783. copy: function(e) {
  40784. return this.x = e.x,
  40785. this.y = e.y,
  40786. this.z = e.z,
  40787. this
  40788. },
  40789. add: function(e, t) {
  40790. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  40791. this.addVectors(e, t)) : (this.x += e.x,
  40792. this.y += e.y,
  40793. this.z += e.z,
  40794. this)
  40795. },
  40796. addScalar: function(e) {
  40797. return this.x += e,
  40798. this.y += e,
  40799. this.z += e,
  40800. this
  40801. },
  40802. addVectors: function(e, t) {
  40803. return this.x = e.x + t.x,
  40804. this.y = e.y + t.y,
  40805. this.z = e.z + t.z,
  40806. this
  40807. },
  40808. addScaledVector: function(e, t) {
  40809. return this.x += e.x * t,
  40810. this.y += e.y * t,
  40811. this.z += e.z * t,
  40812. this
  40813. },
  40814. sub: function(e, t) {
  40815. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  40816. this.subVectors(e, t)) : (this.x -= e.x,
  40817. this.y -= e.y,
  40818. this.z -= e.z,
  40819. this)
  40820. },
  40821. subScalar: function(e) {
  40822. return this.x -= e,
  40823. this.y -= e,
  40824. this.z -= e,
  40825. this
  40826. },
  40827. subVectors: function(e, t) {
  40828. return this.x = e.x - t.x,
  40829. this.y = e.y - t.y,
  40830. this.z = e.z - t.z,
  40831. this
  40832. },
  40833. multiply: function(e, t) {
  40834. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  40835. this.multiplyVectors(e, t)) : (this.x *= e.x,
  40836. this.y *= e.y,
  40837. this.z *= e.z,
  40838. this)
  40839. },
  40840. multiplyScalar: function(e) {
  40841. return isFinite(e) ? (this.x *= e,
  40842. this.y *= e,
  40843. this.z *= e) : (this.x = 0,
  40844. this.y = 0,
  40845. this.z = 0),
  40846. this
  40847. },
  40848. multiplyVectors: function(e, t) {
  40849. return this.x = e.x * t.x,
  40850. this.y = e.y * t.y,
  40851. this.z = e.z * t.z,
  40852. this
  40853. },
  40854. applyEuler: function() {
  40855. var e;
  40856. return function(t) {
  40857. return t instanceof n.Euler == !1 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  40858. void 0 === e && (e = new n.Quaternion),
  40859. this.applyQuaternion(e.setFromEuler(t)),
  40860. this
  40861. }
  40862. }(),
  40863. applyAxisAngle: function() {
  40864. var e;
  40865. return function(t, i) {
  40866. return void 0 === e && (e = new n.Quaternion),
  40867. this.applyQuaternion(e.setFromAxisAngle(t, i)),
  40868. this
  40869. }
  40870. }(),
  40871. applyMatrix3: function(e) {
  40872. var t = this.x
  40873. , i = this.y
  40874. , n = this.z
  40875. , r = e.elements;
  40876. return this.x = r[0] * t + r[3] * i + r[6] * n,
  40877. this.y = r[1] * t + r[4] * i + r[7] * n,
  40878. this.z = r[2] * t + r[5] * i + r[8] * n,
  40879. this
  40880. },
  40881. applyMatrix4: function(e) {
  40882. var t = this.x
  40883. , i = this.y
  40884. , n = this.z
  40885. , r = e.elements;
  40886. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  40887. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  40888. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  40889. this
  40890. },
  40891. applyProjection: function(e) {
  40892. var t = this.x
  40893. , i = this.y
  40894. , n = this.z
  40895. , r = e.elements
  40896. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  40897. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  40898. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  40899. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  40900. this
  40901. },
  40902. applyQuaternion: function(e) {
  40903. var t = this.x
  40904. , i = this.y
  40905. , n = this.z
  40906. , r = e.x
  40907. , o = e.y
  40908. , a = e.z
  40909. , s = e.w
  40910. , l = s * t + o * n - a * i
  40911. , c = s * i + a * t - r * n
  40912. , h = s * n + r * i - o * t
  40913. , u = -r * t - o * i - a * n;
  40914. return this.x = l * s + u * -r + c * -a - h * -o,
  40915. this.y = c * s + u * -o + h * -r - l * -a,
  40916. this.z = h * s + u * -a + l * -o - c * -r,
  40917. this
  40918. },
  40919. project: function() {
  40920. var e;
  40921. return function(t) {
  40922. return void 0 === e && (e = new n.Matrix4),
  40923. e.multiplyMatrices(t.projectionMatrix, e.getInverse(t.matrixWorld)),
  40924. this.applyProjection(e)
  40925. }
  40926. }(),
  40927. unproject: function() {
  40928. var e;
  40929. return function(t) {
  40930. return void 0 === e && (e = new n.Matrix4),
  40931. e.multiplyMatrices(t.matrixWorld, e.getInverse(t.projectionMatrix)),
  40932. this.applyProjection(e)
  40933. }
  40934. }(),
  40935. transformDirection: function(e) {
  40936. var t = this.x
  40937. , i = this.y
  40938. , n = this.z
  40939. , r = e.elements;
  40940. return this.x = r[0] * t + r[4] * i + r[8] * n,
  40941. this.y = r[1] * t + r[5] * i + r[9] * n,
  40942. this.z = r[2] * t + r[6] * i + r[10] * n,
  40943. this.normalize(),
  40944. this
  40945. },
  40946. divide: function(e) {
  40947. return this.x /= e.x,
  40948. this.y /= e.y,
  40949. this.z /= e.z,
  40950. this
  40951. },
  40952. divideScalar: function(e) {
  40953. return this.multiplyScalar(1 / e)
  40954. },
  40955. min: function(e) {
  40956. return this.x = Math.min(this.x, e.x),
  40957. this.y = Math.min(this.y, e.y),
  40958. this.z = Math.min(this.z, e.z),
  40959. this
  40960. },
  40961. max: function(e) {
  40962. return this.x = Math.max(this.x, e.x),
  40963. this.y = Math.max(this.y, e.y),
  40964. this.z = Math.max(this.z, e.z),
  40965. this
  40966. },
  40967. clamp: function(e, t) {
  40968. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  40969. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  40970. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  40971. this
  40972. },
  40973. clampScalar: function() {
  40974. var e, t;
  40975. return function(i, r) {
  40976. return void 0 === e && (e = new n.Vector3,
  40977. t = new n.Vector3),
  40978. e.set(i, i, i),
  40979. t.set(r, r, r),
  40980. this.clamp(e, t)
  40981. }
  40982. }(),
  40983. clampLength: function(e, t) {
  40984. var i = this.length();
  40985. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  40986. this
  40987. },
  40988. floor: function() {
  40989. return this.x = Math.floor(this.x),
  40990. this.y = Math.floor(this.y),
  40991. this.z = Math.floor(this.z),
  40992. this
  40993. },
  40994. ceil: function() {
  40995. return this.x = Math.ceil(this.x),
  40996. this.y = Math.ceil(this.y),
  40997. this.z = Math.ceil(this.z),
  40998. this
  40999. },
  41000. round: function() {
  41001. return this.x = Math.round(this.x),
  41002. this.y = Math.round(this.y),
  41003. this.z = Math.round(this.z),
  41004. this
  41005. },
  41006. roundToZero: function() {
  41007. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  41008. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  41009. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  41010. this
  41011. },
  41012. negate: function() {
  41013. return this.x = -this.x,
  41014. this.y = -this.y,
  41015. this.z = -this.z,
  41016. this
  41017. },
  41018. dot: function(e) {
  41019. return this.x * e.x + this.y * e.y + this.z * e.z
  41020. },
  41021. lengthSq: function() {
  41022. return this.x * this.x + this.y * this.y + this.z * this.z
  41023. },
  41024. length: function() {
  41025. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  41026. },
  41027. lengthManhattan: function() {
  41028. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  41029. },
  41030. normalize: function() {
  41031. return this.divideScalar(this.length())
  41032. },
  41033. setLength: function(e) {
  41034. return this.multiplyScalar(e / this.length())
  41035. },
  41036. lerp: function(e, t) {
  41037. return this.x += (e.x - this.x) * t,
  41038. this.y += (e.y - this.y) * t,
  41039. this.z += (e.z - this.z) * t,
  41040. this
  41041. },
  41042. lerpVectors: function(e, t, i) {
  41043. return this.subVectors(t, e).multiplyScalar(i).add(e),
  41044. this
  41045. },
  41046. cross: function(e, t) {
  41047. if (void 0 !== t)
  41048. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  41049. this.crossVectors(e, t);
  41050. var i = this.x
  41051. , n = this.y
  41052. , r = this.z;
  41053. return this.x = n * e.z - r * e.y,
  41054. this.y = r * e.x - i * e.z,
  41055. this.z = i * e.y - n * e.x,
  41056. this
  41057. },
  41058. crossVectors: function(e, t) {
  41059. var i = e.x
  41060. , n = e.y
  41061. , r = e.z
  41062. , o = t.x
  41063. , a = t.y
  41064. , s = t.z;
  41065. return this.x = n * s - r * a,
  41066. this.y = r * o - i * s,
  41067. this.z = i * a - n * o,
  41068. this
  41069. },
  41070. projectOnVector: function() {
  41071. var e, t;
  41072. return function(i) {
  41073. return void 0 === e && (e = new n.Vector3),
  41074. e.copy(i).normalize(),
  41075. t = this.dot(e),
  41076. this.copy(e).multiplyScalar(t)
  41077. }
  41078. }(),
  41079. projectOnPlane: function() {
  41080. var e;
  41081. return function(t) {
  41082. return void 0 === e && (e = new n.Vector3),
  41083. e.copy(this).projectOnVector(t),
  41084. this.sub(e)
  41085. }
  41086. }(),
  41087. reflect: function() {
  41088. var e;
  41089. return function(t) {
  41090. return void 0 === e && (e = new n.Vector3),
  41091. this.sub(e.copy(t).multiplyScalar(2 * this.dot(t)))
  41092. }
  41093. }(),
  41094. angleTo: function(e) {
  41095. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  41096. return Math.acos(n.Math.clamp(t, -1, 1))
  41097. },
  41098. distanceTo: function(e) {
  41099. return Math.sqrt(this.distanceToSquared(e))
  41100. },
  41101. distanceToSquared: function(e) {
  41102. var t = this.x - e.x
  41103. , i = this.y - e.y
  41104. , n = this.z - e.z;
  41105. return t * t + i * i + n * n
  41106. },
  41107. setFromSpherical: function(e) {
  41108. var t = Math.sin(e.phi) * e.radius;
  41109. return this.x = t * Math.sin(e.theta),
  41110. this.y = Math.cos(e.phi) * e.radius,
  41111. this.z = t * Math.cos(e.theta),
  41112. this
  41113. },
  41114. setFromMatrixPosition: function(e) {
  41115. return this.setFromMatrixColumn(e, 3)
  41116. },
  41117. setFromMatrixScale: function(e) {
  41118. var t = this.setFromMatrixColumn(e, 0).length()
  41119. , i = this.setFromMatrixColumn(e, 1).length()
  41120. , n = this.setFromMatrixColumn(e, 2).length();
  41121. return this.x = t,
  41122. this.y = i,
  41123. this.z = n,
  41124. this
  41125. },
  41126. setFromMatrixColumn: function(e, t) {
  41127. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  41128. e = arguments[1],
  41129. t = arguments[0]),
  41130. this.fromArray(e.elements, 4 * t)
  41131. },
  41132. equals: function(e) {
  41133. return e.x === this.x && e.y === this.y && e.z === this.z
  41134. },
  41135. fromArray: function(e, t) {
  41136. return void 0 === t && (t = 0),
  41137. this.x = e[t],
  41138. this.y = e[t + 1],
  41139. this.z = e[t + 2],
  41140. this
  41141. },
  41142. toArray: function(e, t) {
  41143. return void 0 === e && (e = []),
  41144. void 0 === t && (t = 0),
  41145. e[t] = this.x,
  41146. e[t + 1] = this.y,
  41147. e[t + 2] = this.z,
  41148. e
  41149. },
  41150. fromAttribute: function(e, t, i) {
  41151. return void 0 === i && (i = 0),
  41152. t = t * e.itemSize + i,
  41153. this.x = e.array[t],
  41154. this.y = e.array[t + 1],
  41155. this.z = e.array[t + 2],
  41156. this
  41157. }
  41158. },
  41159. n.Vector4 = function(e, t, i, n) {
  41160. this.x = e || 0,
  41161. this.y = t || 0,
  41162. this.z = i || 0,
  41163. this.w = void 0 !== n ? n : 1
  41164. }
  41165. ,
  41166. n.Vector4.prototype = {
  41167. constructor: n.Vector4,
  41168. set: function(e, t, i, n) {
  41169. return this.x = e,
  41170. this.y = t,
  41171. this.z = i,
  41172. this.w = n,
  41173. this
  41174. },
  41175. setScalar: function(e) {
  41176. return this.x = e,
  41177. this.y = e,
  41178. this.z = e,
  41179. this.w = e,
  41180. this
  41181. },
  41182. setX: function(e) {
  41183. return this.x = e,
  41184. this
  41185. },
  41186. setY: function(e) {
  41187. return this.y = e,
  41188. this
  41189. },
  41190. setZ: function(e) {
  41191. return this.z = e,
  41192. this
  41193. },
  41194. setW: function(e) {
  41195. return this.w = e,
  41196. this
  41197. },
  41198. setComponent: function(e, t) {
  41199. switch (e) {
  41200. case 0:
  41201. this.x = t;
  41202. break;
  41203. case 1:
  41204. this.y = t;
  41205. break;
  41206. case 2:
  41207. this.z = t;
  41208. break;
  41209. case 3:
  41210. this.w = t;
  41211. break;
  41212. default:
  41213. throw new Error("index is out of range: " + e)
  41214. }
  41215. },
  41216. getComponent: function(e) {
  41217. switch (e) {
  41218. case 0:
  41219. return this.x;
  41220. case 1:
  41221. return this.y;
  41222. case 2:
  41223. return this.z;
  41224. case 3:
  41225. return this.w;
  41226. default:
  41227. throw new Error("index is out of range: " + e)
  41228. }
  41229. },
  41230. clone: function() {
  41231. return new this.constructor(this.x,this.y,this.z,this.w)
  41232. },
  41233. copy: function(e) {
  41234. return this.x = e.x,
  41235. this.y = e.y,
  41236. this.z = e.z,
  41237. this.w = void 0 !== e.w ? e.w : 1,
  41238. this
  41239. },
  41240. add: function(e, t) {
  41241. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  41242. this.addVectors(e, t)) : (this.x += e.x,
  41243. this.y += e.y,
  41244. this.z += e.z,
  41245. this.w += e.w,
  41246. this)
  41247. },
  41248. addScalar: function(e) {
  41249. return this.x += e,
  41250. this.y += e,
  41251. this.z += e,
  41252. this.w += e,
  41253. this
  41254. },
  41255. addVectors: function(e, t) {
  41256. return this.x = e.x + t.x,
  41257. this.y = e.y + t.y,
  41258. this.z = e.z + t.z,
  41259. this.w = e.w + t.w,
  41260. this
  41261. },
  41262. addScaledVector: function(e, t) {
  41263. return this.x += e.x * t,
  41264. this.y += e.y * t,
  41265. this.z += e.z * t,
  41266. this.w += e.w * t,
  41267. this
  41268. },
  41269. sub: function(e, t) {
  41270. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  41271. this.subVectors(e, t)) : (this.x -= e.x,
  41272. this.y -= e.y,
  41273. this.z -= e.z,
  41274. this.w -= e.w,
  41275. this)
  41276. },
  41277. subScalar: function(e) {
  41278. return this.x -= e,
  41279. this.y -= e,
  41280. this.z -= e,
  41281. this.w -= e,
  41282. this
  41283. },
  41284. subVectors: function(e, t) {
  41285. return this.x = e.x - t.x,
  41286. this.y = e.y - t.y,
  41287. this.z = e.z - t.z,
  41288. this.w = e.w - t.w,
  41289. this
  41290. },
  41291. multiplyScalar: function(e) {
  41292. return isFinite(e) ? (this.x *= e,
  41293. this.y *= e,
  41294. this.z *= e,
  41295. this.w *= e) : (this.x = 0,
  41296. this.y = 0,
  41297. this.z = 0,
  41298. this.w = 0),
  41299. this
  41300. },
  41301. applyMatrix4: function(e) {
  41302. var t = this.x
  41303. , i = this.y
  41304. , n = this.z
  41305. , r = this.w
  41306. , o = e.elements;
  41307. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  41308. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  41309. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  41310. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  41311. this
  41312. },
  41313. divideScalar: function(e) {
  41314. return this.multiplyScalar(1 / e)
  41315. },
  41316. setAxisAngleFromQuaternion: function(e) {
  41317. this.w = 2 * Math.acos(e.w);
  41318. var t = Math.sqrt(1 - e.w * e.w);
  41319. return t < 1e-4 ? (this.x = 1,
  41320. this.y = 0,
  41321. this.z = 0) : (this.x = e.x / t,
  41322. this.y = e.y / t,
  41323. this.z = e.z / t),
  41324. this
  41325. },
  41326. setAxisAngleFromRotationMatrix: function(e) {
  41327. 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];
  41328. if (Math.abs(c - u) < o && Math.abs(h - f) < o && Math.abs(p - g) < o) {
  41329. if (Math.abs(c + u) < a && Math.abs(h + f) < a && Math.abs(p + g) < a && Math.abs(l + d + m - 3) < a)
  41330. return this.set(1, 0, 0, 0),
  41331. this;
  41332. t = Math.PI;
  41333. var v = (l + 1) / 2
  41334. , A = (d + 1) / 2
  41335. , y = (m + 1) / 2
  41336. , C = (c + u) / 4
  41337. , I = (h + f) / 4
  41338. , E = (p + g) / 4;
  41339. return v > A && v > y ? v < o ? (i = 0,
  41340. n = .707106781,
  41341. r = .707106781) : (i = Math.sqrt(v),
  41342. n = C / i,
  41343. r = I / i) : A > y ? A < o ? (i = .707106781,
  41344. n = 0,
  41345. r = .707106781) : (n = Math.sqrt(A),
  41346. i = C / n,
  41347. r = E / n) : y < o ? (i = .707106781,
  41348. n = .707106781,
  41349. r = 0) : (r = Math.sqrt(y),
  41350. i = I / r,
  41351. n = E / r),
  41352. this.set(i, n, r, t),
  41353. this
  41354. }
  41355. var b = Math.sqrt((g - p) * (g - p) + (h - f) * (h - f) + (u - c) * (u - c));
  41356. return Math.abs(b) < .001 && (b = 1),
  41357. this.x = (g - p) / b,
  41358. this.y = (h - f) / b,
  41359. this.z = (u - c) / b,
  41360. this.w = Math.acos((l + d + m - 1) / 2),
  41361. this
  41362. },
  41363. min: function(e) {
  41364. return this.x = Math.min(this.x, e.x),
  41365. this.y = Math.min(this.y, e.y),
  41366. this.z = Math.min(this.z, e.z),
  41367. this.w = Math.min(this.w, e.w),
  41368. this
  41369. },
  41370. max: function(e) {
  41371. return this.x = Math.max(this.x, e.x),
  41372. this.y = Math.max(this.y, e.y),
  41373. this.z = Math.max(this.z, e.z),
  41374. this.w = Math.max(this.w, e.w),
  41375. this
  41376. },
  41377. clamp: function(e, t) {
  41378. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  41379. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  41380. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  41381. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  41382. this
  41383. },
  41384. clampScalar: function() {
  41385. var e, t;
  41386. return function(i, r) {
  41387. return void 0 === e && (e = new n.Vector4,
  41388. t = new n.Vector4),
  41389. e.set(i, i, i, i),
  41390. t.set(r, r, r, r),
  41391. this.clamp(e, t)
  41392. }
  41393. }(),
  41394. floor: function() {
  41395. return this.x = Math.floor(this.x),
  41396. this.y = Math.floor(this.y),
  41397. this.z = Math.floor(this.z),
  41398. this.w = Math.floor(this.w),
  41399. this
  41400. },
  41401. ceil: function() {
  41402. return this.x = Math.ceil(this.x),
  41403. this.y = Math.ceil(this.y),
  41404. this.z = Math.ceil(this.z),
  41405. this.w = Math.ceil(this.w),
  41406. this
  41407. },
  41408. round: function() {
  41409. return this.x = Math.round(this.x),
  41410. this.y = Math.round(this.y),
  41411. this.z = Math.round(this.z),
  41412. this.w = Math.round(this.w),
  41413. this
  41414. },
  41415. roundToZero: function() {
  41416. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  41417. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  41418. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  41419. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  41420. this
  41421. },
  41422. negate: function() {
  41423. return this.x = -this.x,
  41424. this.y = -this.y,
  41425. this.z = -this.z,
  41426. this.w = -this.w,
  41427. this
  41428. },
  41429. dot: function(e) {
  41430. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  41431. },
  41432. lengthSq: function() {
  41433. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  41434. },
  41435. length: function() {
  41436. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  41437. },
  41438. lengthManhattan: function() {
  41439. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  41440. },
  41441. normalize: function() {
  41442. return this.divideScalar(this.length())
  41443. },
  41444. setLength: function(e) {
  41445. return this.multiplyScalar(e / this.length())
  41446. },
  41447. lerp: function(e, t) {
  41448. return this.x += (e.x - this.x) * t,
  41449. this.y += (e.y - this.y) * t,
  41450. this.z += (e.z - this.z) * t,
  41451. this.w += (e.w - this.w) * t,
  41452. this
  41453. },
  41454. lerpVectors: function(e, t, i) {
  41455. return this.subVectors(t, e).multiplyScalar(i).add(e),
  41456. this
  41457. },
  41458. equals: function(e) {
  41459. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  41460. },
  41461. fromArray: function(e, t) {
  41462. return void 0 === t && (t = 0),
  41463. this.x = e[t],
  41464. this.y = e[t + 1],
  41465. this.z = e[t + 2],
  41466. this.w = e[t + 3],
  41467. this
  41468. },
  41469. toArray: function(e, t) {
  41470. return void 0 === e && (e = []),
  41471. void 0 === t && (t = 0),
  41472. e[t] = this.x,
  41473. e[t + 1] = this.y,
  41474. e[t + 2] = this.z,
  41475. e[t + 3] = this.w,
  41476. e
  41477. },
  41478. fromAttribute: function(e, t, i) {
  41479. return void 0 === i && (i = 0),
  41480. t = t * e.itemSize + i,
  41481. this.x = e.array[t],
  41482. this.y = e.array[t + 1],
  41483. this.z = e.array[t + 2],
  41484. this.w = e.array[t + 3],
  41485. this
  41486. }
  41487. },
  41488. n.Euler = function(e, t, i, r) {
  41489. this._x = e || 0,
  41490. this._y = t || 0,
  41491. this._z = i || 0,
  41492. this._order = r || n.Euler.DefaultOrder
  41493. }
  41494. ,
  41495. n.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  41496. n.Euler.DefaultOrder = "XYZ",
  41497. n.Euler.prototype = {
  41498. constructor: n.Euler,
  41499. get x() {
  41500. return this._x
  41501. },
  41502. set x(e) {
  41503. this._x = e,
  41504. this.onChangeCallback()
  41505. },
  41506. get y() {
  41507. return this._y
  41508. },
  41509. set y(e) {
  41510. this._y = e,
  41511. this.onChangeCallback()
  41512. },
  41513. get z() {
  41514. return this._z
  41515. },
  41516. set z(e) {
  41517. this._z = e,
  41518. this.onChangeCallback()
  41519. },
  41520. get order() {
  41521. return this._order
  41522. },
  41523. set order(e) {
  41524. this._order = e,
  41525. this.onChangeCallback()
  41526. },
  41527. set: function(e, t, i, n) {
  41528. return this._x = e,
  41529. this._y = t,
  41530. this._z = i,
  41531. this._order = n || this._order,
  41532. this.onChangeCallback(),
  41533. this
  41534. },
  41535. clone: function() {
  41536. return new this.constructor(this._x,this._y,this._z,this._order)
  41537. },
  41538. copy: function(e) {
  41539. return this._x = e._x,
  41540. this._y = e._y,
  41541. this._z = e._z,
  41542. this._order = e._order,
  41543. this.onChangeCallback(),
  41544. this
  41545. },
  41546. setFromRotationMatrix: function(e, t, i) {
  41547. var r = n.Math.clamp
  41548. , o = e.elements
  41549. , a = o[0]
  41550. , s = o[4]
  41551. , l = o[8]
  41552. , c = o[1]
  41553. , h = o[5]
  41554. , u = o[9]
  41555. , d = o[2]
  41556. , p = o[6]
  41557. , f = o[10];
  41558. return t = t || this._order,
  41559. "XYZ" === t ? (this._y = Math.asin(r(l, -1, 1)),
  41560. Math.abs(l) < .99999 ? (this._x = Math.atan2(-u, f),
  41561. this._z = Math.atan2(-s, a)) : (this._x = Math.atan2(p, h),
  41562. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-r(u, -1, 1)),
  41563. Math.abs(u) < .99999 ? (this._y = Math.atan2(l, f),
  41564. this._z = Math.atan2(c, h)) : (this._y = Math.atan2(-d, a),
  41565. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(r(p, -1, 1)),
  41566. Math.abs(p) < .99999 ? (this._y = Math.atan2(-d, f),
  41567. this._z = Math.atan2(-s, h)) : (this._y = 0,
  41568. this._z = Math.atan2(c, a))) : "ZYX" === t ? (this._y = Math.asin(-r(d, -1, 1)),
  41569. Math.abs(d) < .99999 ? (this._x = Math.atan2(p, f),
  41570. this._z = Math.atan2(c, a)) : (this._x = 0,
  41571. this._z = Math.atan2(-s, h))) : "YZX" === t ? (this._z = Math.asin(r(c, -1, 1)),
  41572. Math.abs(c) < .99999 ? (this._x = Math.atan2(-u, h),
  41573. this._y = Math.atan2(-d, a)) : (this._x = 0,
  41574. this._y = Math.atan2(l, f))) : "XZY" === t ? (this._z = Math.asin(-r(s, -1, 1)),
  41575. Math.abs(s) < .99999 ? (this._x = Math.atan2(p, h),
  41576. this._y = Math.atan2(l, a)) : (this._x = Math.atan2(-u, f),
  41577. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  41578. this._order = t,
  41579. i !== !1 && this.onChangeCallback(),
  41580. this
  41581. },
  41582. setFromQuaternion: function() {
  41583. var e;
  41584. return function(t, i, r) {
  41585. return void 0 === e && (e = new n.Matrix4),
  41586. e.makeRotationFromQuaternion(t),
  41587. this.setFromRotationMatrix(e, i, r),
  41588. this
  41589. }
  41590. }(),
  41591. setFromVector3: function(e, t) {
  41592. return this.set(e.x, e.y, e.z, t || this._order)
  41593. },
  41594. reorder: function() {
  41595. var e = new n.Quaternion;
  41596. return function(t) {
  41597. e.setFromEuler(this),
  41598. this.setFromQuaternion(e, t)
  41599. }
  41600. }(),
  41601. equals: function(e) {
  41602. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  41603. },
  41604. fromArray: function(e) {
  41605. return this._x = e[0],
  41606. this._y = e[1],
  41607. this._z = e[2],
  41608. void 0 !== e[3] && (this._order = e[3]),
  41609. this.onChangeCallback(),
  41610. this
  41611. },
  41612. toArray: function(e, t) {
  41613. return void 0 === e && (e = []),
  41614. void 0 === t && (t = 0),
  41615. e[t] = this._x,
  41616. e[t + 1] = this._y,
  41617. e[t + 2] = this._z,
  41618. e[t + 3] = this._order,
  41619. e
  41620. },
  41621. toVector3: function(e) {
  41622. return e ? e.set(this._x, this._y, this._z) : new n.Vector3(this._x,this._y,this._z)
  41623. },
  41624. onChange: function(e) {
  41625. return this.onChangeCallback = e,
  41626. this
  41627. },
  41628. onChangeCallback: function() {}
  41629. },
  41630. n.Line3 = function(e, t) {
  41631. this.start = void 0 !== e ? e : new n.Vector3,
  41632. this.end = void 0 !== t ? t : new n.Vector3
  41633. }
  41634. ,
  41635. n.Line3.prototype = {
  41636. constructor: n.Line3,
  41637. set: function(e, t) {
  41638. return this.start.copy(e),
  41639. this.end.copy(t),
  41640. this
  41641. },
  41642. clone: function() {
  41643. return (new this.constructor).copy(this)
  41644. },
  41645. copy: function(e) {
  41646. return this.start.copy(e.start),
  41647. this.end.copy(e.end),
  41648. this
  41649. },
  41650. center: function(e) {
  41651. var t = e || new n.Vector3;
  41652. return t.addVectors(this.start, this.end).multiplyScalar(.5)
  41653. },
  41654. delta: function(e) {
  41655. var t = e || new n.Vector3;
  41656. return t.subVectors(this.end, this.start)
  41657. },
  41658. distanceSq: function() {
  41659. return this.start.distanceToSquared(this.end)
  41660. },
  41661. distance: function() {
  41662. return this.start.distanceTo(this.end)
  41663. },
  41664. at: function(e, t) {
  41665. var i = t || new n.Vector3;
  41666. return this.delta(i).multiplyScalar(e).add(this.start)
  41667. },
  41668. closestPointToPointParameter: function() {
  41669. var e = new n.Vector3
  41670. , t = new n.Vector3;
  41671. return function(i, r) {
  41672. e.subVectors(i, this.start),
  41673. t.subVectors(this.end, this.start);
  41674. var o = t.dot(t)
  41675. , a = t.dot(e)
  41676. , s = a / o;
  41677. return r && (s = n.Math.clamp(s, 0, 1)),
  41678. s
  41679. }
  41680. }(),
  41681. closestPointToPoint: function(e, t, i) {
  41682. var r = this.closestPointToPointParameter(e, t)
  41683. , o = i || new n.Vector3;
  41684. return this.delta(o).multiplyScalar(r).add(this.start)
  41685. },
  41686. applyMatrix4: function(e) {
  41687. return this.start.applyMatrix4(e),
  41688. this.end.applyMatrix4(e),
  41689. this
  41690. },
  41691. equals: function(e) {
  41692. return e.start.equals(this.start) && e.end.equals(this.end)
  41693. }
  41694. },
  41695. n.Box2 = function(e, t) {
  41696. this.min = void 0 !== e ? e : new n.Vector2(+(1 / 0),+(1 / 0)),
  41697. this.max = void 0 !== t ? t : new n.Vector2(-(1 / 0),-(1 / 0))
  41698. }
  41699. ,
  41700. n.Box2.prototype = {
  41701. constructor: n.Box2,
  41702. set: function(e, t) {
  41703. return this.min.copy(e),
  41704. this.max.copy(t),
  41705. this
  41706. },
  41707. setFromPoints: function(e) {
  41708. this.makeEmpty();
  41709. for (var t = 0, i = e.length; t < i; t++)
  41710. this.expandByPoint(e[t]);
  41711. return this
  41712. },
  41713. setFromCenterAndSize: function() {
  41714. var e = new n.Vector2;
  41715. return function(t, i) {
  41716. var n = e.copy(i).multiplyScalar(.5);
  41717. return this.min.copy(t).sub(n),
  41718. this.max.copy(t).add(n),
  41719. this
  41720. }
  41721. }(),
  41722. clone: function() {
  41723. return (new this.constructor).copy(this)
  41724. },
  41725. copy: function(e) {
  41726. return this.min.copy(e.min),
  41727. this.max.copy(e.max),
  41728. this
  41729. },
  41730. makeEmpty: function() {
  41731. return this.min.x = this.min.y = +(1 / 0),
  41732. this.max.x = this.max.y = -(1 / 0),
  41733. this
  41734. },
  41735. isEmpty: function() {
  41736. return this.max.x < this.min.x || this.max.y < this.min.y
  41737. },
  41738. center: function(e) {
  41739. var t = e || new n.Vector2;
  41740. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  41741. },
  41742. size: function(e) {
  41743. var t = e || new n.Vector2;
  41744. return t.subVectors(this.max, this.min)
  41745. },
  41746. expandByPoint: function(e) {
  41747. return this.min.min(e),
  41748. this.max.max(e),
  41749. this
  41750. },
  41751. expandByVector: function(e) {
  41752. return this.min.sub(e),
  41753. this.max.add(e),
  41754. this
  41755. },
  41756. expandByScalar: function(e) {
  41757. return this.min.addScalar(-e),
  41758. this.max.addScalar(e),
  41759. this
  41760. },
  41761. containsPoint: function(e) {
  41762. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  41763. },
  41764. containsBox: function(e) {
  41765. 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
  41766. },
  41767. getParameter: function(e, t) {
  41768. var i = t || new n.Vector2;
  41769. 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))
  41770. },
  41771. intersectsBox: function(e) {
  41772. 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)
  41773. },
  41774. clampPoint: function(e, t) {
  41775. var i = t || new n.Vector2;
  41776. return i.copy(e).clamp(this.min, this.max)
  41777. },
  41778. distanceToPoint: function() {
  41779. var e = new n.Vector2;
  41780. return function(t) {
  41781. var i = e.copy(t).clamp(this.min, this.max);
  41782. return i.sub(t).length()
  41783. }
  41784. }(),
  41785. intersect: function(e) {
  41786. return this.min.max(e.min),
  41787. this.max.min(e.max),
  41788. this
  41789. },
  41790. union: function(e) {
  41791. return this.min.min(e.min),
  41792. this.max.max(e.max),
  41793. this
  41794. },
  41795. translate: function(e) {
  41796. return this.min.add(e),
  41797. this.max.add(e),
  41798. this
  41799. },
  41800. equals: function(e) {
  41801. return e.min.equals(this.min) && e.max.equals(this.max)
  41802. }
  41803. },
  41804. n.Box3 = function(e, t) {
  41805. this.min = void 0 !== e ? e : new n.Vector3(+(1 / 0),+(1 / 0),+(1 / 0)),
  41806. this.max = void 0 !== t ? t : new n.Vector3(-(1 / 0),-(1 / 0),-(1 / 0))
  41807. }
  41808. ,
  41809. n.Box3.prototype = {
  41810. constructor: n.Box3,
  41811. set: function(e, t) {
  41812. return this.min.copy(e),
  41813. this.max.copy(t),
  41814. this
  41815. },
  41816. setFromArray: function(e) {
  41817. this.makeEmpty();
  41818. 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) {
  41819. var c = e[s]
  41820. , h = e[s + 1]
  41821. , u = e[s + 2];
  41822. c < t && (t = c),
  41823. h < i && (i = h),
  41824. u < n && (n = u),
  41825. c > r && (r = c),
  41826. h > o && (o = h),
  41827. u > a && (a = u)
  41828. }
  41829. this.min.set(t, i, n),
  41830. this.max.set(r, o, a)
  41831. },
  41832. setFromPoints: function(e) {
  41833. this.makeEmpty();
  41834. for (var t = 0, i = e.length; t < i; t++)
  41835. this.expandByPoint(e[t]);
  41836. return this
  41837. },
  41838. setFromCenterAndSize: function() {
  41839. var e = new n.Vector3;
  41840. return function(t, i) {
  41841. var n = e.copy(i).multiplyScalar(.5);
  41842. return this.min.copy(t).sub(n),
  41843. this.max.copy(t).add(n),
  41844. this
  41845. }
  41846. }(),
  41847. setFromObject: function() {
  41848. var e;
  41849. return function(t) {
  41850. void 0 === e && (e = new n.Box3);
  41851. var i = this;
  41852. return this.makeEmpty(),
  41853. t.updateMatrixWorld(!0),
  41854. t.traverse(function(t) {
  41855. var n = t.geometry;
  41856. void 0 !== n && (null === n.boundingBox && n.computeBoundingBox(),
  41857. n.boundingBox.isEmpty() === !1 && (e.copy(n.boundingBox),
  41858. e.applyMatrix4(t.matrixWorld),
  41859. i.union(e)))
  41860. }),
  41861. this
  41862. }
  41863. }(),
  41864. clone: function() {
  41865. return (new this.constructor).copy(this)
  41866. },
  41867. copy: function(e) {
  41868. return this.min.copy(e.min),
  41869. this.max.copy(e.max),
  41870. this
  41871. },
  41872. makeEmpty: function() {
  41873. return this.min.x = this.min.y = this.min.z = +(1 / 0),
  41874. this.max.x = this.max.y = this.max.z = -(1 / 0),
  41875. this
  41876. },
  41877. isEmpty: function() {
  41878. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  41879. },
  41880. center: function(e) {
  41881. var t = e || new n.Vector3;
  41882. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  41883. },
  41884. size: function(e) {
  41885. var t = e || new n.Vector3;
  41886. return t.subVectors(this.max, this.min)
  41887. },
  41888. expandByPoint: function(e) {
  41889. return this.min.min(e),
  41890. this.max.max(e),
  41891. this
  41892. },
  41893. expandByVector: function(e) {
  41894. return this.min.sub(e),
  41895. this.max.add(e),
  41896. this
  41897. },
  41898. expandByScalar: function(e) {
  41899. return this.min.addScalar(-e),
  41900. this.max.addScalar(e),
  41901. this
  41902. },
  41903. containsPoint: function(e) {
  41904. 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)
  41905. },
  41906. containsBox: function(e) {
  41907. 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
  41908. },
  41909. getParameter: function(e, t) {
  41910. var i = t || new n.Vector3;
  41911. 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))
  41912. },
  41913. intersectsBox: function(e) {
  41914. 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)
  41915. },
  41916. intersectsSphere: function() {
  41917. var e;
  41918. return function(t) {
  41919. return void 0 === e && (e = new n.Vector3),
  41920. this.clampPoint(t.center, e),
  41921. e.distanceToSquared(t.center) <= t.radius * t.radius
  41922. }
  41923. }(),
  41924. intersectsPlane: function(e) {
  41925. var t, i;
  41926. return e.normal.x > 0 ? (t = e.normal.x * this.min.x,
  41927. i = e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  41928. i = e.normal.x * this.min.x),
  41929. e.normal.y > 0 ? (t += e.normal.y * this.min.y,
  41930. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  41931. i += e.normal.y * this.min.y),
  41932. e.normal.z > 0 ? (t += e.normal.z * this.min.z,
  41933. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  41934. i += e.normal.z * this.min.z),
  41935. t <= e.constant && i >= e.constant
  41936. },
  41937. clampPoint: function(e, t) {
  41938. var i = t || new n.Vector3;
  41939. return i.copy(e).clamp(this.min, this.max)
  41940. },
  41941. distanceToPoint: function() {
  41942. var e = new n.Vector3;
  41943. return function(t) {
  41944. var i = e.copy(t).clamp(this.min, this.max);
  41945. return i.sub(t).length()
  41946. }
  41947. }(),
  41948. getBoundingSphere: function() {
  41949. var e = new n.Vector3;
  41950. return function(t) {
  41951. var i = t || new n.Sphere;
  41952. return i.center = this.center(),
  41953. i.radius = .5 * this.size(e).length(),
  41954. i
  41955. }
  41956. }(),
  41957. intersect: function(e) {
  41958. return this.min.max(e.min),
  41959. this.max.min(e.max),
  41960. this
  41961. },
  41962. union: function(e) {
  41963. return this.min.min(e.min),
  41964. this.max.max(e.max),
  41965. this
  41966. },
  41967. applyMatrix4: function() {
  41968. 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];
  41969. return function(t) {
  41970. return e[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(t),
  41971. e[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(t),
  41972. e[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(t),
  41973. e[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(t),
  41974. e[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(t),
  41975. e[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(t),
  41976. e[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(t),
  41977. e[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(t),
  41978. this.makeEmpty(),
  41979. this.setFromPoints(e),
  41980. this
  41981. }
  41982. }(),
  41983. translate: function(e) {
  41984. return this.min.add(e),
  41985. this.max.add(e),
  41986. this
  41987. },
  41988. equals: function(e) {
  41989. return e.min.equals(this.min) && e.max.equals(this.max)
  41990. }
  41991. },
  41992. n.Matrix3 = function() {
  41993. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  41994. arguments.length > 0 && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  41995. }
  41996. ,
  41997. n.Matrix3.prototype = {
  41998. constructor: n.Matrix3,
  41999. set: function(e, t, i, n, r, o, a, s, l) {
  42000. var c = this.elements;
  42001. return c[0] = e,
  42002. c[1] = n,
  42003. c[2] = a,
  42004. c[3] = t,
  42005. c[4] = r,
  42006. c[5] = s,
  42007. c[6] = i,
  42008. c[7] = o,
  42009. c[8] = l,
  42010. this
  42011. },
  42012. identity: function() {
  42013. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  42014. this
  42015. },
  42016. clone: function() {
  42017. return (new this.constructor).fromArray(this.elements)
  42018. },
  42019. copy: function(e) {
  42020. var t = e.elements;
  42021. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  42022. this
  42023. },
  42024. setFromMatrix4: function(e) {
  42025. var t = e.elements;
  42026. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  42027. this
  42028. },
  42029. applyToVector3Array: function() {
  42030. var e;
  42031. return function(t, i, r) {
  42032. void 0 === e && (e = new n.Vector3),
  42033. void 0 === i && (i = 0),
  42034. void 0 === r && (r = t.length);
  42035. for (var o = 0, a = i; o < r; o += 3,
  42036. a += 3)
  42037. e.fromArray(t, a),
  42038. e.applyMatrix3(this),
  42039. e.toArray(t, a);
  42040. return t
  42041. }
  42042. }(),
  42043. applyToBuffer: function() {
  42044. var e;
  42045. return function(t, i, r) {
  42046. void 0 === e && (e = new n.Vector3),
  42047. void 0 === i && (i = 0),
  42048. void 0 === r && (r = t.length / t.itemSize);
  42049. for (var o = 0, a = i; o < r; o++,
  42050. a++)
  42051. e.x = t.getX(a),
  42052. e.y = t.getY(a),
  42053. e.z = t.getZ(a),
  42054. e.applyMatrix3(this),
  42055. t.setXYZ(e.x, e.y, e.z);
  42056. return t
  42057. }
  42058. }(),
  42059. multiplyScalar: function(e) {
  42060. var t = this.elements;
  42061. return t[0] *= e,
  42062. t[3] *= e,
  42063. t[6] *= e,
  42064. t[1] *= e,
  42065. t[4] *= e,
  42066. t[7] *= e,
  42067. t[2] *= e,
  42068. t[5] *= e,
  42069. t[8] *= e,
  42070. this
  42071. },
  42072. determinant: function() {
  42073. var e = this.elements
  42074. , t = e[0]
  42075. , i = e[1]
  42076. , n = e[2]
  42077. , r = e[3]
  42078. , o = e[4]
  42079. , a = e[5]
  42080. , s = e[6]
  42081. , l = e[7]
  42082. , c = e[8];
  42083. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  42084. },
  42085. getInverse: function(e, t) {
  42086. e instanceof n.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  42087. var i = e.elements
  42088. , r = this.elements
  42089. , o = i[0]
  42090. , a = i[1]
  42091. , s = i[2]
  42092. , l = i[3]
  42093. , c = i[4]
  42094. , h = i[5]
  42095. , u = i[6]
  42096. , d = i[7]
  42097. , p = i[8]
  42098. , f = p * c - h * d
  42099. , g = h * u - p * l
  42100. , m = d * l - c * u
  42101. , v = o * f + a * g + s * m;
  42102. if (0 === v) {
  42103. var A = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  42104. if (t)
  42105. throw new Error(A);
  42106. return console.warn(A),
  42107. this.identity()
  42108. }
  42109. return r[0] = f,
  42110. r[1] = s * d - p * a,
  42111. r[2] = h * a - s * c,
  42112. r[3] = g,
  42113. r[4] = p * o - s * u,
  42114. r[5] = s * l - h * o,
  42115. r[6] = m,
  42116. r[7] = a * u - d * o,
  42117. r[8] = c * o - a * l,
  42118. this.multiplyScalar(1 / v)
  42119. },
  42120. transpose: function() {
  42121. var e, t = this.elements;
  42122. return e = t[1],
  42123. t[1] = t[3],
  42124. t[3] = e,
  42125. e = t[2],
  42126. t[2] = t[6],
  42127. t[6] = e,
  42128. e = t[5],
  42129. t[5] = t[7],
  42130. t[7] = e,
  42131. this
  42132. },
  42133. flattenToArrayOffset: function(e, t) {
  42134. var i = this.elements;
  42135. return e[t] = i[0],
  42136. e[t + 1] = i[1],
  42137. e[t + 2] = i[2],
  42138. e[t + 3] = i[3],
  42139. e[t + 4] = i[4],
  42140. e[t + 5] = i[5],
  42141. e[t + 6] = i[6],
  42142. e[t + 7] = i[7],
  42143. e[t + 8] = i[8],
  42144. e
  42145. },
  42146. getNormalMatrix: function(e) {
  42147. return this.setFromMatrix4(e).getInverse(this).transpose()
  42148. },
  42149. transposeIntoArray: function(e) {
  42150. var t = this.elements;
  42151. return e[0] = t[0],
  42152. e[1] = t[3],
  42153. e[2] = t[6],
  42154. e[3] = t[1],
  42155. e[4] = t[4],
  42156. e[5] = t[7],
  42157. e[6] = t[2],
  42158. e[7] = t[5],
  42159. e[8] = t[8],
  42160. this
  42161. },
  42162. fromArray: function(e) {
  42163. return this.elements.set(e),
  42164. this
  42165. },
  42166. toArray: function() {
  42167. var e = this.elements;
  42168. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  42169. }
  42170. },
  42171. n.Matrix4 = function() {
  42172. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  42173. arguments.length > 0 && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  42174. }
  42175. ,
  42176. n.Matrix4.prototype = {
  42177. constructor: n.Matrix4,
  42178. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  42179. var m = this.elements;
  42180. return m[0] = e,
  42181. m[4] = t,
  42182. m[8] = i,
  42183. m[12] = n,
  42184. m[1] = r,
  42185. m[5] = o,
  42186. m[9] = a,
  42187. m[13] = s,
  42188. m[2] = l,
  42189. m[6] = c,
  42190. m[10] = h,
  42191. m[14] = u,
  42192. m[3] = d,
  42193. m[7] = p,
  42194. m[11] = f,
  42195. m[15] = g,
  42196. this
  42197. },
  42198. identity: function() {
  42199. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  42200. this
  42201. },
  42202. clone: function() {
  42203. return (new n.Matrix4).fromArray(this.elements)
  42204. },
  42205. copy: function(e) {
  42206. return this.elements.set(e.elements),
  42207. this
  42208. },
  42209. copyPosition: function(e) {
  42210. var t = this.elements
  42211. , i = e.elements;
  42212. return t[12] = i[12],
  42213. t[13] = i[13],
  42214. t[14] = i[14],
  42215. this
  42216. },
  42217. extractBasis: function(e, t, i) {
  42218. return e.setFromMatrixColumn(this, 0),
  42219. t.setFromMatrixColumn(this, 1),
  42220. i.setFromMatrixColumn(this, 2),
  42221. this
  42222. },
  42223. makeBasis: function(e, t, i) {
  42224. 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),
  42225. this
  42226. },
  42227. extractRotation: function() {
  42228. var e;
  42229. return function(t) {
  42230. void 0 === e && (e = new n.Vector3);
  42231. var i = this.elements
  42232. , r = t.elements
  42233. , o = 1 / e.setFromMatrixColumn(t, 0).length()
  42234. , a = 1 / e.setFromMatrixColumn(t, 1).length()
  42235. , s = 1 / e.setFromMatrixColumn(t, 2).length();
  42236. return i[0] = r[0] * o,
  42237. i[1] = r[1] * o,
  42238. i[2] = r[2] * o,
  42239. i[4] = r[4] * a,
  42240. i[5] = r[5] * a,
  42241. i[6] = r[6] * a,
  42242. i[8] = r[8] * s,
  42243. i[9] = r[9] * s,
  42244. i[10] = r[10] * s,
  42245. this
  42246. }
  42247. }(),
  42248. makeRotationFromEuler: function(e) {
  42249. e instanceof n.Euler == !1 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  42250. var t = this.elements
  42251. , i = e.x
  42252. , r = e.y
  42253. , o = e.z
  42254. , a = Math.cos(i)
  42255. , s = Math.sin(i)
  42256. , l = Math.cos(r)
  42257. , c = Math.sin(r)
  42258. , h = Math.cos(o)
  42259. , u = Math.sin(o);
  42260. if ("XYZ" === e.order) {
  42261. var d = a * h
  42262. , p = a * u
  42263. , f = s * h
  42264. , g = s * u;
  42265. t[0] = l * h,
  42266. t[4] = -l * u,
  42267. t[8] = c,
  42268. t[1] = p + f * c,
  42269. t[5] = d - g * c,
  42270. t[9] = -s * l,
  42271. t[2] = g - d * c,
  42272. t[6] = f + p * c,
  42273. t[10] = a * l
  42274. } else if ("YXZ" === e.order) {
  42275. var m = l * h
  42276. , v = l * u
  42277. , A = c * h
  42278. , y = c * u;
  42279. t[0] = m + y * s,
  42280. t[4] = A * s - v,
  42281. t[8] = a * c,
  42282. t[1] = a * u,
  42283. t[5] = a * h,
  42284. t[9] = -s,
  42285. t[2] = v * s - A,
  42286. t[6] = y + m * s,
  42287. t[10] = a * l
  42288. } else if ("ZXY" === e.order) {
  42289. var m = l * h
  42290. , v = l * u
  42291. , A = c * h
  42292. , y = c * u;
  42293. t[0] = m - y * s,
  42294. t[4] = -a * u,
  42295. t[8] = A + v * s,
  42296. t[1] = v + A * s,
  42297. t[5] = a * h,
  42298. t[9] = y - m * s,
  42299. t[2] = -a * c,
  42300. t[6] = s,
  42301. t[10] = a * l
  42302. } else if ("ZYX" === e.order) {
  42303. var d = a * h
  42304. , p = a * u
  42305. , f = s * h
  42306. , g = s * u;
  42307. t[0] = l * h,
  42308. t[4] = f * c - p,
  42309. t[8] = d * c + g,
  42310. t[1] = l * u,
  42311. t[5] = g * c + d,
  42312. t[9] = p * c - f,
  42313. t[2] = -c,
  42314. t[6] = s * l,
  42315. t[10] = a * l
  42316. } else if ("YZX" === e.order) {
  42317. var C = a * l
  42318. , I = a * c
  42319. , E = s * l
  42320. , b = s * c;
  42321. t[0] = l * h,
  42322. t[4] = b - C * u,
  42323. t[8] = E * u + I,
  42324. t[1] = u,
  42325. t[5] = a * h,
  42326. t[9] = -s * h,
  42327. t[2] = -c * h,
  42328. t[6] = I * u + E,
  42329. t[10] = C - b * u
  42330. } else if ("XZY" === e.order) {
  42331. var C = a * l
  42332. , I = a * c
  42333. , E = s * l
  42334. , b = s * c;
  42335. t[0] = l * h,
  42336. t[4] = -u,
  42337. t[8] = c * h,
  42338. t[1] = C * u + b,
  42339. t[5] = a * h,
  42340. t[9] = I * u - E,
  42341. t[2] = E * u - I,
  42342. t[6] = s * h,
  42343. t[10] = b * u + C
  42344. }
  42345. return t[3] = 0,
  42346. t[7] = 0,
  42347. t[11] = 0,
  42348. t[12] = 0,
  42349. t[13] = 0,
  42350. t[14] = 0,
  42351. t[15] = 1,
  42352. this
  42353. },
  42354. makeRotationFromQuaternion: function(e) {
  42355. var t = this.elements
  42356. , i = e.x
  42357. , n = e.y
  42358. , r = e.z
  42359. , o = e.w
  42360. , a = i + i
  42361. , s = n + n
  42362. , l = r + r
  42363. , c = i * a
  42364. , h = i * s
  42365. , u = i * l
  42366. , d = n * s
  42367. , p = n * l
  42368. , f = r * l
  42369. , g = o * a
  42370. , m = o * s
  42371. , v = o * l;
  42372. return t[0] = 1 - (d + f),
  42373. t[4] = h - v,
  42374. t[8] = u + m,
  42375. t[1] = h + v,
  42376. t[5] = 1 - (c + f),
  42377. t[9] = p - g,
  42378. t[2] = u - m,
  42379. t[6] = p + g,
  42380. t[10] = 1 - (c + d),
  42381. 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. lookAt: function() {
  42391. var e, t, i;
  42392. return function(r, o, a) {
  42393. void 0 === e && (e = new n.Vector3),
  42394. void 0 === t && (t = new n.Vector3),
  42395. void 0 === i && (i = new n.Vector3);
  42396. var s = this.elements;
  42397. return i.subVectors(r, o).normalize(),
  42398. 0 === i.lengthSq() && (i.z = 1),
  42399. e.crossVectors(a, i).normalize(),
  42400. 0 === e.lengthSq() && (i.x += 1e-4,
  42401. e.crossVectors(a, i).normalize()),
  42402. t.crossVectors(i, e),
  42403. s[0] = e.x,
  42404. s[4] = t.x,
  42405. s[8] = i.x,
  42406. s[1] = e.y,
  42407. s[5] = t.y,
  42408. s[9] = i.y,
  42409. s[2] = e.z,
  42410. s[6] = t.z,
  42411. s[10] = i.z,
  42412. this
  42413. }
  42414. }(),
  42415. multiply: function(e, t) {
  42416. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  42417. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  42418. },
  42419. multiplyMatrices: function(e, t) {
  42420. var i = e.elements
  42421. , n = t.elements
  42422. , r = this.elements
  42423. , o = i[0]
  42424. , a = i[4]
  42425. , s = i[8]
  42426. , l = i[12]
  42427. , c = i[1]
  42428. , h = i[5]
  42429. , u = i[9]
  42430. , d = i[13]
  42431. , p = i[2]
  42432. , f = i[6]
  42433. , g = i[10]
  42434. , m = i[14]
  42435. , v = i[3]
  42436. , A = i[7]
  42437. , y = i[11]
  42438. , C = i[15]
  42439. , I = n[0]
  42440. , E = n[4]
  42441. , b = n[8]
  42442. , w = n[12]
  42443. , _ = n[1]
  42444. , T = n[5]
  42445. , x = n[9]
  42446. , S = n[13]
  42447. , M = n[2]
  42448. , R = n[6]
  42449. , P = n[10]
  42450. , O = n[14]
  42451. , L = n[3]
  42452. , D = n[7]
  42453. , N = n[11]
  42454. , B = n[15];
  42455. return r[0] = o * I + a * _ + s * M + l * L,
  42456. r[4] = o * E + a * T + s * R + l * D,
  42457. r[8] = o * b + a * x + s * P + l * N,
  42458. r[12] = o * w + a * S + s * O + l * B,
  42459. r[1] = c * I + h * _ + u * M + d * L,
  42460. r[5] = c * E + h * T + u * R + d * D,
  42461. r[9] = c * b + h * x + u * P + d * N,
  42462. r[13] = c * w + h * S + u * O + d * B,
  42463. r[2] = p * I + f * _ + g * M + m * L,
  42464. r[6] = p * E + f * T + g * R + m * D,
  42465. r[10] = p * b + f * x + g * P + m * N,
  42466. r[14] = p * w + f * S + g * O + m * B,
  42467. r[3] = v * I + A * _ + y * M + C * L,
  42468. r[7] = v * E + A * T + y * R + C * D,
  42469. r[11] = v * b + A * x + y * P + C * N,
  42470. r[15] = v * w + A * S + y * O + C * B,
  42471. this
  42472. },
  42473. multiplyToArray: function(e, t, i) {
  42474. var n = this.elements;
  42475. return this.multiplyMatrices(e, t),
  42476. i[0] = n[0],
  42477. i[1] = n[1],
  42478. i[2] = n[2],
  42479. i[3] = n[3],
  42480. i[4] = n[4],
  42481. i[5] = n[5],
  42482. i[6] = n[6],
  42483. i[7] = n[7],
  42484. i[8] = n[8],
  42485. i[9] = n[9],
  42486. i[10] = n[10],
  42487. i[11] = n[11],
  42488. i[12] = n[12],
  42489. i[13] = n[13],
  42490. i[14] = n[14],
  42491. i[15] = n[15],
  42492. this
  42493. },
  42494. multiplyScalar: function(e) {
  42495. var t = this.elements;
  42496. return t[0] *= e,
  42497. t[4] *= e,
  42498. t[8] *= e,
  42499. t[12] *= e,
  42500. t[1] *= e,
  42501. t[5] *= e,
  42502. t[9] *= e,
  42503. t[13] *= e,
  42504. t[2] *= e,
  42505. t[6] *= e,
  42506. t[10] *= e,
  42507. t[14] *= e,
  42508. t[3] *= e,
  42509. t[7] *= e,
  42510. t[11] *= e,
  42511. t[15] *= e,
  42512. this
  42513. },
  42514. applyToVector3Array: function() {
  42515. var e;
  42516. return function(t, i, r) {
  42517. void 0 === e && (e = new n.Vector3),
  42518. void 0 === i && (i = 0),
  42519. void 0 === r && (r = t.length);
  42520. for (var o = 0, a = i; o < r; o += 3,
  42521. a += 3)
  42522. e.fromArray(t, a),
  42523. e.applyMatrix4(this),
  42524. e.toArray(t, a);
  42525. return t
  42526. }
  42527. }(),
  42528. applyToBuffer: function() {
  42529. var e;
  42530. return function(t, i, r) {
  42531. void 0 === e && (e = new n.Vector3),
  42532. void 0 === i && (i = 0),
  42533. void 0 === r && (r = t.length / t.itemSize);
  42534. for (var o = 0, a = i; o < r; o++,
  42535. a++)
  42536. e.x = t.getX(a),
  42537. e.y = t.getY(a),
  42538. e.z = t.getZ(a),
  42539. e.applyMatrix4(this),
  42540. t.setXYZ(e.x, e.y, e.z);
  42541. return t
  42542. }
  42543. }(),
  42544. determinant: function() {
  42545. var e = this.elements
  42546. , t = e[0]
  42547. , i = e[4]
  42548. , n = e[8]
  42549. , r = e[12]
  42550. , o = e[1]
  42551. , a = e[5]
  42552. , s = e[9]
  42553. , l = e[13]
  42554. , c = e[2]
  42555. , h = e[6]
  42556. , u = e[10]
  42557. , d = e[14]
  42558. , p = e[3]
  42559. , f = e[7]
  42560. , g = e[11]
  42561. , m = e[15];
  42562. 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)
  42563. },
  42564. transpose: function() {
  42565. var e, t = this.elements;
  42566. return e = t[1],
  42567. t[1] = t[4],
  42568. t[4] = e,
  42569. e = t[2],
  42570. t[2] = t[8],
  42571. t[8] = e,
  42572. e = t[6],
  42573. t[6] = t[9],
  42574. t[9] = e,
  42575. e = t[3],
  42576. t[3] = t[12],
  42577. t[12] = e,
  42578. e = t[7],
  42579. t[7] = t[13],
  42580. t[13] = e,
  42581. e = t[11],
  42582. t[11] = t[14],
  42583. t[14] = e,
  42584. this
  42585. },
  42586. flattenToArrayOffset: function(e, t) {
  42587. var i = this.elements;
  42588. return e[t] = i[0],
  42589. e[t + 1] = i[1],
  42590. e[t + 2] = i[2],
  42591. e[t + 3] = i[3],
  42592. e[t + 4] = i[4],
  42593. e[t + 5] = i[5],
  42594. e[t + 6] = i[6],
  42595. e[t + 7] = i[7],
  42596. e[t + 8] = i[8],
  42597. e[t + 9] = i[9],
  42598. e[t + 10] = i[10],
  42599. e[t + 11] = i[11],
  42600. e[t + 12] = i[12],
  42601. e[t + 13] = i[13],
  42602. e[t + 14] = i[14],
  42603. e[t + 15] = i[15],
  42604. e
  42605. },
  42606. getPosition: function() {
  42607. var e;
  42608. return function() {
  42609. return void 0 === e && (e = new n.Vector3),
  42610. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  42611. e.setFromMatrixColumn(this, 3)
  42612. }
  42613. }(),
  42614. setPosition: function(e) {
  42615. var t = this.elements;
  42616. return t[12] = e.x,
  42617. t[13] = e.y,
  42618. t[14] = e.z,
  42619. this
  42620. },
  42621. getInverse: function(e, t) {
  42622. var i = this.elements
  42623. , n = e.elements
  42624. , r = n[0]
  42625. , o = n[1]
  42626. , a = n[2]
  42627. , s = n[3]
  42628. , l = n[4]
  42629. , c = n[5]
  42630. , h = n[6]
  42631. , u = n[7]
  42632. , d = n[8]
  42633. , p = n[9]
  42634. , f = n[10]
  42635. , g = n[11]
  42636. , m = n[12]
  42637. , v = n[13]
  42638. , A = n[14]
  42639. , y = n[15]
  42640. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  42641. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  42642. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  42643. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  42644. , w = r * C + o * I + a * E + s * b;
  42645. if (0 === w) {
  42646. var _ = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  42647. if (t)
  42648. throw new Error(_);
  42649. return console.warn(_),
  42650. this.identity()
  42651. }
  42652. return i[0] = C,
  42653. i[1] = v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y,
  42654. i[2] = c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y,
  42655. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  42656. i[4] = I,
  42657. i[5] = d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y,
  42658. i[6] = m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y,
  42659. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  42660. i[8] = E,
  42661. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y,
  42662. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y,
  42663. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  42664. i[12] = b,
  42665. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A,
  42666. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A,
  42667. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  42668. this.multiplyScalar(1 / w)
  42669. },
  42670. scale: function(e) {
  42671. var t = this.elements
  42672. , i = e.x
  42673. , n = e.y
  42674. , r = e.z;
  42675. return t[0] *= i,
  42676. t[4] *= n,
  42677. t[8] *= r,
  42678. t[1] *= i,
  42679. t[5] *= n,
  42680. t[9] *= r,
  42681. t[2] *= i,
  42682. t[6] *= n,
  42683. t[10] *= r,
  42684. t[3] *= i,
  42685. t[7] *= n,
  42686. t[11] *= r,
  42687. this
  42688. },
  42689. getMaxScaleOnAxis: function() {
  42690. var e = this.elements
  42691. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  42692. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  42693. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  42694. return Math.sqrt(Math.max(t, i, n))
  42695. },
  42696. makeTranslation: function(e, t, i) {
  42697. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  42698. this
  42699. },
  42700. makeRotationX: function(e) {
  42701. var t = Math.cos(e)
  42702. , i = Math.sin(e);
  42703. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  42704. this
  42705. },
  42706. makeRotationY: function(e) {
  42707. var t = Math.cos(e)
  42708. , i = Math.sin(e);
  42709. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  42710. this
  42711. },
  42712. makeRotationZ: function(e) {
  42713. var t = Math.cos(e)
  42714. , i = Math.sin(e);
  42715. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  42716. this
  42717. },
  42718. makeRotationAxis: function(e, t) {
  42719. var i = Math.cos(t)
  42720. , n = Math.sin(t)
  42721. , r = 1 - i
  42722. , o = e.x
  42723. , a = e.y
  42724. , s = e.z
  42725. , l = r * o
  42726. , c = r * a;
  42727. 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),
  42728. this
  42729. },
  42730. makeScale: function(e, t, i) {
  42731. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  42732. this
  42733. },
  42734. compose: function(e, t, i) {
  42735. return this.makeRotationFromQuaternion(t),
  42736. this.scale(i),
  42737. this.setPosition(e),
  42738. this
  42739. },
  42740. decompose: function() {
  42741. var e, t;
  42742. return function(i, r, o) {
  42743. void 0 === e && (e = new n.Vector3),
  42744. void 0 === t && (t = new n.Matrix4);
  42745. var a = this.elements
  42746. , s = e.set(a[0], a[1], a[2]).length()
  42747. , l = e.set(a[4], a[5], a[6]).length()
  42748. , c = e.set(a[8], a[9], a[10]).length()
  42749. , h = this.determinant();
  42750. h < 0 && (s = -s),
  42751. i.x = a[12],
  42752. i.y = a[13],
  42753. i.z = a[14],
  42754. t.elements.set(this.elements);
  42755. var u = 1 / s
  42756. , d = 1 / l
  42757. , p = 1 / c;
  42758. return t.elements[0] *= u,
  42759. t.elements[1] *= u,
  42760. t.elements[2] *= u,
  42761. t.elements[4] *= d,
  42762. t.elements[5] *= d,
  42763. t.elements[6] *= d,
  42764. t.elements[8] *= p,
  42765. t.elements[9] *= p,
  42766. t.elements[10] *= p,
  42767. r.setFromRotationMatrix(t),
  42768. o.x = s,
  42769. o.y = l,
  42770. o.z = c,
  42771. this
  42772. }
  42773. }(),
  42774. makeFrustum: function(e, t, i, n, r, o) {
  42775. var a = this.elements
  42776. , s = 2 * r / (t - e)
  42777. , l = 2 * r / (n - i)
  42778. , c = (t + e) / (t - e)
  42779. , h = (n + i) / (n - i)
  42780. , u = -(o + r) / (o - r)
  42781. , d = -2 * o * r / (o - r);
  42782. return a[0] = s,
  42783. a[4] = 0,
  42784. a[8] = c,
  42785. a[12] = 0,
  42786. a[1] = 0,
  42787. a[5] = l,
  42788. a[9] = h,
  42789. a[13] = 0,
  42790. a[2] = 0,
  42791. a[6] = 0,
  42792. a[10] = u,
  42793. a[14] = d,
  42794. a[3] = 0,
  42795. a[7] = 0,
  42796. a[11] = -1,
  42797. a[15] = 0,
  42798. this
  42799. },
  42800. makePerspective: function(e, t, i, r) {
  42801. var o = i * Math.tan(n.Math.degToRad(.5 * e))
  42802. , a = -o
  42803. , s = a * t
  42804. , l = o * t;
  42805. return this.makeFrustum(s, l, a, o, i, r)
  42806. },
  42807. makeOrthographic: function(e, t, i, n, r, o) {
  42808. var a = this.elements
  42809. , s = 1 / (t - e)
  42810. , l = 1 / (i - n)
  42811. , c = 1 / (o - r)
  42812. , h = (t + e) * s
  42813. , u = (i + n) * l
  42814. , d = (o + r) * c;
  42815. return a[0] = 2 * s,
  42816. a[4] = 0,
  42817. a[8] = 0,
  42818. a[12] = -h,
  42819. a[1] = 0,
  42820. a[5] = 2 * l,
  42821. a[9] = 0,
  42822. a[13] = -u,
  42823. a[2] = 0,
  42824. a[6] = 0,
  42825. a[10] = -2 * c,
  42826. a[14] = -d,
  42827. a[3] = 0,
  42828. a[7] = 0,
  42829. a[11] = 0,
  42830. a[15] = 1,
  42831. this
  42832. },
  42833. equals: function(e) {
  42834. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  42835. if (t[n] !== i[n])
  42836. return !1;
  42837. return !0
  42838. },
  42839. fromArray: function(e) {
  42840. return this.elements.set(e),
  42841. this
  42842. },
  42843. toArray: function() {
  42844. var e = this.elements;
  42845. 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]]
  42846. }
  42847. },
  42848. n.Ray = function(e, t) {
  42849. this.origin = void 0 !== e ? e : new n.Vector3,
  42850. this.direction = void 0 !== t ? t : new n.Vector3
  42851. }
  42852. ,
  42853. n.Ray.prototype = {
  42854. constructor: n.Ray,
  42855. set: function(e, t) {
  42856. return this.origin.copy(e),
  42857. this.direction.copy(t),
  42858. this
  42859. },
  42860. clone: function() {
  42861. return (new this.constructor).copy(this)
  42862. },
  42863. copy: function(e) {
  42864. return this.origin.copy(e.origin),
  42865. this.direction.copy(e.direction),
  42866. this
  42867. },
  42868. at: function(e, t) {
  42869. var i = t || new n.Vector3;
  42870. return i.copy(this.direction).multiplyScalar(e).add(this.origin)
  42871. },
  42872. lookAt: function(e) {
  42873. this.direction.copy(e).sub(this.origin).normalize()
  42874. },
  42875. recast: function() {
  42876. var e = new n.Vector3;
  42877. return function(t) {
  42878. return this.origin.copy(this.at(t, e)),
  42879. this
  42880. }
  42881. }(),
  42882. closestPointToPoint: function(e, t) {
  42883. var i = t || new n.Vector3;
  42884. i.subVectors(e, this.origin);
  42885. var r = i.dot(this.direction);
  42886. return r < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(r).add(this.origin)
  42887. },
  42888. distanceToPoint: function(e) {
  42889. return Math.sqrt(this.distanceSqToPoint(e))
  42890. },
  42891. distanceSqToPoint: function() {
  42892. var e = new n.Vector3;
  42893. return function(t) {
  42894. var i = e.subVectors(t, this.origin).dot(this.direction);
  42895. return i < 0 ? this.origin.distanceToSquared(t) : (e.copy(this.direction).multiplyScalar(i).add(this.origin),
  42896. e.distanceToSquared(t))
  42897. }
  42898. }(),
  42899. distanceSqToSegment: function() {
  42900. var e = new n.Vector3
  42901. , t = new n.Vector3
  42902. , i = new n.Vector3;
  42903. return function(n, r, o, a) {
  42904. e.copy(n).add(r).multiplyScalar(.5),
  42905. t.copy(r).sub(n).normalize(),
  42906. i.copy(this.origin).sub(e);
  42907. 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);
  42908. if (m > 0)
  42909. if (s = d * f - p,
  42910. l = d * p - f,
  42911. h = u * m,
  42912. s >= 0)
  42913. if (l >= -h)
  42914. if (l <= h) {
  42915. var v = 1 / m;
  42916. s *= v,
  42917. l *= v,
  42918. c = s * (s + d * l + 2 * p) + l * (d * s + l + 2 * f) + g
  42919. } else
  42920. l = u,
  42921. s = Math.max(0, -(d * l + p)),
  42922. c = -s * s + l * (l + 2 * f) + g;
  42923. else
  42924. l = -u,
  42925. s = Math.max(0, -(d * l + p)),
  42926. c = -s * s + l * (l + 2 * f) + g;
  42927. else
  42928. l <= -h ? (s = Math.max(0, -(-d * u + p)),
  42929. l = s > 0 ? -u : Math.min(Math.max(-u, -f), u),
  42930. c = -s * s + l * (l + 2 * f) + g) : l <= h ? (s = 0,
  42931. l = Math.min(Math.max(-u, -f), u),
  42932. c = l * (l + 2 * f) + g) : (s = Math.max(0, -(d * u + p)),
  42933. l = s > 0 ? u : Math.min(Math.max(-u, -f), u),
  42934. c = -s * s + l * (l + 2 * f) + g);
  42935. else
  42936. l = d > 0 ? -u : u,
  42937. s = Math.max(0, -(d * l + p)),
  42938. c = -s * s + l * (l + 2 * f) + g;
  42939. return o && o.copy(this.direction).multiplyScalar(s).add(this.origin),
  42940. a && a.copy(t).multiplyScalar(l).add(e),
  42941. c
  42942. }
  42943. }(),
  42944. intersectSphere: function() {
  42945. var e = new n.Vector3;
  42946. return function(t, i) {
  42947. e.subVectors(t.center, this.origin);
  42948. var n = e.dot(this.direction)
  42949. , r = e.dot(e) - n * n
  42950. , o = t.radius * t.radius;
  42951. if (r > o)
  42952. return null;
  42953. var a = Math.sqrt(o - r)
  42954. , s = n - a
  42955. , l = n + a;
  42956. return s < 0 && l < 0 ? null : s < 0 ? this.at(l, i) : this.at(s, i)
  42957. }
  42958. }(),
  42959. intersectsSphere: function(e) {
  42960. return this.distanceToPoint(e.center) <= e.radius
  42961. },
  42962. distanceToPlane: function(e) {
  42963. var t = e.normal.dot(this.direction);
  42964. if (0 === t)
  42965. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  42966. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  42967. return i >= 0 ? i : null
  42968. },
  42969. intersectPlane: function(e, t) {
  42970. var i = this.distanceToPlane(e);
  42971. return null === i ? null : this.at(i, t)
  42972. },
  42973. intersectsPlane: function(e) {
  42974. var t = e.distanceToPoint(this.origin);
  42975. if (0 === t)
  42976. return !0;
  42977. var i = e.normal.dot(this.direction);
  42978. return i * t < 0
  42979. },
  42980. intersectBox: function(e, t) {
  42981. 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;
  42982. return l >= 0 ? (i = (e.min.x - u.x) * l,
  42983. n = (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  42984. n = (e.min.x - u.x) * l),
  42985. c >= 0 ? (r = (e.min.y - u.y) * c,
  42986. o = (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  42987. o = (e.min.y - u.y) * c),
  42988. i > o || r > n ? null : ((r > i || i !== i) && (i = r),
  42989. (o < n || n !== n) && (n = o),
  42990. h >= 0 ? (a = (e.min.z - u.z) * h,
  42991. s = (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  42992. s = (e.min.z - u.z) * h),
  42993. i > s || a > n ? null : ((a > i || i !== i) && (i = a),
  42994. (s < n || n !== n) && (n = s),
  42995. n < 0 ? null : this.at(i >= 0 ? i : n, t)))
  42996. },
  42997. intersectsBox: function() {
  42998. var e = new n.Vector3;
  42999. return function(t) {
  43000. return null !== this.intersectBox(t, e)
  43001. }
  43002. }(),
  43003. intersectTriangle: function() {
  43004. var e = new n.Vector3
  43005. , t = new n.Vector3
  43006. , i = new n.Vector3
  43007. , r = new n.Vector3;
  43008. return function(n, o, a, s, l) {
  43009. t.subVectors(o, n),
  43010. i.subVectors(a, n),
  43011. r.crossVectors(t, i);
  43012. var c, h = this.direction.dot(r);
  43013. if (h > 0) {
  43014. if (s)
  43015. return null;
  43016. c = 1
  43017. } else {
  43018. if (!(h < 0))
  43019. return null;
  43020. c = -1,
  43021. h = -h
  43022. }
  43023. e.subVectors(this.origin, n);
  43024. var u = c * this.direction.dot(i.crossVectors(e, i));
  43025. if (u < 0)
  43026. return null;
  43027. var d = c * this.direction.dot(t.cross(e));
  43028. if (d < 0)
  43029. return null;
  43030. if (u + d > h)
  43031. return null;
  43032. var p = -c * e.dot(r);
  43033. return p < 0 ? null : this.at(p / h, l)
  43034. }
  43035. }(),
  43036. applyMatrix4: function(e) {
  43037. return this.direction.add(this.origin).applyMatrix4(e),
  43038. this.origin.applyMatrix4(e),
  43039. this.direction.sub(this.origin),
  43040. this.direction.normalize(),
  43041. this
  43042. },
  43043. equals: function(e) {
  43044. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  43045. }
  43046. },
  43047. n.Sphere = function(e, t) {
  43048. this.center = void 0 !== e ? e : new n.Vector3,
  43049. this.radius = void 0 !== t ? t : 0
  43050. }
  43051. ,
  43052. n.Sphere.prototype = {
  43053. constructor: n.Sphere,
  43054. set: function(e, t) {
  43055. return this.center.copy(e),
  43056. this.radius = t,
  43057. this
  43058. },
  43059. setFromPoints: function() {
  43060. var e = new n.Box3;
  43061. return function(t, i) {
  43062. var n = this.center;
  43063. void 0 !== i ? n.copy(i) : e.setFromPoints(t).center(n);
  43064. for (var r = 0, o = 0, a = t.length; o < a; o++)
  43065. r = Math.max(r, n.distanceToSquared(t[o]));
  43066. return this.radius = Math.sqrt(r),
  43067. this
  43068. }
  43069. }(),
  43070. clone: function() {
  43071. return (new this.constructor).copy(this)
  43072. },
  43073. copy: function(e) {
  43074. return this.center.copy(e.center),
  43075. this.radius = e.radius,
  43076. this
  43077. },
  43078. empty: function() {
  43079. return this.radius <= 0
  43080. },
  43081. containsPoint: function(e) {
  43082. return e.distanceToSquared(this.center) <= this.radius * this.radius
  43083. },
  43084. distanceToPoint: function(e) {
  43085. return e.distanceTo(this.center) - this.radius
  43086. },
  43087. intersectsSphere: function(e) {
  43088. var t = this.radius + e.radius;
  43089. return e.center.distanceToSquared(this.center) <= t * t
  43090. },
  43091. intersectsBox: function(e) {
  43092. return e.intersectsSphere(this)
  43093. },
  43094. intersectsPlane: function(e) {
  43095. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  43096. },
  43097. clampPoint: function(e, t) {
  43098. var i = this.center.distanceToSquared(e)
  43099. , r = t || new n.Vector3;
  43100. return r.copy(e),
  43101. i > this.radius * this.radius && (r.sub(this.center).normalize(),
  43102. r.multiplyScalar(this.radius).add(this.center)),
  43103. r
  43104. },
  43105. getBoundingBox: function(e) {
  43106. var t = e || new n.Box3;
  43107. return t.set(this.center, this.center),
  43108. t.expandByScalar(this.radius),
  43109. t
  43110. },
  43111. applyMatrix4: function(e) {
  43112. return this.center.applyMatrix4(e),
  43113. this.radius = this.radius * e.getMaxScaleOnAxis(),
  43114. this
  43115. },
  43116. translate: function(e) {
  43117. return this.center.add(e),
  43118. this
  43119. },
  43120. equals: function(e) {
  43121. return e.center.equals(this.center) && e.radius === this.radius
  43122. }
  43123. },
  43124. n.Frustum = function(e, t, i, r, o, a) {
  43125. 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]
  43126. }
  43127. ,
  43128. n.Frustum.prototype = {
  43129. constructor: n.Frustum,
  43130. set: function(e, t, i, n, r, o) {
  43131. var a = this.planes;
  43132. return a[0].copy(e),
  43133. a[1].copy(t),
  43134. a[2].copy(i),
  43135. a[3].copy(n),
  43136. a[4].copy(r),
  43137. a[5].copy(o),
  43138. this
  43139. },
  43140. clone: function() {
  43141. return (new this.constructor).copy(this)
  43142. },
  43143. copy: function(e) {
  43144. for (var t = this.planes, i = 0; i < 6; i++)
  43145. t[i].copy(e.planes[i]);
  43146. return this
  43147. },
  43148. setFromMatrix: function(e) {
  43149. var t = this.planes
  43150. , i = e.elements
  43151. , n = i[0]
  43152. , r = i[1]
  43153. , o = i[2]
  43154. , a = i[3]
  43155. , s = i[4]
  43156. , l = i[5]
  43157. , c = i[6]
  43158. , h = i[7]
  43159. , u = i[8]
  43160. , d = i[9]
  43161. , p = i[10]
  43162. , f = i[11]
  43163. , g = i[12]
  43164. , m = i[13]
  43165. , v = i[14]
  43166. , A = i[15];
  43167. return t[0].setComponents(a - n, h - s, f - u, A - g).normalize(),
  43168. t[1].setComponents(a + n, h + s, f + u, A + g).normalize(),
  43169. t[2].setComponents(a + r, h + l, f + d, A + m).normalize(),
  43170. t[3].setComponents(a - r, h - l, f - d, A - m).normalize(),
  43171. t[4].setComponents(a - o, h - c, f - p, A - v).normalize(),
  43172. t[5].setComponents(a + o, h + c, f + p, A + v).normalize(),
  43173. this
  43174. },
  43175. intersectsObject: function() {
  43176. var e = new n.Sphere;
  43177. return function(t) {
  43178. var i = t.geometry;
  43179. return null === i.boundingSphere && i.computeBoundingSphere(),
  43180. e.copy(i.boundingSphere),
  43181. e.applyMatrix4(t.matrixWorld),
  43182. this.intersectsSphere(e)
  43183. }
  43184. }(),
  43185. intersectsSphere: function(e) {
  43186. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  43187. var o = t[r].distanceToPoint(i);
  43188. if (o < n)
  43189. return !1
  43190. }
  43191. return !0
  43192. },
  43193. intersectsBox: function() {
  43194. var e = new n.Vector3
  43195. , t = new n.Vector3;
  43196. return function(i) {
  43197. for (var n = this.planes, r = 0; r < 6; r++) {
  43198. var o = n[r];
  43199. e.x = o.normal.x > 0 ? i.min.x : i.max.x,
  43200. t.x = o.normal.x > 0 ? i.max.x : i.min.x,
  43201. e.y = o.normal.y > 0 ? i.min.y : i.max.y,
  43202. t.y = o.normal.y > 0 ? i.max.y : i.min.y,
  43203. e.z = o.normal.z > 0 ? i.min.z : i.max.z,
  43204. t.z = o.normal.z > 0 ? i.max.z : i.min.z;
  43205. var a = o.distanceToPoint(e)
  43206. , s = o.distanceToPoint(t);
  43207. if (a < 0 && s < 0)
  43208. return !1
  43209. }
  43210. return !0
  43211. }
  43212. }(),
  43213. containsPoint: function(e) {
  43214. for (var t = this.planes, i = 0; i < 6; i++)
  43215. if (t[i].distanceToPoint(e) < 0)
  43216. return !1;
  43217. return !0
  43218. }
  43219. },
  43220. n.Plane = function(e, t) {
  43221. this.normal = void 0 !== e ? e : new n.Vector3(1,0,0),
  43222. this.constant = void 0 !== t ? t : 0
  43223. }
  43224. ,
  43225. n.Plane.prototype = {
  43226. constructor: n.Plane,
  43227. set: function(e, t) {
  43228. return this.normal.copy(e),
  43229. this.constant = t,
  43230. this
  43231. },
  43232. setComponents: function(e, t, i, n) {
  43233. return this.normal.set(e, t, i),
  43234. this.constant = n,
  43235. this
  43236. },
  43237. setFromNormalAndCoplanarPoint: function(e, t) {
  43238. return this.normal.copy(e),
  43239. this.constant = -t.dot(this.normal),
  43240. this
  43241. },
  43242. setFromCoplanarPoints: function() {
  43243. var e = new n.Vector3
  43244. , t = new n.Vector3;
  43245. return function(i, n, r) {
  43246. var o = e.subVectors(r, n).cross(t.subVectors(i, n)).normalize();
  43247. return this.setFromNormalAndCoplanarPoint(o, i),
  43248. this
  43249. }
  43250. }(),
  43251. clone: function() {
  43252. return (new this.constructor).copy(this)
  43253. },
  43254. copy: function(e) {
  43255. return this.normal.copy(e.normal),
  43256. this.constant = e.constant,
  43257. this
  43258. },
  43259. normalize: function() {
  43260. var e = 1 / this.normal.length();
  43261. return this.normal.multiplyScalar(e),
  43262. this.constant *= e,
  43263. this
  43264. },
  43265. negate: function() {
  43266. return this.constant *= -1,
  43267. this.normal.negate(),
  43268. this
  43269. },
  43270. distanceToPoint: function(e) {
  43271. return this.normal.dot(e) + this.constant
  43272. },
  43273. distanceToSphere: function(e) {
  43274. return this.distanceToPoint(e.center) - e.radius
  43275. },
  43276. projectPoint: function(e, t) {
  43277. return this.orthoPoint(e, t).sub(e).negate()
  43278. },
  43279. orthoPoint: function(e, t) {
  43280. var i = this.distanceToPoint(e)
  43281. , r = t || new n.Vector3;
  43282. return r.copy(this.normal).multiplyScalar(i)
  43283. },
  43284. intersectLine: function() {
  43285. var e = new n.Vector3;
  43286. return function(t, i) {
  43287. var r = i || new n.Vector3
  43288. , o = t.delta(e)
  43289. , a = this.normal.dot(o);
  43290. if (0 !== a) {
  43291. var s = -(t.start.dot(this.normal) + this.constant) / a;
  43292. if (!(s < 0 || s > 1))
  43293. return r.copy(o).multiplyScalar(s).add(t.start)
  43294. } else if (0 === this.distanceToPoint(t.start))
  43295. return r.copy(t.start)
  43296. }
  43297. }(),
  43298. intersectsLine: function(e) {
  43299. var t = this.distanceToPoint(e.start)
  43300. , i = this.distanceToPoint(e.end);
  43301. return t < 0 && i > 0 || i < 0 && t > 0
  43302. },
  43303. intersectsBox: function(e) {
  43304. return e.intersectsPlane(this)
  43305. },
  43306. intersectsSphere: function(e) {
  43307. return e.intersectsPlane(this)
  43308. },
  43309. coplanarPoint: function(e) {
  43310. var t = e || new n.Vector3;
  43311. return t.copy(this.normal).multiplyScalar(-this.constant)
  43312. },
  43313. applyMatrix4: function() {
  43314. var e = new n.Vector3
  43315. , t = new n.Vector3
  43316. , i = new n.Matrix3;
  43317. return function(n, r) {
  43318. var o = r || i.getNormalMatrix(n)
  43319. , a = e.copy(this.normal).applyMatrix3(o)
  43320. , s = this.coplanarPoint(t);
  43321. return s.applyMatrix4(n),
  43322. this.setFromNormalAndCoplanarPoint(a, s),
  43323. this
  43324. }
  43325. }(),
  43326. translate: function(e) {
  43327. return this.constant = this.constant - e.dot(this.normal),
  43328. this
  43329. },
  43330. equals: function(e) {
  43331. return e.normal.equals(this.normal) && e.constant === this.constant
  43332. }
  43333. },
  43334. n.Spherical = function(e, t, i) {
  43335. return this.radius = void 0 !== e ? e : 1,
  43336. this.phi = void 0 !== t ? t : 0,
  43337. this.theta = void 0 !== i ? i : 0,
  43338. this
  43339. }
  43340. ,
  43341. n.Spherical.prototype = {
  43342. constructor: n.Spherical,
  43343. set: function(e, t, i) {
  43344. this.radius = e,
  43345. this.phi = t,
  43346. this.theta = i
  43347. },
  43348. clone: function() {
  43349. return (new this.constructor).copy(this)
  43350. },
  43351. copy: function(e) {
  43352. return this.radius.copy(e.radius),
  43353. this.phi.copy(e.phi),
  43354. this.theta.copy(e.theta),
  43355. this
  43356. },
  43357. makeSafe: function() {
  43358. var e = 1e-6;
  43359. this.phi = Math.max(e, Math.min(Math.PI - e, this.phi))
  43360. },
  43361. setFromVector3: function(e) {
  43362. return this.radius = e.length(),
  43363. 0 === this.radius ? (this.theta = 0,
  43364. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  43365. this.phi = Math.acos(n.Math.clamp(e.y / this.radius, -1, 1))),
  43366. this
  43367. }
  43368. },
  43369. n.Math = {
  43370. generateUUID: function() {
  43371. var e, t = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), i = new Array(36), n = 0;
  43372. return function() {
  43373. for (var r = 0; r < 36; r++)
  43374. 8 === r || 13 === r || 18 === r || 23 === r ? i[r] = "-" : 14 === r ? i[r] = "4" : (n <= 2 && (n = 33554432 + 16777216 * Math.random() | 0),
  43375. e = 15 & n,
  43376. n >>= 4,
  43377. i[r] = t[19 === r ? 3 & e | 8 : e]);
  43378. return i.join("")
  43379. }
  43380. }(),
  43381. clamp: function(e, t, i) {
  43382. return Math.max(t, Math.min(i, e))
  43383. },
  43384. euclideanModulo: function(e, t) {
  43385. return (e % t + t) % t
  43386. },
  43387. mapLinear: function(e, t, i, n, r) {
  43388. return n + (e - t) * (r - n) / (i - t)
  43389. },
  43390. smoothstep: function(e, t, i) {
  43391. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  43392. e * e * (3 - 2 * e))
  43393. },
  43394. smootherstep: function(e, t, i) {
  43395. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  43396. e * e * e * (e * (6 * e - 15) + 10))
  43397. },
  43398. random16: function() {
  43399. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  43400. Math.random()
  43401. },
  43402. randInt: function(e, t) {
  43403. return e + Math.floor(Math.random() * (t - e + 1))
  43404. },
  43405. randFloat: function(e, t) {
  43406. return e + Math.random() * (t - e)
  43407. },
  43408. randFloatSpread: function(e) {
  43409. return e * (.5 - Math.random())
  43410. },
  43411. degToRad: function() {
  43412. var e = Math.PI / 180;
  43413. return function(t) {
  43414. return t * e
  43415. }
  43416. }(),
  43417. radToDeg: function() {
  43418. var e = 180 / Math.PI;
  43419. return function(t) {
  43420. return t * e
  43421. }
  43422. }(),
  43423. isPowerOfTwo: function(e) {
  43424. return 0 === (e & e - 1) && 0 !== e
  43425. },
  43426. nearestPowerOfTwo: function(e) {
  43427. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  43428. },
  43429. nextPowerOfTwo: function(e) {
  43430. return e--,
  43431. e |= e >> 1,
  43432. e |= e >> 2,
  43433. e |= e >> 4,
  43434. e |= e >> 8,
  43435. e |= e >> 16,
  43436. e++,
  43437. e
  43438. }
  43439. },
  43440. n.Spline = function(e) {
  43441. function t(e, t, i, n, r, o, a) {
  43442. var s = .5 * (i - e)
  43443. , l = .5 * (n - t);
  43444. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  43445. }
  43446. this.points = e;
  43447. var i, r, o, a, s, l, c, h, u, d = [], p = {
  43448. x: 0,
  43449. y: 0,
  43450. z: 0
  43451. };
  43452. this.initFromArray = function(e) {
  43453. this.points = [];
  43454. for (var t = 0; t < e.length; t++)
  43455. this.points[t] = {
  43456. x: e[t][0],
  43457. y: e[t][1],
  43458. z: e[t][2]
  43459. }
  43460. }
  43461. ,
  43462. this.getPoint = function(e) {
  43463. return i = (this.points.length - 1) * e,
  43464. r = Math.floor(i),
  43465. o = i - r,
  43466. d[0] = 0 === r ? r : r - 1,
  43467. d[1] = r,
  43468. d[2] = r > this.points.length - 2 ? this.points.length - 1 : r + 1,
  43469. d[3] = r > this.points.length - 3 ? this.points.length - 1 : r + 2,
  43470. l = this.points[d[0]],
  43471. c = this.points[d[1]],
  43472. h = this.points[d[2]],
  43473. u = this.points[d[3]],
  43474. a = o * o,
  43475. s = o * a,
  43476. p.x = t(l.x, c.x, h.x, u.x, o, a, s),
  43477. p.y = t(l.y, c.y, h.y, u.y, o, a, s),
  43478. p.z = t(l.z, c.z, h.z, u.z, o, a, s),
  43479. p
  43480. }
  43481. ,
  43482. this.getControlPointsArray = function() {
  43483. var e, t, i = this.points.length, n = [];
  43484. for (e = 0; e < i; e++)
  43485. t = this.points[e],
  43486. n[e] = [t.x, t.y, t.z];
  43487. return n
  43488. }
  43489. ,
  43490. this.getLength = function(e) {
  43491. var t, i, r, o, a = 0, s = 0, l = 0, c = new n.Vector3, h = new n.Vector3, u = [], d = 0;
  43492. for (u[0] = 0,
  43493. e || (e = 100),
  43494. r = this.points.length * e,
  43495. c.copy(this.points[0]),
  43496. t = 1; t < r; t++)
  43497. i = t / r,
  43498. o = this.getPoint(i),
  43499. h.copy(o),
  43500. d += h.distanceTo(c),
  43501. c.copy(o),
  43502. a = (this.points.length - 1) * i,
  43503. s = Math.floor(a),
  43504. s !== l && (u[s] = d,
  43505. l = s);
  43506. return u[u.length] = d,
  43507. {
  43508. chunks: u,
  43509. total: d
  43510. }
  43511. }
  43512. ,
  43513. this.reparametrizeByArcLength = function(e) {
  43514. var t, i, r, o, a, s, l, c, h = [], u = new n.Vector3, d = this.getLength();
  43515. for (h.push(u.copy(this.points[0]).clone()),
  43516. t = 1; t < this.points.length; t++) {
  43517. for (s = d.chunks[t] - d.chunks[t - 1],
  43518. l = Math.ceil(e * s / d.total),
  43519. o = (t - 1) / (this.points.length - 1),
  43520. a = t / (this.points.length - 1),
  43521. i = 1; i < l - 1; i++)
  43522. r = o + i * (1 / l) * (a - o),
  43523. c = this.getPoint(r),
  43524. h.push(u.copy(c).clone());
  43525. h.push(u.copy(this.points[t]).clone())
  43526. }
  43527. this.points = h
  43528. }
  43529. }
  43530. ,
  43531. n.Triangle = function(e, t, i) {
  43532. this.a = void 0 !== e ? e : new n.Vector3,
  43533. this.b = void 0 !== t ? t : new n.Vector3,
  43534. this.c = void 0 !== i ? i : new n.Vector3
  43535. }
  43536. ,
  43537. n.Triangle.normal = function() {
  43538. var e = new n.Vector3;
  43539. return function(t, i, r, o) {
  43540. var a = o || new n.Vector3;
  43541. a.subVectors(r, i),
  43542. e.subVectors(t, i),
  43543. a.cross(e);
  43544. var s = a.lengthSq();
  43545. return s > 0 ? a.multiplyScalar(1 / Math.sqrt(s)) : a.set(0, 0, 0)
  43546. }
  43547. }(),
  43548. n.Triangle.barycoordFromPoint = function() {
  43549. var e = new n.Vector3
  43550. , t = new n.Vector3
  43551. , i = new n.Vector3;
  43552. return function(r, o, a, s, l) {
  43553. e.subVectors(s, o),
  43554. t.subVectors(a, o),
  43555. i.subVectors(r, o);
  43556. var c = e.dot(e)
  43557. , h = e.dot(t)
  43558. , u = e.dot(i)
  43559. , d = t.dot(t)
  43560. , p = t.dot(i)
  43561. , f = c * d - h * h
  43562. , g = l || new n.Vector3;
  43563. if (0 === f)
  43564. return g.set(-2, -1, -1);
  43565. var m = 1 / f
  43566. , v = (d * u - h * p) * m
  43567. , A = (c * p - h * u) * m;
  43568. return g.set(1 - v - A, A, v)
  43569. }
  43570. }(),
  43571. n.Triangle.containsPoint = function() {
  43572. var e = new n.Vector3;
  43573. return function(t, i, r, o) {
  43574. var a = n.Triangle.barycoordFromPoint(t, i, r, o, e);
  43575. return a.x >= 0 && a.y >= 0 && a.x + a.y <= 1
  43576. }
  43577. }(),
  43578. n.Triangle.prototype = {
  43579. constructor: n.Triangle,
  43580. set: function(e, t, i) {
  43581. return this.a.copy(e),
  43582. this.b.copy(t),
  43583. this.c.copy(i),
  43584. this
  43585. },
  43586. setFromPointsAndIndices: function(e, t, i, n) {
  43587. return this.a.copy(e[t]),
  43588. this.b.copy(e[i]),
  43589. this.c.copy(e[n]),
  43590. this
  43591. },
  43592. clone: function() {
  43593. return (new this.constructor).copy(this)
  43594. },
  43595. copy: function(e) {
  43596. return this.a.copy(e.a),
  43597. this.b.copy(e.b),
  43598. this.c.copy(e.c),
  43599. this
  43600. },
  43601. area: function() {
  43602. var e = new n.Vector3
  43603. , t = new n.Vector3;
  43604. return function() {
  43605. return e.subVectors(this.c, this.b),
  43606. t.subVectors(this.a, this.b),
  43607. .5 * e.cross(t).length()
  43608. }
  43609. }(),
  43610. midpoint: function(e) {
  43611. var t = e || new n.Vector3;
  43612. return t.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  43613. },
  43614. normal: function(e) {
  43615. return n.Triangle.normal(this.a, this.b, this.c, e)
  43616. },
  43617. plane: function(e) {
  43618. var t = e || new n.Plane;
  43619. return t.setFromCoplanarPoints(this.a, this.b, this.c)
  43620. },
  43621. barycoordFromPoint: function(e, t) {
  43622. return n.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  43623. },
  43624. containsPoint: function(e) {
  43625. return n.Triangle.containsPoint(e, this.a, this.b, this.c)
  43626. },
  43627. equals: function(e) {
  43628. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  43629. }
  43630. },
  43631. n.Interpolant = function(e, t, i, n) {
  43632. this.parameterPositions = e,
  43633. this._cachedIndex = 0,
  43634. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  43635. this.sampleValues = t,
  43636. this.valueSize = i
  43637. }
  43638. ,
  43639. n.Interpolant.prototype = {
  43640. constructor: n.Interpolant,
  43641. evaluate: function(e) {
  43642. var t = this.parameterPositions
  43643. , i = this._cachedIndex
  43644. , n = t[i]
  43645. , r = t[i - 1];
  43646. e: {
  43647. t: {
  43648. var o;
  43649. i: {
  43650. n: if (!(e < n)) {
  43651. for (var a = i + 2; ; ) {
  43652. if (void 0 === n) {
  43653. if (e < r)
  43654. break n;
  43655. return i = t.length,
  43656. this._cachedIndex = i,
  43657. this.afterEnd_(i - 1, e, r)
  43658. }
  43659. if (i === a)
  43660. break;
  43661. if (r = n,
  43662. n = t[++i],
  43663. e < n)
  43664. break t
  43665. }
  43666. o = t.length;
  43667. break i
  43668. }
  43669. {
  43670. if (e >= r)
  43671. break e;
  43672. var s = t[1];
  43673. e < s && (i = 2,
  43674. r = s);
  43675. for (var a = i - 2; ; ) {
  43676. if (void 0 === r)
  43677. return this._cachedIndex = 0,
  43678. this.beforeStart_(0, e, n);
  43679. if (i === a)
  43680. break;
  43681. if (n = r,
  43682. r = t[--i - 1],
  43683. e >= r)
  43684. break t
  43685. }
  43686. o = i,
  43687. i = 0
  43688. }
  43689. }
  43690. for (; i < o; ) {
  43691. var l = i + o >>> 1;
  43692. e < t[l] ? o = l : i = l + 1
  43693. }
  43694. if (n = t[i],
  43695. r = t[i - 1],
  43696. void 0 === r)
  43697. return this._cachedIndex = 0,
  43698. this.beforeStart_(0, e, n);
  43699. if (void 0 === n)
  43700. return i = t.length,
  43701. this._cachedIndex = i,
  43702. this.afterEnd_(i - 1, r, e)
  43703. }
  43704. this._cachedIndex = i,
  43705. this.intervalChanged_(i, r, n)
  43706. }
  43707. return this.interpolate_(i, r, e, n)
  43708. },
  43709. settings: null,
  43710. DefaultSettings_: {},
  43711. getSettings_: function() {
  43712. return this.settings || this.DefaultSettings_
  43713. },
  43714. copySampleValue_: function(e) {
  43715. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  43716. t[o] = i[r + o];
  43717. return t
  43718. },
  43719. interpolate_: function(e, t, i, n) {
  43720. throw new Error("call to abstract method")
  43721. },
  43722. intervalChanged_: function(e, t, i) {}
  43723. },
  43724. Object.assign(n.Interpolant.prototype, {
  43725. beforeStart_: n.Interpolant.prototype.copySampleValue_,
  43726. afterEnd_: n.Interpolant.prototype.copySampleValue_
  43727. }),
  43728. n.CubicInterpolant = function(e, t, i, r) {
  43729. n.Interpolant.call(this, e, t, i, r),
  43730. this._weightPrev = -0,
  43731. this._offsetPrev = -0,
  43732. this._weightNext = -0,
  43733. this._offsetNext = -0
  43734. }
  43735. ,
  43736. n.CubicInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43737. constructor: n.CubicInterpolant,
  43738. DefaultSettings_: {
  43739. endingStart: n.ZeroCurvatureEnding,
  43740. endingEnd: n.ZeroCurvatureEnding
  43741. },
  43742. intervalChanged_: function(e, t, i) {
  43743. var r = this.parameterPositions
  43744. , o = e - 2
  43745. , a = e + 1
  43746. , s = r[o]
  43747. , l = r[a];
  43748. if (void 0 === s)
  43749. switch (this.getSettings_().endingStart) {
  43750. case n.ZeroSlopeEnding:
  43751. o = e,
  43752. s = 2 * t - i;
  43753. break;
  43754. case n.WrapAroundEnding:
  43755. o = r.length - 2,
  43756. s = t + r[o] - r[o + 1];
  43757. break;
  43758. default:
  43759. o = e,
  43760. s = i
  43761. }
  43762. if (void 0 === l)
  43763. switch (this.getSettings_().endingEnd) {
  43764. case n.ZeroSlopeEnding:
  43765. a = e,
  43766. l = 2 * i - t;
  43767. break;
  43768. case n.WrapAroundEnding:
  43769. a = 1,
  43770. l = i + r[1] - r[0];
  43771. break;
  43772. default:
  43773. a = e - 1,
  43774. l = t
  43775. }
  43776. var c = .5 * (i - t)
  43777. , h = this.valueSize;
  43778. this._weightPrev = c / (t - s),
  43779. this._weightNext = c / (l - i),
  43780. this._offsetPrev = o * h,
  43781. this._offsetNext = a * h
  43782. },
  43783. interpolate_: function(e, t, i, n) {
  43784. 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)
  43785. r[C] = m * o[c + C] + v * o[l + C] + A * o[s + C] + y * o[h + C];
  43786. return r
  43787. }
  43788. }),
  43789. n.DiscreteInterpolant = function(e, t, i, r) {
  43790. n.Interpolant.call(this, e, t, i, r)
  43791. }
  43792. ,
  43793. n.DiscreteInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43794. constructor: n.DiscreteInterpolant,
  43795. interpolate_: function(e, t, i, n) {
  43796. return this.copySampleValue_(e - 1)
  43797. }
  43798. }),
  43799. n.LinearInterpolant = function(e, t, i, r) {
  43800. n.Interpolant.call(this, e, t, i, r)
  43801. }
  43802. ,
  43803. n.LinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43804. constructor: n.LinearInterpolant,
  43805. interpolate_: function(e, t, i, n) {
  43806. 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)
  43807. r[u] = o[l + u] * h + o[s + u] * c;
  43808. return r
  43809. }
  43810. }),
  43811. n.QuaternionLinearInterpolant = function(e, t, i, r) {
  43812. n.Interpolant.call(this, e, t, i, r)
  43813. }
  43814. ,
  43815. n.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43816. constructor: n.QuaternionLinearInterpolant,
  43817. interpolate_: function(e, t, i, r) {
  43818. 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)
  43819. n.Quaternion.slerpFlat(o, 0, a, l - s, a, l, c);
  43820. return o
  43821. }
  43822. }),
  43823. n.Clock = function(e) {
  43824. this.autoStart = void 0 === e || e,
  43825. this.startTime = 0,
  43826. this.oldTime = 0,
  43827. this.elapsedTime = 0,
  43828. this.running = !1
  43829. }
  43830. ,
  43831. n.Clock.prototype = {
  43832. constructor: n.Clock,
  43833. start: function() {
  43834. this.startTime = performance.now(),
  43835. this.oldTime = this.startTime,
  43836. this.running = !0
  43837. },
  43838. stop: function() {
  43839. this.getElapsedTime(),
  43840. this.running = !1
  43841. },
  43842. getElapsedTime: function() {
  43843. return this.getDelta(),
  43844. this.elapsedTime
  43845. },
  43846. getDelta: function() {
  43847. var e = 0;
  43848. if (this.autoStart && !this.running && this.start(),
  43849. this.running) {
  43850. var t = performance.now();
  43851. e = .001 * (t - this.oldTime),
  43852. this.oldTime = t,
  43853. this.elapsedTime += e
  43854. }
  43855. return e
  43856. }
  43857. },
  43858. n.EventDispatcher = function() {}
  43859. ,
  43860. n.EventDispatcher.prototype = {
  43861. constructor: n.EventDispatcher,
  43862. apply: function(e) {
  43863. e.addEventListener = n.EventDispatcher.prototype.addEventListener,
  43864. e.hasEventListener = n.EventDispatcher.prototype.hasEventListener,
  43865. e.removeEventListener = n.EventDispatcher.prototype.removeEventListener,
  43866. e.dispatchEvent = n.EventDispatcher.prototype.dispatchEvent
  43867. },
  43868. addEventListener: function(e, t) {
  43869. void 0 === this._listeners && (this._listeners = {});
  43870. var i = this._listeners;
  43871. void 0 === i[e] && (i[e] = []),
  43872. i[e].indexOf(t) === -1 && i[e].push(t)
  43873. },
  43874. hasEventListener: function(e, t) {
  43875. if (void 0 === this._listeners)
  43876. return !1;
  43877. var i = this._listeners;
  43878. return void 0 !== i[e] && i[e].indexOf(t) !== -1
  43879. },
  43880. removeEventListener: function(e, t) {
  43881. if (void 0 !== this._listeners) {
  43882. var i = this._listeners
  43883. , n = i[e];
  43884. if (void 0 !== n) {
  43885. var r = n.indexOf(t);
  43886. r !== -1 && n.splice(r, 1)
  43887. }
  43888. }
  43889. },
  43890. dispatchEvent: function(e) {
  43891. if (void 0 !== this._listeners) {
  43892. var t = this._listeners
  43893. , i = t[e.type];
  43894. if (void 0 !== i) {
  43895. e.target = this;
  43896. for (var n = [], r = i.length, o = 0; o < r; o++)
  43897. n[o] = i[o];
  43898. for (var o = 0; o < r; o++)
  43899. n[o].call(this, e)
  43900. }
  43901. }
  43902. }
  43903. },
  43904. n.Layers = function() {
  43905. this.mask = 1
  43906. }
  43907. ,
  43908. n.Layers.prototype = {
  43909. constructor: n.Layers,
  43910. set: function(e) {
  43911. this.mask = 1 << e
  43912. },
  43913. enable: function(e) {
  43914. this.mask |= 1 << e
  43915. },
  43916. toggle: function(e) {
  43917. this.mask ^= 1 << e
  43918. },
  43919. disable: function(e) {
  43920. this.mask &= ~(1 << e)
  43921. },
  43922. test: function(e) {
  43923. return 0 !== (this.mask & e.mask)
  43924. }
  43925. },
  43926. function(e) {
  43927. function t(e, t) {
  43928. return e.distance - t.distance
  43929. }
  43930. function i(e, t, n, r) {
  43931. if (e.visible !== !1 && (e.raycast(t, n),
  43932. r === !0))
  43933. for (var o = e.children, a = 0, s = o.length; a < s; a++)
  43934. i(o[a], t, n, !0)
  43935. }
  43936. e.Raycaster = function(t, i, n, r) {
  43937. this.ray = new e.Ray(t,i),
  43938. this.near = n || 0,
  43939. this.far = r || 1 / 0,
  43940. this.params = {
  43941. Mesh: {},
  43942. Line: {},
  43943. LOD: {},
  43944. Points: {
  43945. threshold: 1
  43946. },
  43947. Sprite: {}
  43948. },
  43949. Object.defineProperties(this.params, {
  43950. PointCloud: {
  43951. get: function() {
  43952. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  43953. this.Points
  43954. }
  43955. }
  43956. })
  43957. }
  43958. ,
  43959. e.Raycaster.prototype = {
  43960. constructor: e.Raycaster,
  43961. linePrecision: 1,
  43962. set: function(e, t) {
  43963. this.ray.set(e, t)
  43964. },
  43965. setFromCamera: function(t, i) {
  43966. i instanceof e.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(i.matrixWorld),
  43967. 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),
  43968. this.ray.direction.set(0, 0, -1).transformDirection(i.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  43969. },
  43970. intersectObject: function(e, n) {
  43971. var r = [];
  43972. return i(e, this, r, n),
  43973. r.sort(t),
  43974. r
  43975. },
  43976. intersectObjects: function(e, n) {
  43977. var r = [];
  43978. if (Array.isArray(e) === !1)
  43979. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  43980. r;
  43981. for (var o = 0, a = e.length; o < a; o++)
  43982. i(e[o], this, r, n);
  43983. return r.sort(t),
  43984. r
  43985. }
  43986. }
  43987. }(n),
  43988. n.Object3D = function() {
  43989. function e() {
  43990. o.setFromEuler(r, !1)
  43991. }
  43992. function t() {
  43993. r.setFromQuaternion(o, void 0, !1)
  43994. }
  43995. Object.defineProperty(this, "id", {
  43996. value: n.Object3DIdCount++
  43997. }),
  43998. this.uuid = n.Math.generateUUID(),
  43999. this.name = "",
  44000. this.type = "Object3D",
  44001. this.parent = null,
  44002. this.children = [],
  44003. this.up = n.Object3D.DefaultUp.clone();
  44004. var i = new n.Vector3
  44005. , r = new n.Euler
  44006. , o = new n.Quaternion
  44007. , a = new n.Vector3(1,1,1);
  44008. r.onChange(e),
  44009. o.onChange(t),
  44010. Object.defineProperties(this, {
  44011. position: {
  44012. enumerable: !0,
  44013. value: i
  44014. },
  44015. rotation: {
  44016. enumerable: !0,
  44017. value: r
  44018. },
  44019. quaternion: {
  44020. enumerable: !0,
  44021. value: o
  44022. },
  44023. scale: {
  44024. enumerable: !0,
  44025. value: a
  44026. },
  44027. modelViewMatrix: {
  44028. value: new n.Matrix4
  44029. },
  44030. normalMatrix: {
  44031. value: new n.Matrix3
  44032. }
  44033. }),
  44034. this.rotationAutoUpdate = !0,
  44035. this.matrix = new n.Matrix4,
  44036. this.matrixWorld = new n.Matrix4,
  44037. this.matrixAutoUpdate = n.Object3D.DefaultMatrixAutoUpdate,
  44038. this.matrixWorldNeedsUpdate = !1,
  44039. this.layers = new n.Layers,
  44040. this.visible = !0,
  44041. this.castShadow = !1,
  44042. this.receiveShadow = !1,
  44043. this.frustumCulled = !0,
  44044. this.renderOrder = 0,
  44045. this.userData = {}
  44046. }
  44047. ,
  44048. n.Object3D.DefaultUp = new n.Vector3(0,1,0),
  44049. n.Object3D.DefaultMatrixAutoUpdate = !0,
  44050. n.Object3D.prototype = {
  44051. constructor: n.Object3D,
  44052. applyMatrix: function(e) {
  44053. this.matrix.multiplyMatrices(e, this.matrix),
  44054. this.matrix.decompose(this.position, this.quaternion, this.scale)
  44055. },
  44056. setRotationFromAxisAngle: function(e, t) {
  44057. this.quaternion.setFromAxisAngle(e, t)
  44058. },
  44059. setRotationFromEuler: function(e) {
  44060. this.quaternion.setFromEuler(e, !0)
  44061. },
  44062. setRotationFromMatrix: function(e) {
  44063. this.quaternion.setFromRotationMatrix(e)
  44064. },
  44065. setRotationFromQuaternion: function(e) {
  44066. this.quaternion.copy(e)
  44067. },
  44068. rotateOnAxis: function() {
  44069. var e = new n.Quaternion;
  44070. return function(t, i) {
  44071. return e.setFromAxisAngle(t, i),
  44072. this.quaternion.multiply(e),
  44073. this
  44074. }
  44075. }(),
  44076. rotateX: function() {
  44077. var e = new n.Vector3(1,0,0);
  44078. return function(t) {
  44079. return this.rotateOnAxis(e, t)
  44080. }
  44081. }(),
  44082. rotateY: function() {
  44083. var e = new n.Vector3(0,1,0);
  44084. return function(t) {
  44085. return this.rotateOnAxis(e, t)
  44086. }
  44087. }(),
  44088. rotateZ: function() {
  44089. var e = new n.Vector3(0,0,1);
  44090. return function(t) {
  44091. return this.rotateOnAxis(e, t)
  44092. }
  44093. }(),
  44094. translateOnAxis: function() {
  44095. var e = new n.Vector3;
  44096. return function(t, i) {
  44097. return e.copy(t).applyQuaternion(this.quaternion),
  44098. this.position.add(e.multiplyScalar(i)),
  44099. this
  44100. }
  44101. }(),
  44102. translateX: function() {
  44103. var e = new n.Vector3(1,0,0);
  44104. return function(t) {
  44105. return this.translateOnAxis(e, t)
  44106. }
  44107. }(),
  44108. translateY: function() {
  44109. var e = new n.Vector3(0,1,0);
  44110. return function(t) {
  44111. return this.translateOnAxis(e, t)
  44112. }
  44113. }(),
  44114. translateZ: function() {
  44115. var e = new n.Vector3(0,0,1);
  44116. return function(t) {
  44117. return this.translateOnAxis(e, t)
  44118. }
  44119. }(),
  44120. localToWorld: function(e) {
  44121. return e.applyMatrix4(this.matrixWorld)
  44122. },
  44123. worldToLocal: function() {
  44124. var e = new n.Matrix4;
  44125. return function(t) {
  44126. return t.applyMatrix4(e.getInverse(this.matrixWorld))
  44127. }
  44128. }(),
  44129. lookAt: function() {
  44130. var e = new n.Matrix4;
  44131. return function(t) {
  44132. e.lookAt(t, this.position, this.up),
  44133. this.quaternion.setFromRotationMatrix(e)
  44134. }
  44135. }(),
  44136. add: function(e) {
  44137. if (arguments.length > 1) {
  44138. for (var t = 0; t < arguments.length; t++)
  44139. this.add(arguments[t]);
  44140. return this
  44141. }
  44142. return e === this ? (console.error("THREE.Object3D.add: object can't be added as a child of itself.", e),
  44143. this) : (e instanceof n.Object3D ? (null !== e.parent && e.parent.remove(e),
  44144. e.parent = this,
  44145. e.dispatchEvent({
  44146. type: "added"
  44147. }),
  44148. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  44149. this)
  44150. },
  44151. remove: function(e) {
  44152. if (arguments.length > 1)
  44153. for (var t = 0; t < arguments.length; t++)
  44154. this.remove(arguments[t]);
  44155. var i = this.children.indexOf(e);
  44156. i !== -1 && (e.parent = null,
  44157. e.dispatchEvent({
  44158. type: "removed"
  44159. }),
  44160. this.children.splice(i, 1))
  44161. },
  44162. getObjectById: function(e) {
  44163. return this.getObjectByProperty("id", e)
  44164. },
  44165. getObjectByName: function(e) {
  44166. return this.getObjectByProperty("name", e)
  44167. },
  44168. getObjectByProperty: function(e, t) {
  44169. if (this[e] === t)
  44170. return this;
  44171. for (var i = 0, n = this.children.length; i < n; i++) {
  44172. var r = this.children[i]
  44173. , o = r.getObjectByProperty(e, t);
  44174. if (void 0 !== o)
  44175. return o
  44176. }
  44177. },
  44178. getWorldPosition: function(e) {
  44179. var t = e || new n.Vector3;
  44180. return this.updateMatrixWorld(!0),
  44181. t.setFromMatrixPosition(this.matrixWorld)
  44182. },
  44183. getWorldQuaternion: function() {
  44184. var e = new n.Vector3
  44185. , t = new n.Vector3;
  44186. return function(i) {
  44187. var r = i || new n.Quaternion;
  44188. return this.updateMatrixWorld(!0),
  44189. this.matrixWorld.decompose(e, r, t),
  44190. r
  44191. }
  44192. }(),
  44193. getWorldRotation: function() {
  44194. var e = new n.Quaternion;
  44195. return function(t) {
  44196. var i = t || new n.Euler;
  44197. return this.getWorldQuaternion(e),
  44198. i.setFromQuaternion(e, this.rotation.order, !1)
  44199. }
  44200. }(),
  44201. getWorldScale: function() {
  44202. var e = new n.Vector3
  44203. , t = new n.Quaternion;
  44204. return function(i) {
  44205. var r = i || new n.Vector3;
  44206. return this.updateMatrixWorld(!0),
  44207. this.matrixWorld.decompose(e, t, r),
  44208. r
  44209. }
  44210. }(),
  44211. getWorldDirection: function() {
  44212. var e = new n.Quaternion;
  44213. return function(t) {
  44214. var i = t || new n.Vector3;
  44215. return this.getWorldQuaternion(e),
  44216. i.set(0, 0, 1).applyQuaternion(e)
  44217. }
  44218. }(),
  44219. raycast: function() {},
  44220. traverse: function(e) {
  44221. e(this);
  44222. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  44223. t[i].traverse(e)
  44224. },
  44225. traverseVisible: function(e) {
  44226. if (this.visible !== !1) {
  44227. e(this);
  44228. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  44229. t[i].traverseVisible(e)
  44230. }
  44231. },
  44232. traverseAncestors: function(e) {
  44233. var t = this.parent;
  44234. null !== t && (e(t),
  44235. t.traverseAncestors(e))
  44236. },
  44237. updateMatrix: function() {
  44238. this.matrix.compose(this.position, this.quaternion, this.scale),
  44239. this.matrixWorldNeedsUpdate = !0
  44240. },
  44241. updateMatrixWorld: function(e) {
  44242. this.matrixAutoUpdate === !0 && this.updateMatrix(),
  44243. this.matrixWorldNeedsUpdate !== !0 && e !== !0 || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  44244. this.matrixWorldNeedsUpdate = !1,
  44245. e = !0);
  44246. for (var t = 0, i = this.children.length; t < i; t++)
  44247. this.children[t].updateMatrixWorld(e)
  44248. },
  44249. toJSON: function(e) {
  44250. function t(e) {
  44251. var t = [];
  44252. for (var i in e) {
  44253. var n = e[i];
  44254. delete n.metadata,
  44255. t.push(n)
  44256. }
  44257. return t
  44258. }
  44259. var i = void 0 === e
  44260. , n = {};
  44261. i && (e = {
  44262. geometries: {},
  44263. materials: {},
  44264. textures: {},
  44265. images: {}
  44266. },
  44267. n.metadata = {
  44268. version: 4.4,
  44269. type: "Object",
  44270. generator: "Object3D.toJSON"
  44271. });
  44272. var r = {};
  44273. if (r.uuid = this.uuid,
  44274. r.type = this.type,
  44275. "" !== this.name && (r.name = this.name),
  44276. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  44277. this.castShadow === !0 && (r.castShadow = !0),
  44278. this.receiveShadow === !0 && (r.receiveShadow = !0),
  44279. this.visible === !1 && (r.visible = !1),
  44280. r.matrix = this.matrix.toArray(),
  44281. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  44282. r.geometry = this.geometry.uuid),
  44283. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  44284. r.material = this.material.uuid),
  44285. this.children.length > 0) {
  44286. r.children = [];
  44287. for (var o = 0; o < this.children.length; o++)
  44288. r.children.push(this.children[o].toJSON(e).object)
  44289. }
  44290. if (i) {
  44291. var a = t(e.geometries)
  44292. , s = t(e.materials)
  44293. , l = t(e.textures)
  44294. , c = t(e.images);
  44295. a.length > 0 && (n.geometries = a),
  44296. s.length > 0 && (n.materials = s),
  44297. l.length > 0 && (n.textures = l),
  44298. c.length > 0 && (n.images = c)
  44299. }
  44300. return n.object = r,
  44301. n
  44302. },
  44303. clone: function(e) {
  44304. return (new this.constructor).copy(this, e)
  44305. },
  44306. copy: function(e, t) {
  44307. if (void 0 === t && (t = !0),
  44308. this.name = e.name,
  44309. this.up.copy(e.up),
  44310. this.position.copy(e.position),
  44311. this.quaternion.copy(e.quaternion),
  44312. this.scale.copy(e.scale),
  44313. this.rotationAutoUpdate = e.rotationAutoUpdate,
  44314. this.matrix.copy(e.matrix),
  44315. this.matrixWorld.copy(e.matrixWorld),
  44316. this.matrixAutoUpdate = e.matrixAutoUpdate,
  44317. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  44318. this.visible = e.visible,
  44319. this.castShadow = e.castShadow,
  44320. this.receiveShadow = e.receiveShadow,
  44321. this.frustumCulled = e.frustumCulled,
  44322. this.renderOrder = e.renderOrder,
  44323. this.userData = JSON.parse(JSON.stringify(e.userData)),
  44324. t === !0)
  44325. for (var i = 0; i < e.children.length; i++) {
  44326. var n = e.children[i];
  44327. this.add(n.clone())
  44328. }
  44329. return this
  44330. }
  44331. },
  44332. n.EventDispatcher.prototype.apply(n.Object3D.prototype),
  44333. n.Object3DIdCount = 0,
  44334. n.Face3 = function(e, t, i, r, o, a) {
  44335. this.a = e,
  44336. this.b = t,
  44337. this.c = i,
  44338. this.normal = r instanceof n.Vector3 ? r : new n.Vector3,
  44339. this.vertexNormals = Array.isArray(r) ? r : [],
  44340. this.color = o instanceof n.Color ? o : new n.Color,
  44341. this.vertexColors = Array.isArray(o) ? o : [],
  44342. this.materialIndex = void 0 !== a ? a : 0
  44343. }
  44344. ,
  44345. n.Face3.prototype = {
  44346. constructor: n.Face3,
  44347. clone: function() {
  44348. return (new this.constructor).copy(this)
  44349. },
  44350. copy: function(e) {
  44351. this.a = e.a,
  44352. this.b = e.b,
  44353. this.c = e.c,
  44354. this.normal.copy(e.normal),
  44355. this.color.copy(e.color),
  44356. this.materialIndex = e.materialIndex;
  44357. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  44358. this.vertexNormals[t] = e.vertexNormals[t].clone();
  44359. for (var t = 0, i = e.vertexColors.length; t < i; t++)
  44360. this.vertexColors[t] = e.vertexColors[t].clone();
  44361. return this
  44362. }
  44363. },
  44364. n.BufferAttribute = function(e, t) {
  44365. this.uuid = n.Math.generateUUID(),
  44366. this.array = e,
  44367. this.itemSize = t,
  44368. this.dynamic = !1,
  44369. this.updateRange = {
  44370. offset: 0,
  44371. count: -1
  44372. },
  44373. this.version = 0
  44374. }
  44375. ,
  44376. n.BufferAttribute.prototype = {
  44377. constructor: n.BufferAttribute,
  44378. get count() {
  44379. return this.array.length / this.itemSize
  44380. },
  44381. set needsUpdate(e) {
  44382. e === !0 && this.version++
  44383. },
  44384. setDynamic: function(e) {
  44385. return this.dynamic = e,
  44386. this
  44387. },
  44388. copy: function(e) {
  44389. return this.array = new e.array.constructor(e.array),
  44390. this.itemSize = e.itemSize,
  44391. this.dynamic = e.dynamic,
  44392. this
  44393. },
  44394. copyAt: function(e, t, i) {
  44395. e *= this.itemSize,
  44396. i *= t.itemSize;
  44397. for (var n = 0, r = this.itemSize; n < r; n++)
  44398. this.array[e + n] = t.array[i + n];
  44399. return this
  44400. },
  44401. copyArray: function(e) {
  44402. return this.array.set(e),
  44403. this
  44404. },
  44405. copyColorsArray: function(e) {
  44406. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  44407. var a = e[r];
  44408. void 0 === a && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", r),
  44409. a = new n.Color),
  44410. t[i++] = a.r,
  44411. t[i++] = a.g,
  44412. t[i++] = a.b
  44413. }
  44414. return this
  44415. },
  44416. copyIndicesArray: function(e) {
  44417. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  44418. var o = e[n];
  44419. t[i++] = o.a,
  44420. t[i++] = o.b,
  44421. t[i++] = o.c
  44422. }
  44423. return this
  44424. },
  44425. copyVector2sArray: function(e) {
  44426. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  44427. var a = e[r];
  44428. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", r),
  44429. a = new n.Vector2),
  44430. t[i++] = a.x,
  44431. t[i++] = a.y
  44432. }
  44433. return this
  44434. },
  44435. copyVector3sArray: function(e) {
  44436. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  44437. var a = e[r];
  44438. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", r),
  44439. a = new n.Vector3),
  44440. t[i++] = a.x,
  44441. t[i++] = a.y,
  44442. t[i++] = a.z
  44443. }
  44444. return this
  44445. },
  44446. copyVector4sArray: function(e) {
  44447. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  44448. var a = e[r];
  44449. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", r),
  44450. a = new n.Vector4),
  44451. t[i++] = a.x,
  44452. t[i++] = a.y,
  44453. t[i++] = a.z,
  44454. t[i++] = a.w
  44455. }
  44456. return this
  44457. },
  44458. set: function(e, t) {
  44459. return void 0 === t && (t = 0),
  44460. this.array.set(e, t),
  44461. this
  44462. },
  44463. getX: function(e) {
  44464. return this.array[e * this.itemSize]
  44465. },
  44466. setX: function(e, t) {
  44467. return this.array[e * this.itemSize] = t,
  44468. this
  44469. },
  44470. getY: function(e) {
  44471. return this.array[e * this.itemSize + 1]
  44472. },
  44473. setY: function(e, t) {
  44474. return this.array[e * this.itemSize + 1] = t,
  44475. this
  44476. },
  44477. getZ: function(e) {
  44478. return this.array[e * this.itemSize + 2]
  44479. },
  44480. setZ: function(e, t) {
  44481. return this.array[e * this.itemSize + 2] = t,
  44482. this
  44483. },
  44484. getW: function(e) {
  44485. return this.array[e * this.itemSize + 3]
  44486. },
  44487. setW: function(e, t) {
  44488. return this.array[e * this.itemSize + 3] = t,
  44489. this
  44490. },
  44491. setXY: function(e, t, i) {
  44492. return e *= this.itemSize,
  44493. this.array[e + 0] = t,
  44494. this.array[e + 1] = i,
  44495. this
  44496. },
  44497. setXYZ: function(e, t, i, n) {
  44498. return e *= this.itemSize,
  44499. this.array[e + 0] = t,
  44500. this.array[e + 1] = i,
  44501. this.array[e + 2] = n,
  44502. this
  44503. },
  44504. setXYZW: function(e, t, i, n, r) {
  44505. return e *= this.itemSize,
  44506. this.array[e + 0] = t,
  44507. this.array[e + 1] = i,
  44508. this.array[e + 2] = n,
  44509. this.array[e + 3] = r,
  44510. this
  44511. },
  44512. clone: function() {
  44513. return (new this.constructor).copy(this)
  44514. }
  44515. },
  44516. n.Int8Attribute = function(e, t) {
  44517. return new n.BufferAttribute(new Int8Array(e),t)
  44518. }
  44519. ,
  44520. n.Uint8Attribute = function(e, t) {
  44521. return new n.BufferAttribute(new Uint8Array(e),t)
  44522. }
  44523. ,
  44524. n.Uint8ClampedAttribute = function(e, t) {
  44525. return new n.BufferAttribute(new Uint8ClampedArray(e),t)
  44526. }
  44527. ,
  44528. n.Int16Attribute = function(e, t) {
  44529. return new n.BufferAttribute(new Int16Array(e),t)
  44530. }
  44531. ,
  44532. n.Uint16Attribute = function(e, t) {
  44533. return new n.BufferAttribute(new Uint16Array(e),t)
  44534. }
  44535. ;
  44536. n.Int32Attribute = function(e, t) {
  44537. return new n.BufferAttribute(new Int32Array(e),t)
  44538. }
  44539. ;
  44540. n.Uint32Attribute = function(e, t) {
  44541. return new n.BufferAttribute(new Uint32Array(e),t)
  44542. }
  44543. ,
  44544. n.Float32Attribute = function(e, t) {
  44545. return new n.BufferAttribute(new Float32Array(e),t)
  44546. }
  44547. ,
  44548. n.Float64Attribute = function(e, t) {
  44549. return new n.BufferAttribute(new Float64Array(e),t)
  44550. }
  44551. ,
  44552. n.DynamicBufferAttribute = function(e, t) {
  44553. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  44554. new n.BufferAttribute(e,t).setDynamic(!0)
  44555. }
  44556. ,
  44557. n.InstancedBufferAttribute = function(e, t, i) {
  44558. n.BufferAttribute.call(this, e, t),
  44559. this.meshPerAttribute = i || 1
  44560. }
  44561. ,
  44562. n.InstancedBufferAttribute.prototype = Object.create(n.BufferAttribute.prototype),
  44563. n.InstancedBufferAttribute.prototype.constructor = n.InstancedBufferAttribute,
  44564. n.InstancedBufferAttribute.prototype.copy = function(e) {
  44565. return n.BufferAttribute.prototype.copy.call(this, e),
  44566. this.meshPerAttribute = e.meshPerAttribute,
  44567. this
  44568. }
  44569. ,
  44570. n.InterleavedBuffer = function(e, t) {
  44571. this.uuid = n.Math.generateUUID(),
  44572. this.array = e,
  44573. this.stride = t,
  44574. this.dynamic = !1,
  44575. this.updateRange = {
  44576. offset: 0,
  44577. count: -1
  44578. },
  44579. this.version = 0
  44580. }
  44581. ,
  44582. n.InterleavedBuffer.prototype = {
  44583. constructor: n.InterleavedBuffer,
  44584. get length() {
  44585. return this.array.length
  44586. },
  44587. get count() {
  44588. return this.array.length / this.stride
  44589. },
  44590. set needsUpdate(e) {
  44591. e === !0 && this.version++
  44592. },
  44593. setDynamic: function(e) {
  44594. return this.dynamic = e,
  44595. this
  44596. },
  44597. copy: function(e) {
  44598. return this.array = new e.array.constructor(e.array),
  44599. this.stride = e.stride,
  44600. this.dynamic = e.dynamic,
  44601. this
  44602. },
  44603. copyAt: function(e, t, i) {
  44604. e *= this.stride,
  44605. i *= t.stride;
  44606. for (var n = 0, r = this.stride; n < r; n++)
  44607. this.array[e + n] = t.array[i + n];
  44608. return this
  44609. },
  44610. set: function(e, t) {
  44611. return void 0 === t && (t = 0),
  44612. this.array.set(e, t),
  44613. this
  44614. },
  44615. clone: function() {
  44616. return (new this.constructor).copy(this)
  44617. }
  44618. },
  44619. n.InstancedInterleavedBuffer = function(e, t, i) {
  44620. n.InterleavedBuffer.call(this, e, t),
  44621. this.meshPerAttribute = i || 1
  44622. }
  44623. ,
  44624. n.InstancedInterleavedBuffer.prototype = Object.create(n.InterleavedBuffer.prototype),
  44625. n.InstancedInterleavedBuffer.prototype.constructor = n.InstancedInterleavedBuffer,
  44626. n.InstancedInterleavedBuffer.prototype.copy = function(e) {
  44627. return n.InterleavedBuffer.prototype.copy.call(this, e),
  44628. this.meshPerAttribute = e.meshPerAttribute,
  44629. this
  44630. }
  44631. ,
  44632. n.InterleavedBufferAttribute = function(e, t, i) {
  44633. this.uuid = n.Math.generateUUID(),
  44634. this.data = e,
  44635. this.itemSize = t,
  44636. this.offset = i
  44637. }
  44638. ,
  44639. n.InterleavedBufferAttribute.prototype = {
  44640. constructor: n.InterleavedBufferAttribute,
  44641. get length() {
  44642. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  44643. this.array.length
  44644. },
  44645. get count() {
  44646. return this.data.count
  44647. },
  44648. setX: function(e, t) {
  44649. return this.data.array[e * this.data.stride + this.offset] = t,
  44650. this
  44651. },
  44652. setY: function(e, t) {
  44653. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  44654. this
  44655. },
  44656. setZ: function(e, t) {
  44657. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  44658. this
  44659. },
  44660. setW: function(e, t) {
  44661. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  44662. this
  44663. },
  44664. getX: function(e) {
  44665. return this.data.array[e * this.data.stride + this.offset]
  44666. },
  44667. getY: function(e) {
  44668. return this.data.array[e * this.data.stride + this.offset + 1]
  44669. },
  44670. getZ: function(e) {
  44671. return this.data.array[e * this.data.stride + this.offset + 2]
  44672. },
  44673. getW: function(e) {
  44674. return this.data.array[e * this.data.stride + this.offset + 3]
  44675. },
  44676. setXY: function(e, t, i) {
  44677. return e = e * this.data.stride + this.offset,
  44678. this.data.array[e + 0] = t,
  44679. this.data.array[e + 1] = i,
  44680. this
  44681. },
  44682. setXYZ: function(e, t, i, n) {
  44683. return e = e * this.data.stride + this.offset,
  44684. this.data.array[e + 0] = t,
  44685. this.data.array[e + 1] = i,
  44686. this.data.array[e + 2] = n,
  44687. this
  44688. },
  44689. setXYZW: function(e, t, i, n, r) {
  44690. return e = e * this.data.stride + this.offset,
  44691. this.data.array[e + 0] = t,
  44692. this.data.array[e + 1] = i,
  44693. this.data.array[e + 2] = n,
  44694. this.data.array[e + 3] = r,
  44695. this
  44696. }
  44697. },
  44698. n.Geometry = function() {
  44699. Object.defineProperty(this, "id", {
  44700. value: n.GeometryIdCount++
  44701. }),
  44702. this.uuid = n.Math.generateUUID(),
  44703. this.name = "",
  44704. this.type = "Geometry",
  44705. this.vertices = [],
  44706. this.colors = [],
  44707. this.faces = [],
  44708. this.faceVertexUvs = [[]],
  44709. this.morphTargets = [],
  44710. this.morphNormals = [],
  44711. this.skinWeights = [],
  44712. this.skinIndices = [],
  44713. this.lineDistances = [],
  44714. this.boundingBox = null,
  44715. this.boundingSphere = null,
  44716. this.verticesNeedUpdate = !1,
  44717. this.elementsNeedUpdate = !1,
  44718. this.uvsNeedUpdate = !1,
  44719. this.normalsNeedUpdate = !1,
  44720. this.colorsNeedUpdate = !1,
  44721. this.lineDistancesNeedUpdate = !1,
  44722. this.groupsNeedUpdate = !1
  44723. }
  44724. ,
  44725. n.Geometry.prototype = {
  44726. constructor: n.Geometry,
  44727. applyMatrix: function(e) {
  44728. for (var t = (new n.Matrix3).getNormalMatrix(e), i = 0, r = this.vertices.length; i < r; i++) {
  44729. var o = this.vertices[i];
  44730. o.applyMatrix4(e)
  44731. }
  44732. for (var i = 0, r = this.faces.length; i < r; i++) {
  44733. var a = this.faces[i];
  44734. a.normal.applyMatrix3(t).normalize();
  44735. for (var s = 0, l = a.vertexNormals.length; s < l; s++)
  44736. a.vertexNormals[s].applyMatrix3(t).normalize()
  44737. }
  44738. return null !== this.boundingBox && this.computeBoundingBox(),
  44739. null !== this.boundingSphere && this.computeBoundingSphere(),
  44740. this.verticesNeedUpdate = !0,
  44741. this.normalsNeedUpdate = !0,
  44742. this
  44743. },
  44744. rotateX: function() {
  44745. var e;
  44746. return function(t) {
  44747. return void 0 === e && (e = new n.Matrix4),
  44748. e.makeRotationX(t),
  44749. this.applyMatrix(e),
  44750. this
  44751. }
  44752. }(),
  44753. rotateY: function() {
  44754. var e;
  44755. return function(t) {
  44756. return void 0 === e && (e = new n.Matrix4),
  44757. e.makeRotationY(t),
  44758. this.applyMatrix(e),
  44759. this
  44760. }
  44761. }(),
  44762. rotateZ: function() {
  44763. var e;
  44764. return function(t) {
  44765. return void 0 === e && (e = new n.Matrix4),
  44766. e.makeRotationZ(t),
  44767. this.applyMatrix(e),
  44768. this
  44769. }
  44770. }(),
  44771. translate: function() {
  44772. var e;
  44773. return function(t, i, r) {
  44774. return void 0 === e && (e = new n.Matrix4),
  44775. e.makeTranslation(t, i, r),
  44776. this.applyMatrix(e),
  44777. this
  44778. }
  44779. }(),
  44780. scale: function() {
  44781. var e;
  44782. return function(t, i, r) {
  44783. return void 0 === e && (e = new n.Matrix4),
  44784. e.makeScale(t, i, r),
  44785. this.applyMatrix(e),
  44786. this
  44787. }
  44788. }(),
  44789. lookAt: function() {
  44790. var e;
  44791. return function(t) {
  44792. void 0 === e && (e = new n.Object3D),
  44793. e.lookAt(t),
  44794. e.updateMatrix(),
  44795. this.applyMatrix(e.matrix)
  44796. }
  44797. }(),
  44798. fromBufferGeometry: function(e) {
  44799. function t(e, t, r, o) {
  44800. var a = void 0 !== s ? [u[e].clone(), u[t].clone(), u[r].clone()] : []
  44801. , f = void 0 !== l ? [i.colors[e].clone(), i.colors[t].clone(), i.colors[r].clone()] : []
  44802. , g = new n.Face3(e,t,r,a,f,o);
  44803. i.faces.push(g),
  44804. void 0 !== c && i.faceVertexUvs[0].push([d[e].clone(), d[t].clone(), d[r].clone()]),
  44805. void 0 !== h && i.faceVertexUvs[1].push([p[e].clone(), p[t].clone(), p[r].clone()])
  44806. }
  44807. var i = this
  44808. , r = null !== e.index ? e.index.array : void 0
  44809. , o = e.attributes
  44810. , a = o.position.array
  44811. , s = void 0 !== o.normal ? o.normal.array : void 0
  44812. , l = void 0 !== o.color ? o.color.array : void 0
  44813. , c = void 0 !== o.uv ? o.uv.array : void 0
  44814. , h = void 0 !== o.uv2 ? o.uv2.array : void 0;
  44815. void 0 !== h && (this.faceVertexUvs[1] = []);
  44816. for (var u = [], d = [], p = [], f = 0, g = 0; f < a.length; f += 3,
  44817. g += 2)
  44818. i.vertices.push(new n.Vector3(a[f],a[f + 1],a[f + 2])),
  44819. void 0 !== s && u.push(new n.Vector3(s[f],s[f + 1],s[f + 2])),
  44820. void 0 !== l && i.colors.push(new n.Color(l[f],l[f + 1],l[f + 2])),
  44821. void 0 !== c && d.push(new n.Vector2(c[g],c[g + 1])),
  44822. void 0 !== h && p.push(new n.Vector2(h[g],h[g + 1]));
  44823. if (void 0 !== r) {
  44824. var m = e.groups;
  44825. if (m.length > 0)
  44826. for (var f = 0; f < m.length; f++)
  44827. for (var v = m[f], A = v.start, y = v.count, g = A, C = A + y; g < C; g += 3)
  44828. t(r[g], r[g + 1], r[g + 2], v.materialIndex);
  44829. else
  44830. for (var f = 0; f < r.length; f += 3)
  44831. t(r[f], r[f + 1], r[f + 2])
  44832. } else
  44833. for (var f = 0; f < a.length / 3; f += 3)
  44834. t(f, f + 1, f + 2);
  44835. return this.computeFaceNormals(),
  44836. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  44837. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  44838. this
  44839. },
  44840. center: function() {
  44841. this.computeBoundingBox();
  44842. var e = this.boundingBox.center().negate();
  44843. return this.translate(e.x, e.y, e.z),
  44844. e
  44845. },
  44846. normalize: function() {
  44847. this.computeBoundingSphere();
  44848. var e = this.boundingSphere.center
  44849. , t = this.boundingSphere.radius
  44850. , i = 0 === t ? 1 : 1 / t
  44851. , r = new n.Matrix4;
  44852. 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),
  44853. this.applyMatrix(r),
  44854. this
  44855. },
  44856. computeFaceNormals: function() {
  44857. for (var e = new n.Vector3, t = new n.Vector3, i = 0, r = this.faces.length; i < r; i++) {
  44858. var o = this.faces[i]
  44859. , a = this.vertices[o.a]
  44860. , s = this.vertices[o.b]
  44861. , l = this.vertices[o.c];
  44862. e.subVectors(l, s),
  44863. t.subVectors(a, s),
  44864. e.cross(t),
  44865. e.normalize(),
  44866. o.normal.copy(e)
  44867. }
  44868. },
  44869. computeVertexNormals: function(e) {
  44870. void 0 === e && (e = !0);
  44871. var t, i, r, o, a, s;
  44872. for (s = new Array(this.vertices.length),
  44873. t = 0,
  44874. i = this.vertices.length; t < i; t++)
  44875. s[t] = new n.Vector3;
  44876. if (e) {
  44877. var l, c, h, u = new n.Vector3, d = new n.Vector3;
  44878. for (r = 0,
  44879. o = this.faces.length; r < o; r++)
  44880. a = this.faces[r],
  44881. l = this.vertices[a.a],
  44882. c = this.vertices[a.b],
  44883. h = this.vertices[a.c],
  44884. u.subVectors(h, c),
  44885. d.subVectors(l, c),
  44886. u.cross(d),
  44887. s[a.a].add(u),
  44888. s[a.b].add(u),
  44889. s[a.c].add(u)
  44890. } else
  44891. for (r = 0,
  44892. o = this.faces.length; r < o; r++)
  44893. a = this.faces[r],
  44894. s[a.a].add(a.normal),
  44895. s[a.b].add(a.normal),
  44896. s[a.c].add(a.normal);
  44897. for (t = 0,
  44898. i = this.vertices.length; t < i; t++)
  44899. s[t].normalize();
  44900. for (r = 0,
  44901. o = this.faces.length; r < o; r++) {
  44902. a = this.faces[r];
  44903. var p = a.vertexNormals;
  44904. 3 === p.length ? (p[0].copy(s[a.a]),
  44905. p[1].copy(s[a.b]),
  44906. p[2].copy(s[a.c])) : (p[0] = s[a.a].clone(),
  44907. p[1] = s[a.b].clone(),
  44908. p[2] = s[a.c].clone())
  44909. }
  44910. this.faces.length > 0 && (this.normalsNeedUpdate = !0)
  44911. },
  44912. computeMorphNormals: function() {
  44913. var e, t, i, r, o;
  44914. for (i = 0,
  44915. r = this.faces.length; i < r; i++)
  44916. for (o = this.faces[i],
  44917. o.__originalFaceNormal ? o.__originalFaceNormal.copy(o.normal) : o.__originalFaceNormal = o.normal.clone(),
  44918. o.__originalVertexNormals || (o.__originalVertexNormals = []),
  44919. e = 0,
  44920. t = o.vertexNormals.length; e < t; e++)
  44921. o.__originalVertexNormals[e] ? o.__originalVertexNormals[e].copy(o.vertexNormals[e]) : o.__originalVertexNormals[e] = o.vertexNormals[e].clone();
  44922. var a = new n.Geometry;
  44923. for (a.faces = this.faces,
  44924. e = 0,
  44925. t = this.morphTargets.length; e < t; e++) {
  44926. if (!this.morphNormals[e]) {
  44927. this.morphNormals[e] = {},
  44928. this.morphNormals[e].faceNormals = [],
  44929. this.morphNormals[e].vertexNormals = [];
  44930. var s, l, c = this.morphNormals[e].faceNormals, h = this.morphNormals[e].vertexNormals;
  44931. for (i = 0,
  44932. r = this.faces.length; i < r; i++)
  44933. s = new n.Vector3,
  44934. l = {
  44935. a: new n.Vector3,
  44936. b: new n.Vector3,
  44937. c: new n.Vector3
  44938. },
  44939. c.push(s),
  44940. h.push(l)
  44941. }
  44942. var u = this.morphNormals[e];
  44943. a.vertices = this.morphTargets[e].vertices,
  44944. a.computeFaceNormals(),
  44945. a.computeVertexNormals();
  44946. var s, l;
  44947. for (i = 0,
  44948. r = this.faces.length; i < r; i++)
  44949. o = this.faces[i],
  44950. s = u.faceNormals[i],
  44951. l = u.vertexNormals[i],
  44952. s.copy(o.normal),
  44953. l.a.copy(o.vertexNormals[0]),
  44954. l.b.copy(o.vertexNormals[1]),
  44955. l.c.copy(o.vertexNormals[2])
  44956. }
  44957. for (i = 0,
  44958. r = this.faces.length; i < r; i++)
  44959. o = this.faces[i],
  44960. o.normal = o.__originalFaceNormal,
  44961. o.vertexNormals = o.__originalVertexNormals
  44962. },
  44963. computeTangents: function() {
  44964. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  44965. },
  44966. computeLineDistances: function() {
  44967. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  44968. i > 0 && (e += t[i].distanceTo(t[i - 1])),
  44969. this.lineDistances[i] = e
  44970. },
  44971. computeBoundingBox: function() {
  44972. null === this.boundingBox && (this.boundingBox = new n.Box3),
  44973. this.boundingBox.setFromPoints(this.vertices)
  44974. },
  44975. computeBoundingSphere: function() {
  44976. null === this.boundingSphere && (this.boundingSphere = new n.Sphere),
  44977. this.boundingSphere.setFromPoints(this.vertices)
  44978. },
  44979. merge: function(e, t, i) {
  44980. if (e instanceof n.Geometry == !1)
  44981. return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e);
  44982. 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];
  44983. void 0 === i && (i = 0),
  44984. void 0 !== t && (r = (new n.Matrix3).getNormalMatrix(t));
  44985. for (var d = 0, p = s.length; d < p; d++) {
  44986. var f = s[d]
  44987. , g = f.clone();
  44988. void 0 !== t && g.applyMatrix4(t),
  44989. a.push(g)
  44990. }
  44991. for (d = 0,
  44992. p = c.length; d < p; d++) {
  44993. var m, v, A, y = c[d], C = y.vertexNormals, I = y.vertexColors;
  44994. m = new n.Face3(y.a + o,y.b + o,y.c + o),
  44995. m.normal.copy(y.normal),
  44996. void 0 !== r && m.normal.applyMatrix3(r).normalize();
  44997. for (var E = 0, b = C.length; E < b; E++)
  44998. v = C[E].clone(),
  44999. void 0 !== r && v.applyMatrix3(r).normalize(),
  45000. m.vertexNormals.push(v);
  45001. m.color.copy(y.color);
  45002. for (var E = 0, b = I.length; E < b; E++)
  45003. A = I[E],
  45004. m.vertexColors.push(A.clone());
  45005. m.materialIndex = y.materialIndex + i,
  45006. l.push(m)
  45007. }
  45008. for (d = 0,
  45009. p = u.length; d < p; d++) {
  45010. var w = u[d]
  45011. , _ = [];
  45012. if (void 0 !== w) {
  45013. for (var E = 0, b = w.length; E < b; E++)
  45014. _.push(w[E].clone());
  45015. h.push(_)
  45016. }
  45017. }
  45018. },
  45019. mergeMesh: function(e) {
  45020. return e instanceof n.Mesh == !1 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  45021. void this.merge(e.geometry, e.matrix))
  45022. },
  45023. mergeVertices: function() {
  45024. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = 4, d = Math.pow(10, u);
  45025. for (i = 0,
  45026. n = this.vertices.length; i < n; i++)
  45027. e = this.vertices[i],
  45028. t = Math.round(e.x * d) + "_" + Math.round(e.y * d) + "_" + Math.round(e.z * d),
  45029. void 0 === l[t] ? (l[t] = i,
  45030. c.push(this.vertices[i]),
  45031. h[i] = c.length - 1) : h[i] = h[l[t]];
  45032. var p = [];
  45033. for (i = 0,
  45034. n = this.faces.length; i < n; i++) {
  45035. r = this.faces[i],
  45036. r.a = h[r.a],
  45037. r.b = h[r.b],
  45038. r.c = h[r.c],
  45039. o = [r.a, r.b, r.c];
  45040. for (var f = -1, g = 0; g < 3; g++)
  45041. if (o[g] === o[(g + 1) % 3]) {
  45042. f = g,
  45043. p.push(i);
  45044. break
  45045. }
  45046. }
  45047. for (i = p.length - 1; i >= 0; i--) {
  45048. var m = p[i];
  45049. for (this.faces.splice(m, 1),
  45050. a = 0,
  45051. s = this.faceVertexUvs.length; a < s; a++)
  45052. this.faceVertexUvs[a].splice(m, 1)
  45053. }
  45054. var v = this.vertices.length - c.length;
  45055. return this.vertices = c,
  45056. v
  45057. },
  45058. sortFacesByMaterialIndex: function() {
  45059. function e(e, t) {
  45060. return e.materialIndex - t.materialIndex
  45061. }
  45062. for (var t = this.faces, i = t.length, n = 0; n < i; n++)
  45063. t[n]._id = n;
  45064. t.sort(e);
  45065. var r, o, a = this.faceVertexUvs[0], s = this.faceVertexUvs[1];
  45066. a && a.length === i && (r = []),
  45067. s && s.length === i && (o = []);
  45068. for (var n = 0; n < i; n++) {
  45069. var l = t[n]._id;
  45070. r && r.push(a[l]),
  45071. o && o.push(s[l])
  45072. }
  45073. r && (this.faceVertexUvs[0] = r),
  45074. o && (this.faceVertexUvs[1] = o)
  45075. },
  45076. toJSON: function() {
  45077. function e(e, t, i) {
  45078. return i ? e | 1 << t : e & ~(1 << t)
  45079. }
  45080. function t(e) {
  45081. var t = e.x.toString() + e.y.toString() + e.z.toString();
  45082. return void 0 !== d[t] ? d[t] : (d[t] = u.length / 3,
  45083. u.push(e.x, e.y, e.z),
  45084. d[t])
  45085. }
  45086. function i(e) {
  45087. var t = e.r.toString() + e.g.toString() + e.b.toString();
  45088. return void 0 !== f[t] ? f[t] : (f[t] = p.length,
  45089. p.push(e.getHex()),
  45090. f[t])
  45091. }
  45092. function n(e) {
  45093. var t = e.x.toString() + e.y.toString();
  45094. return void 0 !== m[t] ? m[t] : (m[t] = g.length / 2,
  45095. g.push(e.x, e.y),
  45096. m[t])
  45097. }
  45098. var r = {
  45099. metadata: {
  45100. version: 4.4,
  45101. type: "Geometry",
  45102. generator: "Geometry.toJSON"
  45103. }
  45104. };
  45105. if (r.uuid = this.uuid,
  45106. r.type = this.type,
  45107. "" !== this.name && (r.name = this.name),
  45108. void 0 !== this.parameters) {
  45109. var o = this.parameters;
  45110. for (var a in o)
  45111. void 0 !== o[a] && (r[a] = o[a]);
  45112. return r
  45113. }
  45114. for (var s = [], l = 0; l < this.vertices.length; l++) {
  45115. var c = this.vertices[l];
  45116. s.push(c.x, c.y, c.z)
  45117. }
  45118. for (var h = [], u = [], d = {}, p = [], f = {}, g = [], m = {}, l = 0; l < this.faces.length; l++) {
  45119. var v = this.faces[l]
  45120. , A = !0
  45121. , y = !1
  45122. , C = void 0 !== this.faceVertexUvs[0][l]
  45123. , I = v.normal.length() > 0
  45124. , E = v.vertexNormals.length > 0
  45125. , b = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  45126. , w = v.vertexColors.length > 0
  45127. , _ = 0;
  45128. if (_ = e(_, 0, 0),
  45129. _ = e(_, 1, A),
  45130. _ = e(_, 2, y),
  45131. _ = e(_, 3, C),
  45132. _ = e(_, 4, I),
  45133. _ = e(_, 5, E),
  45134. _ = e(_, 6, b),
  45135. _ = e(_, 7, w),
  45136. h.push(_),
  45137. h.push(v.a, v.b, v.c),
  45138. h.push(v.materialIndex),
  45139. C) {
  45140. var T = this.faceVertexUvs[0][l];
  45141. h.push(n(T[0]), n(T[1]), n(T[2]))
  45142. }
  45143. if (I && h.push(t(v.normal)),
  45144. E) {
  45145. var x = v.vertexNormals;
  45146. h.push(t(x[0]), t(x[1]), t(x[2]))
  45147. }
  45148. if (b && h.push(i(v.color)),
  45149. w) {
  45150. var S = v.vertexColors;
  45151. h.push(i(S[0]), i(S[1]), i(S[2]))
  45152. }
  45153. }
  45154. return r.data = {},
  45155. r.data.vertices = s,
  45156. r.data.normals = u,
  45157. p.length > 0 && (r.data.colors = p),
  45158. g.length > 0 && (r.data.uvs = [g]),
  45159. r.data.faces = h,
  45160. r
  45161. },
  45162. clone: function() {
  45163. return (new n.Geometry).copy(this)
  45164. },
  45165. copy: function(e) {
  45166. this.vertices = [],
  45167. this.faces = [],
  45168. this.faceVertexUvs = [[]];
  45169. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  45170. this.vertices.push(t[i].clone());
  45171. for (var r = e.faces, i = 0, n = r.length; i < n; i++)
  45172. this.faces.push(r[i].clone());
  45173. for (var i = 0, n = e.faceVertexUvs.length; i < n; i++) {
  45174. var o = e.faceVertexUvs[i];
  45175. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  45176. for (var a = 0, s = o.length; a < s; a++) {
  45177. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  45178. var d = l[h];
  45179. c.push(d.clone())
  45180. }
  45181. this.faceVertexUvs[i].push(c)
  45182. }
  45183. }
  45184. return this
  45185. },
  45186. dispose: function() {
  45187. this.dispatchEvent({
  45188. type: "dispose"
  45189. })
  45190. }
  45191. },
  45192. n.EventDispatcher.prototype.apply(n.Geometry.prototype),
  45193. n.GeometryIdCount = 0,
  45194. n.DirectGeometry = function() {
  45195. Object.defineProperty(this, "id", {
  45196. value: n.GeometryIdCount++
  45197. }),
  45198. this.uuid = n.Math.generateUUID(),
  45199. this.name = "",
  45200. this.type = "DirectGeometry",
  45201. this.indices = [],
  45202. this.vertices = [],
  45203. this.normals = [],
  45204. this.colors = [],
  45205. this.uvs = [],
  45206. this.uvs2 = [],
  45207. this.groups = [],
  45208. this.morphTargets = {},
  45209. this.skinWeights = [],
  45210. this.skinIndices = [],
  45211. this.boundingBox = null,
  45212. this.boundingSphere = null,
  45213. this.verticesNeedUpdate = !1,
  45214. this.normalsNeedUpdate = !1,
  45215. this.colorsNeedUpdate = !1,
  45216. this.uvsNeedUpdate = !1,
  45217. this.groupsNeedUpdate = !1
  45218. }
  45219. ,
  45220. n.DirectGeometry.prototype = {
  45221. constructor: n.DirectGeometry,
  45222. computeBoundingBox: n.Geometry.prototype.computeBoundingBox,
  45223. computeBoundingSphere: n.Geometry.prototype.computeBoundingSphere,
  45224. computeFaceNormals: function() {
  45225. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  45226. },
  45227. computeVertexNormals: function() {
  45228. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  45229. },
  45230. computeGroups: function(e) {
  45231. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  45232. var a = r[o];
  45233. a.materialIndex !== i && (i = a.materialIndex,
  45234. void 0 !== t && (t.count = 3 * o - t.start,
  45235. n.push(t)),
  45236. t = {
  45237. start: 3 * o,
  45238. materialIndex: i
  45239. })
  45240. }
  45241. void 0 !== t && (t.count = 3 * o - t.start,
  45242. n.push(t)),
  45243. this.groups = n
  45244. },
  45245. fromGeometry: function(e) {
  45246. 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;
  45247. if (c > 0) {
  45248. t = [];
  45249. for (var h = 0; h < c; h++)
  45250. t[h] = [];
  45251. this.morphTargets.position = t
  45252. }
  45253. var u, d = e.morphNormals, p = d.length;
  45254. if (p > 0) {
  45255. u = [];
  45256. for (var h = 0; h < p; h++)
  45257. u[h] = [];
  45258. this.morphTargets.normal = u
  45259. }
  45260. for (var f = e.skinIndices, g = e.skinWeights, m = f.length === r.length, v = g.length === r.length, h = 0; h < i.length; h++) {
  45261. var A = i[h];
  45262. this.vertices.push(r[A.a], r[A.b], r[A.c]);
  45263. var y = A.vertexNormals;
  45264. if (3 === y.length)
  45265. this.normals.push(y[0], y[1], y[2]);
  45266. else {
  45267. var C = A.normal;
  45268. this.normals.push(C, C, C)
  45269. }
  45270. var I = A.vertexColors;
  45271. if (3 === I.length)
  45272. this.colors.push(I[0], I[1], I[2]);
  45273. else {
  45274. var E = A.color;
  45275. this.colors.push(E, E, E)
  45276. }
  45277. if (a === !0) {
  45278. var b = o[0][h];
  45279. void 0 !== b ? this.uvs.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", h),
  45280. this.uvs.push(new n.Vector2, new n.Vector2, new n.Vector2))
  45281. }
  45282. if (s === !0) {
  45283. var b = o[1][h];
  45284. void 0 !== b ? this.uvs2.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", h),
  45285. this.uvs2.push(new n.Vector2, new n.Vector2, new n.Vector2))
  45286. }
  45287. for (var w = 0; w < c; w++) {
  45288. var _ = l[w].vertices;
  45289. t[w].push(_[A.a], _[A.b], _[A.c])
  45290. }
  45291. for (var w = 0; w < p; w++) {
  45292. var T = d[w].vertexNormals[h];
  45293. u[w].push(T.a, T.b, T.c)
  45294. }
  45295. m && this.skinIndices.push(f[A.a], f[A.b], f[A.c]),
  45296. v && this.skinWeights.push(g[A.a], g[A.b], g[A.c])
  45297. }
  45298. return this.computeGroups(e),
  45299. this.verticesNeedUpdate = e.verticesNeedUpdate,
  45300. this.normalsNeedUpdate = e.normalsNeedUpdate,
  45301. this.colorsNeedUpdate = e.colorsNeedUpdate,
  45302. this.uvsNeedUpdate = e.uvsNeedUpdate,
  45303. this.groupsNeedUpdate = e.groupsNeedUpdate,
  45304. this
  45305. },
  45306. dispose: function() {
  45307. this.dispatchEvent({
  45308. type: "dispose"
  45309. })
  45310. }
  45311. },
  45312. n.EventDispatcher.prototype.apply(n.DirectGeometry.prototype),
  45313. n.BufferGeometry = function() {
  45314. Object.defineProperty(this, "id", {
  45315. value: n.GeometryIdCount++
  45316. }),
  45317. this.uuid = n.Math.generateUUID(),
  45318. this.name = "",
  45319. this.type = "BufferGeometry",
  45320. this.index = null,
  45321. this.attributes = {},
  45322. this.morphAttributes = {},
  45323. this.groups = [],
  45324. this.boundingBox = null,
  45325. this.boundingSphere = null,
  45326. this.drawRange = {
  45327. start: 0,
  45328. count: 1 / 0
  45329. }
  45330. }
  45331. ,
  45332. n.BufferGeometry.prototype = {
  45333. constructor: n.BufferGeometry,
  45334. getIndex: function() {
  45335. return this.index
  45336. },
  45337. setIndex: function(e) {
  45338. this.index = e
  45339. },
  45340. addAttribute: function(e, t) {
  45341. return t instanceof n.BufferAttribute == !1 && t instanceof n.InterleavedBufferAttribute == !1 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  45342. void this.addAttribute(e, new n.BufferAttribute(arguments[1],arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  45343. void this.setIndex(t)) : (this.attributes[e] = t,
  45344. this)
  45345. },
  45346. getAttribute: function(e) {
  45347. return this.attributes[e]
  45348. },
  45349. removeAttribute: function(e) {
  45350. return delete this.attributes[e],
  45351. this
  45352. },
  45353. addGroup: function(e, t, i) {
  45354. this.groups.push({
  45355. start: e,
  45356. count: t,
  45357. materialIndex: void 0 !== i ? i : 0
  45358. })
  45359. },
  45360. clearGroups: function() {
  45361. this.groups = []
  45362. },
  45363. setDrawRange: function(e, t) {
  45364. this.drawRange.start = e,
  45365. this.drawRange.count = t
  45366. },
  45367. applyMatrix: function(e) {
  45368. var t = this.attributes.position;
  45369. void 0 !== t && (e.applyToVector3Array(t.array),
  45370. t.needsUpdate = !0);
  45371. var i = this.attributes.normal;
  45372. if (void 0 !== i) {
  45373. var r = (new n.Matrix3).getNormalMatrix(e);
  45374. r.applyToVector3Array(i.array),
  45375. i.needsUpdate = !0
  45376. }
  45377. return null !== this.boundingBox && this.computeBoundingBox(),
  45378. null !== this.boundingSphere && this.computeBoundingSphere(),
  45379. this
  45380. },
  45381. rotateX: function() {
  45382. var e;
  45383. return function(t) {
  45384. return void 0 === e && (e = new n.Matrix4),
  45385. e.makeRotationX(t),
  45386. this.applyMatrix(e),
  45387. this
  45388. }
  45389. }(),
  45390. rotateY: function() {
  45391. var e;
  45392. return function(t) {
  45393. return void 0 === e && (e = new n.Matrix4),
  45394. e.makeRotationY(t),
  45395. this.applyMatrix(e),
  45396. this
  45397. }
  45398. }(),
  45399. rotateZ: function() {
  45400. var e;
  45401. return function(t) {
  45402. return void 0 === e && (e = new n.Matrix4),
  45403. e.makeRotationZ(t),
  45404. this.applyMatrix(e),
  45405. this
  45406. }
  45407. }(),
  45408. translate: function() {
  45409. var e;
  45410. return function(t, i, r) {
  45411. return void 0 === e && (e = new n.Matrix4),
  45412. e.makeTranslation(t, i, r),
  45413. this.applyMatrix(e),
  45414. this
  45415. }
  45416. }(),
  45417. scale: function() {
  45418. var e;
  45419. return function(t, i, r) {
  45420. return void 0 === e && (e = new n.Matrix4),
  45421. e.makeScale(t, i, r),
  45422. this.applyMatrix(e),
  45423. this
  45424. }
  45425. }(),
  45426. lookAt: function() {
  45427. var e;
  45428. return function(t) {
  45429. void 0 === e && (e = new n.Object3D),
  45430. e.lookAt(t),
  45431. e.updateMatrix(),
  45432. this.applyMatrix(e.matrix)
  45433. }
  45434. }(),
  45435. center: function() {
  45436. this.computeBoundingBox();
  45437. var e = this.boundingBox.center().negate();
  45438. return this.translate(e.x, e.y, e.z),
  45439. e
  45440. },
  45441. setFromObject: function(e) {
  45442. var t = e.geometry;
  45443. if (e instanceof n.Points || e instanceof n.Line) {
  45444. var i = new n.Float32Attribute(3 * t.vertices.length,3)
  45445. , r = new n.Float32Attribute(3 * t.colors.length,3);
  45446. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  45447. this.addAttribute("color", r.copyColorsArray(t.colors)),
  45448. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  45449. var o = new n.Float32Attribute(t.lineDistances.length,1);
  45450. this.addAttribute("lineDistance", o.copyArray(t.lineDistances))
  45451. }
  45452. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  45453. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  45454. } else
  45455. e instanceof n.Mesh && t instanceof n.Geometry && this.fromGeometry(t);
  45456. return this
  45457. },
  45458. updateFromObject: function(e) {
  45459. var t = e.geometry;
  45460. if (e instanceof n.Mesh) {
  45461. var i = t.__directGeometry;
  45462. if (void 0 === i)
  45463. return this.fromGeometry(t);
  45464. i.verticesNeedUpdate = t.verticesNeedUpdate,
  45465. i.normalsNeedUpdate = t.normalsNeedUpdate,
  45466. i.colorsNeedUpdate = t.colorsNeedUpdate,
  45467. i.uvsNeedUpdate = t.uvsNeedUpdate,
  45468. i.groupsNeedUpdate = t.groupsNeedUpdate,
  45469. t.verticesNeedUpdate = !1,
  45470. t.normalsNeedUpdate = !1,
  45471. t.colorsNeedUpdate = !1,
  45472. t.uvsNeedUpdate = !1,
  45473. t.groupsNeedUpdate = !1,
  45474. t = i
  45475. }
  45476. if (t.verticesNeedUpdate === !0) {
  45477. var r = this.attributes.position;
  45478. void 0 !== r && (r.copyVector3sArray(t.vertices),
  45479. r.needsUpdate = !0),
  45480. t.verticesNeedUpdate = !1
  45481. }
  45482. if (t.normalsNeedUpdate === !0) {
  45483. var r = this.attributes.normal;
  45484. void 0 !== r && (r.copyVector3sArray(t.normals),
  45485. r.needsUpdate = !0),
  45486. t.normalsNeedUpdate = !1
  45487. }
  45488. if (t.colorsNeedUpdate === !0) {
  45489. var r = this.attributes.color;
  45490. void 0 !== r && (r.copyColorsArray(t.colors),
  45491. r.needsUpdate = !0),
  45492. t.colorsNeedUpdate = !1
  45493. }
  45494. if (t.uvsNeedUpdate) {
  45495. var r = this.attributes.uv;
  45496. void 0 !== r && (r.copyVector2sArray(t.uvs),
  45497. r.needsUpdate = !0),
  45498. t.uvsNeedUpdate = !1
  45499. }
  45500. if (t.lineDistancesNeedUpdate) {
  45501. var r = this.attributes.lineDistance;
  45502. void 0 !== r && (r.copyArray(t.lineDistances),
  45503. r.needsUpdate = !0),
  45504. t.lineDistancesNeedUpdate = !1
  45505. }
  45506. return t.groupsNeedUpdate && (t.computeGroups(e.geometry),
  45507. this.groups = t.groups,
  45508. t.groupsNeedUpdate = !1),
  45509. this
  45510. },
  45511. fromGeometry: function(e) {
  45512. return e.__directGeometry = (new n.DirectGeometry).fromGeometry(e),
  45513. this.fromDirectGeometry(e.__directGeometry)
  45514. },
  45515. fromDirectGeometry: function(e) {
  45516. var t = new Float32Array(3 * e.vertices.length);
  45517. if (this.addAttribute("position", new n.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  45518. e.normals.length > 0) {
  45519. var i = new Float32Array(3 * e.normals.length);
  45520. this.addAttribute("normal", new n.BufferAttribute(i,3).copyVector3sArray(e.normals))
  45521. }
  45522. if (e.colors.length > 0) {
  45523. var r = new Float32Array(3 * e.colors.length);
  45524. this.addAttribute("color", new n.BufferAttribute(r,3).copyColorsArray(e.colors))
  45525. }
  45526. if (e.uvs.length > 0) {
  45527. var o = new Float32Array(2 * e.uvs.length);
  45528. this.addAttribute("uv", new n.BufferAttribute(o,2).copyVector2sArray(e.uvs))
  45529. }
  45530. if (e.uvs2.length > 0) {
  45531. var a = new Float32Array(2 * e.uvs2.length);
  45532. this.addAttribute("uv2", new n.BufferAttribute(a,2).copyVector2sArray(e.uvs2))
  45533. }
  45534. if (e.indices.length > 0) {
  45535. var s = e.vertices.length > 65535 ? Uint32Array : Uint16Array
  45536. , l = new s(3 * e.indices.length);
  45537. this.setIndex(new n.BufferAttribute(l,1).copyIndicesArray(e.indices))
  45538. }
  45539. this.groups = e.groups;
  45540. for (var c in e.morphTargets) {
  45541. for (var h = [], u = e.morphTargets[c], d = 0, p = u.length; d < p; d++) {
  45542. var f = u[d]
  45543. , g = new n.Float32Attribute(3 * f.length,3);
  45544. h.push(g.copyVector3sArray(f))
  45545. }
  45546. this.morphAttributes[c] = h
  45547. }
  45548. if (e.skinIndices.length > 0) {
  45549. var m = new n.Float32Attribute(4 * e.skinIndices.length,4);
  45550. this.addAttribute("skinIndex", m.copyVector4sArray(e.skinIndices))
  45551. }
  45552. if (e.skinWeights.length > 0) {
  45553. var v = new n.Float32Attribute(4 * e.skinWeights.length,4);
  45554. this.addAttribute("skinWeight", v.copyVector4sArray(e.skinWeights))
  45555. }
  45556. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  45557. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  45558. this
  45559. },
  45560. computeBoundingBox: function() {
  45561. new n.Vector3;
  45562. return function() {
  45563. null === this.boundingBox && (this.boundingBox = new n.Box3);
  45564. var e = this.attributes.position.array;
  45565. e && this.boundingBox.setFromArray(e),
  45566. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  45567. this.boundingBox.max.set(0, 0, 0)),
  45568. (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)
  45569. }
  45570. }(),
  45571. computeBoundingSphere: function() {
  45572. var e = new n.Box3
  45573. , t = new n.Vector3;
  45574. return function() {
  45575. null === this.boundingSphere && (this.boundingSphere = new n.Sphere);
  45576. var i = this.attributes.position.array;
  45577. if (i) {
  45578. var r = this.boundingSphere.center;
  45579. e.setFromArray(i),
  45580. e.center(r);
  45581. for (var o = 0, a = 0, s = i.length; a < s; a += 3)
  45582. t.fromArray(i, a),
  45583. o = Math.max(o, r.distanceToSquared(t));
  45584. this.boundingSphere.radius = Math.sqrt(o),
  45585. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  45586. }
  45587. }
  45588. }(),
  45589. computeFaceNormals: function() {},
  45590. computeVertexNormals: function() {
  45591. var e = this.index
  45592. , t = this.attributes
  45593. , i = this.groups;
  45594. if (t.position) {
  45595. var r = t.position.array;
  45596. if (void 0 === t.normal)
  45597. this.addAttribute("normal", new n.BufferAttribute(new Float32Array(r.length),3));
  45598. else
  45599. for (var o = t.normal.array, a = 0, s = o.length; a < s; a++)
  45600. o[a] = 0;
  45601. 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;
  45602. if (e) {
  45603. var v = e.array;
  45604. 0 === i.length && this.addGroup(0, v.length);
  45605. for (var A = 0, y = i.length; A < y; ++A)
  45606. for (var C = i[A], I = C.start, E = C.count, a = I, s = I + E; a < s; a += 3)
  45607. l = 3 * v[a + 0],
  45608. c = 3 * v[a + 1],
  45609. h = 3 * v[a + 2],
  45610. d.fromArray(r, l),
  45611. p.fromArray(r, c),
  45612. f.fromArray(r, h),
  45613. g.subVectors(f, p),
  45614. m.subVectors(d, p),
  45615. g.cross(m),
  45616. u[l] += g.x,
  45617. u[l + 1] += g.y,
  45618. u[l + 2] += g.z,
  45619. u[c] += g.x,
  45620. u[c + 1] += g.y,
  45621. u[c + 2] += g.z,
  45622. u[h] += g.x,
  45623. u[h + 1] += g.y,
  45624. u[h + 2] += g.z
  45625. } else
  45626. for (var a = 0, s = r.length; a < s; a += 9)
  45627. d.fromArray(r, a),
  45628. p.fromArray(r, a + 3),
  45629. f.fromArray(r, a + 6),
  45630. g.subVectors(f, p),
  45631. m.subVectors(d, p),
  45632. g.cross(m),
  45633. u[a] = g.x,
  45634. u[a + 1] = g.y,
  45635. u[a + 2] = g.z,
  45636. u[a + 3] = g.x,
  45637. u[a + 4] = g.y,
  45638. u[a + 5] = g.z,
  45639. u[a + 6] = g.x,
  45640. u[a + 7] = g.y,
  45641. u[a + 8] = g.z;
  45642. this.normalizeNormals(),
  45643. t.normal.needsUpdate = !0
  45644. }
  45645. },
  45646. merge: function(e, t) {
  45647. if (e instanceof n.BufferGeometry == !1)
  45648. return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e);
  45649. void 0 === t && (t = 0);
  45650. var i = this.attributes;
  45651. for (var r in i)
  45652. if (void 0 !== e.attributes[r])
  45653. 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++,
  45654. u++)
  45655. a[u] = l[h];
  45656. return this
  45657. },
  45658. normalizeNormals: function() {
  45659. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  45660. e = r[o],
  45661. t = r[o + 1],
  45662. i = r[o + 2],
  45663. n = 1 / Math.sqrt(e * e + t * t + i * i),
  45664. r[o] *= n,
  45665. r[o + 1] *= n,
  45666. r[o + 2] *= n
  45667. },
  45668. toNonIndexed: function() {
  45669. if (null === this.index)
  45670. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  45671. this;
  45672. var e = new n.BufferGeometry
  45673. , t = this.index.array
  45674. , i = this.attributes;
  45675. for (var r in i) {
  45676. 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++) {
  45677. c = t[u] * s;
  45678. for (var p = 0; p < s; p++)
  45679. l[h++] = a[c++]
  45680. }
  45681. e.addAttribute(r, new n.BufferAttribute(l,s))
  45682. }
  45683. return e
  45684. },
  45685. toJSON: function() {
  45686. var e = {
  45687. metadata: {
  45688. version: 4.4,
  45689. type: "BufferGeometry",
  45690. generator: "BufferGeometry.toJSON"
  45691. }
  45692. };
  45693. if (e.uuid = this.uuid,
  45694. e.type = this.type,
  45695. "" !== this.name && (e.name = this.name),
  45696. void 0 !== this.parameters) {
  45697. var t = this.parameters;
  45698. for (var i in t)
  45699. void 0 !== t[i] && (e[i] = t[i]);
  45700. return e
  45701. }
  45702. e.data = {
  45703. attributes: {}
  45704. };
  45705. var n = this.index;
  45706. if (null !== n) {
  45707. var r = Array.prototype.slice.call(n.array);
  45708. e.data.index = {
  45709. type: n.array.constructor.name,
  45710. array: r
  45711. }
  45712. }
  45713. var o = this.attributes;
  45714. for (var i in o) {
  45715. var a = o[i]
  45716. , r = Array.prototype.slice.call(a.array);
  45717. e.data.attributes[i] = {
  45718. itemSize: a.itemSize,
  45719. type: a.array.constructor.name,
  45720. array: r
  45721. }
  45722. }
  45723. var s = this.groups;
  45724. s.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(s)));
  45725. var l = this.boundingSphere;
  45726. return null !== l && (e.data.boundingSphere = {
  45727. center: l.center.toArray(),
  45728. radius: l.radius
  45729. }),
  45730. e
  45731. },
  45732. clone: function() {
  45733. return (new n.BufferGeometry).copy(this)
  45734. },
  45735. copy: function(e) {
  45736. var t = e.index;
  45737. null !== t && this.setIndex(t.clone());
  45738. var i = e.attributes;
  45739. for (var n in i) {
  45740. var r = i[n];
  45741. this.addAttribute(n, r.clone())
  45742. }
  45743. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  45744. var l = o[a];
  45745. this.addGroup(l.start, l.count)
  45746. }
  45747. return this
  45748. },
  45749. dispose: function() {
  45750. this.dispatchEvent({
  45751. type: "dispose"
  45752. })
  45753. }
  45754. },
  45755. n.EventDispatcher.prototype.apply(n.BufferGeometry.prototype),
  45756. n.BufferGeometry.MaxIndex = 65535,
  45757. n.InstancedBufferGeometry = function() {
  45758. n.BufferGeometry.call(this),
  45759. this.type = "InstancedBufferGeometry",
  45760. this.maxInstancedCount = void 0
  45761. }
  45762. ,
  45763. n.InstancedBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  45764. n.InstancedBufferGeometry.prototype.constructor = n.InstancedBufferGeometry,
  45765. n.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  45766. this.groups.push({
  45767. start: e,
  45768. count: t,
  45769. instances: i
  45770. })
  45771. }
  45772. ,
  45773. n.InstancedBufferGeometry.prototype.copy = function(e) {
  45774. var t = e.index;
  45775. null !== t && this.setIndex(t.clone());
  45776. var i = e.attributes;
  45777. for (var n in i) {
  45778. var r = i[n];
  45779. this.addAttribute(n, r.clone())
  45780. }
  45781. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  45782. var l = o[a];
  45783. this.addGroup(l.start, l.count, l.instances)
  45784. }
  45785. return this
  45786. }
  45787. ,
  45788. n.EventDispatcher.prototype.apply(n.InstancedBufferGeometry.prototype),
  45789. n.Uniform = function(e, t) {
  45790. this.type = e,
  45791. this.value = t,
  45792. this.dynamic = !1
  45793. }
  45794. ,
  45795. n.Uniform.prototype = {
  45796. constructor: n.Uniform,
  45797. onUpdate: function(e) {
  45798. return this.dynamic = !0,
  45799. this.onUpdateCallback = e,
  45800. this
  45801. }
  45802. },
  45803. n.AnimationClip = function(e, t, i) {
  45804. this.name = e || n.Math.generateUUID(),
  45805. this.tracks = i,
  45806. this.duration = void 0 !== t ? t : -1,
  45807. this.duration < 0 && this.resetDuration(),
  45808. this.trim(),
  45809. this.optimize()
  45810. }
  45811. ,
  45812. n.AnimationClip.prototype = {
  45813. constructor: n.AnimationClip,
  45814. resetDuration: function() {
  45815. for (var e = this.tracks, t = 0, i = 0, n = e.length; i !== n; ++i) {
  45816. var r = this.tracks[i];
  45817. t = Math.max(t, r.times[r.times.length - 1])
  45818. }
  45819. this.duration = t
  45820. },
  45821. trim: function() {
  45822. for (var e = 0; e < this.tracks.length; e++)
  45823. this.tracks[e].trim(0, this.duration);
  45824. return this
  45825. },
  45826. optimize: function() {
  45827. for (var e = 0; e < this.tracks.length; e++)
  45828. this.tracks[e].optimize();
  45829. return this
  45830. }
  45831. },
  45832. Object.assign(n.AnimationClip, {
  45833. parse: function(e) {
  45834. for (var t = [], i = e.tracks, r = 1 / (e.fps || 1), o = 0, a = i.length; o !== a; ++o)
  45835. t.push(n.KeyframeTrack.parse(i[o]).scale(r));
  45836. return new n.AnimationClip(e.name,e.duration,t)
  45837. },
  45838. toJSON: function(e) {
  45839. for (var t = [], i = e.tracks, r = {
  45840. name: e.name,
  45841. duration: e.duration,
  45842. tracks: t
  45843. }, o = 0, a = i.length; o !== a; ++o)
  45844. t.push(n.KeyframeTrack.toJSON(i[o]));
  45845. return r
  45846. },
  45847. CreateFromMorphTargetSequence: function(e, t, i) {
  45848. for (var r = t.length, o = [], a = 0; a < r; a++) {
  45849. var s = []
  45850. , l = [];
  45851. s.push((a + r - 1) % r, a, (a + 1) % r),
  45852. l.push(0, 1, 0);
  45853. var c = n.AnimationUtils.getKeyframeOrder(s);
  45854. s = n.AnimationUtils.sortedArray(s, 1, c),
  45855. l = n.AnimationUtils.sortedArray(l, 1, c),
  45856. 0 === s[0] && (s.push(r),
  45857. l.push(l[0])),
  45858. o.push(new n.NumberKeyframeTrack(".morphTargetInfluences[" + t[a].name + "]",s,l).scale(1 / i))
  45859. }
  45860. return new n.AnimationClip(e,-1,o)
  45861. },
  45862. findByName: function(e, t) {
  45863. for (var i = 0; i < e.length; i++)
  45864. if (e[i].name === t)
  45865. return e[i];
  45866. return null
  45867. },
  45868. CreateClipsFromMorphTargetSequences: function(e, t) {
  45869. for (var i = {}, r = /^([\w-]*?)([\d]+)$/, o = 0, a = e.length; o < a; o++) {
  45870. var s = e[o]
  45871. , l = s.name.match(r);
  45872. if (l && l.length > 1) {
  45873. var c = l[1]
  45874. , h = i[c];
  45875. h || (i[c] = h = []),
  45876. h.push(s)
  45877. }
  45878. }
  45879. var u = [];
  45880. for (var c in i)
  45881. u.push(n.AnimationClip.CreateFromMorphTargetSequence(c, i[c], t));
  45882. return u
  45883. },
  45884. parseAnimation: function(e, t, i) {
  45885. if (!e)
  45886. return console.error(" no animation in JSONLoader data"),
  45887. null;
  45888. for (var r = function(e, t, i, r, o) {
  45889. if (0 !== i.length) {
  45890. var a = []
  45891. , s = [];
  45892. n.AnimationUtils.flattenJSON(i, a, s, r),
  45893. 0 !== a.length && o.push(new e(t,a,s))
  45894. }
  45895. }, o = [], a = e.name || "default", s = e.length || -1, l = e.fps || 30, c = e.hierarchy || [], h = 0; h < c.length; h++) {
  45896. var u = c[h].keys;
  45897. if (u && 0 != u.length)
  45898. if (u[0].morphTargets) {
  45899. for (var d = {}, p = 0; p < u.length; p++)
  45900. if (u[p].morphTargets)
  45901. for (var f = 0; f < u[p].morphTargets.length; f++)
  45902. d[u[p].morphTargets[f]] = -1;
  45903. for (var g in d) {
  45904. for (var m = [], v = [], f = 0; f !== u[p].morphTargets.length; ++f) {
  45905. var A = u[p];
  45906. m.push(A.time),
  45907. v.push(A.morphTarget === g ? 1 : 0)
  45908. }
  45909. o.push(new n.NumberKeyframeTrack(".morphTargetInfluence[" + g + "]",m,v))
  45910. }
  45911. s = d.length * (l || 1)
  45912. } else {
  45913. var y = ".bones[" + t[h].name + "]";
  45914. r(n.VectorKeyframeTrack, y + ".position", u, "pos", o),
  45915. r(n.QuaternionKeyframeTrack, y + ".quaternion", u, "rot", o),
  45916. r(n.VectorKeyframeTrack, y + ".scale", u, "scl", o)
  45917. }
  45918. }
  45919. if (0 === o.length)
  45920. return null;
  45921. var C = new n.AnimationClip(a,s,o);
  45922. return C
  45923. }
  45924. }),
  45925. n.AnimationMixer = function(e) {
  45926. this._root = e,
  45927. this._initMemoryManager(),
  45928. this._accuIndex = 0,
  45929. this.time = 0,
  45930. this.timeScale = 1
  45931. }
  45932. ,
  45933. n.AnimationMixer.prototype = {
  45934. constructor: n.AnimationMixer,
  45935. clipAction: function(e, t) {
  45936. 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];
  45937. if (void 0 !== l) {
  45938. var c = l.actionByRoot[o];
  45939. if (void 0 !== c)
  45940. return c;
  45941. if (i = l.knownActions[0],
  45942. s = i._clip,
  45943. e !== a && e !== s)
  45944. throw new Error("Different clips with the same name detected!")
  45945. }
  45946. if (null === s)
  45947. return null;
  45948. var h = new n.AnimationMixer._Action(this,s,t);
  45949. return this._bindAction(h, i),
  45950. this._addInactiveAction(h, a, o),
  45951. h
  45952. },
  45953. existingAction: function(e, t) {
  45954. var i = t || this._root
  45955. , n = i.uuid
  45956. , r = "string" == typeof e ? e : e.name
  45957. , o = this._actionsByClip[r];
  45958. return void 0 !== o ? o.actionByRoot[n] || null : null
  45959. },
  45960. stopAllAction: function() {
  45961. var e = this._actions
  45962. , t = this._nActiveActions
  45963. , i = this._bindings
  45964. , n = this._nActiveBindings;
  45965. this._nActiveActions = 0,
  45966. this._nActiveBindings = 0;
  45967. for (var r = 0; r !== t; ++r)
  45968. e[r].reset();
  45969. for (var r = 0; r !== n; ++r)
  45970. i[r].useCount = 0;
  45971. return this
  45972. },
  45973. update: function(e) {
  45974. e *= this.timeScale;
  45975. 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) {
  45976. var s = t[a];
  45977. s.enabled && s._update(n, e, r, o)
  45978. }
  45979. for (var l = this._bindings, c = this._nActiveBindings, a = 0; a !== c; ++a)
  45980. l[a].apply(o);
  45981. return this
  45982. },
  45983. getRoot: function() {
  45984. return this._root
  45985. },
  45986. uncacheClip: function(e) {
  45987. var t = this._actions
  45988. , i = e.name
  45989. , n = this._actionsByClip
  45990. , r = n[i];
  45991. if (void 0 !== r) {
  45992. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  45993. var l = o[a];
  45994. this._deactivateAction(l);
  45995. var c = l._cacheIndex
  45996. , h = t[t.length - 1];
  45997. l._cacheIndex = null,
  45998. l._byClipCacheIndex = null,
  45999. h._cacheIndex = c,
  46000. t[c] = h,
  46001. t.pop(),
  46002. this._removeInactiveBindingsForAction(l)
  46003. }
  46004. delete n[i]
  46005. }
  46006. },
  46007. uncacheRoot: function(e) {
  46008. var t = e.uuid
  46009. , i = this._actionsByClip;
  46010. for (var n in i) {
  46011. var r = i[n].actionByRoot
  46012. , o = r[t];
  46013. void 0 !== o && (this._deactivateAction(o),
  46014. this._removeInactiveAction(o))
  46015. }
  46016. var a = this._bindingsByRootAndName
  46017. , s = a[t];
  46018. if (void 0 !== s)
  46019. for (var l in s) {
  46020. var c = s[l];
  46021. c.restoreOriginalState(),
  46022. this._removeInactiveBinding(c)
  46023. }
  46024. },
  46025. uncacheAction: function(e, t) {
  46026. var i = this.existingAction(e, t);
  46027. null !== i && (this._deactivateAction(i),
  46028. this._removeInactiveAction(i))
  46029. }
  46030. },
  46031. n.EventDispatcher.prototype.apply(n.AnimationMixer.prototype),
  46032. n.AnimationMixer._Action = function(e, t, i) {
  46033. this._mixer = e,
  46034. this._clip = t,
  46035. this._localRoot = i || null;
  46036. for (var r = t.tracks, o = r.length, a = new Array(o), s = {
  46037. endingStart: n.ZeroCurvatureEnding,
  46038. endingEnd: n.ZeroCurvatureEnding
  46039. }, l = 0; l !== o; ++l) {
  46040. var c = r[l].createInterpolant(null);
  46041. a[l] = c,
  46042. c.settings = s
  46043. }
  46044. this._interpolantSettings = s,
  46045. this._interpolants = a,
  46046. this._propertyBindings = new Array(o),
  46047. this._cacheIndex = null,
  46048. this._byClipCacheIndex = null,
  46049. this._timeScaleInterpolant = null,
  46050. this._weightInterpolant = null,
  46051. this.loop = n.LoopRepeat,
  46052. this._loopCount = -1,
  46053. this._startTime = null,
  46054. this.time = 0,
  46055. this.timeScale = 1,
  46056. this._effectiveTimeScale = 1,
  46057. this.weight = 1,
  46058. this._effectiveWeight = 1,
  46059. this.repetitions = 1 / 0,
  46060. this.paused = !1,
  46061. this.enabled = !0,
  46062. this.clampWhenFinished = !1,
  46063. this.zeroSlopeAtStart = !0,
  46064. this.zeroSlopeAtEnd = !0
  46065. }
  46066. ,
  46067. n.AnimationMixer._Action.prototype = {
  46068. constructor: n.AnimationMixer._Action,
  46069. play: function() {
  46070. return this._mixer._activateAction(this),
  46071. this
  46072. },
  46073. stop: function() {
  46074. return this._mixer._deactivateAction(this),
  46075. this.reset()
  46076. },
  46077. reset: function() {
  46078. return this.paused = !1,
  46079. this.enabled = !0,
  46080. this.time = 0,
  46081. this._loopCount = -1,
  46082. this._startTime = null,
  46083. this.stopFading().stopWarping()
  46084. },
  46085. isRunning: function() {
  46086. this._startTime;
  46087. return this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  46088. },
  46089. isScheduled: function() {
  46090. return this._mixer._isActiveAction(this)
  46091. },
  46092. startAt: function(e) {
  46093. return this._startTime = e,
  46094. this
  46095. },
  46096. setLoop: function(e, t) {
  46097. return this.loop = e,
  46098. this.repetitions = t,
  46099. this
  46100. },
  46101. setEffectiveWeight: function(e) {
  46102. return this.weight = e,
  46103. this._effectiveWeight = this.enabled ? e : 0,
  46104. this.stopFading()
  46105. },
  46106. getEffectiveWeight: function() {
  46107. return this._effectiveWeight
  46108. },
  46109. fadeIn: function(e) {
  46110. return this._scheduleFading(e, 0, 1)
  46111. },
  46112. fadeOut: function(e) {
  46113. return this._scheduleFading(e, 1, 0)
  46114. },
  46115. crossFadeFrom: function(e, t, i) {
  46116. this._mixer;
  46117. if (e.fadeOut(t),
  46118. this.fadeIn(t),
  46119. i) {
  46120. var n = this._clip.duration
  46121. , r = e._clip.duration
  46122. , o = r / n
  46123. , a = n / r;
  46124. e.warp(1, o, t),
  46125. this.warp(a, 1, t)
  46126. }
  46127. return this
  46128. },
  46129. crossFadeTo: function(e, t, i) {
  46130. return e.crossFadeFrom(this, t, i)
  46131. },
  46132. stopFading: function() {
  46133. var e = this._weightInterpolant;
  46134. return null !== e && (this._weightInterpolant = null,
  46135. this._mixer._takeBackControlInterpolant(e)),
  46136. this
  46137. },
  46138. setEffectiveTimeScale: function(e) {
  46139. return this.timeScale = e,
  46140. this._effectiveTimeScale = this.paused ? 0 : e,
  46141. this.stopWarping()
  46142. },
  46143. getEffectiveTimeScale: function() {
  46144. return this._effectiveTimeScale
  46145. },
  46146. setDuration: function(e) {
  46147. return this.timeScale = this._clip.duration / e,
  46148. this.stopWarping()
  46149. },
  46150. syncWith: function(e) {
  46151. return this.time = e.time,
  46152. this.timeScale = e.timeScale,
  46153. this.stopWarping()
  46154. },
  46155. halt: function(e) {
  46156. return this.warp(this._currentTimeScale, 0, e)
  46157. },
  46158. warp: function(e, t, i) {
  46159. var n = this._mixer
  46160. , r = n.time
  46161. , o = this._timeScaleInterpolant
  46162. , a = this.timeScale;
  46163. null === o && (o = n._lendControlInterpolant(),
  46164. this._timeScaleInterpolant = o);
  46165. var s = o.parameterPositions
  46166. , l = o.sampleValues;
  46167. return s[0] = r,
  46168. s[1] = r + i,
  46169. l[0] = e / a,
  46170. l[1] = t / a,
  46171. this
  46172. },
  46173. stopWarping: function() {
  46174. var e = this._timeScaleInterpolant;
  46175. return null !== e && (this._timeScaleInterpolant = null,
  46176. this._mixer._takeBackControlInterpolant(e)),
  46177. this
  46178. },
  46179. getMixer: function() {
  46180. return this._mixer
  46181. },
  46182. getClip: function() {
  46183. return this._clip
  46184. },
  46185. getRoot: function() {
  46186. return this._localRoot || this._mixer._root
  46187. },
  46188. _update: function(e, t, i, n) {
  46189. var r = this._startTime;
  46190. if (null !== r) {
  46191. var o = (e - r) * i;
  46192. if (o < 0 || 0 === i)
  46193. return;
  46194. this._startTime = null,
  46195. t = i * o
  46196. }
  46197. t *= this._updateTimeScale(e);
  46198. var a = this._updateTime(t)
  46199. , s = this._updateWeight(e);
  46200. if (s > 0)
  46201. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  46202. l[h].evaluate(a),
  46203. c[h].accumulate(n, s)
  46204. },
  46205. _updateWeight: function(e) {
  46206. var t = 0;
  46207. if (this.enabled) {
  46208. t = this.weight;
  46209. var i = this._weightInterpolant;
  46210. if (null !== i) {
  46211. var n = i.evaluate(e)[0];
  46212. t *= n,
  46213. e > i.parameterPositions[1] && (this.stopFading(),
  46214. 0 === n && (this.enabled = !1))
  46215. }
  46216. }
  46217. return this._effectiveWeight = t,
  46218. t
  46219. },
  46220. _updateTimeScale: function(e) {
  46221. var t = 0;
  46222. if (!this.paused) {
  46223. t = this.timeScale;
  46224. var i = this._timeScaleInterpolant;
  46225. if (null !== i) {
  46226. var n = i.evaluate(e)[0];
  46227. t *= n,
  46228. e > i.parameterPositions[1] && (this.stopWarping(),
  46229. 0 === t ? this.pause = !0 : this.timeScale = t)
  46230. }
  46231. }
  46232. return this._effectiveTimeScale = t,
  46233. t
  46234. },
  46235. _updateTime: function(e) {
  46236. var t = this.time + e;
  46237. if (0 === e)
  46238. return t;
  46239. var i = this._clip.duration
  46240. , r = this.loop
  46241. , o = this._loopCount
  46242. , a = !1;
  46243. switch (r) {
  46244. case n.LoopOnce:
  46245. if (o === -1 && (this.loopCount = 0,
  46246. this._setEndings(!0, !0, !1)),
  46247. t >= i)
  46248. t = i;
  46249. else {
  46250. if (!(t < 0))
  46251. break;
  46252. t = 0
  46253. }
  46254. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  46255. this._mixer.dispatchEvent({
  46256. type: "finished",
  46257. action: this,
  46258. direction: e < 0 ? -1 : 1
  46259. });
  46260. break;
  46261. case n.LoopPingPong:
  46262. a = !0;
  46263. case n.LoopRepeat:
  46264. if (o === -1 && (e > 0 ? (o = 0,
  46265. this._setEndings(!0, 0 === this.repetitions, a)) : this._setEndings(0 === this.repetitions, !0, a)),
  46266. t >= i || t < 0) {
  46267. var s = Math.floor(t / i);
  46268. t -= i * s,
  46269. o += Math.abs(s);
  46270. var l = this.repetitions - o;
  46271. if (l < 0) {
  46272. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  46273. t = e > 0 ? i : 0,
  46274. this._mixer.dispatchEvent({
  46275. type: "finished",
  46276. action: this,
  46277. direction: e > 0 ? 1 : -1
  46278. });
  46279. break
  46280. }
  46281. if (0 === l) {
  46282. var c = e < 0;
  46283. this._setEndings(c, !c, a)
  46284. } else
  46285. this._setEndings(!1, !1, a);
  46286. this._loopCount = o,
  46287. this._mixer.dispatchEvent({
  46288. type: "loop",
  46289. action: this,
  46290. loopDelta: s
  46291. })
  46292. }
  46293. if (r === n.LoopPingPong && 1 === (1 & o))
  46294. return this.time = t,
  46295. i - t
  46296. }
  46297. return this.time = t,
  46298. t
  46299. },
  46300. _setEndings: function(e, t, i) {
  46301. var r = this._interpolantSettings;
  46302. i ? (r.endingStart = n.ZeroSlopeEnding,
  46303. r.endingEnd = n.ZeroSlopeEnding) : (e ? r.endingStart = this.zeroSlopeAtStart ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingStart = n.WrapAroundEnding,
  46304. t ? r.endingEnd = this.zeroSlopeAtEnd ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingEnd = n.WrapAroundEnding)
  46305. },
  46306. _scheduleFading: function(e, t, i) {
  46307. var n = this._mixer
  46308. , r = n.time
  46309. , o = this._weightInterpolant;
  46310. null === o && (o = n._lendControlInterpolant(),
  46311. this._weightInterpolant = o);
  46312. var a = o.parameterPositions
  46313. , s = o.sampleValues;
  46314. return a[0] = r,
  46315. s[0] = t,
  46316. a[1] = r + e,
  46317. s[1] = i,
  46318. this
  46319. }
  46320. },
  46321. Object.assign(n.AnimationMixer.prototype, {
  46322. _bindAction: function(e, t) {
  46323. var i = e._localRoot || this._root
  46324. , r = e._clip.tracks
  46325. , o = r.length
  46326. , a = e._propertyBindings
  46327. , s = e._interpolants
  46328. , l = i.uuid
  46329. , c = this._bindingsByRootAndName
  46330. , h = c[l];
  46331. void 0 === h && (h = {},
  46332. c[l] = h);
  46333. for (var u = 0; u !== o; ++u) {
  46334. var d = r[u]
  46335. , p = d.name
  46336. , f = h[p];
  46337. if (void 0 !== f)
  46338. a[u] = f;
  46339. else {
  46340. if (f = a[u],
  46341. void 0 !== f) {
  46342. null === f._cacheIndex && (++f.referenceCount,
  46343. this._addInactiveBinding(f, l, p));
  46344. continue
  46345. }
  46346. var g = t && t._propertyBindings[u].binding.parsedPath;
  46347. f = new n.PropertyMixer(n.PropertyBinding.create(i, p, g),d.ValueTypeName,d.getValueSize()),
  46348. ++f.referenceCount,
  46349. this._addInactiveBinding(f, l, p),
  46350. a[u] = f
  46351. }
  46352. s[u].resultBuffer = f.buffer
  46353. }
  46354. },
  46355. _activateAction: function(e) {
  46356. if (!this._isActiveAction(e)) {
  46357. if (null === e._cacheIndex) {
  46358. var t = (e._localRoot || this._root).uuid
  46359. , i = e._clip.name
  46360. , n = this._actionsByClip[i];
  46361. this._bindAction(e, n && n.knownActions[0]),
  46362. this._addInactiveAction(e, i, t)
  46363. }
  46364. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  46365. var s = r[o];
  46366. 0 === s.useCount++ && (this._lendBinding(s),
  46367. s.saveOriginalState())
  46368. }
  46369. this._lendAction(e)
  46370. }
  46371. },
  46372. _deactivateAction: function(e) {
  46373. if (this._isActiveAction(e)) {
  46374. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  46375. var r = t[i];
  46376. 0 === --r.useCount && (r.restoreOriginalState(),
  46377. this._takeBackBinding(r))
  46378. }
  46379. this._takeBackAction(e)
  46380. }
  46381. },
  46382. _initMemoryManager: function() {
  46383. this._actions = [],
  46384. this._nActiveActions = 0,
  46385. this._actionsByClip = {},
  46386. this._bindings = [],
  46387. this._nActiveBindings = 0,
  46388. this._bindingsByRootAndName = {},
  46389. this._controlInterpolants = [],
  46390. this._nActiveControlInterpolants = 0;
  46391. var e = this;
  46392. this.stats = {
  46393. actions: {
  46394. get total() {
  46395. return e._actions.length
  46396. },
  46397. get inUse() {
  46398. return e._nActiveActions
  46399. }
  46400. },
  46401. bindings: {
  46402. get total() {
  46403. return e._bindings.length
  46404. },
  46405. get inUse() {
  46406. return e._nActiveBindings
  46407. }
  46408. },
  46409. controlInterpolants: {
  46410. get total() {
  46411. return e._controlInterpolants.length
  46412. },
  46413. get inUse() {
  46414. return e._nActiveControlInterpolants
  46415. }
  46416. }
  46417. }
  46418. },
  46419. _isActiveAction: function(e) {
  46420. var t = e._cacheIndex;
  46421. return null !== t && t < this._nActiveActions
  46422. },
  46423. _addInactiveAction: function(e, t, i) {
  46424. var n = this._actions
  46425. , r = this._actionsByClip
  46426. , o = r[t];
  46427. if (void 0 === o)
  46428. o = {
  46429. knownActions: [e],
  46430. actionByRoot: {}
  46431. },
  46432. e._byClipCacheIndex = 0,
  46433. r[t] = o;
  46434. else {
  46435. var a = o.knownActions;
  46436. e._byClipCacheIndex = a.length,
  46437. a.push(e)
  46438. }
  46439. e._cacheIndex = n.length,
  46440. n.push(e),
  46441. o.actionByRoot[i] = e
  46442. },
  46443. _removeInactiveAction: function(e) {
  46444. var t = this._actions
  46445. , i = t[t.length - 1]
  46446. , n = e._cacheIndex;
  46447. i._cacheIndex = n,
  46448. t[n] = i,
  46449. t.pop(),
  46450. e._cacheIndex = null;
  46451. var r = e._clip.name
  46452. , o = this._actionsByClip
  46453. , a = o[r]
  46454. , s = a.knownActions
  46455. , l = s[s.length - 1]
  46456. , c = e._byClipCacheIndex;
  46457. l._byClipCacheIndex = c,
  46458. s[c] = l,
  46459. s.pop(),
  46460. e._byClipCacheIndex = null;
  46461. var h = a.actionByRoot
  46462. , u = (t._localRoot || this._root).uuid;
  46463. delete h[u],
  46464. 0 === s.length && delete o[r],
  46465. this._removeInactiveBindingsForAction(e)
  46466. },
  46467. _removeInactiveBindingsForAction: function(e) {
  46468. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  46469. var r = t[i];
  46470. 0 === --r.referenceCount && this._removeInactiveBinding(r)
  46471. }
  46472. },
  46473. _lendAction: function(e) {
  46474. var t = this._actions
  46475. , i = e._cacheIndex
  46476. , n = this._nActiveActions++
  46477. , r = t[n];
  46478. e._cacheIndex = n,
  46479. t[n] = e,
  46480. r._cacheIndex = i,
  46481. t[i] = r
  46482. },
  46483. _takeBackAction: function(e) {
  46484. var t = this._actions
  46485. , i = e._cacheIndex
  46486. , n = --this._nActiveActions
  46487. , r = t[n];
  46488. e._cacheIndex = n,
  46489. t[n] = e,
  46490. r._cacheIndex = i,
  46491. t[i] = r
  46492. },
  46493. _addInactiveBinding: function(e, t, i) {
  46494. var n = this._bindingsByRootAndName
  46495. , r = n[t]
  46496. , o = this._bindings;
  46497. void 0 === r && (r = {},
  46498. n[t] = r),
  46499. r[i] = e,
  46500. e._cacheIndex = o.length,
  46501. o.push(e)
  46502. },
  46503. _removeInactiveBinding: function(e) {
  46504. var t = this._bindings
  46505. , i = e.binding
  46506. , n = i.rootNode.uuid
  46507. , r = i.path
  46508. , o = this._bindingsByRootAndName
  46509. , a = o[n]
  46510. , s = t[t.length - 1]
  46511. , l = e._cacheIndex;
  46512. s._cacheIndex = l,
  46513. t[l] = s,
  46514. t.pop(),
  46515. delete a[r];
  46516. e: {
  46517. for (var c in a)
  46518. break e;
  46519. delete o[n]
  46520. }
  46521. },
  46522. _lendBinding: function(e) {
  46523. var t = this._bindings
  46524. , i = e._cacheIndex
  46525. , n = this._nActiveBindings++
  46526. , r = t[n];
  46527. e._cacheIndex = n,
  46528. t[n] = e,
  46529. r._cacheIndex = i,
  46530. t[i] = r
  46531. },
  46532. _takeBackBinding: function(e) {
  46533. var t = this._bindings
  46534. , i = e._cacheIndex
  46535. , n = --this._nActiveBindings
  46536. , r = t[n];
  46537. e._cacheIndex = n,
  46538. t[n] = e,
  46539. r._cacheIndex = i,
  46540. t[i] = r
  46541. },
  46542. _lendControlInterpolant: function() {
  46543. var e = this._controlInterpolants
  46544. , t = this._nActiveControlInterpolants++
  46545. , i = e[t];
  46546. return void 0 === i && (i = new n.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),
  46547. i.__cacheIndex = t,
  46548. e[t] = i),
  46549. i
  46550. },
  46551. _takeBackControlInterpolant: function(e) {
  46552. var t = this._controlInterpolants
  46553. , i = e.__cacheIndex
  46554. , n = --this._nActiveControlInterpolants
  46555. , r = t[n];
  46556. e.__cacheIndex = n,
  46557. t[n] = e,
  46558. r.__cacheIndex = i,
  46559. t[i] = r
  46560. },
  46561. _controlInterpolantsResultBuffer: new Float32Array(1)
  46562. }),
  46563. n.AnimationObjectGroup = function(e) {
  46564. this.uuid = n.Math.generateUUID(),
  46565. this._objects = Array.prototype.slice.call(arguments),
  46566. this.nCachedObjects_ = 0;
  46567. var t = {};
  46568. this._indicesByUUID = t;
  46569. for (var i = 0, r = arguments.length; i !== r; ++i)
  46570. t[arguments[i].uuid] = i;
  46571. this._paths = [],
  46572. this._parsedPaths = [],
  46573. this._bindings = [],
  46574. this._bindingsIndicesByPath = {};
  46575. var o = this;
  46576. this.stats = {
  46577. objects: {
  46578. get total() {
  46579. return o._objects.length
  46580. },
  46581. get inUse() {
  46582. return this.total - o.nCachedObjects_
  46583. }
  46584. },
  46585. get bindingsPerObject() {
  46586. return o._bindings.length
  46587. }
  46588. }
  46589. }
  46590. ,
  46591. n.AnimationObjectGroup.prototype = {
  46592. constructor: n.AnimationObjectGroup,
  46593. add: function(e) {
  46594. 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) {
  46595. var d = arguments[h]
  46596. , p = d.uuid
  46597. , f = o[p];
  46598. if (void 0 === f) {
  46599. f = i++,
  46600. o[p] = f,
  46601. t.push(d);
  46602. for (var g = 0, m = c; g !== m; ++g)
  46603. l[g].push(new n.PropertyBinding(d,a[g],s[g]))
  46604. } else if (f < r) {
  46605. var v = t[f]
  46606. , A = --r
  46607. , y = t[A];
  46608. o[y.uuid] = f,
  46609. t[f] = y,
  46610. o[p] = A,
  46611. t[A] = d;
  46612. for (var g = 0, m = c; g !== m; ++g) {
  46613. var C = l[g]
  46614. , I = C[A]
  46615. , E = C[f];
  46616. C[f] = I,
  46617. void 0 === E && (E = new n.PropertyBinding(d,a[g],s[g])),
  46618. C[A] = E
  46619. }
  46620. } else
  46621. t[f] !== v && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  46622. }
  46623. this.nCachedObjects_ = r
  46624. },
  46625. remove: function(e) {
  46626. for (var t = this._objects, i = (t.length,
  46627. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  46628. var l = arguments[a]
  46629. , c = l.uuid
  46630. , h = n[c];
  46631. if (void 0 !== h && h >= i) {
  46632. var u = i++
  46633. , d = t[u];
  46634. n[d.uuid] = h,
  46635. t[h] = d,
  46636. n[c] = u,
  46637. t[u] = l;
  46638. for (var p = 0, f = o; p !== f; ++p) {
  46639. var g = r[p]
  46640. , m = g[u]
  46641. , v = g[h];
  46642. g[h] = m,
  46643. g[u] = v
  46644. }
  46645. }
  46646. }
  46647. this.nCachedObjects_ = i
  46648. },
  46649. uncache: function(e) {
  46650. 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) {
  46651. var c = arguments[s]
  46652. , h = c.uuid
  46653. , u = r[h];
  46654. if (void 0 !== u)
  46655. if (delete r[h],
  46656. u < n) {
  46657. var d = --n
  46658. , p = t[d]
  46659. , f = --i
  46660. , g = t[f];
  46661. r[p.uuid] = u,
  46662. t[u] = p,
  46663. r[g.uuid] = d,
  46664. t[d] = g,
  46665. t.pop();
  46666. for (var m = 0, v = a; m !== v; ++m) {
  46667. var A = o[m]
  46668. , y = A[d]
  46669. , C = A[f];
  46670. A[u] = y,
  46671. A[d] = C,
  46672. A.pop()
  46673. }
  46674. } else {
  46675. var f = --i
  46676. , g = t[f];
  46677. r[g.uuid] = u,
  46678. t[u] = g,
  46679. t.pop();
  46680. for (var m = 0, v = a; m !== v; ++m) {
  46681. var A = o[m];
  46682. A[u] = A[f],
  46683. A.pop()
  46684. }
  46685. }
  46686. }
  46687. this.nCachedObjects_ = n
  46688. },
  46689. subscribe_: function(e, t) {
  46690. var i = this._bindingsIndicesByPath
  46691. , r = i[e]
  46692. , o = this._bindings;
  46693. if (void 0 !== r)
  46694. return o[r];
  46695. var a = this._paths
  46696. , s = this._parsedPaths
  46697. , l = this._objects
  46698. , c = l.length
  46699. , h = this.nCachedObjects_
  46700. , u = new Array(c);
  46701. r = o.length,
  46702. i[e] = r,
  46703. a.push(e),
  46704. s.push(t),
  46705. o.push(u);
  46706. for (var d = h, p = l.length; d !== p; ++d) {
  46707. var f = l[d];
  46708. u[d] = new n.PropertyBinding(f,e,t)
  46709. }
  46710. return u
  46711. },
  46712. unsubscribe_: function(e) {
  46713. var t = this._bindingsIndicesByPath
  46714. , i = t[e];
  46715. if (void 0 !== i) {
  46716. var n = this._paths
  46717. , r = this._parsedPaths
  46718. , o = this._bindings
  46719. , a = o.length - 1
  46720. , s = o[a]
  46721. , l = e[a];
  46722. t[l] = i,
  46723. o[i] = s,
  46724. o.pop(),
  46725. r[i] = r[a],
  46726. r.pop(),
  46727. n[i] = n[a],
  46728. n.pop()
  46729. }
  46730. }
  46731. },
  46732. n.AnimationUtils = {
  46733. arraySlice: function(e, t, i) {
  46734. return n.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  46735. },
  46736. convertArray: function(e, t, i) {
  46737. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  46738. },
  46739. isTypedArray: function(e) {
  46740. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  46741. },
  46742. getKeyframeOrder: function(e) {
  46743. function t(t, i) {
  46744. return e[t] - e[i]
  46745. }
  46746. for (var i = e.length, n = new Array(i), r = 0; r !== i; ++r)
  46747. n[r] = r;
  46748. return n.sort(t),
  46749. n
  46750. },
  46751. sortedArray: function(e, t, i) {
  46752. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  46753. for (var s = i[o] * t, l = 0; l !== t; ++l)
  46754. r[a++] = e[s + l];
  46755. return r
  46756. },
  46757. flattenJSON: function(e, t, i, n) {
  46758. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  46759. o = e[r++];
  46760. if (void 0 !== o) {
  46761. var a = o[n];
  46762. if (void 0 !== a)
  46763. if (Array.isArray(a)) {
  46764. do
  46765. a = o[n],
  46766. void 0 !== a && (t.push(o.time),
  46767. i.push.apply(i, a)),
  46768. o = e[r++];
  46769. while (void 0 !== o)
  46770. } else if (void 0 !== a.toArray) {
  46771. do
  46772. a = o[n],
  46773. void 0 !== a && (t.push(o.time),
  46774. a.toArray(i, i.length)),
  46775. o = e[r++];
  46776. while (void 0 !== o)
  46777. } else
  46778. do
  46779. a = o[n],
  46780. void 0 !== a && (t.push(o.time),
  46781. i.push(a)),
  46782. o = e[r++];
  46783. while (void 0 !== o)
  46784. }
  46785. }
  46786. },
  46787. n.KeyframeTrack = function(e, t, i, r) {
  46788. if (void 0 === e)
  46789. throw new Error("track name is undefined");
  46790. if (void 0 === t || 0 === t.length)
  46791. throw new Error("no keyframes in track named " + e);
  46792. this.name = e,
  46793. this.times = n.AnimationUtils.convertArray(t, this.TimeBufferType),
  46794. this.values = n.AnimationUtils.convertArray(i, this.ValueBufferType),
  46795. this.setInterpolation(r || this.DefaultInterpolation),
  46796. this.validate(),
  46797. this.optimize()
  46798. }
  46799. ,
  46800. n.KeyframeTrack.prototype = {
  46801. constructor: n.KeyframeTrack,
  46802. TimeBufferType: Float32Array,
  46803. ValueBufferType: Float32Array,
  46804. DefaultInterpolation: n.InterpolateLinear,
  46805. InterpolantFactoryMethodDiscrete: function(e) {
  46806. return new n.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  46807. },
  46808. InterpolantFactoryMethodLinear: function(e) {
  46809. return new n.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  46810. },
  46811. InterpolantFactoryMethodSmooth: function(e) {
  46812. return new n.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  46813. },
  46814. setInterpolation: function(e) {
  46815. var t = void 0;
  46816. switch (e) {
  46817. case n.InterpolateDiscrete:
  46818. t = this.InterpolantFactoryMethodDiscrete;
  46819. break;
  46820. case n.InterpolateLinear:
  46821. t = this.InterpolantFactoryMethodLinear;
  46822. break;
  46823. case n.InterpolateSmooth:
  46824. t = this.InterpolantFactoryMethodSmooth
  46825. }
  46826. if (void 0 === t) {
  46827. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  46828. if (void 0 === this.createInterpolant) {
  46829. if (e === this.DefaultInterpolation)
  46830. throw new Error(i);
  46831. this.setInterpolation(this.DefaultInterpolation)
  46832. }
  46833. return void console.warn(i)
  46834. }
  46835. this.createInterpolant = t
  46836. },
  46837. getInterpolation: function() {
  46838. switch (this.createInterpolant) {
  46839. case this.InterpolantFactoryMethodDiscrete:
  46840. return n.InterpolateDiscrete;
  46841. case this.InterpolantFactoryMethodLinear:
  46842. return n.InterpolateLinear;
  46843. case this.InterpolantFactoryMethodSmooth:
  46844. return n.InterpolateSmooth
  46845. }
  46846. },
  46847. getValueSize: function() {
  46848. return this.values.length / this.times.length
  46849. },
  46850. shift: function(e) {
  46851. if (0 !== e)
  46852. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  46853. t[i] += e;
  46854. return this
  46855. },
  46856. scale: function(e) {
  46857. if (1 !== e)
  46858. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  46859. t[i] *= e;
  46860. return this
  46861. },
  46862. trim: function(e, t) {
  46863. for (var i = this.times, r = i.length, o = 0, a = r - 1; o !== r && i[o] < e; )
  46864. ++o;
  46865. for (; a !== -1 && i[a] > t; )
  46866. --a;
  46867. if (++a,
  46868. 0 !== o || a !== r) {
  46869. o >= a && (a = Math.max(a, 1),
  46870. o = a - 1);
  46871. var s = this.getValueSize();
  46872. this.times = n.AnimationUtils.arraySlice(i, o, a),
  46873. this.values = n.AnimationUtils.arraySlice(this.values, o * s, a * s)
  46874. }
  46875. return this
  46876. },
  46877. validate: function() {
  46878. var e = !0
  46879. , t = this.getValueSize();
  46880. t - Math.floor(t) !== 0 && (console.error("invalid value size in track", this),
  46881. e = !1);
  46882. var i = this.times
  46883. , r = this.values
  46884. , o = i.length;
  46885. 0 === o && (console.error("track is empty", this),
  46886. e = !1);
  46887. for (var a = null, s = 0; s !== o; s++) {
  46888. var l = i[s];
  46889. if ("number" == typeof l && isNaN(l)) {
  46890. console.error("time is not a valid number", this, s, l),
  46891. e = !1;
  46892. break
  46893. }
  46894. if (null !== a && a > l) {
  46895. console.error("out of order keys", this, s, l, a),
  46896. e = !1;
  46897. break
  46898. }
  46899. a = l
  46900. }
  46901. if (void 0 !== r && n.AnimationUtils.isTypedArray(r))
  46902. for (var s = 0, c = r.length; s !== c; ++s) {
  46903. var h = r[s];
  46904. if (isNaN(h)) {
  46905. console.error("value is not a valid number", this, s, h),
  46906. e = !1;
  46907. break
  46908. }
  46909. }
  46910. return e
  46911. },
  46912. optimize: function() {
  46913. for (var e = this.times, t = this.values, i = this.getValueSize(), r = 1, o = 1, a = e.length - 1; o <= a; ++o) {
  46914. var s = !1
  46915. , l = e[o]
  46916. , c = e[o + 1];
  46917. if (l !== c && (1 !== o || l !== l[0]))
  46918. for (var h = o * i, u = h - i, d = h + i, p = 0; p !== i; ++p) {
  46919. var f = t[h + p];
  46920. if (f !== t[u + p] || f !== t[d + p]) {
  46921. s = !0;
  46922. break
  46923. }
  46924. }
  46925. if (s) {
  46926. if (o !== r) {
  46927. e[r] = e[o];
  46928. for (var g = o * i, m = r * i, p = 0; p !== i; ++p)
  46929. t[m + p] = t[g + p]
  46930. }
  46931. ++r
  46932. }
  46933. }
  46934. return r !== e.length && (this.times = n.AnimationUtils.arraySlice(e, 0, r),
  46935. this.values = n.AnimationUtils.arraySlice(t, 0, r * i)),
  46936. this
  46937. }
  46938. },
  46939. Object.assign(n.KeyframeTrack, {
  46940. parse: function(e) {
  46941. if (void 0 === e.type)
  46942. throw new Error("track type undefined, can not parse");
  46943. var t = n.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  46944. if (void 0 === e.times) {
  46945. console.warn("legacy JSON format detected, converting");
  46946. var i = []
  46947. , r = [];
  46948. n.AnimationUtils.flattenJSON(e.keys, i, r, "value"),
  46949. e.times = i,
  46950. e.values = r
  46951. }
  46952. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  46953. },
  46954. toJSON: function(e) {
  46955. var t, i = e.constructor;
  46956. if (void 0 !== i.toJSON)
  46957. t = i.toJSON(e);
  46958. else {
  46959. t = {
  46960. name: e.name,
  46961. times: n.AnimationUtils.convertArray(e.times, Array),
  46962. values: n.AnimationUtils.convertArray(e.values, Array)
  46963. };
  46964. var r = e.getInterpolation();
  46965. r !== e.DefaultInterpolation && (t.interpolation = r)
  46966. }
  46967. return t.type = e.ValueTypeName,
  46968. t
  46969. },
  46970. _getTrackTypeForValueTypeName: function(e) {
  46971. switch (e.toLowerCase()) {
  46972. case "scalar":
  46973. case "double":
  46974. case "float":
  46975. case "number":
  46976. case "integer":
  46977. return n.NumberKeyframeTrack;
  46978. case "vector":
  46979. case "vector2":
  46980. case "vector3":
  46981. case "vector4":
  46982. return n.VectorKeyframeTrack;
  46983. case "color":
  46984. return n.ColorKeyframeTrack;
  46985. case "quaternion":
  46986. return n.QuaternionKeyframeTrack;
  46987. case "bool":
  46988. case "boolean":
  46989. return n.BooleanKeyframeTrack;
  46990. case "string":
  46991. return n.StringKeyframeTrack
  46992. }
  46993. throw new Error("Unsupported typeName: " + e)
  46994. }
  46995. }),
  46996. n.PropertyBinding = function(e, t, i) {
  46997. this.path = t,
  46998. this.parsedPath = i || n.PropertyBinding.parseTrackName(t),
  46999. this.node = n.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  47000. this.rootNode = e
  47001. }
  47002. ,
  47003. n.PropertyBinding.prototype = {
  47004. constructor: n.PropertyBinding,
  47005. getValue: function(e, t) {
  47006. this.bind(),
  47007. this.getValue(e, t)
  47008. },
  47009. setValue: function(e, t) {
  47010. this.bind(),
  47011. this.setValue(e, t)
  47012. },
  47013. bind: function() {
  47014. var e = this.node
  47015. , t = this.parsedPath
  47016. , i = t.objectName
  47017. , r = t.propertyName
  47018. , o = t.propertyIndex;
  47019. if (e || (e = n.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  47020. this.node = e),
  47021. this.getValue = this._getValue_unavailable,
  47022. this.setValue = this._setValue_unavailable,
  47023. !e)
  47024. return void console.error(" trying to update node for track: " + this.path + " but it wasn't found.");
  47025. if (i) {
  47026. var a = t.objectIndex;
  47027. switch (i) {
  47028. case "materials":
  47029. if (!e.material)
  47030. return void console.error(" can not bind to material as node does not have a material", this);
  47031. if (!e.material.materials)
  47032. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  47033. e = e.material.materials;
  47034. break;
  47035. case "bones":
  47036. if (!e.skeleton)
  47037. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  47038. e = e.skeleton.bones;
  47039. for (var s = 0; s < e.length; s++)
  47040. if (e[s].name === a) {
  47041. a = s;
  47042. break
  47043. }
  47044. break;
  47045. default:
  47046. if (void 0 === e[i])
  47047. return void console.error(" can not bind to objectName of node, undefined", this);
  47048. e = e[i]
  47049. }
  47050. if (void 0 !== a) {
  47051. if (void 0 === e[a])
  47052. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  47053. e = e[a]
  47054. }
  47055. }
  47056. var l = e[r];
  47057. if (!l) {
  47058. var c = t.nodeName;
  47059. return void console.error(" trying to update property for track: " + c + "." + r + " but it wasn't found.", e)
  47060. }
  47061. var h = this.Versioning.None;
  47062. void 0 !== e.needsUpdate ? (h = this.Versioning.NeedsUpdate,
  47063. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (h = this.Versioning.MatrixWorldNeedsUpdate,
  47064. this.targetObject = e);
  47065. var u = this.BindingType.Direct;
  47066. if (void 0 !== o) {
  47067. if ("morphTargetInfluences" === r) {
  47068. if (!e.geometry)
  47069. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  47070. if (!e.geometry.morphTargets)
  47071. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  47072. for (var s = 0; s < this.node.geometry.morphTargets.length; s++)
  47073. if (e.geometry.morphTargets[s].name === o) {
  47074. o = s;
  47075. break
  47076. }
  47077. }
  47078. u = this.BindingType.ArrayElement,
  47079. this.resolvedProperty = l,
  47080. this.propertyIndex = o
  47081. } else
  47082. void 0 !== l.fromArray && void 0 !== l.toArray ? (u = this.BindingType.HasFromToArray,
  47083. this.resolvedProperty = l) : void 0 !== l.length ? (u = this.BindingType.EntireArray,
  47084. this.resolvedProperty = l) : this.propertyName = r;
  47085. this.getValue = this.GetterByBindingType[u],
  47086. this.setValue = this.SetterByBindingTypeAndVersioning[u][h]
  47087. },
  47088. unbind: function() {
  47089. this.node = null,
  47090. this.getValue = this._getValue_unbound,
  47091. this.setValue = this._setValue_unbound
  47092. }
  47093. },
  47094. Object.assign(n.PropertyBinding.prototype, {
  47095. _getValue_unavailable: function() {},
  47096. _setValue_unavailable: function() {},
  47097. _getValue_unbound: n.PropertyBinding.prototype.getValue,
  47098. _setValue_unbound: n.PropertyBinding.prototype.setValue,
  47099. BindingType: {
  47100. Direct: 0,
  47101. EntireArray: 1,
  47102. ArrayElement: 2,
  47103. HasFromToArray: 3
  47104. },
  47105. Versioning: {
  47106. None: 0,
  47107. NeedsUpdate: 1,
  47108. MatrixWorldNeedsUpdate: 2
  47109. },
  47110. GetterByBindingType: [function(e, t) {
  47111. e[t] = this.node[this.propertyName]
  47112. }
  47113. , function(e, t) {
  47114. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  47115. e[t++] = i[n]
  47116. }
  47117. , function(e, t) {
  47118. e[t] = this.resolvedProperty[this.propertyIndex]
  47119. }
  47120. , function(e, t) {
  47121. this.resolvedProperty.toArray(e, t)
  47122. }
  47123. ],
  47124. SetterByBindingTypeAndVersioning: [[function(e, t) {
  47125. this.node[this.propertyName] = e[t]
  47126. }
  47127. , function(e, t) {
  47128. this.node[this.propertyName] = e[t],
  47129. this.targetObject.needsUpdate = !0
  47130. }
  47131. , function(e, t) {
  47132. this.node[this.propertyName] = e[t],
  47133. this.targetObject.matrixWorldNeedsUpdate = !0
  47134. }
  47135. ], [function(e, t) {
  47136. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  47137. i[n] = e[t++]
  47138. }
  47139. , function(e, t) {
  47140. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  47141. i[n] = e[t++];
  47142. this.targetObject.needsUpdate = !0
  47143. }
  47144. , function(e, t) {
  47145. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  47146. i[n] = e[t++];
  47147. this.targetObject.matrixWorldNeedsUpdate = !0
  47148. }
  47149. ], [function(e, t) {
  47150. this.resolvedProperty[this.propertyIndex] = e[t]
  47151. }
  47152. , function(e, t) {
  47153. this.resolvedProperty[this.propertyIndex] = e[t],
  47154. this.targetObject.needsUpdate = !0
  47155. }
  47156. , function(e, t) {
  47157. this.resolvedProperty[this.propertyIndex] = e[t],
  47158. this.targetObject.matrixWorldNeedsUpdate = !0
  47159. }
  47160. ], [function(e, t) {
  47161. this.resolvedProperty.fromArray(e, t)
  47162. }
  47163. , function(e, t) {
  47164. this.resolvedProperty.fromArray(e, t),
  47165. this.targetObject.needsUpdate = !0
  47166. }
  47167. , function(e, t) {
  47168. this.resolvedProperty.fromArray(e, t),
  47169. this.targetObject.matrixWorldNeedsUpdate = !0
  47170. }
  47171. ]]
  47172. }),
  47173. n.PropertyBinding.Composite = function(e, t, i) {
  47174. var r = i || n.PropertyBinding.parseTrackName(t);
  47175. this._targetGroup = e,
  47176. this._bindings = e.subscribe_(t, r)
  47177. }
  47178. ,
  47179. n.PropertyBinding.Composite.prototype = {
  47180. constructor: n.PropertyBinding.Composite,
  47181. getValue: function(e, t) {
  47182. this.bind();
  47183. var i = this._targetGroup.nCachedObjects_
  47184. , n = this._bindings[i];
  47185. void 0 !== n && n.getValue(e, t)
  47186. },
  47187. setValue: function(e, t) {
  47188. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  47189. i[n].setValue(e, t)
  47190. },
  47191. bind: function() {
  47192. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  47193. e[t].bind()
  47194. },
  47195. unbind: function() {
  47196. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  47197. e[t].unbind()
  47198. }
  47199. },
  47200. n.PropertyBinding.create = function(e, t, i) {
  47201. return e instanceof n.AnimationObjectGroup ? new n.PropertyBinding.Composite(e,t,i) : new n.PropertyBinding(e,t,i)
  47202. }
  47203. ,
  47204. n.PropertyBinding.parseTrackName = function(e) {
  47205. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  47206. , i = t.exec(e);
  47207. if (!i)
  47208. throw new Error("cannot parse trackName at all: " + e);
  47209. i.index === t.lastIndex && t.lastIndex++;
  47210. var n = {
  47211. nodeName: i[3],
  47212. objectName: i[5],
  47213. objectIndex: i[7],
  47214. propertyName: i[9],
  47215. propertyIndex: i[11]
  47216. };
  47217. if (null === n.propertyName || 0 === n.propertyName.length)
  47218. throw new Error("can not parse propertyName from trackName: " + e);
  47219. return n
  47220. }
  47221. ,
  47222. n.PropertyBinding.findNode = function(e, t) {
  47223. if (!t || "" === t || "root" === t || "." === t || t === -1 || t === e.name || t === e.uuid)
  47224. return e;
  47225. if (e.skeleton) {
  47226. var i = function(e) {
  47227. for (var i = 0; i < e.bones.length; i++) {
  47228. var n = e.bones[i];
  47229. if (n.name === t)
  47230. return n
  47231. }
  47232. return null
  47233. }
  47234. , n = i(e.skeleton);
  47235. if (n)
  47236. return n
  47237. }
  47238. if (e.children) {
  47239. var r = function(e) {
  47240. for (var i = 0; i < e.length; i++) {
  47241. var n = e[i];
  47242. if (n.name === t || n.uuid === t)
  47243. return n;
  47244. var o = r(n.children);
  47245. if (o)
  47246. return o
  47247. }
  47248. return null
  47249. }
  47250. , o = r(e.children);
  47251. if (o)
  47252. return o
  47253. }
  47254. return null
  47255. }
  47256. ,
  47257. n.PropertyMixer = function(e, t, i) {
  47258. this.binding = e,
  47259. this.valueSize = i;
  47260. var n, r = Float64Array;
  47261. switch (t) {
  47262. case "quaternion":
  47263. n = this._slerp;
  47264. break;
  47265. case "string":
  47266. case "bool":
  47267. r = Array,
  47268. n = this._select;
  47269. break;
  47270. default:
  47271. n = this._lerp
  47272. }
  47273. this.buffer = new r(4 * i),
  47274. this._mixBufferRegion = n,
  47275. this.cumulativeWeight = 0,
  47276. this.useCount = 0,
  47277. this.referenceCount = 0
  47278. }
  47279. ,
  47280. n.PropertyMixer.prototype = {
  47281. constructor: n.PropertyMixer,
  47282. accumulate: function(e, t) {
  47283. var i = this.buffer
  47284. , n = this.valueSize
  47285. , r = e * n + n
  47286. , o = this.cumulativeWeight;
  47287. if (0 === o) {
  47288. for (var a = 0; a !== n; ++a)
  47289. i[r + a] = i[a];
  47290. o = t
  47291. } else {
  47292. o += t;
  47293. var s = t / o;
  47294. this._mixBufferRegion(i, r, 0, s, n)
  47295. }
  47296. this.cumulativeWeight = o
  47297. },
  47298. apply: function(e) {
  47299. var t = this.valueSize
  47300. , i = this.buffer
  47301. , n = e * t + t
  47302. , r = this.cumulativeWeight
  47303. , o = this.binding;
  47304. if (this.cumulativeWeight = 0,
  47305. r < 1) {
  47306. var a = 3 * t;
  47307. this._mixBufferRegion(i, n, a, 1 - r, t)
  47308. }
  47309. for (var s = t, l = t + t; s !== l; ++s)
  47310. if (i[s] !== i[s + t]) {
  47311. o.setValue(i, n);
  47312. break
  47313. }
  47314. },
  47315. saveOriginalState: function() {
  47316. var e = this.binding
  47317. , t = this.buffer
  47318. , i = this.valueSize
  47319. , n = 3 * i;
  47320. e.getValue(t, n);
  47321. for (var r = i, o = n; r !== o; ++r)
  47322. t[r] = t[n + r % i];
  47323. this.cumulativeWeight = 0
  47324. },
  47325. restoreOriginalState: function() {
  47326. var e = 3 * this.valueSize;
  47327. this.binding.setValue(this.buffer, e)
  47328. },
  47329. _select: function(e, t, i, n, r) {
  47330. if (n >= .5)
  47331. for (var o = 0; o !== r; ++o)
  47332. e[t + o] = e[i + o]
  47333. },
  47334. _slerp: function(e, t, i, r, o) {
  47335. n.Quaternion.slerpFlat(e, t, e, t, e, i, r)
  47336. },
  47337. _lerp: function(e, t, i, n, r) {
  47338. for (var o = 1 - n, a = 0; a !== r; ++a) {
  47339. var s = t + a;
  47340. e[s] = e[s] * o + e[i + a] * n
  47341. }
  47342. }
  47343. },
  47344. n.BooleanKeyframeTrack = function(e, t, i) {
  47345. n.KeyframeTrack.call(this, e, t, i)
  47346. }
  47347. ,
  47348. n.BooleanKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47349. constructor: n.BooleanKeyframeTrack,
  47350. ValueTypeName: "bool",
  47351. ValueBufferType: Array,
  47352. DefaultInterpolation: n.IntepolateDiscrete,
  47353. InterpolantFactoryMethodLinear: void 0,
  47354. InterpolantFactoryMethodSmooth: void 0
  47355. }),
  47356. n.NumberKeyframeTrack = function(e, t, i, r) {
  47357. n.KeyframeTrack.call(this, e, t, i, r)
  47358. }
  47359. ,
  47360. n.NumberKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47361. constructor: n.NumberKeyframeTrack,
  47362. ValueTypeName: "number"
  47363. }),
  47364. n.QuaternionKeyframeTrack = function(e, t, i, r) {
  47365. n.KeyframeTrack.call(this, e, t, i, r)
  47366. }
  47367. ,
  47368. n.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47369. constructor: n.QuaternionKeyframeTrack,
  47370. ValueTypeName: "quaternion",
  47371. DefaultInterpolation: n.InterpolateLinear,
  47372. InterpolantFactoryMethodLinear: function(e) {
  47373. return new n.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  47374. },
  47375. InterpolantFactoryMethodSmooth: void 0
  47376. }),
  47377. n.StringKeyframeTrack = function(e, t, i, r) {
  47378. n.KeyframeTrack.call(this, e, t, i, r)
  47379. }
  47380. ,
  47381. n.StringKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47382. constructor: n.StringKeyframeTrack,
  47383. ValueTypeName: "string",
  47384. ValueBufferType: Array,
  47385. DefaultInterpolation: n.IntepolateDiscrete,
  47386. InterpolantFactoryMethodLinear: void 0,
  47387. InterpolantFactoryMethodSmooth: void 0
  47388. }),
  47389. n.VectorKeyframeTrack = function(e, t, i, r) {
  47390. n.KeyframeTrack.call(this, e, t, i, r)
  47391. }
  47392. ,
  47393. n.VectorKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47394. constructor: n.VectorKeyframeTrack,
  47395. ValueTypeName: "vector"
  47396. }),
  47397. n.Audio = function(e) {
  47398. n.Object3D.call(this),
  47399. this.type = "Audio",
  47400. this.context = e.context,
  47401. this.source = this.context.createBufferSource(),
  47402. this.source.onended = this.onEnded.bind(this),
  47403. this.gain = this.context.createGain(),
  47404. this.gain.connect(e.getInput()),
  47405. this.autoplay = !1,
  47406. this.startTime = 0,
  47407. this.playbackRate = 1,
  47408. this.isPlaying = !1,
  47409. this.hasPlaybackControl = !0,
  47410. this.sourceType = "empty",
  47411. this.filter = null
  47412. }
  47413. ,
  47414. n.Audio.prototype = Object.create(n.Object3D.prototype),
  47415. n.Audio.prototype.constructor = n.Audio,
  47416. n.Audio.prototype.getOutput = function() {
  47417. return this.gain
  47418. }
  47419. ,
  47420. n.Audio.prototype.load = function(e) {
  47421. var t = new n.AudioBuffer(this.context);
  47422. return t.load(e),
  47423. this.setBuffer(t),
  47424. this
  47425. }
  47426. ,
  47427. n.Audio.prototype.setNodeSource = function(e) {
  47428. return this.hasPlaybackControl = !1,
  47429. this.sourceType = "audioNode",
  47430. this.source = e,
  47431. this.connect(),
  47432. this
  47433. }
  47434. ,
  47435. n.Audio.prototype.setBuffer = function(e) {
  47436. var t = this;
  47437. return e.onReady(function(e) {
  47438. t.source.buffer = e,
  47439. t.sourceType = "buffer",
  47440. t.autoplay && t.play()
  47441. }),
  47442. this
  47443. }
  47444. ,
  47445. n.Audio.prototype.play = function() {
  47446. if (this.isPlaying === !0)
  47447. return void console.warn("THREE.Audio: Audio is already playing.");
  47448. if (this.hasPlaybackControl === !1)
  47449. return void console.warn("THREE.Audio: this Audio has no playback control.");
  47450. var e = this.context.createBufferSource();
  47451. e.buffer = this.source.buffer,
  47452. e.loop = this.source.loop,
  47453. e.onended = this.source.onended,
  47454. e.start(0, this.startTime),
  47455. e.playbackRate.value = this.playbackRate,
  47456. this.isPlaying = !0,
  47457. this.source = e,
  47458. this.connect()
  47459. }
  47460. ,
  47461. n.Audio.prototype.pause = function() {
  47462. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  47463. void (this.startTime = this.context.currentTime))
  47464. }
  47465. ,
  47466. n.Audio.prototype.stop = function() {
  47467. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  47468. void (this.startTime = 0))
  47469. }
  47470. ,
  47471. n.Audio.prototype.connect = function() {
  47472. null !== this.filter ? (this.source.connect(this.filter),
  47473. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  47474. }
  47475. ,
  47476. n.Audio.prototype.disconnect = function() {
  47477. null !== this.filter ? (this.source.disconnect(this.filter),
  47478. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  47479. }
  47480. ,
  47481. n.Audio.prototype.getFilter = function() {
  47482. return this.filter
  47483. }
  47484. ,
  47485. n.Audio.prototype.setFilter = function(e) {
  47486. void 0 === e && (e = null),
  47487. this.isPlaying === !0 ? (this.disconnect(),
  47488. this.filter = e,
  47489. this.connect()) : this.filter = e
  47490. }
  47491. ,
  47492. n.Audio.prototype.setPlaybackRate = function(e) {
  47493. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  47494. void (this.isPlaying === !0 && (this.source.playbackRate.value = this.playbackRate)))
  47495. }
  47496. ,
  47497. n.Audio.prototype.getPlaybackRate = function() {
  47498. return this.playbackRate
  47499. }
  47500. ,
  47501. n.Audio.prototype.onEnded = function() {
  47502. this.isPlaying = !1
  47503. }
  47504. ,
  47505. n.Audio.prototype.setLoop = function(e) {
  47506. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  47507. }
  47508. ,
  47509. n.Audio.prototype.getLoop = function() {
  47510. return this.hasPlaybackControl === !1 ? (console.warn("THREE.Audio: this Audio has no playback control."),
  47511. !1) : this.source.loop
  47512. }
  47513. ,
  47514. n.Audio.prototype.setVolume = function(e) {
  47515. this.gain.gain.value = e
  47516. }
  47517. ,
  47518. n.Audio.prototype.getVolume = function() {
  47519. return this.gain.gain.value
  47520. }
  47521. ,
  47522. n.AudioAnalyser = function(e, t) {
  47523. this.analyser = e.context.createAnalyser(),
  47524. this.analyser.fftSize = void 0 !== t ? t : 2048,
  47525. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  47526. e.getOutput().connect(this.analyser)
  47527. }
  47528. ,
  47529. n.AudioAnalyser.prototype = {
  47530. constructor: n.AudioAnalyser,
  47531. getData: function() {
  47532. return this.analyser.getByteFrequencyData(this.data),
  47533. this.data
  47534. }
  47535. },
  47536. n.AudioBuffer = function(e) {
  47537. this.context = e,
  47538. this.ready = !1,
  47539. this.readyCallbacks = []
  47540. }
  47541. ,
  47542. n.AudioBuffer.prototype.load = function(e) {
  47543. var t = this
  47544. , i = new XMLHttpRequest;
  47545. return i.open("GET", e, !0),
  47546. i.responseType = "arraybuffer",
  47547. i.onload = function(e) {
  47548. t.context.decodeAudioData(this.response, function(e) {
  47549. t.buffer = e,
  47550. t.ready = !0;
  47551. for (var i = 0; i < t.readyCallbacks.length; i++)
  47552. t.readyCallbacks[i](t.buffer);
  47553. t.readyCallbacks = []
  47554. })
  47555. }
  47556. ,
  47557. i.send(),
  47558. this
  47559. }
  47560. ,
  47561. n.AudioBuffer.prototype.onReady = function(e) {
  47562. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  47563. }
  47564. ,
  47565. n.PositionalAudio = function(e) {
  47566. n.Audio.call(this, e),
  47567. this.panner = this.context.createPanner(),
  47568. this.panner.connect(this.gain)
  47569. }
  47570. ,
  47571. n.PositionalAudio.prototype = Object.create(n.Audio.prototype),
  47572. n.PositionalAudio.prototype.constructor = n.PositionalAudio,
  47573. n.PositionalAudio.prototype.getOutput = function() {
  47574. return this.panner
  47575. }
  47576. ,
  47577. n.PositionalAudio.prototype.setRefDistance = function(e) {
  47578. this.panner.refDistance = e
  47579. }
  47580. ,
  47581. n.PositionalAudio.prototype.getRefDistance = function() {
  47582. return this.panner.refDistance
  47583. }
  47584. ,
  47585. n.PositionalAudio.prototype.setRolloffFactor = function(e) {
  47586. this.panner.rolloffFactor = e
  47587. }
  47588. ,
  47589. n.PositionalAudio.prototype.getRolloffFactor = function() {
  47590. return this.panner.rolloffFactor
  47591. }
  47592. ,
  47593. n.PositionalAudio.prototype.setDistanceModel = function(e) {
  47594. this.panner.distanceModel = e
  47595. }
  47596. ,
  47597. n.PositionalAudio.prototype.getDistanceModel = function() {
  47598. return this.panner.distanceModel
  47599. }
  47600. ,
  47601. n.PositionalAudio.prototype.setMaxDistance = function(e) {
  47602. this.panner.maxDistance = e
  47603. }
  47604. ,
  47605. n.PositionalAudio.prototype.getMaxDistance = function() {
  47606. return this.panner.maxDistance
  47607. }
  47608. ,
  47609. n.PositionalAudio.prototype.updateMatrixWorld = function() {
  47610. var e = new n.Vector3;
  47611. return function(t) {
  47612. n.Object3D.prototype.updateMatrixWorld.call(this, t),
  47613. e.setFromMatrixPosition(this.matrixWorld),
  47614. this.panner.setPosition(e.x, e.y, e.z)
  47615. }
  47616. }(),
  47617. n.AudioListener = function() {
  47618. n.Object3D.call(this),
  47619. this.type = "AudioListener",
  47620. this.context = new (window.AudioContext || window.webkitAudioContext),
  47621. this.gain = this.context.createGain(),
  47622. this.gain.connect(this.context.destination),
  47623. this.filter = null
  47624. }
  47625. ,
  47626. n.AudioListener.prototype = Object.create(n.Object3D.prototype),
  47627. n.AudioListener.prototype.constructor = n.AudioListener,
  47628. n.AudioListener.prototype.getInput = function() {
  47629. return this.gain
  47630. }
  47631. ,
  47632. n.AudioListener.prototype.removeFilter = function() {
  47633. null !== this.filter && (this.gain.disconnect(this.filter),
  47634. this.filter.disconnect(this.context.destination),
  47635. this.gain.connect(this.context.destination),
  47636. this.filter = null)
  47637. }
  47638. ,
  47639. n.AudioListener.prototype.setFilter = function(e) {
  47640. null !== this.filter ? (this.gain.disconnect(this.filter),
  47641. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  47642. this.filter = e,
  47643. this.gain.connect(this.filter),
  47644. this.filter.connect(this.context.destination)
  47645. }
  47646. ,
  47647. n.AudioListener.prototype.getFilter = function() {
  47648. return this.filter
  47649. }
  47650. ,
  47651. n.AudioListener.prototype.setMasterVolume = function(e) {
  47652. this.gain.gain.value = e
  47653. }
  47654. ,
  47655. n.AudioListener.prototype.getMasterVolume = function() {
  47656. return this.gain.gain.value
  47657. }
  47658. ,
  47659. n.AudioListener.prototype.updateMatrixWorld = function() {
  47660. var e = new n.Vector3
  47661. , t = new n.Quaternion
  47662. , i = new n.Vector3
  47663. , r = new n.Vector3;
  47664. return function(o) {
  47665. n.Object3D.prototype.updateMatrixWorld.call(this, o);
  47666. var a = this.context.listener
  47667. , s = this.up;
  47668. this.matrixWorld.decompose(e, t, i),
  47669. r.set(0, 0, -1).applyQuaternion(t),
  47670. a.setPosition(e.x, e.y, e.z),
  47671. a.setOrientation(r.x, r.y, r.z, s.x, s.y, s.z)
  47672. }
  47673. }(),
  47674. n.Camera = function() {
  47675. n.Object3D.call(this),
  47676. this.type = "Camera",
  47677. this.matrixWorldInverse = new n.Matrix4,
  47678. this.projectionMatrix = new n.Matrix4
  47679. }
  47680. ,
  47681. n.Camera.prototype = Object.create(n.Object3D.prototype),
  47682. n.Camera.prototype.constructor = n.Camera,
  47683. n.Camera.prototype.getWorldDirection = function() {
  47684. var e = new n.Quaternion;
  47685. return function(t) {
  47686. var i = t || new n.Vector3;
  47687. return this.getWorldQuaternion(e),
  47688. i.set(0, 0, -1).applyQuaternion(e)
  47689. }
  47690. }(),
  47691. n.Camera.prototype.lookAt = function() {
  47692. var e = new n.Matrix4;
  47693. return function(t) {
  47694. e.lookAt(this.position, t, this.up),
  47695. this.quaternion.setFromRotationMatrix(e)
  47696. }
  47697. }(),
  47698. n.Camera.prototype.clone = function() {
  47699. return (new this.constructor).copy(this)
  47700. }
  47701. ,
  47702. n.Camera.prototype.copy = function(e) {
  47703. return n.Object3D.prototype.copy.call(this, e),
  47704. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  47705. this.projectionMatrix.copy(e.projectionMatrix),
  47706. this
  47707. }
  47708. ,
  47709. n.CubeCamera = function(e, t, i) {
  47710. n.Object3D.call(this),
  47711. this.type = "CubeCamera";
  47712. var r = 90
  47713. , o = 1
  47714. , a = new n.PerspectiveCamera(r,o,e,t);
  47715. a.up.set(0, -1, 0),
  47716. a.lookAt(new n.Vector3(1,0,0)),
  47717. this.add(a);
  47718. var s = new n.PerspectiveCamera(r,o,e,t);
  47719. s.up.set(0, -1, 0),
  47720. s.lookAt(new n.Vector3(-1,0,0)),
  47721. this.add(s);
  47722. var l = new n.PerspectiveCamera(r,o,e,t);
  47723. l.up.set(0, 0, 1),
  47724. l.lookAt(new n.Vector3(0,1,0)),
  47725. this.add(l);
  47726. var c = new n.PerspectiveCamera(r,o,e,t);
  47727. c.up.set(0, 0, -1),
  47728. c.lookAt(new n.Vector3(0,-1,0)),
  47729. this.add(c);
  47730. var h = new n.PerspectiveCamera(r,o,e,t);
  47731. h.up.set(0, -1, 0),
  47732. h.lookAt(new n.Vector3(0,0,1)),
  47733. this.add(h);
  47734. var u = new n.PerspectiveCamera(r,o,e,t);
  47735. u.up.set(0, -1, 0),
  47736. u.lookAt(new n.Vector3(0,0,-1)),
  47737. this.add(u);
  47738. var d = {
  47739. format: n.RGBFormat,
  47740. magFilter: n.LinearFilter,
  47741. minFilter: n.LinearFilter
  47742. };
  47743. this.renderTarget = new n.WebGLRenderTargetCube(i,i,d),
  47744. this.updateCubeMap = function(e, t) {
  47745. null === this.parent && this.updateMatrixWorld();
  47746. var i = this.renderTarget
  47747. , n = i.texture.generateMipmaps;
  47748. i.texture.generateMipmaps = !1,
  47749. i.activeCubeFace = 0,
  47750. e.render(t, a, i),
  47751. i.activeCubeFace = 1,
  47752. e.render(t, s, i),
  47753. i.activeCubeFace = 2,
  47754. e.render(t, l, i),
  47755. i.activeCubeFace = 3,
  47756. e.render(t, c, i),
  47757. i.activeCubeFace = 4,
  47758. e.render(t, h, i),
  47759. i.texture.generateMipmaps = n,
  47760. i.activeCubeFace = 5,
  47761. e.render(t, u, i),
  47762. e.setRenderTarget(null)
  47763. }
  47764. }
  47765. ,
  47766. n.CubeCamera.prototype = Object.create(n.Object3D.prototype),
  47767. n.CubeCamera.prototype.constructor = n.CubeCamera,
  47768. n.OrthographicCamera = function(e, t, i, r, o, a) {
  47769. n.Camera.call(this),
  47770. this.type = "OrthographicCamera",
  47771. this.zoom = 1,
  47772. this.left = e,
  47773. this.right = t,
  47774. this.top = i,
  47775. this.bottom = r,
  47776. this.near = void 0 !== o ? o : .1,
  47777. this.far = void 0 !== a ? a : 2e3,
  47778. this.updateProjectionMatrix()
  47779. }
  47780. ,
  47781. n.OrthographicCamera.prototype = Object.create(n.Camera.prototype),
  47782. n.OrthographicCamera.prototype.constructor = n.OrthographicCamera,
  47783. n.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  47784. var e = (this.right - this.left) / (2 * this.zoom)
  47785. , t = (this.top - this.bottom) / (2 * this.zoom)
  47786. , i = (this.right + this.left) / 2
  47787. , n = (this.top + this.bottom) / 2;
  47788. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  47789. }
  47790. ,
  47791. n.OrthographicCamera.prototype.copy = function(e) {
  47792. return n.Camera.prototype.copy.call(this, e),
  47793. this.left = e.left,
  47794. this.right = e.right,
  47795. this.top = e.top,
  47796. this.bottom = e.bottom,
  47797. this.near = e.near,
  47798. this.far = e.far,
  47799. this.zoom = e.zoom,
  47800. this
  47801. }
  47802. ,
  47803. n.OrthographicCamera.prototype.toJSON = function(e) {
  47804. var t = n.Object3D.prototype.toJSON.call(this, e);
  47805. return t.object.zoom = this.zoom,
  47806. t.object.left = this.left,
  47807. t.object.right = this.right,
  47808. t.object.top = this.top,
  47809. t.object.bottom = this.bottom,
  47810. t.object.near = this.near,
  47811. t.object.far = this.far,
  47812. t
  47813. }
  47814. ,
  47815. n.PerspectiveCamera = function(e, t, i, r) {
  47816. n.Camera.call(this),
  47817. this.type = "PerspectiveCamera",
  47818. this.focalLength = 10,
  47819. this.zoom = 1,
  47820. this.fov = void 0 !== e ? e : 50,
  47821. this.aspect = void 0 !== t ? t : 1,
  47822. this.near = void 0 !== i ? i : .1,
  47823. this.far = void 0 !== r ? r : 2e3,
  47824. this.updateProjectionMatrix()
  47825. }
  47826. ,
  47827. n.PerspectiveCamera.prototype = Object.create(n.Camera.prototype),
  47828. n.PerspectiveCamera.prototype.constructor = n.PerspectiveCamera,
  47829. n.PerspectiveCamera.prototype.setLens = function(e, t) {
  47830. void 0 === t && (t = 24),
  47831. this.fov = 2 * n.Math.radToDeg(Math.atan(t / (2 * e))),
  47832. this.updateProjectionMatrix()
  47833. }
  47834. ,
  47835. n.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  47836. this.fullWidth = e,
  47837. this.fullHeight = t,
  47838. this.x = i,
  47839. this.y = n,
  47840. this.width = r,
  47841. this.height = o,
  47842. this.updateProjectionMatrix()
  47843. }
  47844. ,
  47845. n.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  47846. var e = n.Math.radToDeg(2 * Math.atan(Math.tan(.5 * n.Math.degToRad(this.fov)) / this.zoom));
  47847. if (this.fullWidth) {
  47848. var t = this.fullWidth / this.fullHeight
  47849. , i = Math.tan(n.Math.degToRad(.5 * e)) * this.near
  47850. , r = -i
  47851. , o = t * r
  47852. , a = t * i
  47853. , s = Math.abs(a - o)
  47854. , l = Math.abs(i - r);
  47855. 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)
  47856. } else
  47857. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  47858. }
  47859. ,
  47860. n.PerspectiveCamera.prototype.copy = function(e) {
  47861. return n.Camera.prototype.copy.call(this, e),
  47862. this.focalLength = e.focalLength,
  47863. this.zoom = e.zoom,
  47864. this.fov = e.fov,
  47865. this.aspect = e.aspect,
  47866. this.near = e.near,
  47867. this.far = e.far,
  47868. this
  47869. }
  47870. ,
  47871. n.PerspectiveCamera.prototype.toJSON = function(e) {
  47872. var t = n.Object3D.prototype.toJSON.call(this, e);
  47873. return t.object.focalLength = this.focalLength,
  47874. t.object.zoom = this.zoom,
  47875. t.object.fov = this.fov,
  47876. t.object.aspect = this.aspect,
  47877. t.object.near = this.near,
  47878. t.object.far = this.far,
  47879. t
  47880. }
  47881. ,
  47882. n.StereoCamera = function() {
  47883. this.type = "StereoCamera",
  47884. this.aspect = 1,
  47885. this.cameraL = new n.PerspectiveCamera,
  47886. this.cameraL.layers.enable(1),
  47887. this.cameraL.matrixAutoUpdate = !1,
  47888. this.cameraR = new n.PerspectiveCamera,
  47889. this.cameraR.layers.enable(2),
  47890. this.cameraR.matrixAutoUpdate = !1
  47891. }
  47892. ,
  47893. n.StereoCamera.prototype = {
  47894. constructor: n.StereoCamera,
  47895. update: function() {
  47896. var e, t, i, r, o, a = new n.Matrix4, s = new n.Matrix4;
  47897. return function(l) {
  47898. var c = e !== l.focalLength || t !== l.fov || i !== l.aspect * this.aspect || r !== l.near || o !== l.far;
  47899. if (c) {
  47900. e = l.focalLength,
  47901. t = l.fov,
  47902. i = l.aspect * this.aspect,
  47903. r = l.near,
  47904. o = l.far;
  47905. var h, u, d = l.projectionMatrix.clone(), p = .032, f = p * r / e, g = r * Math.tan(n.Math.degToRad(.5 * t));
  47906. s.elements[12] = -p,
  47907. a.elements[12] = p,
  47908. h = -g * i + f,
  47909. u = g * i + f,
  47910. d.elements[0] = 2 * r / (u - h),
  47911. d.elements[8] = (u + h) / (u - h),
  47912. this.cameraL.projectionMatrix.copy(d),
  47913. h = -g * i - f,
  47914. u = g * i - f,
  47915. d.elements[0] = 2 * r / (u - h),
  47916. d.elements[8] = (u + h) / (u - h),
  47917. this.cameraR.projectionMatrix.copy(d)
  47918. }
  47919. this.cameraL.matrixWorld.copy(l.matrixWorld).multiply(s),
  47920. this.cameraR.matrixWorld.copy(l.matrixWorld).multiply(a)
  47921. }
  47922. }()
  47923. },
  47924. n.Light = function(e, t) {
  47925. n.Object3D.call(this),
  47926. this.type = "Light",
  47927. this.color = new n.Color(e),
  47928. this.intensity = void 0 !== t ? t : 1,
  47929. this.receiveShadow = void 0
  47930. }
  47931. ,
  47932. n.Light.prototype = Object.create(n.Object3D.prototype),
  47933. n.Light.prototype.constructor = n.Light,
  47934. n.Light.prototype.copy = function(e) {
  47935. return n.Object3D.prototype.copy.call(this, e),
  47936. this.color.copy(e.color),
  47937. this.intensity = e.intensity,
  47938. this
  47939. }
  47940. ,
  47941. n.Light.prototype.toJSON = function(e) {
  47942. var t = n.Object3D.prototype.toJSON.call(this, e);
  47943. return t.object.color = this.color.getHex(),
  47944. t.object.intensity = this.intensity,
  47945. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  47946. void 0 !== this.distance && (t.object.distance = this.distance),
  47947. void 0 !== this.angle && (t.object.angle = this.angle),
  47948. void 0 !== this.decay && (t.object.decay = this.decay),
  47949. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  47950. t
  47951. }
  47952. ,
  47953. n.LightShadow = function(e) {
  47954. this.camera = e,
  47955. this.bias = 0,
  47956. this.radius = 1,
  47957. this.mapSize = new n.Vector2(512,512),
  47958. this.map = null,
  47959. this.matrix = new n.Matrix4
  47960. }
  47961. ,
  47962. n.LightShadow.prototype = {
  47963. constructor: n.LightShadow,
  47964. copy: function(e) {
  47965. return this.camera = e.camera.clone(),
  47966. this.bias = e.bias,
  47967. this.radius = e.radius,
  47968. this.mapSize.copy(e.mapSize),
  47969. this
  47970. },
  47971. clone: function() {
  47972. return (new this.constructor).copy(this)
  47973. }
  47974. },
  47975. n.AmbientLight = function(e, t) {
  47976. n.Light.call(this, e, t),
  47977. this.type = "AmbientLight",
  47978. this.castShadow = void 0
  47979. }
  47980. ,
  47981. n.AmbientLight.prototype = Object.create(n.Light.prototype),
  47982. n.AmbientLight.prototype.constructor = n.AmbientLight,
  47983. n.DirectionalLight = function(e, t) {
  47984. n.Light.call(this, e, t),
  47985. this.type = "DirectionalLight",
  47986. this.position.set(0, 1, 0),
  47987. this.updateMatrix(),
  47988. this.target = new n.Object3D,
  47989. this.shadow = new n.LightShadow(new n.OrthographicCamera(-5,5,5,-5,.5,500))
  47990. }
  47991. ,
  47992. n.DirectionalLight.prototype = Object.create(n.Light.prototype),
  47993. n.DirectionalLight.prototype.constructor = n.DirectionalLight,
  47994. n.DirectionalLight.prototype.copy = function(e) {
  47995. return n.Light.prototype.copy.call(this, e),
  47996. this.target = e.target.clone(),
  47997. this.shadow = e.shadow.clone(),
  47998. this
  47999. }
  48000. ,
  48001. n.HemisphereLight = function(e, t, i) {
  48002. n.Light.call(this, e, i),
  48003. this.type = "HemisphereLight",
  48004. this.castShadow = void 0,
  48005. this.position.set(0, 1, 0),
  48006. this.updateMatrix(),
  48007. this.groundColor = new n.Color(t)
  48008. }
  48009. ,
  48010. n.HemisphereLight.prototype = Object.create(n.Light.prototype),
  48011. n.HemisphereLight.prototype.constructor = n.HemisphereLight,
  48012. n.HemisphereLight.prototype.copy = function(e) {
  48013. return n.Light.prototype.copy.call(this, e),
  48014. this.groundColor.copy(e.groundColor),
  48015. this
  48016. }
  48017. ,
  48018. n.PointLight = function(e, t, i, r) {
  48019. n.Light.call(this, e, t),
  48020. this.type = "PointLight",
  48021. this.distance = void 0 !== i ? i : 0,
  48022. this.decay = void 0 !== r ? r : 1,
  48023. this.shadow = new n.LightShadow(new n.PerspectiveCamera(90,1,.5,500))
  48024. }
  48025. ,
  48026. n.PointLight.prototype = Object.create(n.Light.prototype),
  48027. n.PointLight.prototype.constructor = n.PointLight,
  48028. Object.defineProperty(n.PointLight.prototype, "power", {
  48029. get: function() {
  48030. return 4 * this.intensity * Math.PI
  48031. },
  48032. set: function(e) {
  48033. this.intensity = e / (4 * Math.PI)
  48034. }
  48035. }),
  48036. n.PointLight.prototype.copy = function(e) {
  48037. return n.Light.prototype.copy.call(this, e),
  48038. this.distance = e.distance,
  48039. this.decay = e.decay,
  48040. this.shadow = e.shadow.clone(),
  48041. this
  48042. }
  48043. ,
  48044. n.SpotLight = function(e, t, i, r, o, a) {
  48045. n.Light.call(this, e, t),
  48046. this.type = "SpotLight",
  48047. this.position.set(0, 1, 0),
  48048. this.updateMatrix(),
  48049. this.target = new n.Object3D,
  48050. this.distance = void 0 !== i ? i : 0,
  48051. this.angle = void 0 !== r ? r : Math.PI / 3,
  48052. this.penumbra = void 0 !== o ? o : 0,
  48053. this.decay = void 0 !== a ? a : 1,
  48054. this.shadow = new n.LightShadow(new n.PerspectiveCamera(50,1,.5,500))
  48055. }
  48056. ,
  48057. n.SpotLight.prototype = Object.create(n.Light.prototype),
  48058. n.SpotLight.prototype.constructor = n.SpotLight,
  48059. Object.defineProperty(n.SpotLight.prototype, "power", {
  48060. get: function() {
  48061. return this.intensity * Math.PI
  48062. },
  48063. set: function(e) {
  48064. this.intensity = e / Math.PI
  48065. }
  48066. }),
  48067. n.SpotLight.prototype.copy = function(e) {
  48068. return n.Light.prototype.copy.call(this, e),
  48069. this.distance = e.distance,
  48070. this.angle = e.angle,
  48071. this.penumbra = e.penumbra,
  48072. this.decay = e.decay,
  48073. this.target = e.target.clone(),
  48074. this.shadow = e.shadow.clone(),
  48075. this
  48076. }
  48077. ,
  48078. n.Cache = {
  48079. enabled: !1,
  48080. files: {},
  48081. add: function(e, t) {
  48082. this.enabled !== !1 && (this.files[e] = t)
  48083. },
  48084. get: function(e) {
  48085. if (this.enabled !== !1)
  48086. return this.files[e]
  48087. },
  48088. remove: function(e) {
  48089. delete this.files[e]
  48090. },
  48091. clear: function() {
  48092. this.files = {}
  48093. }
  48094. },
  48095. n.Loader = function() {
  48096. this.onLoadStart = function() {}
  48097. ,
  48098. this.onLoadProgress = function() {}
  48099. ,
  48100. this.onLoadComplete = function() {}
  48101. }
  48102. ,
  48103. n.Loader.prototype = {
  48104. constructor: n.Loader,
  48105. crossOrigin: void 0,
  48106. extractUrlBase: function(e) {
  48107. var t = e.split("/");
  48108. return 1 === t.length ? "./" : (t.pop(),
  48109. t.join("/") + "/")
  48110. },
  48111. initMaterials: function(e, t, i) {
  48112. for (var n = [], r = 0; r < e.length; ++r)
  48113. n[r] = this.createMaterial(e[r], t, i);
  48114. return n
  48115. },
  48116. createMaterial: function() {
  48117. var e, t, i;
  48118. return function(r, o, a) {
  48119. function s(e, i, r, s, c) {
  48120. var h, u = o + e, d = n.Loader.Handlers.get(u);
  48121. null !== d ? h = d.load(u) : (t.setCrossOrigin(a),
  48122. h = t.load(u)),
  48123. void 0 !== i && (h.repeat.fromArray(i),
  48124. 1 !== i[0] && (h.wrapS = n.RepeatWrapping),
  48125. 1 !== i[1] && (h.wrapT = n.RepeatWrapping)),
  48126. void 0 !== r && h.offset.fromArray(r),
  48127. void 0 !== s && ("repeat" === s[0] && (h.wrapS = n.RepeatWrapping),
  48128. "mirror" === s[0] && (h.wrapS = n.MirroredRepeatWrapping),
  48129. "repeat" === s[1] && (h.wrapT = n.RepeatWrapping),
  48130. "mirror" === s[1] && (h.wrapT = n.MirroredRepeatWrapping)),
  48131. void 0 !== c && (h.anisotropy = c);
  48132. var p = n.Math.generateUUID();
  48133. return l[p] = h,
  48134. p
  48135. }
  48136. void 0 === e && (e = new n.Color),
  48137. void 0 === t && (t = new n.TextureLoader),
  48138. void 0 === i && (i = new n.MaterialLoader);
  48139. var l = {}
  48140. , c = {
  48141. uuid: n.Math.generateUUID(),
  48142. type: "MeshLambertMaterial"
  48143. };
  48144. for (var h in r) {
  48145. var u = r[h];
  48146. switch (h) {
  48147. case "DbgColor":
  48148. case "DbgIndex":
  48149. case "opticalDensity":
  48150. case "illumination":
  48151. break;
  48152. case "DbgName":
  48153. c.name = u;
  48154. break;
  48155. case "blending":
  48156. c.blending = n[u];
  48157. break;
  48158. case "colorAmbient":
  48159. case "mapAmbient":
  48160. console.warn("THREE.Loader.createMaterial:", h, "is no longer supported.");
  48161. break;
  48162. case "colorDiffuse":
  48163. c.color = e.fromArray(u).getHex();
  48164. break;
  48165. case "colorSpecular":
  48166. c.specular = e.fromArray(u).getHex();
  48167. break;
  48168. case "colorEmissive":
  48169. c.emissive = e.fromArray(u).getHex();
  48170. break;
  48171. case "specularCoef":
  48172. c.shininess = u;
  48173. break;
  48174. case "shading":
  48175. "basic" === u.toLowerCase() && (c.type = "MeshBasicMaterial"),
  48176. "phong" === u.toLowerCase() && (c.type = "MeshPhongMaterial");
  48177. break;
  48178. case "mapDiffuse":
  48179. c.map = s(u, r.mapDiffuseRepeat, r.mapDiffuseOffset, r.mapDiffuseWrap, r.mapDiffuseAnisotropy);
  48180. break;
  48181. case "mapDiffuseRepeat":
  48182. case "mapDiffuseOffset":
  48183. case "mapDiffuseWrap":
  48184. case "mapDiffuseAnisotropy":
  48185. break;
  48186. case "mapLight":
  48187. c.lightMap = s(u, r.mapLightRepeat, r.mapLightOffset, r.mapLightWrap, r.mapLightAnisotropy);
  48188. break;
  48189. case "mapLightRepeat":
  48190. case "mapLightOffset":
  48191. case "mapLightWrap":
  48192. case "mapLightAnisotropy":
  48193. break;
  48194. case "mapAO":
  48195. c.aoMap = s(u, r.mapAORepeat, r.mapAOOffset, r.mapAOWrap, r.mapAOAnisotropy);
  48196. break;
  48197. case "mapAORepeat":
  48198. case "mapAOOffset":
  48199. case "mapAOWrap":
  48200. case "mapAOAnisotropy":
  48201. break;
  48202. case "mapBump":
  48203. c.bumpMap = s(u, r.mapBumpRepeat, r.mapBumpOffset, r.mapBumpWrap, r.mapBumpAnisotropy);
  48204. break;
  48205. case "mapBumpScale":
  48206. c.bumpScale = u;
  48207. break;
  48208. case "mapBumpRepeat":
  48209. case "mapBumpOffset":
  48210. case "mapBumpWrap":
  48211. case "mapBumpAnisotropy":
  48212. break;
  48213. case "mapNormal":
  48214. c.normalMap = s(u, r.mapNormalRepeat, r.mapNormalOffset, r.mapNormalWrap, r.mapNormalAnisotropy);
  48215. break;
  48216. case "mapNormalFactor":
  48217. c.normalScale = [u, u];
  48218. break;
  48219. case "mapNormalRepeat":
  48220. case "mapNormalOffset":
  48221. case "mapNormalWrap":
  48222. case "mapNormalAnisotropy":
  48223. break;
  48224. case "mapSpecular":
  48225. c.specularMap = s(u, r.mapSpecularRepeat, r.mapSpecularOffset, r.mapSpecularWrap, r.mapSpecularAnisotropy);
  48226. break;
  48227. case "mapSpecularRepeat":
  48228. case "mapSpecularOffset":
  48229. case "mapSpecularWrap":
  48230. case "mapSpecularAnisotropy":
  48231. break;
  48232. case "mapAlpha":
  48233. c.alphaMap = s(u, r.mapAlphaRepeat, r.mapAlphaOffset, r.mapAlphaWrap, r.mapAlphaAnisotropy);
  48234. break;
  48235. case "mapAlphaRepeat":
  48236. case "mapAlphaOffset":
  48237. case "mapAlphaWrap":
  48238. case "mapAlphaAnisotropy":
  48239. break;
  48240. case "flipSided":
  48241. c.side = n.BackSide;
  48242. break;
  48243. case "doubleSided":
  48244. c.side = n.DoubleSide;
  48245. break;
  48246. case "transparency":
  48247. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  48248. c.opacity = u;
  48249. break;
  48250. case "depthTest":
  48251. case "depthWrite":
  48252. case "colorWrite":
  48253. case "opacity":
  48254. case "reflectivity":
  48255. case "transparent":
  48256. case "visible":
  48257. case "wireframe":
  48258. c[h] = u;
  48259. break;
  48260. case "vertexColors":
  48261. u === !0 && (c.vertexColors = n.VertexColors),
  48262. "face" === u && (c.vertexColors = n.FaceColors);
  48263. break;
  48264. default:
  48265. console.error("THREE.Loader.createMaterial: Unsupported", h, u)
  48266. }
  48267. }
  48268. return "MeshBasicMaterial" === c.type && delete c.emissive,
  48269. "MeshPhongMaterial" !== c.type && delete c.specular,
  48270. c.opacity < 1 && (c.transparent = !0),
  48271. i.setTextures(l),
  48272. i.parse(c)
  48273. }
  48274. }()
  48275. },
  48276. n.Loader.Handlers = {
  48277. handlers: [],
  48278. add: function(e, t) {
  48279. this.handlers.push(e, t)
  48280. },
  48281. get: function(e) {
  48282. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  48283. var r = t[i]
  48284. , o = t[i + 1];
  48285. if (r.test(e))
  48286. return o
  48287. }
  48288. return null
  48289. }
  48290. },
  48291. n.XHRLoader = function(e) {
  48292. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48293. }
  48294. ,
  48295. n.XHRLoader.prototype = {
  48296. constructor: n.XHRLoader,
  48297. load: function(e, t, i, r) {
  48298. void 0 !== this.path && (e = this.path + e);
  48299. var o = this
  48300. , a = n.Cache.get(e);
  48301. if (void 0 !== a)
  48302. return t && setTimeout(function() {
  48303. t(a)
  48304. }, 0),
  48305. a;
  48306. var s = new XMLHttpRequest;
  48307. return s.overrideMimeType("text/plain"),
  48308. s.open("GET", e, !0),
  48309. s.addEventListener("load", function(i) {
  48310. var a = i.target.response;
  48311. n.Cache.add(e, a),
  48312. 200 === this.status ? (t && t(a),
  48313. o.manager.itemEnd(e)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  48314. t && t(a),
  48315. o.manager.itemEnd(e)) : (r && r(i),
  48316. o.manager.itemError(e))
  48317. }, !1),
  48318. void 0 !== i && s.addEventListener("progress", function(e) {
  48319. i(e)
  48320. }, !1),
  48321. s.addEventListener("error", function(t) {
  48322. r && r(t),
  48323. o.manager.itemError(e)
  48324. }, !1),
  48325. void 0 !== this.responseType && (s.responseType = this.responseType),
  48326. void 0 !== this.withCredentials && (s.withCredentials = this.withCredentials),
  48327. s.send(null),
  48328. o.manager.itemStart(e),
  48329. s
  48330. },
  48331. setPath: function(e) {
  48332. this.path = e
  48333. },
  48334. setResponseType: function(e) {
  48335. this.responseType = e
  48336. },
  48337. setWithCredentials: function(e) {
  48338. this.withCredentials = e
  48339. }
  48340. },
  48341. n.FontLoader = function(e) {
  48342. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48343. }
  48344. ,
  48345. n.FontLoader.prototype = {
  48346. constructor: n.FontLoader,
  48347. load: function(e, t, i, r) {
  48348. var o = new n.XHRLoader(this.manager);
  48349. o.load(e, function(e) {
  48350. t(new n.Font(JSON.parse(e.substring(65, e.length - 2))))
  48351. }, i, r)
  48352. }
  48353. },
  48354. n.ImageLoader = function(e) {
  48355. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48356. }
  48357. ,
  48358. n.ImageLoader.prototype = {
  48359. constructor: n.ImageLoader,
  48360. load: function(e, t, i, r) {
  48361. void 0 !== this.path && (e = this.path + e);
  48362. var o = this
  48363. , a = n.Cache.get(e);
  48364. if (void 0 !== a)
  48365. return o.manager.itemStart(e),
  48366. t ? setTimeout(function() {
  48367. t(a),
  48368. o.manager.itemEnd(e)
  48369. }, 0) : o.manager.itemEnd(e),
  48370. a;
  48371. var s = document.createElement("img");
  48372. return s.addEventListener("load", function(i) {
  48373. n.Cache.add(e, this),
  48374. t && t(this),
  48375. o.manager.itemEnd(e)
  48376. }, !1),
  48377. void 0 !== i && s.addEventListener("progress", function(e) {
  48378. i(e)
  48379. }, !1),
  48380. s.addEventListener("error", function(t) {
  48381. r && r(t),
  48382. o.manager.itemError(e)
  48383. }, !1),
  48384. void 0 !== this.crossOrigin && (s.crossOrigin = this.crossOrigin),
  48385. o.manager.itemStart(e),
  48386. s.src = e,
  48387. s
  48388. },
  48389. setCrossOrigin: function(e) {
  48390. this.crossOrigin = e
  48391. },
  48392. setPath: function(e) {
  48393. this.path = e
  48394. }
  48395. },
  48396. n.JSONLoader = function(e) {
  48397. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  48398. e = void 0),
  48399. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48400. this.withCredentials = !1
  48401. }
  48402. ,
  48403. n.JSONLoader.prototype = {
  48404. constructor: n.JSONLoader,
  48405. get statusDomElement() {
  48406. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  48407. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  48408. this._statusDomElement
  48409. },
  48410. load: function(e, t, i, r) {
  48411. var o = this
  48412. , a = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : n.Loader.prototype.extractUrlBase(e)
  48413. , s = new n.XHRLoader(this.manager);
  48414. s.setWithCredentials(this.withCredentials),
  48415. s.load(e, function(i) {
  48416. var n = JSON.parse(i)
  48417. , r = n.metadata;
  48418. if (void 0 !== r) {
  48419. var s = r.type;
  48420. if (void 0 !== s) {
  48421. if ("object" === s.toLowerCase())
  48422. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.ObjectLoader instead.");
  48423. if ("scene" === s.toLowerCase())
  48424. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.SceneLoader instead.")
  48425. }
  48426. }
  48427. var l = o.parse(n, a);
  48428. t(l.geometry, l.materials)
  48429. }, i, r)
  48430. },
  48431. setTexturePath: function(e) {
  48432. this.texturePath = e
  48433. },
  48434. parse: function(e, t) {
  48435. function i(t) {
  48436. function i(e, t) {
  48437. return e & 1 << t
  48438. }
  48439. 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;
  48440. if (void 0 !== e.uvs) {
  48441. for (r = 0; r < e.uvs.length; r++)
  48442. e.uvs[r].length && B++;
  48443. for (r = 0; r < B; r++)
  48444. s.faceVertexUvs[r] = []
  48445. }
  48446. for (l = 0,
  48447. c = L.length; l < c; )
  48448. E = new n.Vector3,
  48449. E.x = L[l++] * t,
  48450. E.y = L[l++] * t,
  48451. E.z = L[l++] * t,
  48452. s.vertices.push(E);
  48453. for (l = 0,
  48454. c = O.length; l < c; )
  48455. if (f = O[l++],
  48456. g = i(f, 0),
  48457. m = i(f, 1),
  48458. v = i(f, 3),
  48459. A = i(f, 4),
  48460. y = i(f, 5),
  48461. C = i(f, 6),
  48462. I = i(f, 7),
  48463. g) {
  48464. if (w = new n.Face3,
  48465. w.a = O[l],
  48466. w.b = O[l + 1],
  48467. w.c = O[l + 3],
  48468. _ = new n.Face3,
  48469. _.a = O[l + 1],
  48470. _.b = O[l + 2],
  48471. _.c = O[l + 3],
  48472. l += 4,
  48473. m && (p = O[l++],
  48474. w.materialIndex = p,
  48475. _.materialIndex = p),
  48476. a = s.faces.length,
  48477. v)
  48478. for (r = 0; r < B; r++)
  48479. for (S = e.uvs[r],
  48480. s.faceVertexUvs[r][a] = [],
  48481. s.faceVertexUvs[r][a + 1] = [],
  48482. o = 0; o < 4; o++)
  48483. d = O[l++],
  48484. R = S[2 * d],
  48485. P = S[2 * d + 1],
  48486. M = new n.Vector2(R,P),
  48487. 2 !== o && s.faceVertexUvs[r][a].push(M),
  48488. 0 !== o && s.faceVertexUvs[r][a + 1].push(M);
  48489. if (A && (u = 3 * O[l++],
  48490. w.normal.set(D[u++], D[u++], D[u]),
  48491. _.normal.copy(w.normal)),
  48492. y)
  48493. for (r = 0; r < 4; r++)
  48494. u = 3 * O[l++],
  48495. x = new n.Vector3(D[u++],D[u++],D[u]),
  48496. 2 !== r && w.vertexNormals.push(x),
  48497. 0 !== r && _.vertexNormals.push(x);
  48498. if (C && (h = O[l++],
  48499. T = N[h],
  48500. w.color.setHex(T),
  48501. _.color.setHex(T)),
  48502. I)
  48503. for (r = 0; r < 4; r++)
  48504. h = O[l++],
  48505. T = N[h],
  48506. 2 !== r && w.vertexColors.push(new n.Color(T)),
  48507. 0 !== r && _.vertexColors.push(new n.Color(T));
  48508. s.faces.push(w),
  48509. s.faces.push(_)
  48510. } else {
  48511. if (b = new n.Face3,
  48512. b.a = O[l++],
  48513. b.b = O[l++],
  48514. b.c = O[l++],
  48515. m && (p = O[l++],
  48516. b.materialIndex = p),
  48517. a = s.faces.length,
  48518. v)
  48519. for (r = 0; r < B; r++)
  48520. for (S = e.uvs[r],
  48521. s.faceVertexUvs[r][a] = [],
  48522. o = 0; o < 3; o++)
  48523. d = O[l++],
  48524. R = S[2 * d],
  48525. P = S[2 * d + 1],
  48526. M = new n.Vector2(R,P),
  48527. s.faceVertexUvs[r][a].push(M);
  48528. if (A && (u = 3 * O[l++],
  48529. b.normal.set(D[u++], D[u++], D[u])),
  48530. y)
  48531. for (r = 0; r < 3; r++)
  48532. u = 3 * O[l++],
  48533. x = new n.Vector3(D[u++],D[u++],D[u]),
  48534. b.vertexNormals.push(x);
  48535. if (C && (h = O[l++],
  48536. b.color.setHex(N[h])),
  48537. I)
  48538. for (r = 0; r < 3; r++)
  48539. h = O[l++],
  48540. b.vertexColors.push(new n.Color(N[h]));
  48541. s.faces.push(b)
  48542. }
  48543. }
  48544. function r() {
  48545. var t = void 0 !== e.influencesPerVertex ? e.influencesPerVertex : 2;
  48546. if (e.skinWeights)
  48547. for (var i = 0, r = e.skinWeights.length; i < r; i += t) {
  48548. var o = e.skinWeights[i]
  48549. , a = t > 1 ? e.skinWeights[i + 1] : 0
  48550. , l = t > 2 ? e.skinWeights[i + 2] : 0
  48551. , c = t > 3 ? e.skinWeights[i + 3] : 0;
  48552. s.skinWeights.push(new n.Vector4(o,a,l,c))
  48553. }
  48554. if (e.skinIndices)
  48555. for (var i = 0, r = e.skinIndices.length; i < r; i += t) {
  48556. var h = e.skinIndices[i]
  48557. , u = t > 1 ? e.skinIndices[i + 1] : 0
  48558. , d = t > 2 ? e.skinIndices[i + 2] : 0
  48559. , p = t > 3 ? e.skinIndices[i + 3] : 0;
  48560. s.skinIndices.push(new n.Vector4(h,u,d,p))
  48561. }
  48562. s.bones = e.bones,
  48563. 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.")
  48564. }
  48565. function o(t) {
  48566. if (void 0 !== e.morphTargets)
  48567. for (var i = 0, r = e.morphTargets.length; i < r; i++) {
  48568. s.morphTargets[i] = {},
  48569. s.morphTargets[i].name = e.morphTargets[i].name,
  48570. s.morphTargets[i].vertices = [];
  48571. for (var o = s.morphTargets[i].vertices, a = e.morphTargets[i].vertices, l = 0, c = a.length; l < c; l += 3) {
  48572. var h = new n.Vector3;
  48573. h.x = a[l] * t,
  48574. h.y = a[l + 1] * t,
  48575. h.z = a[l + 2] * t,
  48576. o.push(h)
  48577. }
  48578. }
  48579. if (void 0 !== e.morphColors && e.morphColors.length > 0) {
  48580. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  48581. for (var u = s.faces, d = e.morphColors[0].colors, i = 0, r = u.length; i < r; i++)
  48582. u[i].color.fromArray(d, 3 * i)
  48583. }
  48584. }
  48585. function a() {
  48586. var t = []
  48587. , i = [];
  48588. void 0 !== e.animation && i.push(e.animation),
  48589. void 0 !== e.animations && (e.animations.length ? i = i.concat(e.animations) : i.push(e.animations));
  48590. for (var r = 0; r < i.length; r++) {
  48591. var o = n.AnimationClip.parseAnimation(i[r], s.bones);
  48592. o && t.push(o)
  48593. }
  48594. if (s.morphTargets) {
  48595. var a = n.AnimationClip.CreateClipsFromMorphTargetSequences(s.morphTargets, 10);
  48596. t = t.concat(a)
  48597. }
  48598. t.length > 0 && (s.animations = t)
  48599. }
  48600. var s = new n.Geometry
  48601. , l = void 0 !== e.scale ? 1 / e.scale : 1;
  48602. if (i(l),
  48603. r(),
  48604. o(l),
  48605. a(),
  48606. s.computeFaceNormals(),
  48607. s.computeBoundingSphere(),
  48608. void 0 === e.materials || 0 === e.materials.length)
  48609. return {
  48610. geometry: s
  48611. };
  48612. var c = n.Loader.prototype.initMaterials(e.materials, t, this.crossOrigin);
  48613. return {
  48614. geometry: s,
  48615. materials: c
  48616. }
  48617. }
  48618. },
  48619. n.LoadingManager = function(e, t, i) {
  48620. var n = this
  48621. , r = !1
  48622. , o = 0
  48623. , a = 0;
  48624. this.onStart = void 0,
  48625. this.onLoad = e,
  48626. this.onProgress = t,
  48627. this.onError = i,
  48628. this.itemStart = function(e) {
  48629. a++,
  48630. r === !1 && void 0 !== n.onStart && n.onStart(e, o, a),
  48631. r = !0
  48632. }
  48633. ,
  48634. this.itemEnd = function(e) {
  48635. o++,
  48636. void 0 !== n.onProgress && n.onProgress(e, o, a),
  48637. o === a && (r = !1,
  48638. void 0 !== n.onLoad && n.onLoad())
  48639. }
  48640. ,
  48641. this.itemError = function(e) {
  48642. void 0 !== n.onError && n.onError(e)
  48643. }
  48644. }
  48645. ,
  48646. n.DefaultLoadingManager = new n.LoadingManager,
  48647. n.BufferGeometryLoader = function(e) {
  48648. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48649. }
  48650. ,
  48651. n.BufferGeometryLoader.prototype = {
  48652. constructor: n.BufferGeometryLoader,
  48653. load: function(e, t, i, r) {
  48654. var o = this
  48655. , a = new n.XHRLoader(o.manager);
  48656. a.load(e, function(e) {
  48657. t(o.parse(JSON.parse(e)))
  48658. }, i, r)
  48659. },
  48660. parse: function(e) {
  48661. var t = new n.BufferGeometry
  48662. , i = e.data.index
  48663. , r = {
  48664. Int8Array: Int8Array,
  48665. Uint8Array: Uint8Array,
  48666. Uint8ClampedArray: Uint8ClampedArray,
  48667. Int16Array: Int16Array,
  48668. Uint16Array: Uint16Array,
  48669. Int32Array: Int32Array,
  48670. Uint32Array: Uint32Array,
  48671. Float32Array: Float32Array,
  48672. Float64Array: Float64Array
  48673. };
  48674. if (void 0 !== i) {
  48675. var o = new r[i.type](i.array);
  48676. t.setIndex(new n.BufferAttribute(o,1))
  48677. }
  48678. var a = e.data.attributes;
  48679. for (var s in a) {
  48680. var l = a[s]
  48681. , o = new r[l.type](l.array);
  48682. t.addAttribute(s, new n.BufferAttribute(o,l.itemSize))
  48683. }
  48684. var c = e.data.groups || e.data.drawcalls || e.data.offsets;
  48685. if (void 0 !== c)
  48686. for (var h = 0, u = c.length; h !== u; ++h) {
  48687. var d = c[h];
  48688. t.addGroup(d.start, d.count, d.materialIndex)
  48689. }
  48690. var p = e.data.boundingSphere;
  48691. if (void 0 !== p) {
  48692. var f = new n.Vector3;
  48693. void 0 !== p.center && f.fromArray(p.center),
  48694. t.boundingSphere = new n.Sphere(f,p.radius)
  48695. }
  48696. return t
  48697. }
  48698. },
  48699. n.MaterialLoader = function(e) {
  48700. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48701. this.textures = {}
  48702. }
  48703. ,
  48704. n.MaterialLoader.prototype = {
  48705. constructor: n.MaterialLoader,
  48706. load: function(e, t, i, r) {
  48707. var o = this
  48708. , a = new n.XHRLoader(o.manager);
  48709. a.load(e, function(e) {
  48710. t(o.parse(JSON.parse(e)))
  48711. }, i, r)
  48712. },
  48713. setTextures: function(e) {
  48714. this.textures = e
  48715. },
  48716. getTexture: function(e) {
  48717. var t = this.textures;
  48718. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  48719. t[e]
  48720. },
  48721. parse: function(e) {
  48722. var t = new n[e.type];
  48723. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  48724. void 0 !== e.name && (t.name = e.name),
  48725. void 0 !== e.color && t.color.setHex(e.color),
  48726. void 0 !== e.roughness && (t.roughness = e.roughness),
  48727. void 0 !== e.metalness && (t.metalness = e.metalness),
  48728. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  48729. void 0 !== e.specular && t.specular.setHex(e.specular),
  48730. void 0 !== e.shininess && (t.shininess = e.shininess),
  48731. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  48732. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  48733. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  48734. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  48735. void 0 !== e.shading && (t.shading = e.shading),
  48736. void 0 !== e.blending && (t.blending = e.blending),
  48737. void 0 !== e.side && (t.side = e.side),
  48738. void 0 !== e.opacity && (t.opacity = e.opacity),
  48739. void 0 !== e.transparent && (t.transparent = e.transparent),
  48740. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  48741. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  48742. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  48743. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  48744. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  48745. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  48746. void 0 !== e.size && (t.size = e.size),
  48747. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  48748. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  48749. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  48750. t.transparent = !0),
  48751. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  48752. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  48753. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  48754. void 0 !== e.normalScale) {
  48755. var i = e.normalScale;
  48756. Array.isArray(i) === !1 && (i = [i, i]),
  48757. t.normalScale = (new n.Vector2).fromArray(i)
  48758. }
  48759. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  48760. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  48761. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  48762. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  48763. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  48764. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  48765. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  48766. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  48767. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  48768. t.combine = n.MultiplyOperation),
  48769. e.reflectivity && (t.reflectivity = e.reflectivity),
  48770. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  48771. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  48772. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  48773. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  48774. void 0 !== e.materials)
  48775. for (var r = 0, o = e.materials.length; r < o; r++)
  48776. t.materials.push(this.parse(e.materials[r]));
  48777. return t
  48778. }
  48779. },
  48780. n.ObjectLoader = function(e) {
  48781. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48782. this.texturePath = ""
  48783. }
  48784. ,
  48785. n.ObjectLoader.prototype = {
  48786. constructor: n.ObjectLoader,
  48787. load: function(e, t, i, r) {
  48788. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  48789. var o = this
  48790. , a = new n.XHRLoader(o.manager);
  48791. a.load(e, function(e) {
  48792. o.parse(JSON.parse(e), t)
  48793. }, i, r)
  48794. },
  48795. setTexturePath: function(e) {
  48796. this.texturePath = e
  48797. },
  48798. setCrossOrigin: function(e) {
  48799. this.crossOrigin = e
  48800. },
  48801. parse: function(e, t) {
  48802. var i = this.parseGeometries(e.geometries)
  48803. , n = this.parseImages(e.images, function() {
  48804. void 0 !== t && t(a)
  48805. })
  48806. , r = this.parseTextures(e.textures, n)
  48807. , o = this.parseMaterials(e.materials, r)
  48808. , a = this.parseObject(e.object, i, o);
  48809. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  48810. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  48811. a
  48812. },
  48813. parseGeometries: function(e) {
  48814. var t = {};
  48815. if (void 0 !== e)
  48816. for (var i = new n.JSONLoader, r = new n.BufferGeometryLoader, o = 0, a = e.length; o < a; o++) {
  48817. var s, l = e[o];
  48818. switch (l.type) {
  48819. case "PlaneGeometry":
  48820. case "PlaneBufferGeometry":
  48821. s = new n[l.type](l.width,l.height,l.widthSegments,l.heightSegments);
  48822. break;
  48823. case "BoxGeometry":
  48824. case "BoxBufferGeometry":
  48825. case "CubeGeometry":
  48826. s = new n[l.type](l.width,l.height,l.depth,l.widthSegments,l.heightSegments,l.depthSegments);
  48827. break;
  48828. case "CircleGeometry":
  48829. case "CircleBufferGeometry":
  48830. s = new n[l.type](l.radius,l.segments,l.thetaStart,l.thetaLength);
  48831. break;
  48832. case "CylinderGeometry":
  48833. case "CylinderBufferGeometry":
  48834. s = new n[l.type](l.radiusTop,l.radiusBottom,l.height,l.radialSegments,l.heightSegments,l.openEnded,l.thetaStart,l.thetaLength);
  48835. break;
  48836. case "SphereGeometry":
  48837. case "SphereBufferGeometry":
  48838. s = new n[l.type](l.radius,l.widthSegments,l.heightSegments,l.phiStart,l.phiLength,l.thetaStart,l.thetaLength);
  48839. break;
  48840. case "DodecahedronGeometry":
  48841. s = new n.DodecahedronGeometry(l.radius,l.detail);
  48842. break;
  48843. case "IcosahedronGeometry":
  48844. s = new n.IcosahedronGeometry(l.radius,l.detail);
  48845. break;
  48846. case "OctahedronGeometry":
  48847. s = new n.OctahedronGeometry(l.radius,l.detail);
  48848. break;
  48849. case "TetrahedronGeometry":
  48850. s = new n.TetrahedronGeometry(l.radius,l.detail);
  48851. break;
  48852. case "RingGeometry":
  48853. case "RingBufferGeometry":
  48854. s = new n[l.type](l.innerRadius,l.outerRadius,l.thetaSegments,l.phiSegments,l.thetaStart,l.thetaLength);
  48855. break;
  48856. case "TorusGeometry":
  48857. case "TorusBufferGeometry":
  48858. s = new n[l.type](l.radius,l.tube,l.radialSegments,l.tubularSegments,l.arc);
  48859. break;
  48860. case "TorusKnotGeometry":
  48861. case "TorusKnotBufferGeometry":
  48862. s = new n[l.type](l.radius,l.tube,l.tubularSegments,l.radialSegments,l.p,l.q);
  48863. break;
  48864. case "LatheGeometry":
  48865. s = new n.LatheGeometry(l.points,l.segments,l.phiStart,l.phiLength);
  48866. break;
  48867. case "BufferGeometry":
  48868. s = r.parse(l);
  48869. break;
  48870. case "Geometry":
  48871. s = i.parse(l.data, this.texturePath).geometry;
  48872. break;
  48873. default:
  48874. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + l.type + '"');
  48875. continue
  48876. }
  48877. s.uuid = l.uuid,
  48878. void 0 !== l.name && (s.name = l.name),
  48879. t[l.uuid] = s
  48880. }
  48881. return t
  48882. },
  48883. parseMaterials: function(e, t) {
  48884. var i = {};
  48885. if (void 0 !== e) {
  48886. var r = new n.MaterialLoader;
  48887. r.setTextures(t);
  48888. for (var o = 0, a = e.length; o < a; o++) {
  48889. var s = r.parse(e[o]);
  48890. i[s.uuid] = s
  48891. }
  48892. }
  48893. return i
  48894. },
  48895. parseAnimations: function(e) {
  48896. for (var t = [], i = 0; i < e.length; i++) {
  48897. var r = n.AnimationClip.parse(e[i]);
  48898. t.push(r)
  48899. }
  48900. return t
  48901. },
  48902. parseImages: function(e, t) {
  48903. function i(e) {
  48904. return r.manager.itemStart(e),
  48905. s.load(e, function() {
  48906. r.manager.itemEnd(e)
  48907. })
  48908. }
  48909. var r = this
  48910. , o = {};
  48911. if (void 0 !== e && e.length > 0) {
  48912. var a = new n.LoadingManager(t)
  48913. , s = new n.ImageLoader(a);
  48914. s.setCrossOrigin(this.crossOrigin);
  48915. for (var l = 0, c = e.length; l < c; l++) {
  48916. var h = e[l]
  48917. , u = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url) ? h.url : r.texturePath + h.url;
  48918. o[h.uuid] = i(u)
  48919. }
  48920. }
  48921. return o
  48922. },
  48923. parseTextures: function(e, t) {
  48924. function i(e) {
  48925. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  48926. n[e])
  48927. }
  48928. var r = {};
  48929. if (void 0 !== e)
  48930. for (var o = 0, a = e.length; o < a; o++) {
  48931. var s = e[o];
  48932. void 0 === s.image && console.warn('THREE.ObjectLoader: No "image" specified for', s.uuid),
  48933. void 0 === t[s.image] && console.warn("THREE.ObjectLoader: Undefined image", s.image);
  48934. var l = new n.Texture(t[s.image]);
  48935. l.needsUpdate = !0,
  48936. l.uuid = s.uuid,
  48937. void 0 !== s.name && (l.name = s.name),
  48938. void 0 !== s.mapping && (l.mapping = i(s.mapping)),
  48939. void 0 !== s.offset && (l.offset = new n.Vector2(s.offset[0],s.offset[1])),
  48940. void 0 !== s.repeat && (l.repeat = new n.Vector2(s.repeat[0],s.repeat[1])),
  48941. void 0 !== s.minFilter && (l.minFilter = i(s.minFilter)),
  48942. void 0 !== s.magFilter && (l.magFilter = i(s.magFilter)),
  48943. void 0 !== s.anisotropy && (l.anisotropy = s.anisotropy),
  48944. Array.isArray(s.wrap) && (l.wrapS = i(s.wrap[0]),
  48945. l.wrapT = i(s.wrap[1])),
  48946. r[s.uuid] = l
  48947. }
  48948. return r
  48949. },
  48950. parseObject: function() {
  48951. var e = new n.Matrix4;
  48952. return function(t, i, r) {
  48953. function o(e) {
  48954. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  48955. i[e]
  48956. }
  48957. function a(e) {
  48958. if (void 0 !== e)
  48959. return void 0 === r[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  48960. r[e]
  48961. }
  48962. var s;
  48963. switch (t.type) {
  48964. case "Scene":
  48965. s = new n.Scene;
  48966. break;
  48967. case "PerspectiveCamera":
  48968. s = new n.PerspectiveCamera(t.fov,t.aspect,t.near,t.far);
  48969. break;
  48970. case "OrthographicCamera":
  48971. s = new n.OrthographicCamera(t.left,t.right,t.top,t.bottom,t.near,t.far);
  48972. break;
  48973. case "AmbientLight":
  48974. s = new n.AmbientLight(t.color,t.intensity);
  48975. break;
  48976. case "DirectionalLight":
  48977. s = new n.DirectionalLight(t.color,t.intensity);
  48978. break;
  48979. case "PointLight":
  48980. s = new n.PointLight(t.color,t.intensity,t.distance,t.decay);
  48981. break;
  48982. case "SpotLight":
  48983. s = new n.SpotLight(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);
  48984. break;
  48985. case "HemisphereLight":
  48986. s = new n.HemisphereLight(t.color,t.groundColor,t.intensity);
  48987. break;
  48988. case "Mesh":
  48989. var l = o(t.geometry)
  48990. , c = a(t.material);
  48991. s = l.bones && l.bones.length > 0 ? new n.SkinnedMesh(l,c) : new n.Mesh(l,c);
  48992. break;
  48993. case "LOD":
  48994. s = new n.LOD;
  48995. break;
  48996. case "Line":
  48997. s = new n.Line(o(t.geometry),a(t.material),t.mode);
  48998. break;
  48999. case "PointCloud":
  49000. case "Points":
  49001. s = new n.Points(o(t.geometry),a(t.material));
  49002. break;
  49003. case "Sprite":
  49004. s = new n.Sprite(a(t.material));
  49005. break;
  49006. case "Group":
  49007. s = new n.Group;
  49008. break;
  49009. default:
  49010. s = new n.Object3D
  49011. }
  49012. if (s.uuid = t.uuid,
  49013. void 0 !== t.name && (s.name = t.name),
  49014. void 0 !== t.matrix ? (e.fromArray(t.matrix),
  49015. e.decompose(s.position, s.quaternion, s.scale)) : (void 0 !== t.position && s.position.fromArray(t.position),
  49016. void 0 !== t.rotation && s.rotation.fromArray(t.rotation),
  49017. void 0 !== t.scale && s.scale.fromArray(t.scale)),
  49018. void 0 !== t.castShadow && (s.castShadow = t.castShadow),
  49019. void 0 !== t.receiveShadow && (s.receiveShadow = t.receiveShadow),
  49020. void 0 !== t.visible && (s.visible = t.visible),
  49021. void 0 !== t.userData && (s.userData = t.userData),
  49022. void 0 !== t.children)
  49023. for (var h in t.children)
  49024. s.add(this.parseObject(t.children[h], i, r));
  49025. if ("LOD" === t.type)
  49026. for (var u = t.levels, d = 0; d < u.length; d++) {
  49027. var p = u[d]
  49028. , h = s.getObjectByProperty("uuid", p.object);
  49029. void 0 !== h && s.addLevel(h, p.distance)
  49030. }
  49031. return s
  49032. }
  49033. }()
  49034. },
  49035. n.TextureLoader = function(e) {
  49036. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  49037. }
  49038. ,
  49039. n.TextureLoader.prototype = {
  49040. constructor: n.TextureLoader,
  49041. load: function(e, t, i, r) {
  49042. var o = new n.Texture
  49043. , a = new n.ImageLoader(this.manager);
  49044. return a.setCrossOrigin(this.crossOrigin),
  49045. a.setPath(this.path),
  49046. a.load(e, function(e) {
  49047. o.image = e,
  49048. o.needsUpdate = !0,
  49049. void 0 !== t && t(o)
  49050. }, i, r),
  49051. o
  49052. },
  49053. setCrossOrigin: function(e) {
  49054. this.crossOrigin = e
  49055. },
  49056. setPath: function(e) {
  49057. this.path = e
  49058. }
  49059. },
  49060. n.CubeTextureLoader = function(e) {
  49061. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  49062. }
  49063. ,
  49064. n.CubeTextureLoader.prototype = {
  49065. constructor: n.CubeTextureLoader,
  49066. load: function(e, t, i, r) {
  49067. function o(i) {
  49068. s.load(e[i], function(e) {
  49069. a.images[i] = e,
  49070. l++,
  49071. 6 === l && (a.needsUpdate = !0,
  49072. t && t(a))
  49073. }, void 0, r)
  49074. }
  49075. var a = new n.CubeTexture
  49076. , s = new n.ImageLoader(this.manager);
  49077. s.setCrossOrigin(this.crossOrigin),
  49078. s.setPath(this.path);
  49079. for (var l = 0, c = 0; c < e.length; ++c)
  49080. o(c);
  49081. return a
  49082. },
  49083. setCrossOrigin: function(e) {
  49084. this.crossOrigin = e
  49085. },
  49086. setPath: function(e) {
  49087. this.path = e
  49088. }
  49089. },
  49090. n.DataTextureLoader = n.BinaryTextureLoader = function(e) {
  49091. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  49092. this._parser = null
  49093. }
  49094. ,
  49095. n.BinaryTextureLoader.prototype = {
  49096. constructor: n.BinaryTextureLoader,
  49097. load: function(e, t, i, r) {
  49098. var o = this
  49099. , a = new n.DataTexture
  49100. , s = new n.XHRLoader(this.manager);
  49101. return s.setResponseType("arraybuffer"),
  49102. s.load(e, function(e) {
  49103. var i = o._parser(e);
  49104. i && (void 0 !== i.image ? a.image = i.image : void 0 !== i.data && (a.image.width = i.width,
  49105. a.image.height = i.height,
  49106. a.image.data = i.data),
  49107. a.wrapS = void 0 !== i.wrapS ? i.wrapS : n.ClampToEdgeWrapping,
  49108. a.wrapT = void 0 !== i.wrapT ? i.wrapT : n.ClampToEdgeWrapping,
  49109. a.magFilter = void 0 !== i.magFilter ? i.magFilter : n.LinearFilter,
  49110. a.minFilter = void 0 !== i.minFilter ? i.minFilter : n.LinearMipMapLinearFilter,
  49111. a.anisotropy = void 0 !== i.anisotropy ? i.anisotropy : 1,
  49112. void 0 !== i.format && (a.format = i.format),
  49113. void 0 !== i.type && (a.type = i.type),
  49114. void 0 !== i.mipmaps && (a.mipmaps = i.mipmaps),
  49115. 1 === i.mipmapCount && (a.minFilter = n.LinearFilter),
  49116. a.needsUpdate = !0,
  49117. t && t(a, i))
  49118. }, i, r),
  49119. a
  49120. }
  49121. },
  49122. n.CompressedTextureLoader = function(e) {
  49123. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  49124. this._parser = null
  49125. }
  49126. ;
  49127. n.CompressedTextureLoader.prototype = {
  49128. constructor: n.CompressedTextureLoader,
  49129. load: function(e, t, i, r) {
  49130. function o(o) {
  49131. c.load(e[o], function(e) {
  49132. var i = a._parser(e, !0);
  49133. s[o] = {
  49134. width: i.width,
  49135. height: i.height,
  49136. format: i.format,
  49137. mipmaps: i.mipmaps
  49138. },
  49139. h += 1,
  49140. 6 === h && (1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  49141. l.format = i.format,
  49142. l.needsUpdate = !0,
  49143. t && t(l))
  49144. }, i, r)
  49145. }
  49146. var a = this
  49147. , s = []
  49148. , l = new n.CompressedTexture;
  49149. l.image = s;
  49150. var c = new n.XHRLoader(this.manager);
  49151. if (c.setPath(this.path),
  49152. c.setResponseType("arraybuffer"),
  49153. Array.isArray(e))
  49154. for (var h = 0, u = 0, d = e.length; u < d; ++u)
  49155. o(u);
  49156. else
  49157. c.load(e, function(e) {
  49158. var i = a._parser(e, !0);
  49159. if (i.isCubemap)
  49160. for (var r = i.mipmaps.length / i.mipmapCount, o = 0; o < r; o++) {
  49161. s[o] = {
  49162. mipmaps: []
  49163. };
  49164. for (var c = 0; c < i.mipmapCount; c++)
  49165. s[o].mipmaps.push(i.mipmaps[o * i.mipmapCount + c]),
  49166. s[o].format = i.format,
  49167. s[o].width = i.width,
  49168. s[o].height = i.height
  49169. }
  49170. else
  49171. l.image.width = i.width,
  49172. l.image.height = i.height,
  49173. l.mipmaps = i.mipmaps;
  49174. 1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  49175. l.format = i.format,
  49176. l.needsUpdate = !0,
  49177. t && t(l)
  49178. }, i, r);
  49179. return l
  49180. },
  49181. setPath: function(e) {
  49182. this.path = e
  49183. }
  49184. };
  49185. n.Material = function() {
  49186. Object.defineProperty(this, "id", {
  49187. value: n.MaterialIdCount++
  49188. }),
  49189. this.uuid = n.Math.generateUUID(),
  49190. this.name = "",
  49191. this.type = "Material",
  49192. this.side = n.FrontSide,
  49193. this.opacity = 1,
  49194. this.transparent = !1,
  49195. this.blending = n.NormalBlending,
  49196. this.blendSrc = n.SrcAlphaFactor,
  49197. this.blendDst = n.OneMinusSrcAlphaFactor,
  49198. this.blendEquation = n.AddEquation,
  49199. this.blendSrcAlpha = null,
  49200. this.blendDstAlpha = null,
  49201. this.blendEquationAlpha = null,
  49202. this.depthFunc = n.LessEqualDepth,
  49203. this.depthTest = !0,
  49204. this.depthWrite = !0,
  49205. this.colorWrite = !0,
  49206. this.precision = null,
  49207. this.polygonOffset = !1,
  49208. this.polygonOffsetFactor = 0,
  49209. this.polygonOffsetUnits = 0,
  49210. this.alphaTest = 0,
  49211. this.premultipliedAlpha = !1,
  49212. this.overdraw = 0,
  49213. this.visible = !0,
  49214. this._needsUpdate = !0
  49215. }
  49216. ,
  49217. n.Material.prototype = {
  49218. constructor: n.Material,
  49219. get needsUpdate() {
  49220. return this._needsUpdate
  49221. },
  49222. set needsUpdate(e) {
  49223. e === !0 && this.update(),
  49224. this._needsUpdate = e
  49225. },
  49226. setValues: function(e) {
  49227. if (void 0 !== e)
  49228. for (var t in e) {
  49229. var i = e[t];
  49230. if (void 0 !== i) {
  49231. var r = this[t];
  49232. 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.")
  49233. } else
  49234. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  49235. }
  49236. },
  49237. toJSON: function(e) {
  49238. function t(e) {
  49239. var t = [];
  49240. for (var i in e) {
  49241. var n = e[i];
  49242. delete n.metadata,
  49243. t.push(n)
  49244. }
  49245. return t
  49246. }
  49247. var i = void 0 === e;
  49248. i && (e = {
  49249. textures: {},
  49250. images: {}
  49251. });
  49252. var r = {
  49253. metadata: {
  49254. version: 4.4,
  49255. type: "Material",
  49256. generator: "Material.toJSON"
  49257. }
  49258. };
  49259. if (r.uuid = this.uuid,
  49260. r.type = this.type,
  49261. "" !== this.name && (r.name = this.name),
  49262. this.color instanceof n.Color && (r.color = this.color.getHex()),
  49263. .5 !== this.roughness && (r.roughness = this.roughness),
  49264. .5 !== this.metalness && (r.metalness = this.metalness),
  49265. this.emissive instanceof n.Color && (r.emissive = this.emissive.getHex()),
  49266. this.specular instanceof n.Color && (r.specular = this.specular.getHex()),
  49267. void 0 !== this.shininess && (r.shininess = this.shininess),
  49268. this.map instanceof n.Texture && (r.map = this.map.toJSON(e).uuid),
  49269. this.alphaMap instanceof n.Texture && (r.alphaMap = this.alphaMap.toJSON(e).uuid),
  49270. this.lightMap instanceof n.Texture && (r.lightMap = this.lightMap.toJSON(e).uuid),
  49271. this.bumpMap instanceof n.Texture && (r.bumpMap = this.bumpMap.toJSON(e).uuid,
  49272. r.bumpScale = this.bumpScale),
  49273. this.normalMap instanceof n.Texture && (r.normalMap = this.normalMap.toJSON(e).uuid,
  49274. r.normalScale = this.normalScale.toArray()),
  49275. this.displacementMap instanceof n.Texture && (r.displacementMap = this.displacementMap.toJSON(e).uuid,
  49276. r.displacementScale = this.displacementScale,
  49277. r.displacementBias = this.displacementBias),
  49278. this.roughnessMap instanceof n.Texture && (r.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  49279. this.metalnessMap instanceof n.Texture && (r.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  49280. this.emissiveMap instanceof n.Texture && (r.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  49281. this.specularMap instanceof n.Texture && (r.specularMap = this.specularMap.toJSON(e).uuid),
  49282. this.envMap instanceof n.Texture && (r.envMap = this.envMap.toJSON(e).uuid,
  49283. r.reflectivity = this.reflectivity),
  49284. void 0 !== this.size && (r.size = this.size),
  49285. void 0 !== this.sizeAttenuation && (r.sizeAttenuation = this.sizeAttenuation),
  49286. void 0 !== this.vertexColors && this.vertexColors !== n.NoColors && (r.vertexColors = this.vertexColors),
  49287. void 0 !== this.shading && this.shading !== n.SmoothShading && (r.shading = this.shading),
  49288. void 0 !== this.blending && this.blending !== n.NormalBlending && (r.blending = this.blending),
  49289. void 0 !== this.side && this.side !== n.FrontSide && (r.side = this.side),
  49290. this.opacity < 1 && (r.opacity = this.opacity),
  49291. this.transparent === !0 && (r.transparent = this.transparent),
  49292. this.alphaTest > 0 && (r.alphaTest = this.alphaTest),
  49293. this.premultipliedAlpha === !0 && (r.premultipliedAlpha = this.premultipliedAlpha),
  49294. this.wireframe === !0 && (r.wireframe = this.wireframe),
  49295. this.wireframeLinewidth > 1 && (r.wireframeLinewidth = this.wireframeLinewidth),
  49296. i) {
  49297. var o = t(e.textures)
  49298. , a = t(e.images);
  49299. o.length > 0 && (r.textures = o),
  49300. a.length > 0 && (r.images = a)
  49301. }
  49302. return r
  49303. },
  49304. clone: function() {
  49305. return (new this.constructor).copy(this)
  49306. },
  49307. copy: function(e) {
  49308. return this.name = e.name,
  49309. this.side = e.side,
  49310. this.opacity = e.opacity,
  49311. this.transparent = e.transparent,
  49312. this.blending = e.blending,
  49313. this.blendSrc = e.blendSrc,
  49314. this.blendDst = e.blendDst,
  49315. this.blendEquation = e.blendEquation,
  49316. this.blendSrcAlpha = e.blendSrcAlpha,
  49317. this.blendDstAlpha = e.blendDstAlpha,
  49318. this.blendEquationAlpha = e.blendEquationAlpha,
  49319. this.depthFunc = e.depthFunc,
  49320. this.depthTest = e.depthTest,
  49321. this.depthWrite = e.depthWrite,
  49322. this.colorWrite = e.colorWrite,
  49323. this.precision = e.precision,
  49324. this.polygonOffset = e.polygonOffset,
  49325. this.polygonOffsetFactor = e.polygonOffsetFactor,
  49326. this.polygonOffsetUnits = e.polygonOffsetUnits,
  49327. this.alphaTest = e.alphaTest,
  49328. this.premultipliedAlpha = e.premultipliedAlpha,
  49329. this.overdraw = e.overdraw,
  49330. this.visible = e.visible,
  49331. this
  49332. },
  49333. update: function() {
  49334. this.dispatchEvent({
  49335. type: "update"
  49336. })
  49337. },
  49338. dispose: function() {
  49339. this.dispatchEvent({
  49340. type: "dispose"
  49341. })
  49342. }
  49343. },
  49344. n.EventDispatcher.prototype.apply(n.Material.prototype),
  49345. n.MaterialIdCount = 0,
  49346. n.LineBasicMaterial = function(e) {
  49347. n.Material.call(this),
  49348. this.type = "LineBasicMaterial",
  49349. this.color = new n.Color(16777215),
  49350. this.linewidth = 1,
  49351. this.linecap = "round",
  49352. this.linejoin = "round",
  49353. this.blending = n.NormalBlending,
  49354. this.vertexColors = n.NoColors,
  49355. this.fog = !0,
  49356. this.setValues(e)
  49357. }
  49358. ,
  49359. n.LineBasicMaterial.prototype = Object.create(n.Material.prototype),
  49360. n.LineBasicMaterial.prototype.constructor = n.LineBasicMaterial,
  49361. n.LineBasicMaterial.prototype.copy = function(e) {
  49362. return n.Material.prototype.copy.call(this, e),
  49363. this.color.copy(e.color),
  49364. this.linewidth = e.linewidth,
  49365. this.linecap = e.linecap,
  49366. this.linejoin = e.linejoin,
  49367. this.vertexColors = e.vertexColors,
  49368. this.fog = e.fog,
  49369. this
  49370. }
  49371. ,
  49372. n.LineDashedMaterial = function(e) {
  49373. n.Material.call(this),
  49374. this.type = "LineDashedMaterial",
  49375. this.color = new n.Color(16777215),
  49376. this.linewidth = 1,
  49377. this.scale = 1,
  49378. this.dashSize = 3,
  49379. this.gapSize = 1,
  49380. this.blending = n.NormalBlending,
  49381. this.vertexColors = n.NoColors,
  49382. this.fog = !0,
  49383. this.setValues(e)
  49384. }
  49385. ,
  49386. n.LineDashedMaterial.prototype = Object.create(n.Material.prototype),
  49387. n.LineDashedMaterial.prototype.constructor = n.LineDashedMaterial,
  49388. n.LineDashedMaterial.prototype.copy = function(e) {
  49389. return n.Material.prototype.copy.call(this, e),
  49390. this.color.copy(e.color),
  49391. this.linewidth = e.linewidth,
  49392. this.scale = e.scale,
  49393. this.dashSize = e.dashSize,
  49394. this.gapSize = e.gapSize,
  49395. this.vertexColors = e.vertexColors,
  49396. this.fog = e.fog,
  49397. this
  49398. }
  49399. ,
  49400. n.MeshBasicMaterial = function(e) {
  49401. n.Material.call(this),
  49402. this.type = "MeshBasicMaterial",
  49403. this.color = new n.Color(16777215),
  49404. this.map = null,
  49405. this.aoMap = null,
  49406. this.aoMapIntensity = 1,
  49407. this.specularMap = null,
  49408. this.alphaMap = null,
  49409. this.envMap = null,
  49410. this.combine = n.MultiplyOperation,
  49411. this.reflectivity = 1,
  49412. this.refractionRatio = .98,
  49413. this.fog = !0,
  49414. this.shading = n.SmoothShading,
  49415. this.blending = n.NormalBlending,
  49416. this.wireframe = !1,
  49417. this.wireframeLinewidth = 1,
  49418. this.wireframeLinecap = "round",
  49419. this.wireframeLinejoin = "round",
  49420. this.vertexColors = n.NoColors,
  49421. this.skinning = !1,
  49422. this.morphTargets = !1,
  49423. this.setValues(e)
  49424. }
  49425. ,
  49426. n.MeshBasicMaterial.prototype = Object.create(n.Material.prototype),
  49427. n.MeshBasicMaterial.prototype.constructor = n.MeshBasicMaterial,
  49428. n.MeshBasicMaterial.prototype.copy = function(e) {
  49429. return n.Material.prototype.copy.call(this, e),
  49430. this.color.copy(e.color),
  49431. this.map = e.map,
  49432. this.aoMap = e.aoMap,
  49433. this.aoMapIntensity = e.aoMapIntensity,
  49434. this.specularMap = e.specularMap,
  49435. this.alphaMap = e.alphaMap,
  49436. this.envMap = e.envMap,
  49437. this.combine = e.combine,
  49438. this.reflectivity = e.reflectivity,
  49439. this.refractionRatio = e.refractionRatio,
  49440. this.fog = e.fog,
  49441. this.shading = e.shading,
  49442. this.wireframe = e.wireframe,
  49443. this.wireframeLinewidth = e.wireframeLinewidth,
  49444. this.wireframeLinecap = e.wireframeLinecap,
  49445. this.wireframeLinejoin = e.wireframeLinejoin,
  49446. this.vertexColors = e.vertexColors,
  49447. this.skinning = e.skinning,
  49448. this.morphTargets = e.morphTargets,
  49449. this
  49450. }
  49451. ,
  49452. n.MeshLambertMaterial = function(e) {
  49453. n.Material.call(this),
  49454. this.type = "MeshLambertMaterial",
  49455. this.color = new n.Color(16777215),
  49456. this.map = null,
  49457. this.lightMap = null,
  49458. this.lightMapIntensity = 1,
  49459. this.aoMap = null,
  49460. this.aoMapIntensity = 1,
  49461. this.emissive = new n.Color(0),
  49462. this.emissiveIntensity = 1,
  49463. this.emissiveMap = null,
  49464. this.specularMap = null,
  49465. this.alphaMap = null,
  49466. this.envMap = null,
  49467. this.combine = n.MultiplyOperation,
  49468. this.reflectivity = 1,
  49469. this.refractionRatio = .98,
  49470. this.fog = !0,
  49471. this.blending = n.NormalBlending,
  49472. this.wireframe = !1,
  49473. this.wireframeLinewidth = 1,
  49474. this.wireframeLinecap = "round",
  49475. this.wireframeLinejoin = "round",
  49476. this.vertexColors = n.NoColors,
  49477. this.skinning = !1,
  49478. this.morphTargets = !1,
  49479. this.morphNormals = !1,
  49480. this.setValues(e)
  49481. }
  49482. ,
  49483. n.MeshLambertMaterial.prototype = Object.create(n.Material.prototype),
  49484. n.MeshLambertMaterial.prototype.constructor = n.MeshLambertMaterial,
  49485. n.MeshLambertMaterial.prototype.copy = function(e) {
  49486. return n.Material.prototype.copy.call(this, e),
  49487. this.color.copy(e.color),
  49488. this.map = e.map,
  49489. this.lightMap = e.lightMap,
  49490. this.lightMapIntensity = e.lightMapIntensity,
  49491. this.aoMap = e.aoMap,
  49492. this.aoMapIntensity = e.aoMapIntensity,
  49493. this.emissive.copy(e.emissive),
  49494. this.emissiveMap = e.emissiveMap,
  49495. this.emissiveIntensity = e.emissiveIntensity,
  49496. this.specularMap = e.specularMap,
  49497. this.alphaMap = e.alphaMap,
  49498. this.envMap = e.envMap,
  49499. this.combine = e.combine,
  49500. this.reflectivity = e.reflectivity,
  49501. this.refractionRatio = e.refractionRatio,
  49502. this.fog = e.fog,
  49503. this.wireframe = e.wireframe,
  49504. this.wireframeLinewidth = e.wireframeLinewidth,
  49505. this.wireframeLinecap = e.wireframeLinecap,
  49506. this.wireframeLinejoin = e.wireframeLinejoin,
  49507. this.vertexColors = e.vertexColors,
  49508. this.skinning = e.skinning,
  49509. this.morphTargets = e.morphTargets,
  49510. this.morphNormals = e.morphNormals,
  49511. this
  49512. }
  49513. ,
  49514. n.MeshPhongMaterial = function(e) {
  49515. n.Material.call(this),
  49516. this.type = "MeshPhongMaterial",
  49517. this.color = new n.Color(16777215),
  49518. this.specular = new n.Color(1118481),
  49519. this.shininess = 30,
  49520. this.map = null,
  49521. this.lightMap = null,
  49522. this.lightMapIntensity = 1,
  49523. this.aoMap = null,
  49524. this.aoMapIntensity = 1,
  49525. this.emissive = new n.Color(0),
  49526. this.emissiveIntensity = 1,
  49527. this.emissiveMap = null,
  49528. this.bumpMap = null,
  49529. this.bumpScale = 1,
  49530. this.normalMap = null,
  49531. this.normalScale = new n.Vector2(1,1),
  49532. this.displacementMap = null,
  49533. this.displacementScale = 1,
  49534. this.displacementBias = 0,
  49535. this.specularMap = null,
  49536. this.alphaMap = null,
  49537. this.envMap = null,
  49538. this.combine = n.MultiplyOperation,
  49539. this.reflectivity = 1,
  49540. this.refractionRatio = .98,
  49541. this.fog = !0,
  49542. this.shading = n.SmoothShading,
  49543. this.blending = n.NormalBlending,
  49544. this.wireframe = !1,
  49545. this.wireframeLinewidth = 1,
  49546. this.wireframeLinecap = "round",
  49547. this.wireframeLinejoin = "round",
  49548. this.vertexColors = n.NoColors,
  49549. this.skinning = !1,
  49550. this.morphTargets = !1,
  49551. this.morphNormals = !1,
  49552. this.setValues(e)
  49553. }
  49554. ,
  49555. n.MeshPhongMaterial.prototype = Object.create(n.Material.prototype),
  49556. n.MeshPhongMaterial.prototype.constructor = n.MeshPhongMaterial,
  49557. n.MeshPhongMaterial.prototype.copy = function(e) {
  49558. return n.Material.prototype.copy.call(this, e),
  49559. this.color.copy(e.color),
  49560. this.specular.copy(e.specular),
  49561. this.shininess = e.shininess,
  49562. this.map = e.map,
  49563. this.lightMap = e.lightMap,
  49564. this.lightMapIntensity = e.lightMapIntensity,
  49565. this.aoMap = e.aoMap,
  49566. this.aoMapIntensity = e.aoMapIntensity,
  49567. this.emissive.copy(e.emissive),
  49568. this.emissiveMap = e.emissiveMap,
  49569. this.emissiveIntensity = e.emissiveIntensity,
  49570. this.bumpMap = e.bumpMap,
  49571. this.bumpScale = e.bumpScale,
  49572. this.normalMap = e.normalMap,
  49573. this.normalScale.copy(e.normalScale),
  49574. this.displacementMap = e.displacementMap,
  49575. this.displacementScale = e.displacementScale,
  49576. this.displacementBias = e.displacementBias,
  49577. this.specularMap = e.specularMap,
  49578. this.alphaMap = e.alphaMap,
  49579. this.envMap = e.envMap,
  49580. this.combine = e.combine,
  49581. this.reflectivity = e.reflectivity,
  49582. this.refractionRatio = e.refractionRatio,
  49583. this.fog = e.fog,
  49584. this.shading = e.shading,
  49585. this.wireframe = e.wireframe,
  49586. this.wireframeLinewidth = e.wireframeLinewidth,
  49587. this.wireframeLinecap = e.wireframeLinecap,
  49588. this.wireframeLinejoin = e.wireframeLinejoin,
  49589. this.vertexColors = e.vertexColors,
  49590. this.skinning = e.skinning,
  49591. this.morphTargets = e.morphTargets,
  49592. this.morphNormals = e.morphNormals,
  49593. this
  49594. }
  49595. ,
  49596. n.MeshStandardMaterial = function(e) {
  49597. n.Material.call(this),
  49598. this.type = "MeshStandardMaterial",
  49599. this.color = new n.Color(16777215),
  49600. this.roughness = .5,
  49601. this.metalness = .5,
  49602. this.map = null,
  49603. this.lightMap = null,
  49604. this.lightMapIntensity = 1,
  49605. this.aoMap = null,
  49606. this.aoMapIntensity = 1,
  49607. this.emissive = new n.Color(0),
  49608. this.emissiveIntensity = 1,
  49609. this.emissiveMap = null,
  49610. this.bumpMap = null,
  49611. this.bumpScale = 1,
  49612. this.normalMap = null,
  49613. this.normalScale = new n.Vector2(1,1),
  49614. this.displacementMap = null,
  49615. this.displacementScale = 1,
  49616. this.displacementBias = 0,
  49617. this.roughnessMap = null,
  49618. this.metalnessMap = null,
  49619. this.alphaMap = null,
  49620. this.envMap = null,
  49621. this.envMapIntensity = 1,
  49622. this.refractionRatio = .98,
  49623. this.fog = !0,
  49624. this.shading = n.SmoothShading,
  49625. this.blending = n.NormalBlending,
  49626. this.wireframe = !1,
  49627. this.wireframeLinewidth = 1,
  49628. this.wireframeLinecap = "round",
  49629. this.wireframeLinejoin = "round",
  49630. this.vertexColors = n.NoColors,
  49631. this.skinning = !1,
  49632. this.morphTargets = !1,
  49633. this.morphNormals = !1,
  49634. this.setValues(e)
  49635. }
  49636. ,
  49637. n.MeshStandardMaterial.prototype = Object.create(n.Material.prototype),
  49638. n.MeshStandardMaterial.prototype.constructor = n.MeshStandardMaterial,
  49639. n.MeshStandardMaterial.prototype.copy = function(e) {
  49640. return n.Material.prototype.copy.call(this, e),
  49641. this.color.copy(e.color),
  49642. this.roughness = e.roughness,
  49643. this.metalness = e.metalness,
  49644. this.map = e.map,
  49645. this.lightMap = e.lightMap,
  49646. this.lightMapIntensity = e.lightMapIntensity,
  49647. this.aoMap = e.aoMap,
  49648. this.aoMapIntensity = e.aoMapIntensity,
  49649. this.emissive.copy(e.emissive),
  49650. this.emissiveMap = e.emissiveMap,
  49651. this.emissiveIntensity = e.emissiveIntensity,
  49652. this.bumpMap = e.bumpMap,
  49653. this.bumpScale = e.bumpScale,
  49654. this.normalMap = e.normalMap,
  49655. this.normalScale.copy(e.normalScale),
  49656. this.displacementMap = e.displacementMap,
  49657. this.displacementScale = e.displacementScale,
  49658. this.displacementBias = e.displacementBias,
  49659. this.roughnessMap = e.roughnessMap,
  49660. this.metalnessMap = e.metalnessMap,
  49661. this.alphaMap = e.alphaMap,
  49662. this.envMap = e.envMap,
  49663. this.envMapIntensity = e.envMapIntensity,
  49664. this.refractionRatio = e.refractionRatio,
  49665. this.fog = e.fog,
  49666. this.shading = e.shading,
  49667. this.wireframe = e.wireframe,
  49668. this.wireframeLinewidth = e.wireframeLinewidth,
  49669. this.wireframeLinecap = e.wireframeLinecap,
  49670. this.wireframeLinejoin = e.wireframeLinejoin,
  49671. this.vertexColors = e.vertexColors,
  49672. this.skinning = e.skinning,
  49673. this.morphTargets = e.morphTargets,
  49674. this.morphNormals = e.morphNormals,
  49675. this
  49676. }
  49677. ,
  49678. n.MeshDepthMaterial = function(e) {
  49679. n.Material.call(this),
  49680. this.type = "MeshDepthMaterial",
  49681. this.morphTargets = !1,
  49682. this.wireframe = !1,
  49683. this.wireframeLinewidth = 1,
  49684. this.setValues(e)
  49685. }
  49686. ,
  49687. n.MeshDepthMaterial.prototype = Object.create(n.Material.prototype),
  49688. n.MeshDepthMaterial.prototype.constructor = n.MeshDepthMaterial,
  49689. n.MeshDepthMaterial.prototype.copy = function(e) {
  49690. return n.Material.prototype.copy.call(this, e),
  49691. this.wireframe = e.wireframe,
  49692. this.wireframeLinewidth = e.wireframeLinewidth,
  49693. this
  49694. }
  49695. ,
  49696. n.MeshNormalMaterial = function(e) {
  49697. n.Material.call(this, e),
  49698. this.type = "MeshNormalMaterial",
  49699. this.wireframe = !1,
  49700. this.wireframeLinewidth = 1,
  49701. this.morphTargets = !1,
  49702. this.setValues(e)
  49703. }
  49704. ,
  49705. n.MeshNormalMaterial.prototype = Object.create(n.Material.prototype),
  49706. n.MeshNormalMaterial.prototype.constructor = n.MeshNormalMaterial,
  49707. n.MeshNormalMaterial.prototype.copy = function(e) {
  49708. return n.Material.prototype.copy.call(this, e),
  49709. this.wireframe = e.wireframe,
  49710. this.wireframeLinewidth = e.wireframeLinewidth,
  49711. this
  49712. }
  49713. ,
  49714. n.MultiMaterial = function(e) {
  49715. this.uuid = n.Math.generateUUID(),
  49716. this.type = "MultiMaterial",
  49717. this.materials = e instanceof Array ? e : [],
  49718. this.visible = !0
  49719. }
  49720. ,
  49721. n.MultiMaterial.prototype = {
  49722. constructor: n.MultiMaterial,
  49723. toJSON: function(e) {
  49724. for (var t = {
  49725. metadata: {
  49726. version: 4.2,
  49727. type: "material",
  49728. generator: "MaterialExporter"
  49729. },
  49730. uuid: this.uuid,
  49731. type: this.type,
  49732. materials: []
  49733. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  49734. var o = i[n].toJSON(e);
  49735. delete o.metadata,
  49736. t.materials.push(o)
  49737. }
  49738. return t.visible = this.visible,
  49739. t
  49740. },
  49741. clone: function() {
  49742. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  49743. e.materials.push(this.materials[t].clone());
  49744. return e.visible = this.visible,
  49745. e
  49746. }
  49747. },
  49748. n.PointsMaterial = function(e) {
  49749. n.Material.call(this),
  49750. this.type = "PointsMaterial",
  49751. this.color = new n.Color(16777215),
  49752. this.map = null,
  49753. this.size = 1,
  49754. this.sizeAttenuation = !0,
  49755. this.blending = n.NormalBlending,
  49756. this.vertexColors = n.NoColors,
  49757. this.fog = !0,
  49758. this.setValues(e)
  49759. }
  49760. ,
  49761. n.PointsMaterial.prototype = Object.create(n.Material.prototype),
  49762. n.PointsMaterial.prototype.constructor = n.PointsMaterial,
  49763. n.PointsMaterial.prototype.copy = function(e) {
  49764. return n.Material.prototype.copy.call(this, e),
  49765. this.color.copy(e.color),
  49766. this.map = e.map,
  49767. this.size = e.size,
  49768. this.sizeAttenuation = e.sizeAttenuation,
  49769. this.vertexColors = e.vertexColors,
  49770. this.fog = e.fog,
  49771. this
  49772. }
  49773. ,
  49774. n.ShaderMaterial = function(e) {
  49775. n.Material.call(this),
  49776. this.type = "ShaderMaterial",
  49777. this.defines = {},
  49778. this.uniforms = {},
  49779. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  49780. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  49781. this.shading = n.SmoothShading,
  49782. this.linewidth = 1,
  49783. this.wireframe = !1,
  49784. this.wireframeLinewidth = 1,
  49785. this.fog = !1,
  49786. this.lights = !1,
  49787. this.vertexColors = n.NoColors,
  49788. this.skinning = !1,
  49789. this.morphTargets = !1,
  49790. this.morphNormals = !1,
  49791. this.extensions = {
  49792. derivatives: !1,
  49793. fragDepth: !1,
  49794. drawBuffers: !1,
  49795. shaderTextureLOD: !1
  49796. },
  49797. this.defaultAttributeValues = {
  49798. color: [1, 1, 1],
  49799. uv: [0, 0],
  49800. uv2: [0, 0]
  49801. },
  49802. this.index0AttributeName = void 0,
  49803. void 0 !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  49804. this.setValues(e))
  49805. }
  49806. ,
  49807. n.ShaderMaterial.prototype = Object.create(n.Material.prototype),
  49808. n.ShaderMaterial.prototype.constructor = n.ShaderMaterial,
  49809. n.ShaderMaterial.prototype.copy = function(e) {
  49810. return n.Material.prototype.copy.call(this, e),
  49811. this.fragmentShader = e.fragmentShader,
  49812. this.vertexShader = e.vertexShader,
  49813. this.uniforms = n.UniformsUtils.clone(e.uniforms),
  49814. this.defines = e.defines,
  49815. this.shading = e.shading,
  49816. this.wireframe = e.wireframe,
  49817. this.wireframeLinewidth = e.wireframeLinewidth,
  49818. this.fog = e.fog,
  49819. this.lights = e.lights,
  49820. this.vertexColors = e.vertexColors,
  49821. this.skinning = e.skinning,
  49822. this.morphTargets = e.morphTargets,
  49823. this.morphNormals = e.morphNormals,
  49824. this.extensions = e.extensions,
  49825. this
  49826. }
  49827. ,
  49828. n.ShaderMaterial.prototype.toJSON = function(e) {
  49829. var t = n.Material.prototype.toJSON.call(this, e);
  49830. return t.uniforms = this.uniforms,
  49831. t.vertexShader = this.vertexShader,
  49832. t.fragmentShader = this.fragmentShader,
  49833. t
  49834. }
  49835. ,
  49836. n.RawShaderMaterial = function(e) {
  49837. n.ShaderMaterial.call(this, e),
  49838. this.type = "RawShaderMaterial"
  49839. }
  49840. ,
  49841. n.RawShaderMaterial.prototype = Object.create(n.ShaderMaterial.prototype),
  49842. n.RawShaderMaterial.prototype.constructor = n.RawShaderMaterial,
  49843. n.SpriteMaterial = function(e) {
  49844. n.Material.call(this),
  49845. this.type = "SpriteMaterial",
  49846. this.color = new n.Color(16777215),
  49847. this.map = null,
  49848. this.rotation = 0,
  49849. this.fog = !1,
  49850. this.setValues(e)
  49851. }
  49852. ,
  49853. n.SpriteMaterial.prototype = Object.create(n.Material.prototype),
  49854. n.SpriteMaterial.prototype.constructor = n.SpriteMaterial,
  49855. n.SpriteMaterial.prototype.copy = function(e) {
  49856. return n.Material.prototype.copy.call(this, e),
  49857. this.color.copy(e.color),
  49858. this.map = e.map,
  49859. this.rotation = e.rotation,
  49860. this.fog = e.fog,
  49861. this
  49862. }
  49863. ,
  49864. n.Texture = function(e, t, i, r, o, a, s, l, c) {
  49865. Object.defineProperty(this, "id", {
  49866. value: n.TextureIdCount++
  49867. }),
  49868. this.uuid = n.Math.generateUUID(),
  49869. this.name = "",
  49870. this.sourceFile = "",
  49871. this.image = void 0 !== e ? e : n.Texture.DEFAULT_IMAGE,
  49872. this.mipmaps = [],
  49873. this.mapping = void 0 !== t ? t : n.Texture.DEFAULT_MAPPING,
  49874. this.wrapS = void 0 !== i ? i : n.ClampToEdgeWrapping,
  49875. this.wrapT = void 0 !== r ? r : n.ClampToEdgeWrapping,
  49876. this.magFilter = void 0 !== o ? o : n.LinearFilter,
  49877. this.minFilter = void 0 !== a ? a : n.LinearMipMapLinearFilter,
  49878. this.anisotropy = void 0 !== c ? c : 1,
  49879. this.format = void 0 !== s ? s : n.RGBAFormat,
  49880. this.type = void 0 !== l ? l : n.UnsignedByteType,
  49881. this.offset = new n.Vector2(0,0),
  49882. this.repeat = new n.Vector2(1,1),
  49883. this.generateMipmaps = !0,
  49884. this.premultiplyAlpha = !1,
  49885. this.flipY = !0,
  49886. this.unpackAlignment = 4,
  49887. this.encoding = n.LinearEncoding,
  49888. this.version = 0,
  49889. this.onUpdate = null
  49890. }
  49891. ,
  49892. n.Texture.DEFAULT_IMAGE = void 0,
  49893. n.Texture.DEFAULT_MAPPING = n.UVMapping,
  49894. n.Texture.prototype = {
  49895. constructor: n.Texture,
  49896. set needsUpdate(e) {
  49897. e === !0 && this.version++
  49898. },
  49899. clone: function() {
  49900. return (new this.constructor).copy(this)
  49901. },
  49902. copy: function(e) {
  49903. return this.image = e.image,
  49904. this.mipmaps = e.mipmaps.slice(0),
  49905. this.mapping = e.mapping,
  49906. this.wrapS = e.wrapS,
  49907. this.wrapT = e.wrapT,
  49908. this.magFilter = e.magFilter,
  49909. this.minFilter = e.minFilter,
  49910. this.anisotropy = e.anisotropy,
  49911. this.format = e.format,
  49912. this.type = e.type,
  49913. this.offset.copy(e.offset),
  49914. this.repeat.copy(e.repeat),
  49915. this.generateMipmaps = e.generateMipmaps,
  49916. this.premultiplyAlpha = e.premultiplyAlpha,
  49917. this.flipY = e.flipY,
  49918. this.unpackAlignment = e.unpackAlignment,
  49919. this.encoding = e.encoding,
  49920. this
  49921. },
  49922. toJSON: function(e) {
  49923. function t(e) {
  49924. var t;
  49925. return void 0 !== e.toDataURL ? t = e : (t = document.createElement("canvas"),
  49926. t.width = e.width,
  49927. t.height = e.height,
  49928. t.getContext("2d").drawImage(e, 0, 0, e.width, e.height)),
  49929. t.width > 2048 || t.height > 2048 ? t.toDataURL("image/jpeg", .6) : t.toDataURL("image/png")
  49930. }
  49931. if (void 0 !== e.textures[this.uuid])
  49932. return e.textures[this.uuid];
  49933. var i = {
  49934. metadata: {
  49935. version: 4.4,
  49936. type: "Texture",
  49937. generator: "Texture.toJSON"
  49938. },
  49939. uuid: this.uuid,
  49940. name: this.name,
  49941. mapping: this.mapping,
  49942. repeat: [this.repeat.x, this.repeat.y],
  49943. offset: [this.offset.x, this.offset.y],
  49944. wrap: [this.wrapS, this.wrapT],
  49945. minFilter: this.minFilter,
  49946. magFilter: this.magFilter,
  49947. anisotropy: this.anisotropy
  49948. };
  49949. if (void 0 !== this.image) {
  49950. var r = this.image;
  49951. void 0 === r.uuid && (r.uuid = n.Math.generateUUID()),
  49952. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  49953. uuid: r.uuid,
  49954. url: t(r)
  49955. }),
  49956. i.image = r.uuid
  49957. }
  49958. return e.textures[this.uuid] = i,
  49959. i
  49960. },
  49961. dispose: function() {
  49962. this.dispatchEvent({
  49963. type: "dispose"
  49964. })
  49965. },
  49966. transformUv: function(e) {
  49967. if (this.mapping === n.UVMapping) {
  49968. if (e.multiply(this.repeat),
  49969. e.add(this.offset),
  49970. e.x < 0 || e.x > 1)
  49971. switch (this.wrapS) {
  49972. case n.RepeatWrapping:
  49973. e.x = e.x - Math.floor(e.x);
  49974. break;
  49975. case n.ClampToEdgeWrapping:
  49976. e.x = e.x < 0 ? 0 : 1;
  49977. break;
  49978. case n.MirroredRepeatWrapping:
  49979. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  49980. }
  49981. if (e.y < 0 || e.y > 1)
  49982. switch (this.wrapT) {
  49983. case n.RepeatWrapping:
  49984. e.y = e.y - Math.floor(e.y);
  49985. break;
  49986. case n.ClampToEdgeWrapping:
  49987. e.y = e.y < 0 ? 0 : 1;
  49988. break;
  49989. case n.MirroredRepeatWrapping:
  49990. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  49991. }
  49992. this.flipY && (e.y = 1 - e.y)
  49993. }
  49994. }
  49995. },
  49996. n.EventDispatcher.prototype.apply(n.Texture.prototype),
  49997. n.TextureIdCount = 0,
  49998. n.CanvasTexture = function(e, t, i, r, o, a, s, l, c) {
  49999. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  50000. this.needsUpdate = !0
  50001. }
  50002. ,
  50003. n.CanvasTexture.prototype = Object.create(n.Texture.prototype),
  50004. n.CanvasTexture.prototype.constructor = n.CanvasTexture,
  50005. n.CubeTexture = function(e, t, i, r, o, a, s, l, c) {
  50006. e = void 0 !== e ? e : [],
  50007. t = void 0 !== t ? t : n.CubeReflectionMapping,
  50008. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  50009. this.flipY = !1
  50010. }
  50011. ,
  50012. n.CubeTexture.prototype = Object.create(n.Texture.prototype),
  50013. n.CubeTexture.prototype.constructor = n.CubeTexture,
  50014. Object.defineProperty(n.CubeTexture.prototype, "images", {
  50015. get: function() {
  50016. return this.image
  50017. },
  50018. set: function(e) {
  50019. this.image = e
  50020. }
  50021. }),
  50022. n.CompressedTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  50023. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  50024. this.image = {
  50025. width: t,
  50026. height: i
  50027. },
  50028. this.mipmaps = e,
  50029. this.flipY = !1,
  50030. this.generateMipmaps = !1
  50031. }
  50032. ,
  50033. n.CompressedTexture.prototype = Object.create(n.Texture.prototype),
  50034. n.CompressedTexture.prototype.constructor = n.CompressedTexture,
  50035. n.DataTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  50036. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  50037. this.image = {
  50038. data: e,
  50039. width: t,
  50040. height: i
  50041. },
  50042. this.magFilter = void 0 !== c ? c : n.NearestFilter,
  50043. this.minFilter = void 0 !== h ? h : n.NearestFilter,
  50044. this.flipY = !1,
  50045. this.generateMipmaps = !1
  50046. }
  50047. ,
  50048. n.DataTexture.prototype = Object.create(n.Texture.prototype),
  50049. n.DataTexture.prototype.constructor = n.DataTexture,
  50050. n.VideoTexture = function(e, t, i, r, o, a, s, l, c) {
  50051. function h() {
  50052. requestAnimationFrame(h)
  50053. if( !e.paused && e.readyState === e.HAVE_ENOUGH_DATA){//改 add !e.paused
  50054. u.needsUpdate = !0
  50055. }
  50056. }
  50057. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  50058. this.generateMipmaps = !1;
  50059. var u = this;
  50060. h()
  50061. }
  50062. ,
  50063. n.VideoTexture.prototype = Object.create(n.Texture.prototype),
  50064. n.VideoTexture.prototype.constructor = n.VideoTexture,
  50065. n.Group = function() {
  50066. n.Object3D.call(this),
  50067. this.type = "Group"
  50068. }
  50069. ,
  50070. n.Group.prototype = Object.create(n.Object3D.prototype),
  50071. n.Group.prototype.constructor = n.Group,
  50072. n.Points = function(e, t) {
  50073. n.Object3D.call(this),
  50074. this.type = "Points",
  50075. this.geometry = void 0 !== e ? e : new n.Geometry,
  50076. this.material = void 0 !== t ? t : new n.PointsMaterial({
  50077. color: 16777215 * Math.random()
  50078. })
  50079. }
  50080. ,
  50081. n.Points.prototype = Object.create(n.Object3D.prototype),
  50082. n.Points.prototype.constructor = n.Points,
  50083. n.Points.prototype.raycast = function() {
  50084. var e = new n.Matrix4
  50085. , t = new n.Ray
  50086. , i = new n.Sphere;
  50087. return function(r, o) {
  50088. function a(e, i) {
  50089. var n = t.distanceSqToPoint(e);
  50090. if (n < d) {
  50091. var a = t.closestPointToPoint(e);
  50092. a.applyMatrix4(c);
  50093. var l = r.ray.origin.distanceTo(a);
  50094. if (l < r.near || l > r.far)
  50095. return;
  50096. o.push({
  50097. distance: l,
  50098. distanceToRay: Math.sqrt(n),
  50099. point: a.clone(),
  50100. index: i,
  50101. face: null,
  50102. object: s
  50103. })
  50104. }
  50105. }
  50106. var s = this
  50107. , l = this.geometry
  50108. , c = this.matrixWorld
  50109. , h = r.params.Points.threshold;
  50110. if (null === l.boundingSphere && l.computeBoundingSphere(),
  50111. i.copy(l.boundingSphere),
  50112. i.applyMatrix4(c),
  50113. r.ray.intersectsSphere(i) !== !1) {
  50114. e.getInverse(c),
  50115. t.copy(r.ray).applyMatrix4(e);
  50116. var u = h / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  50117. , d = u * u
  50118. , p = new n.Vector3;
  50119. if (l instanceof n.BufferGeometry) {
  50120. var f = l.index
  50121. , g = l.attributes
  50122. , m = g.position.array;
  50123. if (null !== f)
  50124. for (var v = f.array, A = 0, y = v.length; A < y; A++) {
  50125. var C = v[A];
  50126. p.fromArray(m, 3 * C),
  50127. a(p, C)
  50128. }
  50129. else
  50130. for (var A = 0, I = m.length / 3; A < I; A++)
  50131. p.fromArray(m, 3 * A),
  50132. a(p, A)
  50133. } else
  50134. for (var E = l.vertices, A = 0, I = E.length; A < I; A++)
  50135. a(E[A], A)
  50136. }
  50137. }
  50138. }(),
  50139. n.Points.prototype.clone = function() {
  50140. return new this.constructor(this.geometry,this.material).copy(this)
  50141. }
  50142. ,
  50143. n.Line = function(e, t, i) {
  50144. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  50145. new n.LineSegments(e,t)) : (n.Object3D.call(this),
  50146. this.type = "Line",
  50147. this.geometry = void 0 !== e ? e : new n.Geometry,
  50148. void (this.material = void 0 !== t ? t : new n.LineBasicMaterial({
  50149. color: 16777215 * Math.random()
  50150. })))
  50151. }
  50152. ,
  50153. n.Line.prototype = Object.create(n.Object3D.prototype),
  50154. n.Line.prototype.constructor = n.Line,
  50155. n.Line.prototype.raycast = function() {
  50156. var e = new n.Matrix4
  50157. , t = new n.Ray
  50158. , i = new n.Sphere;
  50159. return function(r, o) {
  50160. var a = r.linePrecision
  50161. , s = a * a
  50162. , l = this.geometry
  50163. , c = this.matrixWorld;
  50164. if (null === l.boundingSphere && l.computeBoundingSphere(),
  50165. i.copy(l.boundingSphere),
  50166. i.applyMatrix4(c),
  50167. r.ray.intersectsSphere(i) !== !1) {
  50168. e.getInverse(c),
  50169. t.copy(r.ray).applyMatrix4(e);
  50170. var h = new n.Vector3
  50171. , u = new n.Vector3
  50172. , d = new n.Vector3
  50173. , p = new n.Vector3
  50174. , f = this instanceof n.LineSegments ? 2 : 1;
  50175. if (l instanceof n.BufferGeometry) {
  50176. var g = l.index
  50177. , m = l.attributes
  50178. , v = m.position.array;
  50179. if (null !== g)
  50180. for (var A = g.array, y = 0, C = A.length - 1; y < C; y += f) {
  50181. var I = A[y]
  50182. , E = A[y + 1];
  50183. h.fromArray(v, 3 * I),
  50184. u.fromArray(v, 3 * E);
  50185. var b = t.distanceSqToSegment(h, u, p, d);
  50186. if (!(b > s)) {
  50187. p.applyMatrix4(this.matrixWorld);
  50188. var w = r.ray.origin.distanceTo(p);
  50189. w < r.near || w > r.far || o.push({
  50190. distance: w,
  50191. point: d.clone().applyMatrix4(this.matrixWorld),
  50192. index: y,
  50193. face: null,
  50194. faceIndex: null,
  50195. object: this
  50196. })
  50197. }
  50198. }
  50199. else
  50200. for (var y = 0, C = v.length / 3 - 1; y < C; y += f) {
  50201. h.fromArray(v, 3 * y),
  50202. u.fromArray(v, 3 * y + 3);
  50203. var b = t.distanceSqToSegment(h, u, p, d);
  50204. if (!(b > s)) {
  50205. p.applyMatrix4(this.matrixWorld);
  50206. var w = r.ray.origin.distanceTo(p);
  50207. w < r.near || w > r.far || o.push({
  50208. distance: w,
  50209. point: d.clone().applyMatrix4(this.matrixWorld),
  50210. index: y,
  50211. face: null,
  50212. faceIndex: null,
  50213. object: this
  50214. })
  50215. }
  50216. }
  50217. } else if (l instanceof n.Geometry)
  50218. for (var _ = l.vertices, T = _.length, y = 0; y < T - 1; y += f) {
  50219. var b = t.distanceSqToSegment(_[y], _[y + 1], p, d);
  50220. if (!(b > s)) {
  50221. p.applyMatrix4(this.matrixWorld);
  50222. var w = r.ray.origin.distanceTo(p);
  50223. w < r.near || w > r.far || o.push({
  50224. distance: w,
  50225. point: d.clone().applyMatrix4(this.matrixWorld),
  50226. index: y,
  50227. face: null,
  50228. faceIndex: null,
  50229. object: this
  50230. })
  50231. }
  50232. }
  50233. }
  50234. }
  50235. }(),
  50236. n.Line.prototype.clone = function() {
  50237. return new this.constructor(this.geometry,this.material).copy(this)
  50238. }
  50239. ,
  50240. n.LineStrip = 0,
  50241. n.LinePieces = 1,
  50242. n.LineSegments = function(e, t) {
  50243. n.Line.call(this, e, t),
  50244. this.type = "LineSegments"
  50245. }
  50246. ,
  50247. n.LineSegments.prototype = Object.create(n.Line.prototype),
  50248. n.LineSegments.prototype.constructor = n.LineSegments,
  50249. n.Mesh = function(e, t) {
  50250. n.Object3D.call(this),
  50251. this.type = "Mesh",
  50252. this.geometry = void 0 !== e ? e : new n.Geometry,
  50253. this.material = void 0 !== t ? t : new n.MeshBasicMaterial({
  50254. color: 16777215 * Math.random()
  50255. }),
  50256. this.drawMode = n.TrianglesDrawMode,
  50257. this.updateMorphTargets()
  50258. }
  50259. ,
  50260. n.Mesh.prototype = Object.create(n.Object3D.prototype),
  50261. n.Mesh.prototype.constructor = n.Mesh,
  50262. n.Mesh.prototype.setDrawMode = function(e) {
  50263. this.drawMode = e
  50264. }
  50265. ,
  50266. n.Mesh.prototype.updateMorphTargets = function() {
  50267. if (void 0 !== this.geometry.morphTargets && this.geometry.morphTargets.length > 0) {
  50268. this.morphTargetBase = -1,
  50269. this.morphTargetInfluences = [],
  50270. this.morphTargetDictionary = {};
  50271. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  50272. this.morphTargetInfluences.push(0),
  50273. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  50274. }
  50275. }
  50276. ,
  50277. n.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  50278. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  50279. 0)
  50280. }
  50281. ,
  50282. n.Mesh.prototype.raycast = function() {
  50283. function e(e, t, i, r, o, a, s) {
  50284. return n.Triangle.barycoordFromPoint(e, t, i, r, m),
  50285. o.multiplyScalar(m.x),
  50286. a.multiplyScalar(m.y),
  50287. s.multiplyScalar(m.z),
  50288. o.add(a).add(s),
  50289. o.clone()
  50290. }
  50291. function t(e, t, i, r, o, a, s) {
  50292. var l, c = e.material;
  50293. if (l = c.side === n.BackSide ? i.intersectTriangle(a, o, r, !0, s) : i.intersectTriangle(r, o, a, c.side !== n.DoubleSide, s),
  50294. null === l)
  50295. return null;
  50296. A.copy(s),
  50297. A.applyMatrix4(e.matrixWorld);
  50298. var h = t.ray.origin.distanceTo(A);
  50299. return h < t.near || h > t.far ? null : {
  50300. distance: h,
  50301. point: A.clone(),
  50302. object: e
  50303. }
  50304. }
  50305. function i(i, r, o, a, h, u, d, m) {
  50306. s.fromArray(a, 3 * u),
  50307. l.fromArray(a, 3 * d),
  50308. c.fromArray(a, 3 * m);
  50309. var A = t(i, r, o, s, l, c, v);
  50310. return A && (h && (p.fromArray(h, 2 * u),
  50311. f.fromArray(h, 2 * d),
  50312. g.fromArray(h, 2 * m),
  50313. A.uv = e(v, s, l, c, p, f, g)),
  50314. A.face = new n.Face3(u,d,m,n.Triangle.normal(s, l, c)),
  50315. A.faceIndex = u),
  50316. A
  50317. }
  50318. var r = new n.Matrix4
  50319. , o = new n.Ray
  50320. , a = new n.Sphere
  50321. , s = new n.Vector3
  50322. , l = new n.Vector3
  50323. , c = new n.Vector3
  50324. , h = new n.Vector3
  50325. , u = new n.Vector3
  50326. , d = new n.Vector3
  50327. , p = new n.Vector2
  50328. , f = new n.Vector2
  50329. , g = new n.Vector2
  50330. , m = new n.Vector3
  50331. , v = new n.Vector3
  50332. , A = new n.Vector3;
  50333. return function(m, A) {
  50334. var y = this.geometry
  50335. , C = this.material
  50336. , I = this.matrixWorld;
  50337. if (void 0 !== C && (null === y.boundingSphere && y.computeBoundingSphere(),
  50338. a.copy(y.boundingSphere),
  50339. a.applyMatrix4(I),
  50340. m.ray.intersectsSphere(a) !== !1 && (r.getInverse(I),
  50341. o.copy(m.ray).applyMatrix4(r),
  50342. null === y.boundingBox || o.intersectsBox(y.boundingBox) !== !1))) {
  50343. var E, b;
  50344. if (y instanceof n.BufferGeometry) {
  50345. var w, _, T, x = y.index, S = y.attributes, M = S.position.array;
  50346. if (void 0 !== S.uv && (E = S.uv.array),
  50347. null !== x)
  50348. for (var R = x.array, P = 0, O = R.length; P < O; P += 3)
  50349. w = R[P],
  50350. _ = R[P + 1],
  50351. T = R[P + 2],
  50352. b = i(this, m, o, M, E, w, _, T),
  50353. b && (b.faceIndex = Math.floor(P / 3),
  50354. A.push(b));
  50355. else
  50356. for (var P = 0, O = M.length; P < O; P += 9)
  50357. w = P / 3,
  50358. _ = w + 1,
  50359. T = w + 2,
  50360. b = i(this, m, o, M, E, w, _, T),
  50361. b && (b.index = w,
  50362. A.push(b))
  50363. } else if (y instanceof n.Geometry) {
  50364. 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];
  50365. k.length > 0 && (E = k);
  50366. for (var H = 0, G = U.length; H < G; H++) {
  50367. var z = U[H]
  50368. , W = B === !0 ? F[z.materialIndex] : C;
  50369. if (void 0 !== W) {
  50370. if (L = V[z.a],
  50371. D = V[z.b],
  50372. N = V[z.c],
  50373. W.morphTargets === !0) {
  50374. var j = y.morphTargets
  50375. , Y = this.morphTargetInfluences;
  50376. s.set(0, 0, 0),
  50377. l.set(0, 0, 0),
  50378. c.set(0, 0, 0);
  50379. for (var X = 0, Z = j.length; X < Z; X++) {
  50380. var q = Y[X];
  50381. if (0 !== q) {
  50382. var K = j[X].vertices;
  50383. s.addScaledVector(h.subVectors(K[z.a], L), q),
  50384. l.addScaledVector(u.subVectors(K[z.b], D), q),
  50385. c.addScaledVector(d.subVectors(K[z.c], N), q)
  50386. }
  50387. }
  50388. s.add(L),
  50389. l.add(D),
  50390. c.add(N),
  50391. L = s,
  50392. D = l,
  50393. N = c
  50394. }
  50395. if (b = t(this, m, o, L, D, N, v)) {
  50396. if (E) {
  50397. var Q = E[H];
  50398. p.copy(Q[0]),
  50399. f.copy(Q[1]),
  50400. g.copy(Q[2]),
  50401. b.uv = e(v, L, D, N, p, f, g)
  50402. }
  50403. b.face = z,
  50404. b.faceIndex = H,
  50405. A.push(b)
  50406. }
  50407. }
  50408. }
  50409. }
  50410. }
  50411. }
  50412. }(),
  50413. n.Mesh.prototype.clone = function() {
  50414. return new this.constructor(this.geometry,this.material).copy(this)
  50415. }
  50416. ,
  50417. n.Bone = function(e) {
  50418. n.Object3D.call(this),
  50419. this.type = "Bone",
  50420. this.skin = e
  50421. }
  50422. ,
  50423. n.Bone.prototype = Object.create(n.Object3D.prototype),
  50424. n.Bone.prototype.constructor = n.Bone,
  50425. n.Bone.prototype.copy = function(e) {
  50426. return n.Object3D.prototype.copy.call(this, e),
  50427. this.skin = e.skin,
  50428. this
  50429. }
  50430. ,
  50431. n.Skeleton = function(e, t, i) {
  50432. if (this.useVertexTexture = void 0 === i || i,
  50433. this.identityMatrix = new n.Matrix4,
  50434. e = e || [],
  50435. this.bones = e.slice(0),
  50436. this.useVertexTexture) {
  50437. var r = Math.sqrt(4 * this.bones.length);
  50438. r = n.Math.nextPowerOfTwo(Math.ceil(r)),
  50439. r = Math.max(r, 4),
  50440. this.boneTextureWidth = r,
  50441. this.boneTextureHeight = r,
  50442. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  50443. this.boneTexture = new n.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,n.RGBAFormat,n.FloatType)
  50444. } else
  50445. this.boneMatrices = new Float32Array(16 * this.bones.length);
  50446. if (void 0 === t)
  50447. this.calculateInverses();
  50448. else if (this.bones.length === t.length)
  50449. this.boneInverses = t.slice(0);
  50450. else {
  50451. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  50452. this.boneInverses = [];
  50453. for (var o = 0, a = this.bones.length; o < a; o++)
  50454. this.boneInverses.push(new n.Matrix4)
  50455. }
  50456. }
  50457. ,
  50458. n.Skeleton.prototype.calculateInverses = function() {
  50459. this.boneInverses = [];
  50460. for (var e = 0, t = this.bones.length; e < t; e++) {
  50461. var i = new n.Matrix4;
  50462. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  50463. this.boneInverses.push(i)
  50464. }
  50465. }
  50466. ,
  50467. n.Skeleton.prototype.pose = function() {
  50468. for (var e, t = 0, i = this.bones.length; t < i; t++)
  50469. e = this.bones[t],
  50470. e && e.matrixWorld.getInverse(this.boneInverses[t]);
  50471. for (var t = 0, i = this.bones.length; t < i; t++)
  50472. e = this.bones[t],
  50473. e && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  50474. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  50475. e.matrix.decompose(e.position, e.quaternion, e.scale));
  50476. }
  50477. ,
  50478. n.Skeleton.prototype.update = function() {
  50479. var e = new n.Matrix4;
  50480. return function() {
  50481. for (var t = 0, i = this.bones.length; t < i; t++) {
  50482. var n = this.bones[t] ? this.bones[t].matrixWorld : this.identityMatrix;
  50483. e.multiplyMatrices(n, this.boneInverses[t]),
  50484. e.flattenToArrayOffset(this.boneMatrices, 16 * t)
  50485. }
  50486. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  50487. }
  50488. }(),
  50489. n.Skeleton.prototype.clone = function() {
  50490. return new n.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  50491. }
  50492. ,
  50493. n.SkinnedMesh = function(e, t, i) {
  50494. n.Mesh.call(this, e, t),
  50495. this.type = "SkinnedMesh",
  50496. this.bindMode = "attached",
  50497. this.bindMatrix = new n.Matrix4,
  50498. this.bindMatrixInverse = new n.Matrix4;
  50499. var r = [];
  50500. if (this.geometry && void 0 !== this.geometry.bones) {
  50501. for (var o, a, s = 0, l = this.geometry.bones.length; s < l; ++s)
  50502. a = this.geometry.bones[s],
  50503. o = new n.Bone(this),
  50504. r.push(o),
  50505. o.name = a.name,
  50506. o.position.fromArray(a.pos),
  50507. o.quaternion.fromArray(a.rotq),
  50508. void 0 !== a.scl && o.scale.fromArray(a.scl);
  50509. for (var s = 0, l = this.geometry.bones.length; s < l; ++s)
  50510. a = this.geometry.bones[s],
  50511. a.parent !== -1 && null !== a.parent ? r[a.parent].add(r[s]) : this.add(r[s])
  50512. }
  50513. this.normalizeSkinWeights(),
  50514. this.updateMatrixWorld(!0),
  50515. this.bind(new n.Skeleton(r,void 0,i), this.matrixWorld)
  50516. }
  50517. ,
  50518. n.SkinnedMesh.prototype = Object.create(n.Mesh.prototype),
  50519. n.SkinnedMesh.prototype.constructor = n.SkinnedMesh,
  50520. n.SkinnedMesh.prototype.bind = function(e, t) {
  50521. this.skeleton = e,
  50522. void 0 === t && (this.updateMatrixWorld(!0),
  50523. this.skeleton.calculateInverses(),
  50524. t = this.matrixWorld),
  50525. this.bindMatrix.copy(t),
  50526. this.bindMatrixInverse.getInverse(t)
  50527. }
  50528. ,
  50529. n.SkinnedMesh.prototype.pose = function() {
  50530. this.skeleton.pose()
  50531. }
  50532. ,
  50533. n.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  50534. if (this.geometry instanceof n.Geometry)
  50535. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  50536. var t = this.geometry.skinWeights[e]
  50537. , i = 1 / t.lengthManhattan();
  50538. i !== 1 / 0 ? t.multiplyScalar(i) : t.set(1, 0, 0, 0)
  50539. }
  50540. else if (this.geometry instanceof n.BufferGeometry)
  50541. for (var r = new n.Vector4, o = this.geometry.attributes.skinWeight, e = 0; e < o.count; e++) {
  50542. r.x = o.getX(e),
  50543. r.y = o.getY(e),
  50544. r.z = o.getZ(e),
  50545. r.w = o.getW(e);
  50546. var i = 1 / r.lengthManhattan();
  50547. i !== 1 / 0 ? r.multiplyScalar(i) : r.set(1, 0, 0, 0),
  50548. o.setXYZW(e, r.x, r.y, r.z, r.w)
  50549. }
  50550. }
  50551. ,
  50552. n.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  50553. n.Mesh.prototype.updateMatrixWorld.call(this, !0),
  50554. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  50555. }
  50556. ,
  50557. n.SkinnedMesh.prototype.clone = function() {
  50558. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  50559. }
  50560. ,
  50561. n.LOD = function() {
  50562. n.Object3D.call(this),
  50563. this.type = "LOD",
  50564. Object.defineProperties(this, {
  50565. levels: {
  50566. enumerable: !0,
  50567. value: []
  50568. },
  50569. objects: {
  50570. get: function() {
  50571. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  50572. this.levels
  50573. }
  50574. }
  50575. })
  50576. }
  50577. ,
  50578. n.LOD.prototype = Object.create(n.Object3D.prototype),
  50579. n.LOD.prototype.constructor = n.LOD,
  50580. n.LOD.prototype.addLevel = function(e, t) {
  50581. void 0 === t && (t = 0),
  50582. t = Math.abs(t);
  50583. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  50584. ;
  50585. i.splice(n, 0, {
  50586. distance: t,
  50587. object: e
  50588. }),
  50589. this.add(e)
  50590. }
  50591. ,
  50592. n.LOD.prototype.getObjectForDistance = function(e) {
  50593. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  50594. ;
  50595. return t[i - 1].object
  50596. }
  50597. ,
  50598. n.LOD.prototype.raycast = function() {
  50599. var e = new n.Vector3;
  50600. return function(t, i) {
  50601. e.setFromMatrixPosition(this.matrixWorld);
  50602. var n = t.ray.origin.distanceTo(e);
  50603. this.getObjectForDistance(n).raycast(t, i)
  50604. }
  50605. }(),
  50606. n.LOD.prototype.update = function() {
  50607. var e = new n.Vector3
  50608. , t = new n.Vector3;
  50609. return function(i) {
  50610. var n = this.levels;
  50611. if (n.length > 1) {
  50612. e.setFromMatrixPosition(i.matrixWorld),
  50613. t.setFromMatrixPosition(this.matrixWorld);
  50614. var r = e.distanceTo(t);
  50615. n[0].object.visible = !0;
  50616. for (var o = 1, a = n.length; o < a && r >= n[o].distance; o++)
  50617. n[o - 1].object.visible = !1,
  50618. n[o].object.visible = !0;
  50619. for (; o < a; o++)
  50620. n[o].object.visible = !1
  50621. }
  50622. }
  50623. }(),
  50624. n.LOD.prototype.copy = function(e) {
  50625. n.Object3D.prototype.copy.call(this, e, !1);
  50626. for (var t = e.levels, i = 0, r = t.length; i < r; i++) {
  50627. var o = t[i];
  50628. this.addLevel(o.object.clone(), o.distance)
  50629. }
  50630. return this
  50631. }
  50632. ,
  50633. n.LOD.prototype.toJSON = function(e) {
  50634. var t = n.Object3D.prototype.toJSON.call(this, e);
  50635. t.object.levels = [];
  50636. for (var i = this.levels, r = 0, o = i.length; r < o; r++) {
  50637. var a = i[r];
  50638. t.object.levels.push({
  50639. object: a.object.uuid,
  50640. distance: a.distance
  50641. })
  50642. }
  50643. return t
  50644. }
  50645. ,
  50646. n.Sprite = function() {
  50647. var e = new Uint16Array([0, 1, 2, 0, 2, 3])
  50648. , t = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0])
  50649. , i = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1])
  50650. , r = new n.BufferGeometry;
  50651. return r.setIndex(new n.BufferAttribute(e,1)),
  50652. r.addAttribute("position", new n.BufferAttribute(t,3)),
  50653. r.addAttribute("uv", new n.BufferAttribute(i,2)),
  50654. function(e) {
  50655. n.Object3D.call(this),
  50656. this.type = "Sprite",
  50657. this.geometry = r,
  50658. this.material = void 0 !== e ? e : new n.SpriteMaterial
  50659. }
  50660. }(),
  50661. n.Sprite.prototype = Object.create(n.Object3D.prototype),
  50662. n.Sprite.prototype.constructor = n.Sprite,
  50663. n.Sprite.prototype.raycast = function() {
  50664. var e = new n.Vector3;
  50665. return function(t, i) {
  50666. e.setFromMatrixPosition(this.matrixWorld);
  50667. var n = t.ray.distanceSqToPoint(e)
  50668. , r = this.scale.x * this.scale.y;
  50669. n > r || i.push({
  50670. distance: Math.sqrt(n),
  50671. point: this.position,
  50672. face: null,
  50673. object: this
  50674. })
  50675. }
  50676. }(),
  50677. n.Sprite.prototype.clone = function() {
  50678. return new this.constructor(this.material).copy(this)
  50679. }
  50680. ,
  50681. n.Particle = n.Sprite,
  50682. n.LensFlare = function(e, t, i, r, o) {
  50683. n.Object3D.call(this),
  50684. this.lensFlares = [],
  50685. this.positionScreen = new n.Vector3,
  50686. this.customUpdateCallback = void 0,
  50687. void 0 !== e && this.add(e, t, i, r, o)
  50688. }
  50689. ,
  50690. n.LensFlare.prototype = Object.create(n.Object3D.prototype),
  50691. n.LensFlare.prototype.constructor = n.LensFlare,
  50692. n.LensFlare.prototype.add = function(e, t, i, r, o, a) {
  50693. void 0 === t && (t = -1),
  50694. void 0 === i && (i = 0),
  50695. void 0 === a && (a = 1),
  50696. void 0 === o && (o = new n.Color(16777215)),
  50697. void 0 === r && (r = n.NormalBlending),
  50698. i = Math.min(i, Math.max(0, i)),
  50699. this.lensFlares.push({
  50700. texture: e,
  50701. size: t,
  50702. distance: i,
  50703. x: 0,
  50704. y: 0,
  50705. z: 0,
  50706. scale: 1,
  50707. rotation: 0,
  50708. opacity: a,
  50709. color: o,
  50710. blending: r
  50711. })
  50712. }
  50713. ,
  50714. n.LensFlare.prototype.updateLensFlares = function() {
  50715. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  50716. for (e = 0; e < i; e++)
  50717. t = this.lensFlares[e],
  50718. t.x = this.positionScreen.x + n * t.distance,
  50719. t.y = this.positionScreen.y + r * t.distance,
  50720. t.wantedRotation = t.x * Math.PI * .25,
  50721. t.rotation += .25 * (t.wantedRotation - t.rotation)
  50722. }
  50723. ,
  50724. n.LensFlare.prototype.copy = function(e) {
  50725. n.Object3D.prototype.copy.call(this, e),
  50726. this.positionScreen.copy(e.positionScreen),
  50727. this.customUpdateCallback = e.customUpdateCallback;
  50728. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  50729. this.lensFlares.push(e.lensFlares[t]);
  50730. return this
  50731. }
  50732. ,
  50733. n.Scene = function() {
  50734. n.Object3D.call(this),
  50735. this.type = "Scene",
  50736. this.fog = null,
  50737. this.overrideMaterial = null,
  50738. this.autoUpdate = !0
  50739. }
  50740. ,
  50741. n.Scene.prototype = Object.create(n.Object3D.prototype),
  50742. n.Scene.prototype.constructor = n.Scene,
  50743. n.Scene.prototype.copy = function(e, t) {
  50744. return n.Object3D.prototype.copy.call(this, e, t),
  50745. null !== e.fog && (this.fog = e.fog.clone()),
  50746. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  50747. this.autoUpdate = e.autoUpdate,
  50748. this.matrixAutoUpdate = e.matrixAutoUpdate,
  50749. this
  50750. }
  50751. ,
  50752. n.Fog = function(e, t, i) {
  50753. this.name = "",
  50754. this.color = new n.Color(e),
  50755. this.near = void 0 !== t ? t : 1,
  50756. this.far = void 0 !== i ? i : 1e3
  50757. }
  50758. ,
  50759. n.Fog.prototype.clone = function() {
  50760. return new n.Fog(this.color.getHex(),this.near,this.far)
  50761. }
  50762. ,
  50763. n.FogExp2 = function(e, t) {
  50764. this.name = "",
  50765. this.color = new n.Color(e),
  50766. this.density = void 0 !== t ? t : 25e-5
  50767. }
  50768. ,
  50769. n.FogExp2.prototype.clone = function() {
  50770. return new n.FogExp2(this.color.getHex(),this.density)
  50771. }
  50772. ,
  50773. n.ShaderChunk = {},
  50774. n.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  50775. n.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  50776. n.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  50777. 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",
  50778. n.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  50779. n.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  50780. n.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  50781. 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",
  50782. 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",
  50783. n.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  50784. n.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  50785. n.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  50786. n.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  50787. 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",
  50788. 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",
  50789. n.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  50790. n.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  50791. n.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  50792. 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",
  50793. n.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  50794. 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",
  50795. n.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  50796. 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",
  50797. 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",
  50798. 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",
  50799. 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",
  50800. 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",
  50801. 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",
  50802. n.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  50803. n.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  50804. 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",
  50805. 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",
  50806. n.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  50807. 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",
  50808. n.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  50809. n.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  50810. 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",
  50811. 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",
  50812. 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",
  50813. n.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  50814. 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",
  50815. 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",
  50816. 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",
  50817. n.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  50818. n.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  50819. 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",
  50820. n.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  50821. n.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  50822. n.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  50823. 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",
  50824. 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";
  50825. 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";
  50826. 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",
  50827. 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",
  50828. n.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  50829. 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",
  50830. n.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  50831. n.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  50832. 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",
  50833. 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",
  50834. 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",
  50835. 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",
  50836. 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",
  50837. 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",
  50838. 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",
  50839. 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",
  50840. 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",
  50841. n.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  50842. n.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  50843. 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",
  50844. n.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  50845. n.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  50846. n.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  50847. 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",
  50848. 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",
  50849. 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",
  50850. 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",
  50851. n.UniformsUtils = {
  50852. merge: function(e) {
  50853. for (var t = {}, i = 0; i < e.length; i++) {
  50854. var n = this.clone(e[i]);
  50855. for (var r in n)
  50856. t[r] = n[r]
  50857. }
  50858. return t
  50859. },
  50860. clone: function(e) {
  50861. var t = {};
  50862. for (var i in e) {
  50863. t[i] = {};
  50864. for (var r in e[i]) {
  50865. var o = e[i][r];
  50866. 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
  50867. }
  50868. }
  50869. return t
  50870. }
  50871. },
  50872. n.UniformsLib = {
  50873. common: {
  50874. diffuse: {
  50875. type: "c",
  50876. value: new n.Color(15658734)
  50877. },
  50878. opacity: {
  50879. type: "f",
  50880. value: 1
  50881. },
  50882. map: {
  50883. type: "t",
  50884. value: null
  50885. },
  50886. offsetRepeat: {
  50887. type: "v4",
  50888. value: new n.Vector4(0,0,1,1)
  50889. },
  50890. specularMap: {
  50891. type: "t",
  50892. value: null
  50893. },
  50894. alphaMap: {
  50895. type: "t",
  50896. value: null
  50897. },
  50898. envMap: {
  50899. type: "t",
  50900. value: null
  50901. },
  50902. flipEnvMap: {
  50903. type: "f",
  50904. value: -1
  50905. },
  50906. reflectivity: {
  50907. type: "f",
  50908. value: 1
  50909. },
  50910. refractionRatio: {
  50911. type: "f",
  50912. value: .98
  50913. }
  50914. },
  50915. aomap: {
  50916. aoMap: {
  50917. type: "t",
  50918. value: null
  50919. },
  50920. aoMapIntensity: {
  50921. type: "f",
  50922. value: 1
  50923. }
  50924. },
  50925. lightmap: {
  50926. lightMap: {
  50927. type: "t",
  50928. value: null
  50929. },
  50930. lightMapIntensity: {
  50931. type: "f",
  50932. value: 1
  50933. }
  50934. },
  50935. emissivemap: {
  50936. emissiveMap: {
  50937. type: "t",
  50938. value: null
  50939. }
  50940. },
  50941. bumpmap: {
  50942. bumpMap: {
  50943. type: "t",
  50944. value: null
  50945. },
  50946. bumpScale: {
  50947. type: "f",
  50948. value: 1
  50949. }
  50950. },
  50951. normalmap: {
  50952. normalMap: {
  50953. type: "t",
  50954. value: null
  50955. },
  50956. normalScale: {
  50957. type: "v2",
  50958. value: new n.Vector2(1,1)
  50959. }
  50960. },
  50961. displacementmap: {
  50962. displacementMap: {
  50963. type: "t",
  50964. value: null
  50965. },
  50966. displacementScale: {
  50967. type: "f",
  50968. value: 1
  50969. },
  50970. displacementBias: {
  50971. type: "f",
  50972. value: 0
  50973. }
  50974. },
  50975. roughnessmap: {
  50976. roughnessMap: {
  50977. type: "t",
  50978. value: null
  50979. }
  50980. },
  50981. metalnessmap: {
  50982. metalnessMap: {
  50983. type: "t",
  50984. value: null
  50985. }
  50986. },
  50987. fog: {
  50988. fogDensity: {
  50989. type: "f",
  50990. value: 25e-5
  50991. },
  50992. fogNear: {
  50993. type: "f",
  50994. value: 1
  50995. },
  50996. fogFar: {
  50997. type: "f",
  50998. value: 2e3
  50999. },
  51000. fogColor: {
  51001. type: "c",
  51002. value: new n.Color(16777215)
  51003. }
  51004. },
  51005. lights: {
  51006. ambientLightColor: {
  51007. type: "fv",
  51008. value: []
  51009. },
  51010. directionalLights: {
  51011. type: "sa",
  51012. value: [],
  51013. properties: {
  51014. direction: {
  51015. type: "v3"
  51016. },
  51017. color: {
  51018. type: "c"
  51019. },
  51020. shadow: {
  51021. type: "i"
  51022. },
  51023. shadowBias: {
  51024. type: "f"
  51025. },
  51026. shadowRadius: {
  51027. type: "f"
  51028. },
  51029. shadowMapSize: {
  51030. type: "v2"
  51031. }
  51032. }
  51033. },
  51034. directionalShadowMap: {
  51035. type: "tv",
  51036. value: []
  51037. },
  51038. directionalShadowMatrix: {
  51039. type: "m4v",
  51040. value: []
  51041. },
  51042. spotLights: {
  51043. type: "sa",
  51044. value: [],
  51045. properties: {
  51046. color: {
  51047. type: "c"
  51048. },
  51049. position: {
  51050. type: "v3"
  51051. },
  51052. direction: {
  51053. type: "v3"
  51054. },
  51055. distance: {
  51056. type: "f"
  51057. },
  51058. coneCos: {
  51059. type: "f"
  51060. },
  51061. penumbraCos: {
  51062. type: "f"
  51063. },
  51064. decay: {
  51065. type: "f"
  51066. },
  51067. shadow: {
  51068. type: "i"
  51069. },
  51070. shadowBias: {
  51071. type: "f"
  51072. },
  51073. shadowRadius: {
  51074. type: "f"
  51075. },
  51076. shadowMapSize: {
  51077. type: "v2"
  51078. }
  51079. }
  51080. },
  51081. spotShadowMap: {
  51082. type: "tv",
  51083. value: []
  51084. },
  51085. spotShadowMatrix: {
  51086. type: "m4v",
  51087. value: []
  51088. },
  51089. pointLights: {
  51090. type: "sa",
  51091. value: [],
  51092. properties: {
  51093. color: {
  51094. type: "c"
  51095. },
  51096. position: {
  51097. type: "v3"
  51098. },
  51099. decay: {
  51100. type: "f"
  51101. },
  51102. distance: {
  51103. type: "f"
  51104. },
  51105. shadow: {
  51106. type: "i"
  51107. },
  51108. shadowBias: {
  51109. type: "f"
  51110. },
  51111. shadowRadius: {
  51112. type: "f"
  51113. },
  51114. shadowMapSize: {
  51115. type: "v2"
  51116. }
  51117. }
  51118. },
  51119. pointShadowMap: {
  51120. type: "tv",
  51121. value: []
  51122. },
  51123. pointShadowMatrix: {
  51124. type: "m4v",
  51125. value: []
  51126. },
  51127. hemisphereLights: {
  51128. type: "sa",
  51129. value: [],
  51130. properties: {
  51131. direction: {
  51132. type: "v3"
  51133. },
  51134. skyColor: {
  51135. type: "c"
  51136. },
  51137. groundColor: {
  51138. type: "c"
  51139. }
  51140. }
  51141. }
  51142. },
  51143. points: {
  51144. diffuse: {
  51145. type: "c",
  51146. value: new n.Color(15658734)
  51147. },
  51148. opacity: {
  51149. type: "f",
  51150. value: 1
  51151. },
  51152. size: {
  51153. type: "f",
  51154. value: 1
  51155. },
  51156. scale: {
  51157. type: "f",
  51158. value: 1
  51159. },
  51160. map: {
  51161. type: "t",
  51162. value: null
  51163. },
  51164. offsetRepeat: {
  51165. type: "v4",
  51166. value: new n.Vector4(0,0,1,1)
  51167. }
  51168. }
  51169. },
  51170. 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",
  51171. 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",
  51172. 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",
  51173. 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",
  51174. 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",
  51175. 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",
  51176. 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",
  51177. 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",
  51178. 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",
  51179. 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",
  51180. 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",
  51181. 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",
  51182. 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",
  51183. 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",
  51184. 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",
  51185. 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",
  51186. 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",
  51187. 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",
  51188. 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",
  51189. 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",
  51190. 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",
  51191. 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",
  51192. 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",
  51193. 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",
  51194. n.ShaderLib = {
  51195. basic: {
  51196. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.fog]),
  51197. vertexShader: n.ShaderChunk.meshbasic_vert,
  51198. fragmentShader: n.ShaderChunk.meshbasic_frag
  51199. },
  51200. lambert: {
  51201. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.fog, n.UniformsLib.lights, {
  51202. emissive: {
  51203. type: "c",
  51204. value: new n.Color(0)
  51205. }
  51206. }]),
  51207. vertexShader: n.ShaderChunk.meshlambert_vert,
  51208. fragmentShader: n.ShaderChunk.meshlambert_frag
  51209. },
  51210. phong: {
  51211. 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, {
  51212. emissive: {
  51213. type: "c",
  51214. value: new n.Color(0)
  51215. },
  51216. specular: {
  51217. type: "c",
  51218. value: new n.Color(1118481)
  51219. },
  51220. shininess: {
  51221. type: "f",
  51222. value: 30
  51223. }
  51224. }]),
  51225. vertexShader: n.ShaderChunk.meshphong_vert,
  51226. fragmentShader: n.ShaderChunk.meshphong_frag
  51227. },
  51228. standard: {
  51229. 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, {
  51230. emissive: {
  51231. type: "c",
  51232. value: new n.Color(0)
  51233. },
  51234. roughness: {
  51235. type: "f",
  51236. value: .5
  51237. },
  51238. metalness: {
  51239. type: "f",
  51240. value: 0
  51241. },
  51242. envMapIntensity: {
  51243. type: "f",
  51244. value: 1
  51245. }
  51246. }]),
  51247. vertexShader: n.ShaderChunk.meshstandard_vert,
  51248. fragmentShader: n.ShaderChunk.meshstandard_frag
  51249. },
  51250. points: {
  51251. uniforms: n.UniformsUtils.merge([n.UniformsLib.points, n.UniformsLib.fog]),
  51252. vertexShader: n.ShaderChunk.points_vert,
  51253. fragmentShader: n.ShaderChunk.points_frag
  51254. },
  51255. dashed: {
  51256. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.fog, {
  51257. scale: {
  51258. type: "f",
  51259. value: 1
  51260. },
  51261. dashSize: {
  51262. type: "f",
  51263. value: 1
  51264. },
  51265. totalSize: {
  51266. type: "f",
  51267. value: 2
  51268. }
  51269. }]),
  51270. vertexShader: n.ShaderChunk.linedashed_vert,
  51271. fragmentShader: n.ShaderChunk.linedashed_frag
  51272. },
  51273. depth: {
  51274. uniforms: {
  51275. mNear: {
  51276. type: "f",
  51277. value: 1
  51278. },
  51279. mFar: {
  51280. type: "f",
  51281. value: 2e3
  51282. },
  51283. opacity: {
  51284. type: "f",
  51285. value: 1
  51286. }
  51287. },
  51288. vertexShader: n.ShaderChunk.depth_vert,
  51289. fragmentShader: n.ShaderChunk.depth_frag
  51290. },
  51291. normal: {
  51292. uniforms: {
  51293. opacity: {
  51294. type: "f",
  51295. value: 1
  51296. }
  51297. },
  51298. vertexShader: n.ShaderChunk.normal_vert,
  51299. fragmentShader: n.ShaderChunk.normal_frag
  51300. },
  51301. cube: {
  51302. uniforms: {
  51303. tCube: {
  51304. type: "t",
  51305. value: null
  51306. },
  51307. tFlip: {
  51308. type: "f",
  51309. value: -1
  51310. }
  51311. },
  51312. vertexShader: n.ShaderChunk.cube_vert,
  51313. fragmentShader: n.ShaderChunk.cube_frag
  51314. },
  51315. equirect: {
  51316. uniforms: {
  51317. tEquirect: {
  51318. type: "t",
  51319. value: null
  51320. },
  51321. tFlip: {
  51322. type: "f",
  51323. value: -1
  51324. }
  51325. },
  51326. vertexShader: n.ShaderChunk.equirect_vert,
  51327. fragmentShader: n.ShaderChunk.equirect_frag
  51328. },
  51329. depthRGBA: {
  51330. uniforms: {},
  51331. vertexShader: n.ShaderChunk.depthRGBA_vert,
  51332. fragmentShader: n.ShaderChunk.depthRGBA_frag
  51333. },
  51334. distanceRGBA: {
  51335. uniforms: {
  51336. lightPos: {
  51337. type: "v3",
  51338. value: new n.Vector3(0,0,0)
  51339. }
  51340. },
  51341. vertexShader: n.ShaderChunk.distanceRGBA_vert,
  51342. fragmentShader: n.ShaderChunk.distanceRGBA_frag
  51343. }
  51344. },
  51345. n.WebGLRenderer = function(e) {
  51346. function t() {
  51347. return null === ye ? Oe : 1
  51348. }
  51349. function i(e, t, i, n) {
  51350. se === !0 && (e *= n,
  51351. t *= n,
  51352. i *= n),
  51353. Ye.clearColor(e, t, i, n)
  51354. }
  51355. function r() {
  51356. Ye.init(),
  51357. Ye.scissor(we.copy(Le).multiplyScalar(Oe)),
  51358. Ye.viewport(Te.copy(Ne).multiplyScalar(Oe)),
  51359. i(Se.r, Se.g, Se.b, Me)
  51360. }
  51361. function o() {
  51362. Ae = null,
  51363. be = null,
  51364. Ee = "",
  51365. Ie = -1,
  51366. Ye.reset()
  51367. }
  51368. function a(e) {
  51369. e.preventDefault(),
  51370. o(),
  51371. r(),
  51372. Xe.clear()
  51373. }
  51374. function s(e) {
  51375. var t = e.target;
  51376. t.removeEventListener("dispose", s),
  51377. h(t),
  51378. ke.textures--
  51379. }
  51380. function l(e) {
  51381. var t = e.target;
  51382. t.removeEventListener("dispose", l),
  51383. u(t),
  51384. ke.textures--
  51385. }
  51386. function c(e) {
  51387. var t = e.target;
  51388. t.removeEventListener("dispose", c),
  51389. d(t)
  51390. }
  51391. function h(e) {
  51392. var t = Xe.get(e);
  51393. if (e.image && t.__image__webglTextureCube)
  51394. Ge.deleteTexture(t.__image__webglTextureCube);
  51395. else {
  51396. if (void 0 === t.__webglInit)
  51397. return;
  51398. Ge.deleteTexture(t.__webglTexture)
  51399. }
  51400. Xe.delete(e)
  51401. }
  51402. function u(e) {
  51403. var t = Xe.get(e)
  51404. , i = Xe.get(e.texture);
  51405. if (e && void 0 !== i.__webglTexture) {
  51406. if (Ge.deleteTexture(i.__webglTexture),
  51407. e instanceof n.WebGLRenderTargetCube)
  51408. for (var r = 0; r < 6; r++)
  51409. Ge.deleteFramebuffer(t.__webglFramebuffer[r]),
  51410. Ge.deleteRenderbuffer(t.__webglDepthbuffer[r]);
  51411. else
  51412. Ge.deleteFramebuffer(t.__webglFramebuffer),
  51413. Ge.deleteRenderbuffer(t.__webglDepthbuffer);
  51414. Xe.delete(e.texture),
  51415. Xe.delete(e)
  51416. }
  51417. }
  51418. function d(e) {
  51419. p(e),
  51420. Xe.delete(e)
  51421. }
  51422. function p(e) {
  51423. var t = Xe.get(e).program;
  51424. e.program = void 0,
  51425. void 0 !== t && qe.releaseProgram(t)
  51426. }
  51427. function f(e, t, i, r) {
  51428. var o;
  51429. if (i instanceof n.InstancedBufferGeometry && (o = We.get("ANGLE_instanced_arrays"),
  51430. null === o))
  51431. return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  51432. void 0 === r && (r = 0),
  51433. Ye.initAttributes();
  51434. var a = i.attributes
  51435. , s = t.getAttributes()
  51436. , l = e.defaultAttributeValues;
  51437. for (var c in s) {
  51438. var h = s[c];
  51439. if (h >= 0) {
  51440. var u = a[c];
  51441. if (void 0 !== u) {
  51442. var d = u.itemSize
  51443. , p = Ze.getAttributeBuffer(u);
  51444. if (u instanceof n.InterleavedBufferAttribute) {
  51445. var f = u.data
  51446. , g = f.stride
  51447. , m = u.offset;
  51448. f instanceof n.InstancedInterleavedBuffer ? (Ye.enableAttributeAndDivisor(h, f.meshPerAttribute, o),
  51449. void 0 === i.maxInstancedCount && (i.maxInstancedCount = f.meshPerAttribute * f.count)) : Ye.enableAttribute(h),
  51450. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  51451. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, g * f.array.BYTES_PER_ELEMENT, (r * g + m) * f.array.BYTES_PER_ELEMENT)
  51452. } else
  51453. u instanceof n.InstancedBufferAttribute ? (Ye.enableAttributeAndDivisor(h, u.meshPerAttribute, o),
  51454. void 0 === i.maxInstancedCount && (i.maxInstancedCount = u.meshPerAttribute * u.count)) : Ye.enableAttribute(h),
  51455. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  51456. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, 0, r * d * 4)
  51457. } else if (void 0 !== l) {
  51458. var v = l[c];
  51459. if (void 0 !== v)
  51460. switch (v.length) {
  51461. case 2:
  51462. Ge.vertexAttrib2fv(h, v);
  51463. break;
  51464. case 3:
  51465. Ge.vertexAttrib3fv(h, v);
  51466. break;
  51467. case 4:
  51468. Ge.vertexAttrib4fv(h, v);
  51469. break;
  51470. default:
  51471. Ge.vertexAttrib1fv(h, v)
  51472. }
  51473. }
  51474. }
  51475. }
  51476. Ye.disableUnusedAttributes()
  51477. }
  51478. function g(e, t) {
  51479. return Math.abs(t[0]) - Math.abs(e[0])
  51480. }
  51481. function m(e, t) {
  51482. 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
  51483. }
  51484. function v(e, t) {
  51485. 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
  51486. }
  51487. function A(e, t, i, n, r) {
  51488. var o, a;
  51489. i.transparent ? (o = de,
  51490. a = ++pe) : (o = he,
  51491. a = ++ue);
  51492. var s = o[a];
  51493. void 0 !== s ? (s.id = e.id,
  51494. s.object = e,
  51495. s.geometry = t,
  51496. s.material = i,
  51497. s.z = Ve.z,
  51498. s.group = r) : (s = {
  51499. id: e.id,
  51500. object: e,
  51501. geometry: t,
  51502. material: i,
  51503. z: Ve.z,
  51504. group: r
  51505. },
  51506. o.push(s))
  51507. }
  51508. function y(e, t) {
  51509. if (e.visible !== !1) {
  51510. if (e.layers.test(t.layers))
  51511. if (e instanceof n.Light)
  51512. ce.push(e);
  51513. else if (e instanceof n.Sprite)
  51514. e.frustumCulled !== !1 && Be.intersectsObject(e) !== !0 || ge.push(e);
  51515. else if (e instanceof n.LensFlare)
  51516. me.push(e);
  51517. else if (e instanceof n.ImmediateRenderObject)
  51518. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  51519. Ve.applyProjection(Fe)),
  51520. A(e, null, e.material, Ve.z, null);
  51521. else if ((e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) && (e instanceof n.SkinnedMesh && e.skeleton.update(),
  51522. e.frustumCulled === !1 || Be.intersectsObject(e) === !0)) {
  51523. var i = e.material;
  51524. if (i.visible === !0) {
  51525. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  51526. Ve.applyProjection(Fe));
  51527. var r = Ze.update(e);
  51528. if (i instanceof n.MultiMaterial)
  51529. for (var o = r.groups, a = i.materials, s = 0, l = o.length; s < l; s++) {
  51530. var c = o[s]
  51531. , h = a[c.materialIndex];
  51532. h.visible === !0 && A(e, r, h, Ve.z, c)
  51533. }
  51534. else
  51535. A(e, r, i, Ve.z, null)
  51536. }
  51537. }
  51538. for (var u = e.children, s = 0, l = u.length; s < l; s++)
  51539. y(u[s], t)
  51540. }
  51541. }
  51542. function C(e, t, i, r) {
  51543. for (var o = 0, a = e.length; o < a; o++) {
  51544. var s = e[o]
  51545. , l = s.object
  51546. , c = s.geometry
  51547. , h = void 0 === r ? s.material : r
  51548. , u = s.group;
  51549. if (l.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  51550. l.normalMatrix.getNormalMatrix(l.modelViewMatrix),
  51551. l instanceof n.ImmediateRenderObject) {
  51552. E(h);
  51553. var d = w(t, i, h, l);
  51554. Ee = "",
  51555. l.render(function(e) {
  51556. ve.renderBufferImmediate(e, d, h)
  51557. })
  51558. } else
  51559. ve.renderBufferDirect(t, i, c, h, l, u)
  51560. }
  51561. }
  51562. function I(e, t, i) {
  51563. var r = Xe.get(e)
  51564. , o = qe.getParameters(e, Ue, t, i)
  51565. , a = qe.getProgramCode(e, o)
  51566. , s = r.program
  51567. , l = !0;
  51568. if (void 0 === s)
  51569. e.addEventListener("dispose", c);
  51570. else if (s.code !== a)
  51571. p(e);
  51572. else {
  51573. if (void 0 !== o.shaderID)
  51574. return;
  51575. l = !1
  51576. }
  51577. if (l) {
  51578. if (o.shaderID) {
  51579. var h = n.ShaderLib[o.shaderID];
  51580. r.__webglShader = {
  51581. name: e.type,
  51582. uniforms: n.UniformsUtils.clone(h.uniforms),
  51583. vertexShader: h.vertexShader,
  51584. fragmentShader: h.fragmentShader
  51585. }
  51586. } else
  51587. r.__webglShader = {
  51588. name: e.type,
  51589. uniforms: e.uniforms,
  51590. vertexShader: e.vertexShader,
  51591. fragmentShader: e.fragmentShader
  51592. };
  51593. e.__webglShader = r.__webglShader,
  51594. s = qe.acquireProgram(e, o, a),
  51595. r.program = s,
  51596. e.program = s
  51597. }
  51598. var u = s.getAttributes();
  51599. if (e.morphTargets) {
  51600. e.numSupportedMorphTargets = 0;
  51601. for (var d = 0; d < ve.maxMorphTargets; d++)
  51602. u["morphTarget" + d] >= 0 && e.numSupportedMorphTargets++
  51603. }
  51604. if (e.morphNormals) {
  51605. e.numSupportedMorphNormals = 0;
  51606. for (var d = 0; d < ve.maxMorphNormals; d++)
  51607. u["morphNormal" + d] >= 0 && e.numSupportedMorphNormals++
  51608. }
  51609. r.uniformsList = [];
  51610. var f = r.__webglShader.uniforms
  51611. , g = r.program.getUniforms();
  51612. for (var m in f) {
  51613. var v = g[m];
  51614. v && r.uniformsList.push([r.__webglShader.uniforms[m], v])
  51615. }
  51616. (e instanceof n.MeshPhongMaterial || e instanceof n.MeshLambertMaterial || e instanceof n.MeshStandardMaterial || e.lights) && (r.lightsHash = Ue.hash,
  51617. f.ambientLightColor.value = Ue.ambient,
  51618. f.directionalLights.value = Ue.directional,
  51619. f.spotLights.value = Ue.spot,
  51620. f.pointLights.value = Ue.point,
  51621. f.hemisphereLights.value = Ue.hemi,
  51622. f.directionalShadowMap.value = Ue.directionalShadowMap,
  51623. f.directionalShadowMatrix.value = Ue.directionalShadowMatrix,
  51624. f.spotShadowMap.value = Ue.spotShadowMap,
  51625. f.spotShadowMatrix.value = Ue.spotShadowMatrix,
  51626. f.pointShadowMap.value = Ue.pointShadowMap,
  51627. f.pointShadowMatrix.value = Ue.pointShadowMatrix),
  51628. r.hasDynamicUniforms = !1;
  51629. for (var A = 0, y = r.uniformsList.length; A < y; A++) {
  51630. var C = r.uniformsList[A][0];
  51631. if (C.dynamic === !0) {
  51632. r.hasDynamicUniforms = !0;
  51633. break
  51634. }
  51635. }
  51636. }
  51637. function E(e) {
  51638. b(e),
  51639. 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),
  51640. Ye.setDepthFunc(e.depthFunc),
  51641. Ye.setDepthTest(e.depthTest),
  51642. Ye.setDepthWrite(e.depthWrite),
  51643. Ye.setColorWrite(e.colorWrite),
  51644. Ye.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  51645. }
  51646. function b(e) {
  51647. e.side !== n.DoubleSide ? Ye.enable(Ge.CULL_FACE) : Ye.disable(Ge.CULL_FACE),
  51648. Ye.setFlipSided(e.side === n.BackSide)
  51649. }
  51650. function w(e, t, i, r) {
  51651. xe = 0;
  51652. var o = Xe.get(i);
  51653. void 0 === o.program && (i.needsUpdate = !0),
  51654. void 0 !== o.lightsHash && o.lightsHash !== Ue.hash && (i.needsUpdate = !0),
  51655. i.needsUpdate && (I(i, t, r),
  51656. i.needsUpdate = !1);
  51657. var a = !1
  51658. , s = !1
  51659. , l = !1
  51660. , c = o.program
  51661. , h = c.getUniforms()
  51662. , u = o.__webglShader.uniforms;
  51663. if (c.id !== Ae && (Ge.useProgram(c.program),
  51664. Ae = c.id,
  51665. a = !0,
  51666. s = !0,
  51667. l = !0),
  51668. i.id !== Ie && (Ie = i.id,
  51669. s = !0),
  51670. (a || e !== be) && (Ge.uniformMatrix4fv(h.projectionMatrix, !1, e.projectionMatrix.elements),
  51671. je.logarithmicDepthBuffer && Ge.uniform1f(h.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  51672. e !== be && (be = e,
  51673. s = !0,
  51674. l = !0),
  51675. (i instanceof n.ShaderMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial || i.envMap) && void 0 !== h.cameraPosition && (Ve.setFromMatrixPosition(e.matrixWorld),
  51676. Ge.uniform3f(h.cameraPosition, Ve.x, Ve.y, Ve.z)),
  51677. (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),
  51678. void 0 !== h.toneMappingExposure && Ge.uniform1f(h.toneMappingExposure, ve.toneMappingExposure),
  51679. void 0 !== h.toneMappingWhitePoint && Ge.uniform1f(h.toneMappingWhitePoint, ve.toneMappingWhitePoint)),
  51680. i.skinning)
  51681. if (r.bindMatrix && void 0 !== h.bindMatrix && Ge.uniformMatrix4fv(h.bindMatrix, !1, r.bindMatrix.elements),
  51682. r.bindMatrixInverse && void 0 !== h.bindMatrixInverse && Ge.uniformMatrix4fv(h.bindMatrixInverse, !1, r.bindMatrixInverse.elements),
  51683. je.floatVertexTextures && r.skeleton && r.skeleton.useVertexTexture) {
  51684. if (void 0 !== h.boneTexture) {
  51685. var d = B();
  51686. Ge.uniform1i(h.boneTexture, d),
  51687. ve.setTexture(r.skeleton.boneTexture, d)
  51688. }
  51689. void 0 !== h.boneTextureWidth && Ge.uniform1i(h.boneTextureWidth, r.skeleton.boneTextureWidth),
  51690. void 0 !== h.boneTextureHeight && Ge.uniform1i(h.boneTextureHeight, r.skeleton.boneTextureHeight)
  51691. } else
  51692. r.skeleton && r.skeleton.boneMatrices && void 0 !== h.boneGlobalMatrices && Ge.uniformMatrix4fv(h.boneGlobalMatrices, !1, r.skeleton.boneMatrices);
  51693. return s && ((i instanceof n.MeshPhongMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshStandardMaterial || i.lights) && D(u, l),
  51694. t && i.fog && R(u, t),
  51695. (i instanceof n.MeshBasicMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial) && T(u, i),
  51696. i instanceof n.LineBasicMaterial ? x(u, i) : i instanceof n.LineDashedMaterial ? (x(u, i),
  51697. 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,
  51698. u.mFar.value = e.far,
  51699. u.opacity.value = i.opacity) : i instanceof n.MeshNormalMaterial && (u.opacity.value = i.opacity),
  51700. V(o.uniformsList)),
  51701. N(h, r),
  51702. void 0 !== h.modelMatrix && Ge.uniformMatrix4fv(h.modelMatrix, !1, r.matrixWorld.elements),
  51703. o.hasDynamicUniforms === !0 && _(o.uniformsList, r, e),
  51704. c
  51705. }
  51706. function _(e, t, i) {
  51707. for (var n = [], r = 0, o = e.length; r < o; r++) {
  51708. var a = e[r][0]
  51709. , s = a.onUpdateCallback;
  51710. void 0 !== s && (s.bind(a)(t, i),
  51711. n.push(e[r]))
  51712. }
  51713. V(n)
  51714. }
  51715. function T(e, t) {
  51716. e.opacity.value = t.opacity,
  51717. e.diffuse.value = t.color,
  51718. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  51719. e.map.value = t.map,
  51720. e.specularMap.value = t.specularMap,
  51721. e.alphaMap.value = t.alphaMap,
  51722. t.aoMap && (e.aoMap.value = t.aoMap,
  51723. e.aoMapIntensity.value = t.aoMapIntensity);
  51724. var i;
  51725. 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),
  51726. void 0 !== i) {
  51727. i instanceof n.WebGLRenderTarget && (i = i.texture);
  51728. var r = i.offset
  51729. , o = i.repeat;
  51730. e.offsetRepeat.value.set(r.x, r.y, o.x, o.y)
  51731. }
  51732. e.envMap.value = t.envMap,
  51733. e.flipEnvMap.value = t.envMap instanceof n.WebGLRenderTargetCube ? 1 : -1,
  51734. e.reflectivity.value = t.reflectivity,
  51735. e.refractionRatio.value = t.refractionRatio
  51736. }
  51737. function x(e, t) {
  51738. e.diffuse.value = t.color,
  51739. e.opacity.value = t.opacity
  51740. }
  51741. function S(e, t) {
  51742. e.dashSize.value = t.dashSize,
  51743. e.totalSize.value = t.dashSize + t.gapSize,
  51744. e.scale.value = t.scale
  51745. }
  51746. function M(e, t) {
  51747. if (e.diffuse.value = t.color,
  51748. e.opacity.value = t.opacity,
  51749. e.size.value = t.size * Oe,
  51750. e.scale.value = te.clientHeight / 2,
  51751. e.map.value = t.map,
  51752. null !== t.map) {
  51753. var i = t.map.offset
  51754. , n = t.map.repeat;
  51755. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  51756. }
  51757. }
  51758. function R(e, t) {
  51759. e.fogColor.value = t.color,
  51760. t instanceof n.Fog ? (e.fogNear.value = t.near,
  51761. e.fogFar.value = t.far) : t instanceof n.FogExp2 && (e.fogDensity.value = t.density)
  51762. }
  51763. function P(e, t) {
  51764. t.lightMap && (e.lightMap.value = t.lightMap,
  51765. e.lightMapIntensity.value = t.lightMapIntensity),
  51766. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  51767. }
  51768. function O(e, t) {
  51769. e.specular.value = t.specular,
  51770. e.shininess.value = Math.max(t.shininess, 1e-4),
  51771. t.lightMap && (e.lightMap.value = t.lightMap,
  51772. e.lightMapIntensity.value = t.lightMapIntensity),
  51773. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  51774. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  51775. e.bumpScale.value = t.bumpScale),
  51776. t.normalMap && (e.normalMap.value = t.normalMap,
  51777. e.normalScale.value.copy(t.normalScale)),
  51778. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  51779. e.displacementScale.value = t.displacementScale,
  51780. e.displacementBias.value = t.displacementBias)
  51781. }
  51782. function L(e, t) {
  51783. e.roughness.value = t.roughness,
  51784. e.metalness.value = t.metalness,
  51785. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  51786. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  51787. t.lightMap && (e.lightMap.value = t.lightMap,
  51788. e.lightMapIntensity.value = t.lightMapIntensity),
  51789. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  51790. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  51791. e.bumpScale.value = t.bumpScale),
  51792. t.normalMap && (e.normalMap.value = t.normalMap,
  51793. e.normalScale.value.copy(t.normalScale)),
  51794. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  51795. e.displacementScale.value = t.displacementScale,
  51796. e.displacementBias.value = t.displacementBias),
  51797. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  51798. }
  51799. function D(e, t) {
  51800. e.ambientLightColor.needsUpdate = t,
  51801. e.directionalLights.needsUpdate = t,
  51802. e.pointLights.needsUpdate = t,
  51803. e.spotLights.needsUpdate = t,
  51804. e.hemisphereLights.needsUpdate = t
  51805. }
  51806. function N(e, t) {
  51807. Ge.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  51808. e.normalMatrix && Ge.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  51809. }
  51810. function B() {
  51811. var e = xe;
  51812. return e >= je.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + je.maxTextures),
  51813. xe += 1,
  51814. e
  51815. }
  51816. function F(e, t, i, r) {
  51817. var o, a;
  51818. if ("1i" === t)
  51819. Ge.uniform1i(i, r);
  51820. else if ("1f" === t)
  51821. Ge.uniform1f(i, r);
  51822. else if ("2f" === t)
  51823. Ge.uniform2f(i, r[0], r[1]);
  51824. else if ("3f" === t)
  51825. Ge.uniform3f(i, r[0], r[1], r[2]);
  51826. else if ("4f" === t)
  51827. Ge.uniform4f(i, r[0], r[1], r[2], r[3]);
  51828. else if ("1iv" === t)
  51829. Ge.uniform1iv(i, r);
  51830. else if ("3iv" === t)
  51831. Ge.uniform3iv(i, r);
  51832. else if ("1fv" === t)
  51833. Ge.uniform1fv(i, r);
  51834. else if ("2fv" === t)
  51835. Ge.uniform2fv(i, r);
  51836. else if ("3fv" === t)
  51837. Ge.uniform3fv(i, r);
  51838. else if ("4fv" === t)
  51839. Ge.uniform4fv(i, r);
  51840. else if ("Matrix2fv" === t)
  51841. Ge.uniformMatrix2fv(i, !1, r);
  51842. else if ("Matrix3fv" === t)
  51843. Ge.uniformMatrix3fv(i, !1, r);
  51844. else if ("Matrix4fv" === t)
  51845. Ge.uniformMatrix4fv(i, !1, r);
  51846. else if ("i" === t)
  51847. Ge.uniform1i(i, r);
  51848. else if ("f" === t)
  51849. Ge.uniform1f(i, r);
  51850. else if ("v2" === t)
  51851. Ge.uniform2f(i, r.x, r.y);
  51852. else if ("v3" === t)
  51853. Ge.uniform3f(i, r.x, r.y, r.z);
  51854. else if ("v4" === t)
  51855. Ge.uniform4f(i, r.x, r.y, r.z, r.w);
  51856. else if ("c" === t)
  51857. Ge.uniform3f(i, r.r, r.g, r.b);
  51858. else if ("s" === t) {
  51859. var s = e.properties;
  51860. for (var l in s) {
  51861. var c = s[l]
  51862. , h = i[l]
  51863. , u = r[l];
  51864. F(c, c.type, h, u)
  51865. }
  51866. } else if ("sa" === t)
  51867. for (var s = e.properties, d = 0, p = r.length; d < p; d++)
  51868. for (var l in s) {
  51869. var c = s[l]
  51870. , h = i[d][l]
  51871. , u = r[d][l];
  51872. F(c, c.type, h, u)
  51873. }
  51874. else if ("iv1" === t)
  51875. Ge.uniform1iv(i, r);
  51876. else if ("iv" === t)
  51877. Ge.uniform3iv(i, r);
  51878. else if ("fv1" === t)
  51879. Ge.uniform1fv(i, r);
  51880. else if ("fv" === t)
  51881. Ge.uniform3fv(i, r);
  51882. else if ("v2v" === t) {
  51883. void 0 === e._array && (e._array = new Float32Array(2 * r.length));
  51884. for (var d = 0, f = 0, g = r.length; d < g; d++,
  51885. f += 2)
  51886. e._array[f + 0] = r[d].x,
  51887. e._array[f + 1] = r[d].y;
  51888. Ge.uniform2fv(i, e._array)
  51889. } else if ("v3v" === t) {
  51890. void 0 === e._array && (e._array = new Float32Array(3 * r.length));
  51891. for (var d = 0, m = 0, g = r.length; d < g; d++,
  51892. m += 3)
  51893. e._array[m + 0] = r[d].x,
  51894. e._array[m + 1] = r[d].y,
  51895. e._array[m + 2] = r[d].z;
  51896. Ge.uniform3fv(i, e._array)
  51897. } else if ("v4v" === t) {
  51898. void 0 === e._array && (e._array = new Float32Array(4 * r.length));
  51899. for (var d = 0, v = 0, g = r.length; d < g; d++,
  51900. v += 4)
  51901. e._array[v + 0] = r[d].x,
  51902. e._array[v + 1] = r[d].y,
  51903. e._array[v + 2] = r[d].z,
  51904. e._array[v + 3] = r[d].w;
  51905. Ge.uniform4fv(i, e._array)
  51906. } else if ("m2" === t)
  51907. Ge.uniformMatrix2fv(i, !1, r.elements);
  51908. else if ("m3" === t)
  51909. Ge.uniformMatrix3fv(i, !1, r.elements);
  51910. else if ("m3v" === t) {
  51911. void 0 === e._array && (e._array = new Float32Array(9 * r.length));
  51912. for (var d = 0, g = r.length; d < g; d++)
  51913. r[d].flattenToArrayOffset(e._array, 9 * d);
  51914. Ge.uniformMatrix3fv(i, !1, e._array)
  51915. } else if ("m4" === t)
  51916. Ge.uniformMatrix4fv(i, !1, r.elements);
  51917. else if ("m4v" === t) {
  51918. void 0 === e._array && (e._array = new Float32Array(16 * r.length));
  51919. for (var d = 0, g = r.length; d < g; d++)
  51920. r[d].flattenToArrayOffset(e._array, 16 * d);
  51921. Ge.uniformMatrix4fv(i, !1, e._array)
  51922. } else if ("t" === t) {
  51923. if (o = r,
  51924. a = B(),
  51925. Ge.uniform1i(i, a),
  51926. !o)
  51927. return;
  51928. 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)
  51929. } else if ("tv" === t) {
  51930. void 0 === e._array && (e._array = []);
  51931. for (var d = 0, g = e.value.length; d < g; d++)
  51932. e._array[d] = B();
  51933. Ge.uniform1iv(i, e._array);
  51934. for (var d = 0, g = e.value.length; d < g; d++)
  51935. o = e.value[d],
  51936. a = e._array[d],
  51937. 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))
  51938. } else
  51939. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  51940. }
  51941. function V(e) {
  51942. for (var t = 0, i = e.length; t < i; t++) {
  51943. var n = e[t][0];
  51944. if (n.needsUpdate !== !1) {
  51945. var r = n.type
  51946. , o = e[t][1]
  51947. , a = n.value;
  51948. F(n, r, o, a)
  51949. }
  51950. }
  51951. }
  51952. function U(e, t) {
  51953. 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;
  51954. for (Ue.shadowsPointLight = 0,
  51955. i = 0,
  51956. r = e.length; i < r; i++)
  51957. if (o = e[i],
  51958. a = o.color,
  51959. s = o.intensity,
  51960. l = o.distance,
  51961. o instanceof n.AmbientLight)
  51962. c += a.r * s,
  51963. h += a.g * s,
  51964. u += a.b * s;
  51965. else if (o instanceof n.DirectionalLight) {
  51966. var A = Ke.get(o);
  51967. A.color.copy(o.color).multiplyScalar(o.intensity),
  51968. A.direction.setFromMatrixPosition(o.matrixWorld),
  51969. Ve.setFromMatrixPosition(o.target.matrixWorld),
  51970. A.direction.sub(Ve),
  51971. A.direction.transformDirection(d),
  51972. A.shadow = o.castShadow,
  51973. o.castShadow && (A.shadowBias = o.shadow.bias,
  51974. A.shadowRadius = o.shadow.radius,
  51975. A.shadowMapSize = o.shadow.mapSize,
  51976. Ue.shadows[v++] = o),
  51977. Ue.directionalShadowMap[p] = o.shadow.map,
  51978. Ue.directionalShadowMatrix[p] = o.shadow.matrix,
  51979. Ue.directional[p++] = A
  51980. } else if (o instanceof n.SpotLight) {
  51981. var A = Ke.get(o);
  51982. A.position.setFromMatrixPosition(o.matrixWorld),
  51983. A.position.applyMatrix4(d),
  51984. A.color.copy(a).multiplyScalar(s),
  51985. A.distance = l,
  51986. A.direction.setFromMatrixPosition(o.matrixWorld),
  51987. Ve.setFromMatrixPosition(o.target.matrixWorld),
  51988. A.direction.sub(Ve),
  51989. A.direction.transformDirection(d),
  51990. A.coneCos = Math.cos(o.angle),
  51991. A.penumbraCos = Math.cos(o.angle * (1 - o.penumbra)),
  51992. A.decay = 0 === o.distance ? 0 : o.decay,
  51993. A.shadow = o.castShadow,
  51994. o.castShadow && (A.shadowBias = o.shadow.bias,
  51995. A.shadowRadius = o.shadow.radius,
  51996. A.shadowMapSize = o.shadow.mapSize,
  51997. Ue.shadows[v++] = o),
  51998. Ue.spotShadowMap[g] = o.shadow.map,
  51999. Ue.spotShadowMatrix[g] = o.shadow.matrix,
  52000. Ue.spot[g++] = A
  52001. } else if (o instanceof n.PointLight) {
  52002. var A = Ke.get(o);
  52003. A.position.setFromMatrixPosition(o.matrixWorld),
  52004. A.position.applyMatrix4(d),
  52005. A.color.copy(o.color).multiplyScalar(o.intensity),
  52006. A.distance = o.distance,
  52007. A.decay = 0 === o.distance ? 0 : o.decay,
  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.pointShadowMap[f] = o.shadow.map,
  52014. void 0 === Ue.pointShadowMatrix[f] && (Ue.pointShadowMatrix[f] = new n.Matrix4),
  52015. Ve.setFromMatrixPosition(o.matrixWorld).negate(),
  52016. Ue.pointShadowMatrix[f].identity().setPosition(Ve),
  52017. Ue.point[f++] = A
  52018. } else if (o instanceof n.HemisphereLight) {
  52019. var A = Ke.get(o);
  52020. A.direction.setFromMatrixPosition(o.matrixWorld),
  52021. A.direction.transformDirection(d),
  52022. A.direction.normalize(),
  52023. A.skyColor.copy(o.color).multiplyScalar(s),
  52024. A.groundColor.copy(o.groundColor).multiplyScalar(s),
  52025. Ue.hemi[m++] = A
  52026. }
  52027. Ue.ambient[0] = c,
  52028. Ue.ambient[1] = h,
  52029. Ue.ambient[2] = u,
  52030. Ue.directional.length = p,
  52031. Ue.spot.length = g,
  52032. Ue.point.length = f,
  52033. Ue.hemi.length = m,
  52034. Ue.shadows.length = v,
  52035. Ue.hash = p + "," + f + "," + g + "," + m + "," + v
  52036. }
  52037. function k(e, t, i) {
  52038. var r;
  52039. if (i ? (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, ee(t.wrapS)),
  52040. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, ee(t.wrapT)),
  52041. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, ee(t.magFilter)),
  52042. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, ee(t.minFilter))) : (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, Ge.CLAMP_TO_EDGE),
  52043. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, Ge.CLAMP_TO_EDGE),
  52044. 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),
  52045. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, $(t.magFilter)),
  52046. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, $(t.minFilter)),
  52047. 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)),
  52048. r = We.get("EXT_texture_filter_anisotropic")) {
  52049. if (t.type === n.FloatType && null === We.get("OES_texture_float_linear"))
  52050. return;
  52051. if (t.type === n.HalfFloatType && null === We.get("OES_texture_half_float_linear"))
  52052. return;
  52053. (t.anisotropy > 1 || Xe.get(t).__currentAnisotropy) && (Ge.texParameterf(e, r.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, ve.getMaxAnisotropy())),
  52054. Xe.get(t).__currentAnisotropy = t.anisotropy)
  52055. }
  52056. }
  52057. function H(e, t, i) {
  52058. void 0 === e.__webglInit && (e.__webglInit = !0,
  52059. t.addEventListener("dispose", s),
  52060. e.__webglTexture = Ge.createTexture(),
  52061. ke.textures++),
  52062. Ye.activeTexture(Ge.TEXTURE0 + i),
  52063. Ye.bindTexture(Ge.TEXTURE_2D, e.__webglTexture),
  52064. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, t.flipY),
  52065. Ge.pixelStorei(Ge.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  52066. Ge.pixelStorei(Ge.UNPACK_ALIGNMENT, t.unpackAlignment);
  52067. var r = G(t.image, je.maxTextureSize);
  52068. W(t) && z(r) === !1 && (r = j(r));
  52069. var o = z(r)
  52070. , a = ee(t.format)
  52071. , l = ee(t.type);
  52072. k(Ge.TEXTURE_2D, t, o);
  52073. var c, h = t.mipmaps;
  52074. if (t instanceof n.DataTexture)
  52075. if (h.length > 0 && o) {
  52076. for (var u = 0, d = h.length; u < d; u++)
  52077. c = h[u],
  52078. Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data);
  52079. t.generateMipmaps = !1
  52080. } else
  52081. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, r.width, r.height, 0, a, l, r.data);
  52082. else if (t instanceof n.CompressedTexture)
  52083. for (var u = 0, d = h.length; u < d; u++)
  52084. c = h[u],
  52085. 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);
  52086. else if (h.length > 0 && o) {
  52087. for (var u = 0, d = h.length; u < d; u++)
  52088. c = h[u],
  52089. Ye.texImage2D(Ge.TEXTURE_2D, u, a, a, l, c);
  52090. t.generateMipmaps = !1
  52091. } else
  52092. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, a, l, r);
  52093. t.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  52094. e.__version = t.version,
  52095. t.onUpdate && t.onUpdate(t)
  52096. }
  52097. function G(e, t) {
  52098. if (e.width > t || e.height > t) {
  52099. var i = t / Math.max(e.width, e.height)
  52100. , n = document.createElement("canvas");
  52101. n.width = Math.floor(e.width * i),
  52102. n.height = Math.floor(e.height * i);
  52103. var r = n.getContext("2d");
  52104. return r.drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  52105. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  52106. n
  52107. }
  52108. return e
  52109. }
  52110. function z(e) {
  52111. return n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height)
  52112. }
  52113. function W(e) {
  52114. return e.wrapS !== n.ClampToEdgeWrapping || e.wrapT !== n.ClampToEdgeWrapping || e.minFilter !== n.NearestFilter && e.minFilter !== n.LinearFilter
  52115. }
  52116. function j(e) {
  52117. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  52118. var t = document.createElement("canvas");
  52119. t.width = n.Math.nearestPowerOfTwo(e.width),
  52120. t.height = n.Math.nearestPowerOfTwo(e.height);
  52121. var i = t.getContext("2d");
  52122. return i.drawImage(e, 0, 0, t.width, t.height),
  52123. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  52124. t
  52125. }
  52126. return e
  52127. }
  52128. function Y(e, t) {
  52129. var i = Xe.get(e);
  52130. if (6 === e.image.length)
  52131. if (e.version > 0 && i.__version !== e.version) {
  52132. i.__image__webglTextureCube || (e.addEventListener("dispose", s),
  52133. i.__image__webglTextureCube = Ge.createTexture(),
  52134. ke.textures++),
  52135. Ye.activeTexture(Ge.TEXTURE0 + t),
  52136. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  52137. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, e.flipY);
  52138. for (var r = e instanceof n.CompressedTexture, o = e.image[0]instanceof n.DataTexture, a = [], l = 0; l < 6; l++)
  52139. !ve.autoScaleCubemaps || r || o ? a[l] = o ? e.image[l].image : e.image[l] : a[l] = G(e.image[l], je.maxCubemapSize);
  52140. var c = a[0]
  52141. , h = z(c)
  52142. , u = ee(e.format)
  52143. , d = ee(e.type);
  52144. k(Ge.TEXTURE_CUBE_MAP, e, h);
  52145. for (var l = 0; l < 6; l++)
  52146. if (r)
  52147. for (var p, f = a[l].mipmaps, g = 0, m = f.length; g < m; g++)
  52148. p = f[g],
  52149. 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);
  52150. else
  52151. 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]);
  52152. e.generateMipmaps && h && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  52153. i.__version = e.version,
  52154. e.onUpdate && e.onUpdate(e)
  52155. } else
  52156. Ye.activeTexture(Ge.TEXTURE0 + t),
  52157. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  52158. }
  52159. function X(e, t) {
  52160. Ye.activeTexture(Ge.TEXTURE0 + t),
  52161. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, Xe.get(e).__webglTexture)
  52162. }
  52163. function Z(e, t, i, n) {
  52164. var r = ee(t.texture.format)
  52165. , o = ee(t.texture.type);
  52166. Ye.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  52167. Ge.bindFramebuffer(Ge.FRAMEBUFFER, e),
  52168. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, i, n, Xe.get(t.texture).__webglTexture, 0),
  52169. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  52170. }
  52171. function q(e, t) {
  52172. Ge.bindRenderbuffer(Ge.RENDERBUFFER, e),
  52173. t.depthBuffer && !t.stencilBuffer ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_COMPONENT16, t.width, t.height),
  52174. 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),
  52175. Ge.framebufferRenderbuffer(Ge.FRAMEBUFFER, Ge.DEPTH_STENCIL_ATTACHMENT, Ge.RENDERBUFFER, e)) : Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.RGBA4, t.width, t.height),
  52176. Ge.bindRenderbuffer(Ge.RENDERBUFFER, null)
  52177. }
  52178. function K(e) {
  52179. var t = Xe.get(e)
  52180. , i = e instanceof n.WebGLRenderTargetCube;
  52181. if (i) {
  52182. t.__webglDepthbuffer = [];
  52183. for (var r = 0; r < 6; r++)
  52184. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer[r]),
  52185. t.__webglDepthbuffer[r] = Ge.createRenderbuffer(),
  52186. q(t.__webglDepthbuffer[r], e)
  52187. } else
  52188. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer),
  52189. t.__webglDepthbuffer = Ge.createRenderbuffer(),
  52190. q(t.__webglDepthbuffer, e);
  52191. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  52192. }
  52193. function Q(e) {
  52194. var t = Xe.get(e)
  52195. , i = Xe.get(e.texture);
  52196. e.addEventListener("dispose", l),
  52197. i.__webglTexture = Ge.createTexture(),
  52198. ke.textures++;
  52199. var r = e instanceof n.WebGLRenderTargetCube
  52200. , o = n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height);
  52201. if (r) {
  52202. t.__webglFramebuffer = [];
  52203. for (var a = 0; a < 6; a++)
  52204. t.__webglFramebuffer[a] = Ge.createFramebuffer()
  52205. } else
  52206. t.__webglFramebuffer = Ge.createFramebuffer();
  52207. if (r) {
  52208. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__webglTexture),
  52209. k(Ge.TEXTURE_CUBE_MAP, e.texture, o);
  52210. for (var a = 0; a < 6; a++)
  52211. Z(t.__webglFramebuffer[a], e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + a);
  52212. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  52213. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, null)
  52214. } else
  52215. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture),
  52216. k(Ge.TEXTURE_2D, e.texture, o),
  52217. Z(t.__webglFramebuffer, e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_2D),
  52218. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  52219. Ye.bindTexture(Ge.TEXTURE_2D, null);
  52220. e.depthBuffer && K(e)
  52221. }
  52222. function J(e) {
  52223. var t = e instanceof n.WebGLRenderTargetCube ? Ge.TEXTURE_CUBE_MAP : Ge.TEXTURE_2D
  52224. , i = Xe.get(e.texture).__webglTexture;
  52225. Ye.bindTexture(t, i),
  52226. Ge.generateMipmap(t),
  52227. Ye.bindTexture(t, null)
  52228. }
  52229. function $(e) {
  52230. return e === n.NearestFilter || e === n.NearestMipMapNearestFilter || e === n.NearestMipMapLinearFilter ? Ge.NEAREST : Ge.LINEAR
  52231. }
  52232. function ee(e) {
  52233. var t;
  52234. if (e === n.RepeatWrapping)
  52235. return Ge.REPEAT;
  52236. if (e === n.ClampToEdgeWrapping)
  52237. return Ge.CLAMP_TO_EDGE;
  52238. if (e === n.MirroredRepeatWrapping)
  52239. return Ge.MIRRORED_REPEAT;
  52240. if (e === n.NearestFilter)
  52241. return Ge.NEAREST;
  52242. if (e === n.NearestMipMapNearestFilter)
  52243. return Ge.NEAREST_MIPMAP_NEAREST;
  52244. if (e === n.NearestMipMapLinearFilter)
  52245. return Ge.NEAREST_MIPMAP_LINEAR;
  52246. if (e === n.LinearFilter)
  52247. return Ge.LINEAR;
  52248. if (e === n.LinearMipMapNearestFilter)
  52249. return Ge.LINEAR_MIPMAP_NEAREST;
  52250. if (e === n.LinearMipMapLinearFilter)
  52251. return Ge.LINEAR_MIPMAP_LINEAR;
  52252. if (e === n.UnsignedByteType)
  52253. return Ge.UNSIGNED_BYTE;
  52254. if (e === n.UnsignedShort4444Type)
  52255. return Ge.UNSIGNED_SHORT_4_4_4_4;
  52256. if (e === n.UnsignedShort5551Type)
  52257. return Ge.UNSIGNED_SHORT_5_5_5_1;
  52258. if (e === n.UnsignedShort565Type)
  52259. return Ge.UNSIGNED_SHORT_5_6_5;
  52260. if (e === n.ByteType)
  52261. return Ge.BYTE;
  52262. if (e === n.ShortType)
  52263. return Ge.SHORT;
  52264. if (e === n.UnsignedShortType)
  52265. return Ge.UNSIGNED_SHORT;
  52266. if (e === n.IntType)
  52267. return Ge.INT;
  52268. if (e === n.UnsignedIntType)
  52269. return Ge.UNSIGNED_INT;
  52270. if (e === n.FloatType)
  52271. return Ge.FLOAT;
  52272. if (t = We.get("OES_texture_half_float"),
  52273. null !== t && e === n.HalfFloatType)
  52274. return t.HALF_FLOAT_OES;
  52275. if (e === n.AlphaFormat)
  52276. return Ge.ALPHA;
  52277. if (e === n.RGBFormat)
  52278. return Ge.RGB;
  52279. if (e === n.RGBAFormat)
  52280. return Ge.RGBA;
  52281. if (e === n.LuminanceFormat)
  52282. return Ge.LUMINANCE;
  52283. if (e === n.LuminanceAlphaFormat)
  52284. return Ge.LUMINANCE_ALPHA;
  52285. if (e === n.AddEquation)
  52286. return Ge.FUNC_ADD;
  52287. if (e === n.SubtractEquation)
  52288. return Ge.FUNC_SUBTRACT;
  52289. if (e === n.ReverseSubtractEquation)
  52290. return Ge.FUNC_REVERSE_SUBTRACT;
  52291. if (e === n.ZeroFactor)
  52292. return Ge.ZERO;
  52293. if (e === n.OneFactor)
  52294. return Ge.ONE;
  52295. if (e === n.SrcColorFactor)
  52296. return Ge.SRC_COLOR;
  52297. if (e === n.OneMinusSrcColorFactor)
  52298. return Ge.ONE_MINUS_SRC_COLOR;
  52299. if (e === n.SrcAlphaFactor)
  52300. return Ge.SRC_ALPHA;
  52301. if (e === n.OneMinusSrcAlphaFactor)
  52302. return Ge.ONE_MINUS_SRC_ALPHA;
  52303. if (e === n.DstAlphaFactor)
  52304. return Ge.DST_ALPHA;
  52305. if (e === n.OneMinusDstAlphaFactor)
  52306. return Ge.ONE_MINUS_DST_ALPHA;
  52307. if (e === n.DstColorFactor)
  52308. return Ge.DST_COLOR;
  52309. if (e === n.OneMinusDstColorFactor)
  52310. return Ge.ONE_MINUS_DST_COLOR;
  52311. if (e === n.SrcAlphaSaturateFactor)
  52312. return Ge.SRC_ALPHA_SATURATE;
  52313. if (t = We.get("WEBGL_compressed_texture_s3tc"),
  52314. null !== t) {
  52315. if (e === n.RGB_S3TC_DXT1_Format)
  52316. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  52317. if (e === n.RGBA_S3TC_DXT1_Format)
  52318. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  52319. if (e === n.RGBA_S3TC_DXT3_Format)
  52320. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  52321. if (e === n.RGBA_S3TC_DXT5_Format)
  52322. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  52323. }
  52324. if (t = We.get("WEBGL_compressed_texture_pvrtc"),
  52325. null !== t) {
  52326. if (e === n.RGB_PVRTC_4BPPV1_Format)
  52327. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  52328. if (e === n.RGB_PVRTC_2BPPV1_Format)
  52329. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  52330. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  52331. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  52332. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  52333. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  52334. }
  52335. if (t = We.get("WEBGL_compressed_texture_etc1"),
  52336. null !== t && e === n.RGB_ETC1_Format)
  52337. return t.COMPRESSED_RGB_ETC1_WEBGL;
  52338. if (t = We.get("EXT_blend_minmax"),
  52339. null !== t) {
  52340. if (e === n.MinEquation)
  52341. return t.MIN_EXT;
  52342. if (e === n.MaxEquation)
  52343. return t.MAX_EXT
  52344. }
  52345. return 0
  52346. }
  52347. console.log("THREE.WebGLRenderer", n.REVISION),
  52348. e = e || {};
  52349. var te = void 0 !== e.canvas ? e.canvas : document.createElement("canvas")
  52350. , ie = void 0 !== e.context ? e.context : null
  52351. , ne = void 0 !== e.alpha && e.alpha
  52352. , re = void 0 === e.depth || e.depth
  52353. , oe = void 0 === e.stencil || e.stencil
  52354. , ae = void 0 !== e.antialias && e.antialias
  52355. , se = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  52356. , le = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  52357. , ce = []
  52358. , he = []
  52359. , ue = -1
  52360. , de = []
  52361. , pe = -1
  52362. , fe = new Float32Array(8)
  52363. , ge = []
  52364. , me = [];
  52365. this.domElement = te,
  52366. this.context = null,
  52367. this.autoClear = !0,
  52368. this.autoClearColor = !0,
  52369. this.autoClearDepth = !0,
  52370. this.autoClearStencil = !0,
  52371. this.sortObjects = !0,
  52372. this.gammaFactor = 2,
  52373. this.gammaInput = !1,
  52374. this.gammaOutput = !1,
  52375. this.physicallyCorrectLights = !1,
  52376. this.toneMapping = n.LinearToneMapping,
  52377. this.toneMappingExposure = 1,
  52378. this.toneMappingWhitePoint = 1,
  52379. this.maxMorphTargets = 8,
  52380. this.maxMorphNormals = 4,
  52381. this.autoScaleCubemaps = !0;
  52382. var ve = this
  52383. , Ae = null
  52384. , ye = null
  52385. , Ce = null
  52386. , Ie = -1
  52387. , Ee = ""
  52388. , be = null
  52389. , we = new n.Vector4
  52390. , _e = null
  52391. , Te = new n.Vector4
  52392. , xe = 0
  52393. , Se = new n.Color(0)
  52394. , Me = 0
  52395. , Re = te.width
  52396. , Pe = te.height
  52397. , Oe = 1
  52398. , Le = new n.Vector4(0,0,Re,Pe)
  52399. , De = !1
  52400. , Ne = new n.Vector4(0,0,Re,Pe)
  52401. , Be = new n.Frustum
  52402. , Fe = new n.Matrix4
  52403. , Ve = new n.Vector3
  52404. , Ue = {
  52405. hash: "",
  52406. ambient: [0, 0, 0],
  52407. directional: [],
  52408. directionalShadowMap: [],
  52409. directionalShadowMatrix: [],
  52410. spot: [],
  52411. spotShadowMap: [],
  52412. spotShadowMatrix: [],
  52413. point: [],
  52414. pointShadowMap: [],
  52415. pointShadowMatrix: [],
  52416. hemi: [],
  52417. shadows: [],
  52418. shadowsPointLight: 0
  52419. }
  52420. , ke = {
  52421. geometries: 0,
  52422. textures: 0
  52423. }
  52424. , He = {
  52425. calls: 0,
  52426. vertices: 0,
  52427. faces: 0,
  52428. points: 0
  52429. };
  52430. this.info = {
  52431. render: He,
  52432. memory: ke,
  52433. programs: null
  52434. };
  52435. var Ge;
  52436. try {
  52437. var ze = {
  52438. alpha: ne,
  52439. depth: re,
  52440. stencil: oe,
  52441. antialias: ae,
  52442. premultipliedAlpha: se,
  52443. preserveDrawingBuffer: le
  52444. };
  52445. if (Ge = ie || te.getContext("webgl", ze) || te.getContext("experimental-webgl", ze),
  52446. null === Ge)
  52447. throw null !== te.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  52448. void 0 === Ge.getShaderPrecisionFormat && (Ge.getShaderPrecisionFormat = function() {
  52449. return {
  52450. rangeMin: 1,
  52451. rangeMax: 1,
  52452. precision: 1
  52453. }
  52454. }
  52455. ),
  52456. te.addEventListener("webglcontextlost", a, !1)
  52457. } catch (e) {
  52458. console.error("THREE.WebGLRenderer: " + e)
  52459. }
  52460. var We = new n.WebGLExtensions(Ge);
  52461. We.get("OES_texture_float"),
  52462. We.get("OES_texture_float_linear"),
  52463. We.get("OES_texture_half_float"),
  52464. We.get("OES_texture_half_float_linear"),
  52465. We.get("OES_standard_derivatives"),
  52466. We.get("ANGLE_instanced_arrays"),
  52467. We.get("OES_element_index_uint") && (n.BufferGeometry.MaxIndex = 4294967296);
  52468. var je = new n.WebGLCapabilities(Ge,We,e)
  52469. , Ye = new n.WebGLState(Ge,We,ee)
  52470. , Xe = new n.WebGLProperties
  52471. , Ze = new n.WebGLObjects(Ge,Xe,this.info)
  52472. , qe = new n.WebGLPrograms(this,je)
  52473. , Ke = new n.WebGLLights;
  52474. this.info.programs = qe.programs;
  52475. var Qe = new n.WebGLBufferRenderer(Ge,We,He)
  52476. , Je = new n.WebGLIndexedBufferRenderer(Ge,We,He);
  52477. r(),
  52478. this.context = Ge,
  52479. this.capabilities = je,
  52480. this.extensions = We,
  52481. this.properties = Xe,
  52482. this.state = Ye;
  52483. var $e = new n.WebGLShadowMap(this,Ue,Ze);
  52484. this.shadowMap = $e;
  52485. var et = new n.SpritePlugin(this,ge)
  52486. , tt = new n.LensFlarePlugin(this,me);
  52487. this.getContext = function() {
  52488. return Ge
  52489. }
  52490. ,
  52491. this.getContextAttributes = function() {
  52492. return Ge.getContextAttributes()
  52493. }
  52494. ,
  52495. this.forceContextLoss = function() {
  52496. We.get("WEBGL_lose_context").loseContext()
  52497. }
  52498. ,
  52499. this.getMaxAnisotropy = function() {
  52500. var e;
  52501. return function() {
  52502. if (void 0 !== e)
  52503. return e;
  52504. var t = We.get("EXT_texture_filter_anisotropic");
  52505. return e = null !== t ? Ge.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  52506. }
  52507. }(),
  52508. this.getPrecision = function() {
  52509. return je.precision
  52510. }
  52511. ,
  52512. this.getPixelRatio = function() {
  52513. return Oe
  52514. }
  52515. ,
  52516. this.setPixelRatio = function(e) {
  52517. void 0 !== e && (Oe = e,
  52518. this.setSize(Ne.z, Ne.w, !1))
  52519. }
  52520. ,
  52521. this.getSize = function() {
  52522. return {
  52523. width: Re,
  52524. height: Pe
  52525. }
  52526. }
  52527. ,
  52528. this.setSize = function(e, t, i, devicePixelRatio) {
  52529. if(devicePixelRatio != void 0) Oe = devicePixelRatio; //xzw add 改分辨率 始终保持清晰
  52530. Re = e,
  52531. Pe = t,
  52532. te.width = e * Oe,
  52533. te.height = t * Oe,
  52534. i !== !1 && (te.style.width = e + "px",
  52535. te.style.height = t + "px"),
  52536. this.setViewport(0, 0, e, t)
  52537. }
  52538. ,
  52539. this.setViewport = function(e, t, i, n) {
  52540. Ye.viewport(Ne.set(e, t, i, n))
  52541. }
  52542. ,
  52543. this.setScissor = function(e, t, i, n) {
  52544. Ye.scissor(Le.set(e, t, i, n))
  52545. }
  52546. ,
  52547. this.setScissorTest = function(e) {
  52548. Ye.setScissorTest(De = e)
  52549. }
  52550. ,
  52551. this.getClearColor = function() {
  52552. return Se
  52553. }
  52554. ,
  52555. this.setClearColor = function(e, t) {
  52556. Se.set(e),
  52557. Me = void 0 !== t ? t : 1,
  52558. i(Se.r, Se.g, Se.b, Me)
  52559. }
  52560. ,
  52561. this.getClearAlpha = function() {
  52562. return Me
  52563. }
  52564. ,
  52565. this.setClearAlpha = function(e) {
  52566. Me = e,
  52567. i(Se.r, Se.g, Se.b, Me)
  52568. }
  52569. ,
  52570. this.clear = function(e, t, i) {
  52571. var n = 0;
  52572. (void 0 === e || e) && (n |= Ge.COLOR_BUFFER_BIT),
  52573. (void 0 === t || t) && (n |= Ge.DEPTH_BUFFER_BIT),
  52574. (void 0 === i || i) && (n |= Ge.STENCIL_BUFFER_BIT),
  52575. Ge.clear(n)
  52576. }
  52577. ,
  52578. this.clearColor = function() {
  52579. this.clear(!0, !1, !1)
  52580. }
  52581. ,
  52582. this.clearDepth = function() {
  52583. this.clear(!1, !0, !1)
  52584. }
  52585. ,
  52586. this.clearStencil = function() {
  52587. this.clear(!1, !1, !0)
  52588. }
  52589. ,
  52590. this.clearTarget = function(e, t, i, n) {
  52591. this.setRenderTarget(e),
  52592. this.clear(t, i, n)
  52593. }
  52594. ,
  52595. this.resetGLState = o,
  52596. this.dispose = function() {
  52597. te.removeEventListener("webglcontextlost", a, !1)
  52598. }
  52599. ,
  52600. this.renderBufferImmediate = function(e, t, i) {
  52601. Ye.initAttributes();
  52602. var r = Xe.get(e);
  52603. e.hasPositions && !r.position && (r.position = Ge.createBuffer()),
  52604. e.hasNormals && !r.normal && (r.normal = Ge.createBuffer()),
  52605. e.hasUvs && !r.uv && (r.uv = Ge.createBuffer()),
  52606. e.hasColors && !r.color && (r.color = Ge.createBuffer());
  52607. var o = t.getAttributes();
  52608. if (e.hasPositions && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.position),
  52609. Ge.bufferData(Ge.ARRAY_BUFFER, e.positionArray, Ge.DYNAMIC_DRAW),
  52610. Ye.enableAttribute(o.position),
  52611. Ge.vertexAttribPointer(o.position, 3, Ge.FLOAT, !1, 0, 0)),
  52612. e.hasNormals) {
  52613. if (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.normal),
  52614. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === n.FlatShading)
  52615. for (var a = 0, s = 3 * e.count; a < s; a += 9) {
  52616. var l = e.normalArray
  52617. , c = (l[a + 0] + l[a + 3] + l[a + 6]) / 3
  52618. , h = (l[a + 1] + l[a + 4] + l[a + 7]) / 3
  52619. , u = (l[a + 2] + l[a + 5] + l[a + 8]) / 3;
  52620. l[a + 0] = c,
  52621. l[a + 1] = h,
  52622. l[a + 2] = u,
  52623. l[a + 3] = c,
  52624. l[a + 4] = h,
  52625. l[a + 5] = u,
  52626. l[a + 6] = c,
  52627. l[a + 7] = h,
  52628. l[a + 8] = u
  52629. }
  52630. Ge.bufferData(Ge.ARRAY_BUFFER, e.normalArray, Ge.DYNAMIC_DRAW),
  52631. Ye.enableAttribute(o.normal),
  52632. Ge.vertexAttribPointer(o.normal, 3, Ge.FLOAT, !1, 0, 0)
  52633. }
  52634. e.hasUvs && i.map && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.uv),
  52635. Ge.bufferData(Ge.ARRAY_BUFFER, e.uvArray, Ge.DYNAMIC_DRAW),
  52636. Ye.enableAttribute(o.uv),
  52637. Ge.vertexAttribPointer(o.uv, 2, Ge.FLOAT, !1, 0, 0)),
  52638. e.hasColors && i.vertexColors !== n.NoColors && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.color),
  52639. Ge.bufferData(Ge.ARRAY_BUFFER, e.colorArray, Ge.DYNAMIC_DRAW),
  52640. Ye.enableAttribute(o.color),
  52641. Ge.vertexAttribPointer(o.color, 3, Ge.FLOAT, !1, 0, 0)),
  52642. Ye.disableUnusedAttributes(),
  52643. Ge.drawArrays(Ge.TRIANGLES, 0, e.count),
  52644. e.count = 0
  52645. }
  52646. ,
  52647. this.renderBufferDirect = function(e, i, r, o, a, s) {
  52648. E(o);
  52649. var l = w(e, i, o, a)
  52650. , c = !1
  52651. , h = r.id + "_" + l.id + "_" + o.wireframe;
  52652. h !== Ee && (Ee = h,
  52653. c = !0);
  52654. var u = a.morphTargetInfluences;
  52655. if (void 0 !== u) {
  52656. for (var d = [], p = 0, m = u.length; p < m; p++) {
  52657. var v = u[p];
  52658. d.push([v, p])
  52659. }
  52660. d.sort(g),
  52661. d.length > 8 && (d.length = 8);
  52662. for (var A = r.morphAttributes, p = 0, m = d.length; p < m; p++) {
  52663. var v = d[p];
  52664. if (fe[p] = v[0],
  52665. 0 !== v[0]) {
  52666. var y = v[1];
  52667. o.morphTargets === !0 && A.position && r.addAttribute("morphTarget" + p, A.position[y]),
  52668. o.morphNormals === !0 && A.normal && r.addAttribute("morphNormal" + p, A.normal[y])
  52669. } else
  52670. o.morphTargets === !0 && r.removeAttribute("morphTarget" + p),
  52671. o.morphNormals === !0 && r.removeAttribute("morphNormal" + p)
  52672. }
  52673. var C = l.getUniforms();
  52674. null !== C.morphTargetInfluences && Ge.uniform1fv(C.morphTargetInfluences, fe),
  52675. c = !0
  52676. }
  52677. var y = r.index
  52678. , I = r.attributes.position;
  52679. o.wireframe === !0 && (y = Ze.getWireframeAttribute(r));
  52680. var b;
  52681. null !== y ? (b = Je,
  52682. b.setIndex(y)) : b = Qe,
  52683. c && (f(o, l, r),
  52684. null !== y && Ge.bindBuffer(Ge.ELEMENT_ARRAY_BUFFER, Ze.getAttributeBuffer(y)));
  52685. var _ = 0
  52686. , T = 1 / 0;
  52687. null !== y ? T = y.count : void 0 !== I && (T = I.count);
  52688. var x = r.drawRange.start
  52689. , S = r.drawRange.count
  52690. , M = null !== s ? s.start : 0
  52691. , R = null !== s ? s.count : 1 / 0
  52692. , P = Math.max(_, x, M)
  52693. , O = Math.min(_ + T, x + S, M + R) - 1
  52694. , L = Math.max(0, O - P + 1);
  52695. if (a instanceof n.Mesh)
  52696. if (o.wireframe === !0)
  52697. Ye.setLineWidth(o.wireframeLinewidth * t()),
  52698. b.setMode(Ge.LINES);
  52699. else
  52700. switch (a.drawMode) {
  52701. case n.TrianglesDrawMode:
  52702. b.setMode(Ge.TRIANGLES);
  52703. break;
  52704. case n.TriangleStripDrawMode:
  52705. b.setMode(Ge.TRIANGLE_STRIP);
  52706. break;
  52707. case n.TriangleFanDrawMode:
  52708. b.setMode(Ge.TRIANGLE_FAN)
  52709. }
  52710. else if (a instanceof n.Line) {
  52711. var D = o.linewidth;
  52712. void 0 === D && (D = 1),
  52713. Ye.setLineWidth(D * t()),
  52714. a instanceof n.LineSegments ? b.setMode(Ge.LINES) : b.setMode(Ge.LINE_STRIP)
  52715. } else
  52716. a instanceof n.Points && b.setMode(Ge.POINTS);
  52717. r instanceof n.InstancedBufferGeometry ? r.maxInstancedCount > 0 && b.renderInstances(r, P, L) : b.render(P, L)
  52718. }
  52719. ,
  52720. this.render = function(e, t, i, r) {
  52721. if (t instanceof n.Camera == !1)
  52722. return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");
  52723. var o = e.fog;
  52724. if (Ee = "",
  52725. Ie = -1,
  52726. be = null,
  52727. e.autoUpdate === !0 && e.updateMatrixWorld(),
  52728. null === t.parent && t.updateMatrixWorld(),
  52729. t.matrixWorldInverse.getInverse(t.matrixWorld),
  52730. Fe.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  52731. Be.setFromMatrix(Fe),
  52732. ce.length = 0,
  52733. ue = -1,
  52734. pe = -1,
  52735. ge.length = 0,
  52736. me.length = 0,
  52737. y(e, t),
  52738. he.length = ue + 1,
  52739. de.length = pe + 1,
  52740. ve.sortObjects === !0 && (he.sort(m),
  52741. de.sort(v)),
  52742. U(ce, t),
  52743. $e.render(e, t),
  52744. He.calls = 0,
  52745. He.vertices = 0,
  52746. He.faces = 0,
  52747. He.points = 0,
  52748. void 0 === i && (i = null),
  52749. this.setRenderTarget(i),
  52750. (this.autoClear || r) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  52751. e.overrideMaterial) {
  52752. var a = e.overrideMaterial;
  52753. C(he, t, o, a),
  52754. C(de, t, o, a)
  52755. } else
  52756. Ye.setBlending(n.NoBlending),
  52757. C(he, t, o),
  52758. C(de, t, o);
  52759. if (et.render(e, t),
  52760. tt.render(e, t, Te),
  52761. i) {
  52762. var s = i.texture;
  52763. s.generateMipmaps && z(i) && s.minFilter !== n.NearestFilter && s.minFilter !== n.LinearFilter && J(i)
  52764. }
  52765. Ye.setDepthTest(!0),
  52766. Ye.setDepthWrite(!0),
  52767. Ye.setColorWrite(!0)
  52768. }
  52769. ,
  52770. this.setFaceCulling = function(e, t) {
  52771. e === n.CullFaceNone ? Ye.disable(Ge.CULL_FACE) : (t === n.FrontFaceDirectionCW ? Ge.frontFace(Ge.CW) : Ge.frontFace(Ge.CCW),
  52772. e === n.CullFaceBack ? Ge.cullFace(Ge.BACK) : e === n.CullFaceFront ? Ge.cullFace(Ge.FRONT) : Ge.cullFace(Ge.FRONT_AND_BACK),
  52773. Ye.enable(Ge.CULL_FACE))
  52774. }
  52775. ,
  52776. this.setTexture = function(e, t) {
  52777. var i = Xe.get(e);
  52778. if (e.version > 0 && i.__version !== e.version) {
  52779. var n = e.image;
  52780. 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)
  52781. }
  52782. Ye.activeTexture(Ge.TEXTURE0 + t),
  52783. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture)
  52784. }
  52785. ,
  52786. this.getCurrentRenderTarget = function() {
  52787. return ye
  52788. }
  52789. ,
  52790. this.setRenderTargetFramebuffer = function ( renderTarget, defaultFramebuffer ) {//add
  52791. const renderTargetProperties = Xe.get( renderTarget );
  52792. renderTargetProperties.__webglFramebuffer = defaultFramebuffer;
  52793. renderTargetProperties.__useDefaultFramebuffer = defaultFramebuffer === undefined;
  52794. },
  52795. this.setFramebuffer = function ( value ) {//add
  52796. if ( Ce !== value && ye === null ) Ge.bindFramebuffer( 36160, value );
  52797. Ce = value;
  52798. },
  52799. this.setRenderTarget = function(e) {
  52800. ye = e,
  52801. e && void 0 === Xe.get(e).__webglFramebuffer && Q(e);
  52802. var t, i = e instanceof n.WebGLRenderTargetCube;
  52803. if (e) {
  52804. var r = Xe.get(e);
  52805. t = i ? r.__webglFramebuffer[e.activeCubeFace] : r.__webglFramebuffer,
  52806. we.copy(e.scissor),
  52807. _e = e.scissorTest,
  52808. Te.copy(e.viewport)
  52809. } else
  52810. t = null,
  52811. we.copy(Le).multiplyScalar(Oe),
  52812. _e = De,
  52813. Te.copy(Ne).multiplyScalar(Oe);
  52814. if (Ce !== t && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, t),
  52815. Ce = t),
  52816. Ye.scissor(we),
  52817. Ye.setScissorTest(_e),
  52818. Ye.viewport(Te),
  52819. i) {
  52820. var o = Xe.get(e.texture);
  52821. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, o.__webglTexture, e.activeMipMapLevel)
  52822. }
  52823. }
  52824. ,
  52825. this.readRenderTargetPixels = function(e, t, i, r, o, a) {
  52826. if (e instanceof n.WebGLRenderTarget == !1)
  52827. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
  52828. var s = Xe.get(e).__webglFramebuffer;
  52829. if (s) {
  52830. var l = !1;
  52831. s !== Ce && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, s),
  52832. l = !0);
  52833. try {
  52834. var c = e.texture;
  52835. if (c.format !== n.RGBAFormat && ee(c.format) !== Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_FORMAT))
  52836. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  52837. 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")))
  52838. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  52839. 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.")
  52840. } finally {
  52841. l && Ge.bindFramebuffer(Ge.FRAMEBUFFER, Ce)
  52842. }
  52843. }
  52844. }
  52845. }
  52846. ,
  52847. n.WebGLRenderTarget = function(e, t, i) {
  52848. this.uuid = n.Math.generateUUID(),
  52849. this.width = e,
  52850. this.height = t,
  52851. this.scissor = new n.Vector4(0,0,e,t),
  52852. this.scissorTest = !1,
  52853. this.viewport = new n.Vector4(0,0,e,t),
  52854. i = i || {},
  52855. void 0 === i.minFilter && (i.minFilter = n.LinearFilter),
  52856. this.texture = new n.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  52857. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  52858. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  52859. }
  52860. ,
  52861. n.WebGLRenderTarget.prototype = {
  52862. constructor: n.WebGLRenderTarget,
  52863. setSize: function(e, t) {
  52864. this.width === e && this.height === t || (this.width = e,
  52865. this.height = t,
  52866. this.dispose()),
  52867. this.viewport.set(0, 0, e, t),
  52868. this.scissor.set(0, 0, e, t)
  52869. },
  52870. clone: function() {
  52871. return (new this.constructor).copy(this)
  52872. },
  52873. copy: function(e) {
  52874. return this.width = e.width,
  52875. this.height = e.height,
  52876. this.viewport.copy(e.viewport),
  52877. this.texture = e.texture.clone(),
  52878. this.depthBuffer = e.depthBuffer,
  52879. this.stencilBuffer = e.stencilBuffer,
  52880. this
  52881. },
  52882. dispose: function() {
  52883. this.dispatchEvent({
  52884. type: "dispose"
  52885. })
  52886. }
  52887. },
  52888. n.EventDispatcher.prototype.apply(n.WebGLRenderTarget.prototype),
  52889. n.WebGLRenderTargetCube = function(e, t, i) {
  52890. n.WebGLRenderTarget.call(this, e, t, i),
  52891. this.activeCubeFace = 0,
  52892. this.activeMipMapLevel = 0
  52893. }
  52894. ,
  52895. n.WebGLRenderTargetCube.prototype = Object.create(n.WebGLRenderTarget.prototype),
  52896. n.WebGLRenderTargetCube.prototype.constructor = n.WebGLRenderTargetCube,
  52897. n.WebGLBufferRenderer = function(e, t, i) {
  52898. function r(e) {
  52899. s = e
  52900. }
  52901. function o(t, n) {
  52902. e.drawArrays(s, t, n),
  52903. i.calls++,
  52904. i.vertices += n,
  52905. s === e.TRIANGLES && (i.faces += n / 3)
  52906. }
  52907. function a(r) {
  52908. var o = t.get("ANGLE_instanced_arrays");
  52909. if (null === o)
  52910. return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  52911. var a = r.attributes.position
  52912. , l = 0;
  52913. a instanceof n.InterleavedBufferAttribute ? (l = a.data.count,
  52914. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)) : (l = a.count,
  52915. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)),
  52916. i.calls++,
  52917. i.vertices += l * r.maxInstancedCount,
  52918. s === e.TRIANGLES && (i.faces += r.maxInstancedCount * l / 3)
  52919. }
  52920. var s;
  52921. this.setMode = r,
  52922. this.render = o,
  52923. this.renderInstances = a
  52924. }
  52925. ,
  52926. n.WebGLIndexedBufferRenderer = function(e, t, i) {
  52927. function n(e) {
  52928. s = e
  52929. }
  52930. function r(i) {
  52931. i.array instanceof Uint32Array && t.get("OES_element_index_uint") ? (l = e.UNSIGNED_INT,
  52932. c = 4) : (l = e.UNSIGNED_SHORT,
  52933. c = 2)
  52934. }
  52935. function o(t, n) {
  52936. e.drawElements(s, n, l, t * c),
  52937. i.calls++,
  52938. i.vertices += n,
  52939. s === e.TRIANGLES && (i.faces += n / 3)
  52940. }
  52941. function a(n, r, o) {
  52942. var a = t.get("ANGLE_instanced_arrays");
  52943. 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),
  52944. i.calls++,
  52945. i.vertices += o * n.maxInstancedCount,
  52946. void (s === e.TRIANGLES && (i.faces += n.maxInstancedCount * o / 3)))
  52947. }
  52948. var s, l, c;
  52949. this.setMode = n,
  52950. this.setIndex = r,
  52951. this.render = o,
  52952. this.renderInstances = a
  52953. }
  52954. ,
  52955. n.WebGLExtensions = function(e) {
  52956. var t = {};
  52957. this.get = function(i) {
  52958. if (void 0 !== t[i])
  52959. return t[i];
  52960. var n;
  52961. switch (i) {
  52962. case "EXT_texture_filter_anisotropic":
  52963. n = e.getExtension("EXT_texture_filter_anisotropic") || e.getExtension("MOZ_EXT_texture_filter_anisotropic") || e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  52964. break;
  52965. case "WEBGL_compressed_texture_s3tc":
  52966. n = e.getExtension("WEBGL_compressed_texture_s3tc") || e.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  52967. break;
  52968. case "WEBGL_compressed_texture_pvrtc":
  52969. n = e.getExtension("WEBGL_compressed_texture_pvrtc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  52970. break;
  52971. case "WEBGL_compressed_texture_etc1":
  52972. n = e.getExtension("WEBGL_compressed_texture_etc1");
  52973. break;
  52974. default:
  52975. n = e.getExtension(i)
  52976. }
  52977. return null === n && console.warn("THREE.WebGLRenderer: " + i + " extension not supported."),
  52978. t[i] = n,
  52979. n
  52980. }
  52981. }
  52982. ,
  52983. n.WebGLCapabilities = function(e, t, i) {
  52984. function n(t) {
  52985. if ("highp" === t) {
  52986. if (e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.HIGH_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.HIGH_FLOAT).precision > 0)
  52987. return "highp";
  52988. t = "mediump"
  52989. }
  52990. 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"
  52991. }
  52992. this.getMaxPrecision = n,
  52993. this.precision = void 0 !== i.precision ? i.precision : "highp",
  52994. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  52995. this.maxTextures = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
  52996. this.maxVertexTextures = e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  52997. this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE),
  52998. this.maxCubemapSize = e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),
  52999. this.maxAttributes = e.getParameter(e.MAX_VERTEX_ATTRIBS),
  53000. this.maxVertexUniforms = e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),
  53001. this.maxVaryings = e.getParameter(e.MAX_VARYING_VECTORS),
  53002. this.maxFragmentUniforms = e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),
  53003. this.vertexTextures = this.maxVertexTextures > 0,
  53004. this.floatFragmentTextures = !!t.get("OES_texture_float"),
  53005. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  53006. var r = n(this.precision);
  53007. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  53008. this.precision = r),
  53009. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!t.get("EXT_frag_depth"))
  53010. }
  53011. ,
  53012. n.WebGLGeometries = function(e, t, i) {
  53013. function r(e) {
  53014. var t = e.geometry;
  53015. if (void 0 !== h[t.id])
  53016. return h[t.id];
  53017. t.addEventListener("dispose", o);
  53018. var r;
  53019. return t instanceof n.BufferGeometry ? r = t : t instanceof n.Geometry && (void 0 === t._bufferGeometry && (t._bufferGeometry = (new n.BufferGeometry).setFromObject(e)),
  53020. r = t._bufferGeometry),
  53021. h[t.id] = r,
  53022. i.memory.geometries++,
  53023. r
  53024. }
  53025. function o(e) {
  53026. var n = e.target
  53027. , r = h[n.id];
  53028. null !== r.index && s(r.index),
  53029. l(r.attributes),
  53030. n.removeEventListener("dispose", o),
  53031. delete h[n.id];
  53032. var a = t.get(n);
  53033. a.wireframe && s(a.wireframe),
  53034. t.delete(n);
  53035. var c = t.get(r);
  53036. c.wireframe && s(c.wireframe),
  53037. t.delete(r),
  53038. i.memory.geometries--
  53039. }
  53040. function a(e) {
  53041. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  53042. }
  53043. function s(t) {
  53044. var i = a(t);
  53045. void 0 !== i && (e.deleteBuffer(i),
  53046. c(t))
  53047. }
  53048. function l(e) {
  53049. for (var t in e)
  53050. s(e[t])
  53051. }
  53052. function c(e) {
  53053. e instanceof n.InterleavedBufferAttribute ? t.delete(e.data) : t.delete(e)
  53054. }
  53055. var h = {};
  53056. this.get = r
  53057. }
  53058. ,
  53059. n.WebGLLights = function() {
  53060. var e = {};
  53061. this.get = function(t) {
  53062. if (void 0 !== e[t.id])
  53063. return e[t.id];
  53064. var i;
  53065. switch (t.type) {
  53066. case "DirectionalLight":
  53067. i = {
  53068. direction: new n.Vector3,
  53069. color: new n.Color,
  53070. shadow: !1,
  53071. shadowBias: 0,
  53072. shadowRadius: 1,
  53073. shadowMapSize: new n.Vector2
  53074. };
  53075. break;
  53076. case "SpotLight":
  53077. i = {
  53078. position: new n.Vector3,
  53079. direction: new n.Vector3,
  53080. color: new n.Color,
  53081. distance: 0,
  53082. coneCos: 0,
  53083. penumbraCos: 0,
  53084. decay: 0,
  53085. shadow: !1,
  53086. shadowBias: 0,
  53087. shadowRadius: 1,
  53088. shadowMapSize: new n.Vector2
  53089. };
  53090. break;
  53091. case "PointLight":
  53092. i = {
  53093. position: new n.Vector3,
  53094. color: new n.Color,
  53095. distance: 0,
  53096. decay: 0,
  53097. shadow: !1,
  53098. shadowBias: 0,
  53099. shadowRadius: 1,
  53100. shadowMapSize: new n.Vector2
  53101. };
  53102. break;
  53103. case "HemisphereLight":
  53104. i = {
  53105. direction: new n.Vector3,
  53106. skyColor: new n.Color,
  53107. groundColor: new n.Color
  53108. }
  53109. }
  53110. return e[t.id] = i,
  53111. i
  53112. }
  53113. }
  53114. ,
  53115. n.WebGLObjects = function(e, t, i) {
  53116. function r(t) {
  53117. var i = u.get(t);
  53118. t.geometry instanceof n.Geometry && i.updateFromObject(t);
  53119. var r = i.index
  53120. , a = i.attributes;
  53121. null !== r && o(r, e.ELEMENT_ARRAY_BUFFER);
  53122. for (var s in a)
  53123. o(a[s], e.ARRAY_BUFFER);
  53124. var l = i.morphAttributes;
  53125. for (var s in l)
  53126. for (var c = l[s], h = 0, d = c.length; h < d; h++)
  53127. o(c[h], e.ARRAY_BUFFER);
  53128. return i
  53129. }
  53130. function o(e, i) {
  53131. var r = e instanceof n.InterleavedBufferAttribute ? e.data : e
  53132. , o = t.get(r);
  53133. void 0 === o.__webglBuffer ? a(o, r, i) : o.version !== r.version && s(o, r, i)
  53134. }
  53135. function a(t, i, n) {
  53136. t.__webglBuffer = e.createBuffer(),
  53137. e.bindBuffer(n, t.__webglBuffer);
  53138. var r = i.dynamic ? e.DYNAMIC_DRAW : e.STATIC_DRAW;
  53139. e.bufferData(n, i.array, r),
  53140. t.version = i.version
  53141. }
  53142. function s(t, i, n) {
  53143. e.bindBuffer(n, t.__webglBuffer),
  53144. 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)),
  53145. i.updateRange.count = 0),
  53146. t.version = i.version
  53147. }
  53148. function l(e) {
  53149. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  53150. }
  53151. function c(i) {
  53152. var r = t.get(i);
  53153. if (void 0 !== r.wireframe)
  53154. return r.wireframe;
  53155. var a = []
  53156. , s = i.index
  53157. , l = i.attributes
  53158. , c = l.position;
  53159. if (null !== s)
  53160. for (var u = {}, d = s.array, p = 0, f = d.length; p < f; p += 3) {
  53161. var g = d[p + 0]
  53162. , m = d[p + 1]
  53163. , v = d[p + 2];
  53164. h(u, g, m) && a.push(g, m),
  53165. h(u, m, v) && a.push(m, v),
  53166. h(u, v, g) && a.push(v, g)
  53167. }
  53168. else
  53169. for (var d = l.position.array, p = 0, f = d.length / 3 - 1; p < f; p += 3) {
  53170. var g = p + 0
  53171. , m = p + 1
  53172. , v = p + 2;
  53173. a.push(g, m, m, v, v, g)
  53174. }
  53175. var A = c.count > 65535 ? Uint32Array : Uint16Array
  53176. , y = new n.BufferAttribute(new A(a),1);
  53177. return o(y, e.ELEMENT_ARRAY_BUFFER),
  53178. r.wireframe = y,
  53179. y
  53180. }
  53181. function h(e, t, i) {
  53182. if (t > i) {
  53183. var n = t;
  53184. t = i,
  53185. i = n
  53186. }
  53187. var r = e[t];
  53188. return void 0 === r ? (e[t] = [i],
  53189. !0) : r.indexOf(i) === -1 && (r.push(i),
  53190. !0)
  53191. }
  53192. var u = new n.WebGLGeometries(e,t,i);
  53193. this.getAttributeBuffer = l,
  53194. this.getWireframeAttribute = c,
  53195. this.update = r
  53196. }
  53197. ,
  53198. n.WebGLProgram = function() {
  53199. function e(e) {
  53200. switch (e) {
  53201. case n.LinearEncoding:
  53202. return ["Linear", "( value )"];
  53203. case n.sRGBEncoding:
  53204. return ["sRGB", "( value )"];
  53205. case n.RGBEEncoding:
  53206. return ["RGBE", "( value )"];
  53207. case n.RGBM7Encoding:
  53208. return ["RGBM", "( value, 7.0 )"];
  53209. case n.RGBM16Encoding:
  53210. return ["RGBM", "( value, 16.0 )"];
  53211. case n.RGBDEncoding:
  53212. return ["RGBD", "( value, 256.0 )"];
  53213. case n.GammaEncoding:
  53214. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  53215. default:
  53216. throw new Error("unsupported encoding: " + e)
  53217. }
  53218. }
  53219. function t(t, i) {
  53220. var n = e(i);
  53221. return "vec4 " + t + "( vec4 value ) { return " + n[0] + "ToLinear" + n[1] + "; }"
  53222. }
  53223. function i(t, i) {
  53224. var n = e(i);
  53225. return "vec4 " + t + "( vec4 value ) { return LinearTo" + n[0] + n[1] + "; }"
  53226. }
  53227. function r(e, t) {
  53228. var i;
  53229. switch (t) {
  53230. case n.LinearToneMapping:
  53231. i = "Linear";
  53232. break;
  53233. case n.ReinhardToneMapping:
  53234. i = "Reinhard";
  53235. break;
  53236. case n.Uncharted2ToneMapping:
  53237. i = "Uncharted2";
  53238. break;
  53239. case n.CineonToneMapping:
  53240. i = "OptimizedCineon";
  53241. break;
  53242. default:
  53243. throw new Error("unsupported toneMapping: " + t)
  53244. }
  53245. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  53246. }
  53247. function o(e, t, i) {
  53248. e = e || {};
  53249. 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" : ""];
  53250. return n.filter(c).join("\n")
  53251. }
  53252. function a(e) {
  53253. var t = [];
  53254. for (var i in e) {
  53255. var n = e[i];
  53256. n !== !1 && t.push("#define " + i + " " + n)
  53257. }
  53258. return t.join("\n")
  53259. }
  53260. function s(e, t, i) {
  53261. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), o = 0; o < r; o++) {
  53262. var a = e.getActiveUniform(t, o)
  53263. , s = a.name
  53264. , l = e.getUniformLocation(t, s)
  53265. , c = f.exec(s);
  53266. if (c) {
  53267. var h = c[1]
  53268. , u = c[2]
  53269. , d = n[h];
  53270. d || (d = n[h] = {}),
  53271. d[u] = l
  53272. } else if (c = g.exec(s)) {
  53273. var p = c[1]
  53274. , v = c[2]
  53275. , A = c[3]
  53276. , y = n[p];
  53277. y || (y = n[p] = []);
  53278. var C = y[v];
  53279. C || (C = y[v] = {}),
  53280. C[A] = l
  53281. } else if (c = m.exec(s)) {
  53282. var p = c[1];
  53283. n[p] = l
  53284. } else
  53285. n[s] = l
  53286. }
  53287. return n
  53288. }
  53289. function l(e, t, i) {
  53290. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), o = 0; o < r; o++) {
  53291. var a = e.getActiveAttrib(t, o)
  53292. , s = a.name;
  53293. n[s] = e.getAttribLocation(t, s)
  53294. }
  53295. return n
  53296. }
  53297. function c(e) {
  53298. return "" !== e
  53299. }
  53300. function h(e, t) {
  53301. 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)
  53302. }
  53303. function u(e) {
  53304. function t(e, t) {
  53305. var i = n.ShaderChunk[t];
  53306. if (void 0 === i)
  53307. throw new Error("Can not resolve #include <" + t + ">");
  53308. return u(i)
  53309. }
  53310. var i = /#include +<([\w\d.]+)>/g;
  53311. return e.replace(i, t)
  53312. }
  53313. function d(e) {
  53314. function t(e, t, i, n) {
  53315. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  53316. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  53317. return r
  53318. }
  53319. var i = /for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;
  53320. return e.replace(i, t)
  53321. }
  53322. var p = 0
  53323. , f = /^([\w\d_]+)\.([\w\d_]+)$/
  53324. , g = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/
  53325. , m = /^([\w\d_]+)\[0\]$/;
  53326. return function(e, f, g, m) {
  53327. var v = e.context
  53328. , A = g.extensions
  53329. , y = g.defines
  53330. , C = g.__webglShader.vertexShader
  53331. , I = g.__webglShader.fragmentShader
  53332. , E = "SHADOWMAP_TYPE_BASIC";
  53333. m.shadowMapType === n.PCFShadowMap ? E = "SHADOWMAP_TYPE_PCF" : m.shadowMapType === n.PCFSoftShadowMap && (E = "SHADOWMAP_TYPE_PCF_SOFT");
  53334. var b = "ENVMAP_TYPE_CUBE"
  53335. , w = "ENVMAP_MODE_REFLECTION"
  53336. , _ = "ENVMAP_BLENDING_MULTIPLY";
  53337. if (m.envMap) {
  53338. switch (g.envMap.mapping) {
  53339. case n.CubeReflectionMapping:
  53340. case n.CubeRefractionMapping:
  53341. b = "ENVMAP_TYPE_CUBE";
  53342. break;
  53343. case n.CubeUVReflectionMapping:
  53344. case n.CubeUVRefractionMapping:
  53345. b = "ENVMAP_TYPE_CUBE_UV";
  53346. break;
  53347. case n.EquirectangularReflectionMapping:
  53348. case n.EquirectangularRefractionMapping:
  53349. b = "ENVMAP_TYPE_EQUIREC";
  53350. break;
  53351. case n.SphericalReflectionMapping:
  53352. b = "ENVMAP_TYPE_SPHERE"
  53353. }
  53354. switch (g.envMap.mapping) {
  53355. case n.CubeRefractionMapping:
  53356. case n.EquirectangularRefractionMapping:
  53357. w = "ENVMAP_MODE_REFRACTION"
  53358. }
  53359. switch (g.combine) {
  53360. case n.MultiplyOperation:
  53361. _ = "ENVMAP_BLENDING_MULTIPLY";
  53362. break;
  53363. case n.MixOperation:
  53364. _ = "ENVMAP_BLENDING_MIX";
  53365. break;
  53366. case n.AddOperation:
  53367. _ = "ENVMAP_BLENDING_ADD"
  53368. }
  53369. }
  53370. var T, x, S = e.gammaFactor > 0 ? e.gammaFactor : 1, M = o(A, m, e.extensions), R = a(y), P = v.createProgram();
  53371. g instanceof n.RawShaderMaterial ? (T = "",
  53372. 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"),
  53373. 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")),
  53374. C = u(C, m),
  53375. C = h(C, m),
  53376. I = u(I, m),
  53377. I = h(I, m),
  53378. g instanceof n.ShaderMaterial == !1 && (C = d(C),
  53379. I = d(I));
  53380. var O = T + C
  53381. , L = x + I
  53382. , D = n.WebGLShader(v, v.VERTEX_SHADER, O)
  53383. , N = n.WebGLShader(v, v.FRAGMENT_SHADER, L);
  53384. v.attachShader(P, D),
  53385. v.attachShader(P, N),
  53386. void 0 !== g.index0AttributeName ? v.bindAttribLocation(P, 0, g.index0AttributeName) : m.morphTargets === !0 && v.bindAttribLocation(P, 0, "position"),
  53387. v.linkProgram(P);
  53388. var B = v.getProgramInfoLog(P)
  53389. , F = v.getShaderInfoLog(D)
  53390. , V = v.getShaderInfoLog(N)
  53391. , U = !0
  53392. , k = !0;
  53393. v.getProgramParameter(P, v.LINK_STATUS) === !1 ? (U = !1,
  53394. 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),
  53395. k && (this.diagnostics = {
  53396. runnable: U,
  53397. material: g,
  53398. programLog: B,
  53399. vertexShader: {
  53400. log: F,
  53401. prefix: T
  53402. },
  53403. fragmentShader: {
  53404. log: V,
  53405. prefix: x
  53406. }
  53407. }),
  53408. v.deleteShader(D),
  53409. v.deleteShader(N);
  53410. var H;
  53411. this.getUniforms = function() {
  53412. return void 0 === H && (H = s(v, P)),
  53413. H
  53414. }
  53415. ;
  53416. var G;
  53417. return this.getAttributes = function() {
  53418. return void 0 === G && (G = l(v, P)),
  53419. G
  53420. }
  53421. ,
  53422. this.destroy = function() {
  53423. v.deleteProgram(P),
  53424. this.program = void 0
  53425. }
  53426. ,
  53427. Object.defineProperties(this, {
  53428. uniforms: {
  53429. get: function() {
  53430. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  53431. this.getUniforms()
  53432. }
  53433. },
  53434. attributes: {
  53435. get: function() {
  53436. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  53437. this.getAttributes()
  53438. }
  53439. }
  53440. }),
  53441. this.id = p++,
  53442. this.code = f,
  53443. this.usedTimes = 1,
  53444. this.program = P,
  53445. this.vertexShader = D,
  53446. this.fragmentShader = N,
  53447. this
  53448. }
  53449. }(),
  53450. n.WebGLPrograms = function(e, t) {
  53451. function i(e) {
  53452. if (t.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  53453. return 1024;
  53454. var i = t.maxVertexUniforms
  53455. , r = Math.floor((i - 20) / 4)
  53456. , o = r;
  53457. return void 0 !== e && e instanceof n.SkinnedMesh && (o = Math.min(e.skeleton.bones.length, o),
  53458. 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)")),
  53459. o
  53460. }
  53461. function r(e, t) {
  53462. var i;
  53463. return e ? e instanceof n.Texture ? i = e.encoding : e instanceof n.WebGLRenderTarget && (i = e.texture.encoding) : i = n.LinearEncoding,
  53464. i === n.LinearEncoding && t && (i = n.GammaEncoding),
  53465. i
  53466. }
  53467. var o = []
  53468. , a = {
  53469. MeshDepthMaterial: "depth",
  53470. MeshNormalMaterial: "normal",
  53471. MeshBasicMaterial: "basic",
  53472. MeshLambertMaterial: "lambert",
  53473. MeshPhongMaterial: "phong",
  53474. MeshStandardMaterial: "standard",
  53475. LineBasicMaterial: "basic",
  53476. LineDashedMaterial: "dashed",
  53477. PointsMaterial: "points"
  53478. }
  53479. , 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"];
  53480. this.getParameters = function(o, s, l, c) {
  53481. var h = a[o.type]
  53482. , u = i(c)
  53483. , d = e.getPrecision();
  53484. null !== o.precision && (d = t.getMaxPrecision(o.precision),
  53485. d !== o.precision && console.warn("THREE.WebGLProgram.getParameters:", o.precision, "not supported, using", d, "instead."));
  53486. var p = {
  53487. shaderID: h,
  53488. precision: d,
  53489. supportsVertexTextures: t.vertexTextures,
  53490. outputEncoding: r(e.getCurrentRenderTarget(), e.gammaOutput),
  53491. map: !!o.map,
  53492. mapEncoding: r(o.map, e.gammaInput),
  53493. envMap: !!o.envMap,
  53494. envMapMode: o.envMap && o.envMap.mapping,
  53495. envMapEncoding: r(o.envMap, e.gammaInput),
  53496. envMapCubeUV: !!o.envMap && (o.envMap.mapping === n.CubeUVReflectionMapping || o.envMap.mapping === n.CubeUVRefractionMapping),
  53497. lightMap: !!o.lightMap,
  53498. aoMap: !!o.aoMap,
  53499. emissiveMap: !!o.emissiveMap,
  53500. emissiveMapEncoding: r(o.emissiveMap, e.gammaInput),
  53501. bumpMap: !!o.bumpMap,
  53502. normalMap: !!o.normalMap,
  53503. displacementMap: !!o.displacementMap,
  53504. roughnessMap: !!o.roughnessMap,
  53505. metalnessMap: !!o.metalnessMap,
  53506. specularMap: !!o.specularMap,
  53507. alphaMap: !!o.alphaMap,
  53508. combine: o.combine,
  53509. vertexColors: o.vertexColors,
  53510. fog: l,
  53511. useFog: o.fog,
  53512. fogExp: l instanceof n.FogExp2,
  53513. flatShading: o.shading === n.FlatShading,
  53514. sizeAttenuation: o.sizeAttenuation,
  53515. logarithmicDepthBuffer: t.logarithmicDepthBuffer,
  53516. skinning: o.skinning,
  53517. maxBones: u,
  53518. useVertexTexture: t.floatVertexTextures && c && c.skeleton && c.skeleton.useVertexTexture,
  53519. morphTargets: o.morphTargets,
  53520. morphNormals: o.morphNormals,
  53521. maxMorphTargets: e.maxMorphTargets,
  53522. maxMorphNormals: e.maxMorphNormals,
  53523. numDirLights: s.directional.length,
  53524. numPointLights: s.point.length,
  53525. numSpotLights: s.spot.length,
  53526. numHemiLights: s.hemi.length,
  53527. pointLightShadows: s.shadowsPointLight,
  53528. shadowMapEnabled: e.shadowMap.enabled && c.receiveShadow && s.shadows.length > 0,
  53529. shadowMapType: e.shadowMap.type,
  53530. toneMapping: e.toneMapping,
  53531. physicallyCorrectLights: e.physicallyCorrectLights,
  53532. premultipliedAlpha: o.premultipliedAlpha,
  53533. alphaTest: o.alphaTest,
  53534. doubleSided: o.side === n.DoubleSide,
  53535. flipSided: o.side === n.BackSide
  53536. };
  53537. return p
  53538. }
  53539. ,
  53540. this.getProgramCode = function(e, t) {
  53541. var i = [];
  53542. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  53543. i.push(e.vertexShader)),
  53544. void 0 !== e.defines)
  53545. for (var n in e.defines)
  53546. i.push(n),
  53547. i.push(e.defines[n]);
  53548. for (var r = 0; r < s.length; r++) {
  53549. var o = s[r];
  53550. i.push(o),
  53551. i.push(t[o])
  53552. }
  53553. return i.join()
  53554. }
  53555. ,
  53556. this.acquireProgram = function(t, i, r) {
  53557. for (var a, s = 0, l = o.length; s < l; s++) {
  53558. var c = o[s];
  53559. if (c.code === r) {
  53560. a = c,
  53561. ++a.usedTimes;
  53562. break
  53563. }
  53564. }
  53565. return void 0 === a && (a = new n.WebGLProgram(e,r,t,i),
  53566. o.push(a)),
  53567. a
  53568. }
  53569. ,
  53570. this.releaseProgram = function(e) {
  53571. if (0 === --e.usedTimes) {
  53572. var t = o.indexOf(e);
  53573. o[t] = o[o.length - 1],
  53574. o.pop(),
  53575. e.destroy()
  53576. }
  53577. }
  53578. ,
  53579. this.programs = o
  53580. }
  53581. ,
  53582. n.WebGLProperties = function() {
  53583. var e = {};
  53584. this.get = function(t) {
  53585. var i = t.uuid
  53586. , n = e[i];
  53587. return void 0 === n && (n = {},
  53588. e[i] = n),
  53589. n
  53590. }
  53591. ,
  53592. this.delete = function(t) {
  53593. delete e[t.uuid]
  53594. }
  53595. ,
  53596. this.clear = function() {
  53597. e = {}
  53598. }
  53599. }
  53600. ,
  53601. n.WebGLShader = function() {
  53602. function e(e) {
  53603. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  53604. t[i] = i + 1 + ": " + t[i];
  53605. return t.join("\n")
  53606. }
  53607. return function(t, i, n) {
  53608. var r = t.createShader(i);
  53609. return t.shaderSource(r, n),
  53610. t.compileShader(r),
  53611. t.getShaderParameter(r, t.COMPILE_STATUS) === !1 && console.error("THREE.WebGLShader: Shader couldn't compile."),
  53612. "" !== t.getShaderInfoLog(r) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", i === t.VERTEX_SHADER ? "vertex" : "fragment", t.getShaderInfoLog(r), e(n)),
  53613. r
  53614. }
  53615. }(),
  53616. n.WebGLShadowMap = function(e, t, i) {
  53617. function r(e, t, i, r) {
  53618. var o = e.geometry
  53619. , a = null
  53620. , s = v
  53621. , l = e.customDepthMaterial;
  53622. if (i && (s = A,
  53623. l = e.customDistanceMaterial),
  53624. l)
  53625. a = l;
  53626. else {
  53627. var c = void 0 !== o.morphTargets && o.morphTargets.length > 0 && t.morphTargets
  53628. , h = e instanceof n.SkinnedMesh && t.skinning
  53629. , u = 0;
  53630. c && (u |= f),
  53631. h && (u |= g),
  53632. a = s[u]
  53633. }
  53634. return a.visible = t.visible,
  53635. a.wireframe = t.wireframe,
  53636. a.wireframeLinewidth = t.wireframeLinewidth,
  53637. i && void 0 !== a.uniforms.lightPos && a.uniforms.lightPos.value.copy(r),
  53638. a
  53639. }
  53640. function o(e, t, i) {
  53641. if (e.visible !== !1) {
  53642. 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)) {
  53643. var r = e.material;
  53644. r.visible === !0 && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  53645. p.push(e))
  53646. }
  53647. for (var a = e.children, s = 0, c = a.length; s < c; s++)
  53648. o(a[s], t, i)
  53649. }
  53650. }
  53651. 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) {
  53652. var x = 0 !== (T & f)
  53653. , S = 0 !== (T & g)
  53654. , M = new n.ShaderMaterial({
  53655. uniforms: b,
  53656. vertexShader: E.vertexShader,
  53657. fragmentShader: E.fragmentShader,
  53658. morphTargets: x,
  53659. skinning: S
  53660. });
  53661. v[T] = M;
  53662. var R = new n.ShaderMaterial({
  53663. defines: {
  53664. USE_SHADOWMAP: ""
  53665. },
  53666. uniforms: _,
  53667. vertexShader: w.vertexShader,
  53668. fragmentShader: w.fragmentShader,
  53669. morphTargets: x,
  53670. skinning: S
  53671. });
  53672. A[T] = R
  53673. }
  53674. var P = this;
  53675. this.enabled = !1,
  53676. this.autoUpdate = !0,
  53677. this.needsUpdate = !1,
  53678. this.type = n.PCFShadowMap,
  53679. this.cullFace = n.CullFaceFront,
  53680. this.render = function(f, g) {
  53681. var m, v, A = t.shadows;
  53682. if (0 !== A.length && P.enabled !== !1 && (P.autoUpdate !== !1 || P.needsUpdate !== !1)) {
  53683. s.clearColor(1, 1, 1, 1),
  53684. s.disable(a.BLEND),
  53685. s.enable(a.CULL_FACE),
  53686. a.frontFace(a.CCW),
  53687. a.cullFace(P.cullFace === n.CullFaceFront ? a.FRONT : a.BACK),
  53688. s.setDepthTest(!0),
  53689. s.setScissorTest(!1);
  53690. for (var E = 0, b = A.length; E < b; E++) {
  53691. var w = A[E]
  53692. , _ = w.shadow
  53693. , T = _.camera;
  53694. if (h.copy(_.mapSize),
  53695. w instanceof n.PointLight) {
  53696. m = 6,
  53697. v = !0;
  53698. var x = h.x
  53699. , S = h.y;
  53700. I[0].set(2 * x, S, x, S),
  53701. I[1].set(0, S, x, S),
  53702. I[2].set(3 * x, S, x, S),
  53703. I[3].set(x, S, x, S),
  53704. I[4].set(3 * x, 0, x, S),
  53705. I[5].set(x, 0, x, S),
  53706. h.x *= 4,
  53707. h.y *= 2
  53708. } else
  53709. m = 1,
  53710. v = !1;
  53711. if (null === _.map) {
  53712. var M = {
  53713. minFilter: n.NearestFilter,
  53714. magFilter: n.NearestFilter,
  53715. format: n.RGBAFormat
  53716. };
  53717. _.map = new n.WebGLRenderTarget(h.x,h.y,M),
  53718. w instanceof n.SpotLight && (T.aspect = h.x / h.y),
  53719. T.updateProjectionMatrix()
  53720. }
  53721. var R = _.map
  53722. , O = _.matrix;
  53723. d.setFromMatrixPosition(w.matrixWorld),
  53724. T.position.copy(d),
  53725. e.setRenderTarget(R),
  53726. e.clear();
  53727. for (var L = 0; L < m; L++) {
  53728. if (v) {
  53729. u.copy(T.position),
  53730. u.add(y[L]),
  53731. T.up.copy(C[L]),
  53732. T.lookAt(u);
  53733. var D = I[L];
  53734. s.viewport(D)
  53735. } else
  53736. u.setFromMatrixPosition(w.target.matrixWorld),
  53737. T.lookAt(u);
  53738. T.updateMatrixWorld(),
  53739. T.matrixWorldInverse.getInverse(T.matrixWorld),
  53740. O.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  53741. O.multiply(T.projectionMatrix),
  53742. O.multiply(T.matrixWorldInverse),
  53743. c.multiplyMatrices(T.projectionMatrix, T.matrixWorldInverse),
  53744. l.setFromMatrix(c),
  53745. p.length = 0,
  53746. o(f, g, T);
  53747. for (var N = 0, B = p.length; N < B; N++) {
  53748. var F = p[N]
  53749. , V = i.update(F)
  53750. , U = F.material;
  53751. if (U instanceof n.MultiMaterial)
  53752. for (var k = V.groups, H = U.materials, G = 0, z = k.length; G < z; G++) {
  53753. var W = k[G]
  53754. , j = H[W.materialIndex];
  53755. if (j.visible === !0) {
  53756. var Y = r(F, j, v, d);
  53757. e.renderBufferDirect(T, null, V, Y, F, W)
  53758. }
  53759. }
  53760. else {
  53761. var Y = r(F, U, v, d);
  53762. e.renderBufferDirect(T, null, V, Y, F, null)
  53763. }
  53764. }
  53765. }
  53766. }
  53767. var X = e.getClearColor()
  53768. , Z = e.getClearAlpha();
  53769. e.setClearColor(X, Z),
  53770. s.enable(a.BLEND),
  53771. P.cullFace === n.CullFaceFront && a.cullFace(a.BACK),
  53772. P.needsUpdate = !1
  53773. }
  53774. }
  53775. }
  53776. ,
  53777. n.WebGLState = function(e, t, i) {
  53778. var r = this
  53779. , o = new n.Vector4
  53780. , a = new Uint8Array(16)
  53781. , s = new Uint8Array(16)
  53782. , l = new Uint8Array(16)
  53783. , c = {}
  53784. , h = null
  53785. , u = null
  53786. , d = null
  53787. , p = null
  53788. , f = null
  53789. , g = null
  53790. , m = null
  53791. , v = null
  53792. , A = !1
  53793. , y = null
  53794. , C = null
  53795. , I = null
  53796. , E = null
  53797. , b = null
  53798. , w = null
  53799. , _ = null
  53800. , T = null
  53801. , x = null
  53802. , S = null
  53803. , M = null
  53804. , R = null
  53805. , P = null
  53806. , O = null
  53807. , L = null
  53808. , D = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  53809. , N = void 0
  53810. , B = {}
  53811. , F = new n.Vector4
  53812. , V = null
  53813. , U = null
  53814. , k = new n.Vector4
  53815. , H = new n.Vector4
  53816. , G = e.createTexture();
  53817. e.bindTexture(e.TEXTURE_2D, G),
  53818. e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR),
  53819. e.texImage2D(e.TEXTURE_2D, 0, e.RGB, 1, 1, 0, e.RGB, e.UNSIGNED_BYTE, new Uint8Array(3)),
  53820. this.init = function() {
  53821. this.clearColor(0, 0, 0, 1),
  53822. this.clearDepth(1),
  53823. this.clearStencil(0),
  53824. this.enable(e.DEPTH_TEST),
  53825. e.depthFunc(e.LEQUAL),
  53826. e.frontFace(e.CCW),
  53827. e.cullFace(e.BACK),
  53828. this.enable(e.CULL_FACE),
  53829. this.enable(e.BLEND),
  53830. e.blendEquation(e.FUNC_ADD),
  53831. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  53832. }
  53833. ,
  53834. this.initAttributes = function() {
  53835. for (var e = 0, t = a.length; e < t; e++)
  53836. a[e] = 0
  53837. }
  53838. ,
  53839. this.enableAttribute = function(i) {
  53840. if (a[i] = 1,
  53841. 0 === s[i] && (e.enableVertexAttribArray(i),
  53842. s[i] = 1),
  53843. 0 !== l[i]) {
  53844. var n = t.get("ANGLE_instanced_arrays");
  53845. n.vertexAttribDivisorANGLE(i, 0),
  53846. l[i] = 0
  53847. }
  53848. }
  53849. ,
  53850. this.enableAttributeAndDivisor = function(t, i, n) {
  53851. a[t] = 1,
  53852. 0 === s[t] && (e.enableVertexAttribArray(t),
  53853. s[t] = 1),
  53854. l[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  53855. l[t] = i)
  53856. }
  53857. ,
  53858. this.disableUnusedAttributes = function() {
  53859. for (var t = 0, i = s.length; t < i; t++)
  53860. s[t] !== a[t] && (e.disableVertexAttribArray(t),
  53861. s[t] = 0)
  53862. }
  53863. ,
  53864. this.enable = function(t) {
  53865. c[t] !== !0 && (e.enable(t),
  53866. c[t] = !0)
  53867. }
  53868. ,
  53869. this.disable = function(t) {
  53870. c[t] !== !1 && (e.disable(t),
  53871. c[t] = !1)
  53872. }
  53873. ,
  53874. this.getCompressedTextureFormats = function() {
  53875. if (null === h && (h = [],
  53876. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  53877. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  53878. h.push(i[n]);
  53879. return h
  53880. }
  53881. ,
  53882. this.setBlending = function(t, r, o, a, s, l, c, h) {
  53883. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  53884. t === u && h === A || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53885. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  53886. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53887. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  53888. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53889. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  53890. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53891. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53892. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  53893. u = t,
  53894. A = h),
  53895. t === n.CustomBlending ? (s = s || r,
  53896. l = l || o,
  53897. c = c || a,
  53898. r === d && s === g || (e.blendEquationSeparate(i(r), i(s)),
  53899. d = r,
  53900. g = s),
  53901. o === p && a === f && l === m && c === v || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  53902. p = o,
  53903. f = a,
  53904. m = l,
  53905. v = c)) : (d = null,
  53906. p = null,
  53907. f = null,
  53908. g = null,
  53909. m = null,
  53910. v = null)
  53911. }
  53912. ,
  53913. this.setDepthFunc = function(t) {
  53914. if (y !== t) {
  53915. if (t)
  53916. switch (t) {
  53917. case n.NeverDepth:
  53918. e.depthFunc(e.NEVER);
  53919. break;
  53920. case n.AlwaysDepth:
  53921. e.depthFunc(e.ALWAYS);
  53922. break;
  53923. case n.LessDepth:
  53924. e.depthFunc(e.LESS);
  53925. break;
  53926. case n.LessEqualDepth:
  53927. e.depthFunc(e.LEQUAL);
  53928. break;
  53929. case n.EqualDepth:
  53930. e.depthFunc(e.EQUAL);
  53931. break;
  53932. case n.GreaterEqualDepth:
  53933. e.depthFunc(e.GEQUAL);
  53934. break;
  53935. case n.GreaterDepth:
  53936. e.depthFunc(e.GREATER);
  53937. break;
  53938. case n.NotEqualDepth:
  53939. e.depthFunc(e.NOTEQUAL);
  53940. break;
  53941. default:
  53942. e.depthFunc(e.LEQUAL)
  53943. }
  53944. else
  53945. e.depthFunc(e.LEQUAL);
  53946. y = t
  53947. }
  53948. }
  53949. ,
  53950. this.setDepthTest = function(t) {
  53951. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  53952. }
  53953. ,
  53954. this.setDepthWrite = function(t) {
  53955. C !== t && (e.depthMask(t),
  53956. C = t)
  53957. }
  53958. ,
  53959. this.setColorWrite = function(t) {
  53960. I !== t && (e.colorMask(t, t, t, t),
  53961. I = t)
  53962. }
  53963. ,
  53964. this.setStencilFunc = function(t, i, n) {
  53965. b === t && w === i && _ === n || (e.stencilFunc(t, i, n),
  53966. b = t,
  53967. w = i,
  53968. _ = n)
  53969. }
  53970. ,
  53971. this.setStencilOp = function(t, i, n) {
  53972. T === t && x === i && S === n || (e.stencilOp(t, i, n),
  53973. T = t,
  53974. x = i,
  53975. S = n)
  53976. }
  53977. ,
  53978. this.setStencilTest = function(t) {
  53979. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  53980. }
  53981. ,
  53982. this.setStencilWrite = function(t) {
  53983. E !== t && (e.stencilMask(t),
  53984. E = t)
  53985. }
  53986. ,
  53987. this.setFlipSided = function(t) {
  53988. M !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  53989. M = t)
  53990. }
  53991. ,
  53992. this.setLineWidth = function(t) {
  53993. t !== R && (e.lineWidth(t),
  53994. R = t)
  53995. }
  53996. ,
  53997. this.setPolygonOffset = function(t, i, n) {
  53998. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  53999. !t || P === i && O === n || (e.polygonOffset(i, n),
  54000. P = i,
  54001. O = n)
  54002. }
  54003. ,
  54004. this.getScissorTest = function() {
  54005. return L
  54006. }
  54007. ,
  54008. this.setScissorTest = function(t) {
  54009. L = t,
  54010. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  54011. }
  54012. ,
  54013. this.activeTexture = function(t) {
  54014. void 0 === t && (t = e.TEXTURE0 + D - 1),
  54015. N !== t && (e.activeTexture(t),
  54016. N = t)
  54017. }
  54018. ,
  54019. this.bindTexture = function(t, i) {
  54020. void 0 === N && r.activeTexture();
  54021. var n = B[N];
  54022. void 0 === n && (n = {
  54023. type: void 0,
  54024. texture: void 0
  54025. },
  54026. B[N] = n),
  54027. n.type === t && n.texture === i || (e.bindTexture(t, i || G),
  54028. n.type = t,
  54029. n.texture = i)
  54030. }
  54031. ,
  54032. this.compressedTexImage2D = function() {
  54033. try {
  54034. e.compressedTexImage2D.apply(e, arguments)
  54035. } catch (e) {
  54036. console.error(e)
  54037. }
  54038. }
  54039. ,
  54040. this.texImage2D = function() {
  54041. try {
  54042. e.texImage2D.apply(e, arguments)
  54043. } catch (e) {
  54044. console.error(e)
  54045. }
  54046. }
  54047. ,
  54048. this.clearColor = function(t, i, n, r) {
  54049. o.set(t, i, n, r),
  54050. F.equals(o) === !1 && (e.clearColor(t, i, n, r),
  54051. F.copy(o))
  54052. }
  54053. ,
  54054. this.clearDepth = function(t) {
  54055. V !== t && (e.clearDepth(t),
  54056. V = t)
  54057. }
  54058. ,
  54059. this.clearStencil = function(t) {
  54060. U !== t && (e.clearStencil(t),
  54061. U = t)
  54062. }
  54063. ,
  54064. this.scissor = function(t) {
  54065. k.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  54066. k.copy(t))
  54067. }
  54068. ,
  54069. this.viewport = function(t) {
  54070. H.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  54071. H.copy(t))
  54072. }
  54073. ,
  54074. this.reset = function() {
  54075. for (var t = 0; t < s.length; t++)
  54076. 1 === s[t] && (e.disableVertexAttribArray(t),
  54077. s[t] = 0);
  54078. c = {},
  54079. h = null,
  54080. N = void 0,
  54081. B = {},
  54082. u = null,
  54083. I = null,
  54084. C = null,
  54085. E = null,
  54086. M = null
  54087. }
  54088. }
  54089. ,
  54090. n.LensFlarePlugin = function(e, t) {
  54091. function i() {
  54092. var e = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1])
  54093. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  54094. o = p.createBuffer(),
  54095. a = p.createBuffer(),
  54096. p.bindBuffer(p.ARRAY_BUFFER, o),
  54097. p.bufferData(p.ARRAY_BUFFER, e, p.STATIC_DRAW),
  54098. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  54099. p.bufferData(p.ELEMENT_ARRAY_BUFFER, t, p.STATIC_DRAW),
  54100. u = p.createTexture(),
  54101. d = p.createTexture(),
  54102. f.bindTexture(p.TEXTURE_2D, u),
  54103. p.texImage2D(p.TEXTURE_2D, 0, p.RGB, 16, 16, 0, p.RGB, p.UNSIGNED_BYTE, null),
  54104. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  54105. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  54106. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  54107. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  54108. f.bindTexture(p.TEXTURE_2D, d),
  54109. p.texImage2D(p.TEXTURE_2D, 0, p.RGBA, 16, 16, 0, p.RGBA, p.UNSIGNED_BYTE, null),
  54110. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  54111. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  54112. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  54113. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  54114. h = p.getParameter(p.MAX_VERTEX_TEXTURE_IMAGE_UNITS) > 0;
  54115. var i;
  54116. i = h ? {
  54117. 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"),
  54118. 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")
  54119. } : {
  54120. 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"),
  54121. 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")
  54122. },
  54123. s = r(i),
  54124. l = {
  54125. vertex: p.getAttribLocation(s, "position"),
  54126. uv: p.getAttribLocation(s, "uv")
  54127. },
  54128. c = {
  54129. renderType: p.getUniformLocation(s, "renderType"),
  54130. map: p.getUniformLocation(s, "map"),
  54131. occlusionMap: p.getUniformLocation(s, "occlusionMap"),
  54132. opacity: p.getUniformLocation(s, "opacity"),
  54133. color: p.getUniformLocation(s, "color"),
  54134. scale: p.getUniformLocation(s, "scale"),
  54135. rotation: p.getUniformLocation(s, "rotation"),
  54136. screenPosition: p.getUniformLocation(s, "screenPosition")
  54137. }
  54138. }
  54139. function r(t) {
  54140. var i = p.createProgram()
  54141. , n = p.createShader(p.FRAGMENT_SHADER)
  54142. , r = p.createShader(p.VERTEX_SHADER)
  54143. , o = "precision " + e.getPrecision() + " float;\n";
  54144. return p.shaderSource(n, o + t.fragmentShader),
  54145. p.shaderSource(r, o + t.vertexShader),
  54146. p.compileShader(n),
  54147. p.compileShader(r),
  54148. p.attachShader(i, n),
  54149. p.attachShader(i, r),
  54150. p.linkProgram(i),
  54151. i
  54152. }
  54153. var o, a, s, l, c, h, u, d, p = e.context, f = e.state;
  54154. this.render = function(r, g, m) {
  54155. if (0 !== t.length) {
  54156. var v = new n.Vector3
  54157. , A = m.w / m.z
  54158. , y = .5 * m.z
  54159. , C = .5 * m.w
  54160. , I = 16 / m.w
  54161. , E = new n.Vector2(I * A,I)
  54162. , b = new n.Vector3(1,1,0)
  54163. , w = new n.Vector2(1,1);
  54164. void 0 === s && i(),
  54165. p.useProgram(s),
  54166. f.initAttributes(),
  54167. f.enableAttribute(l.vertex),
  54168. f.enableAttribute(l.uv),
  54169. f.disableUnusedAttributes(),
  54170. p.uniform1i(c.occlusionMap, 0),
  54171. p.uniform1i(c.map, 1),
  54172. p.bindBuffer(p.ARRAY_BUFFER, o),
  54173. p.vertexAttribPointer(l.vertex, 2, p.FLOAT, !1, 16, 0),
  54174. p.vertexAttribPointer(l.uv, 2, p.FLOAT, !1, 16, 8),
  54175. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  54176. f.disable(p.CULL_FACE),
  54177. f.setDepthWrite(!1);
  54178. for (var _ = 0, T = t.length; _ < T; _++) {
  54179. I = 16 / m.w,
  54180. E.set(I * A, I);
  54181. var x = t[_];
  54182. if (v.set(x.matrixWorld.elements[12], x.matrixWorld.elements[13], x.matrixWorld.elements[14]),
  54183. v.applyMatrix4(g.matrixWorldInverse),
  54184. v.applyProjection(g.projectionMatrix),
  54185. b.copy(v),
  54186. w.x = b.x * y + y,
  54187. w.y = b.y * C + C,
  54188. h || w.x > 0 && w.x < m.z && w.y > 0 && w.y < m.w) {
  54189. f.activeTexture(p.TEXTURE0),
  54190. f.bindTexture(p.TEXTURE_2D, null),
  54191. f.activeTexture(p.TEXTURE1),
  54192. f.bindTexture(p.TEXTURE_2D, u),
  54193. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGB, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  54194. p.uniform1i(c.renderType, 0),
  54195. p.uniform2f(c.scale, E.x, E.y),
  54196. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  54197. f.disable(p.BLEND),
  54198. f.enable(p.DEPTH_TEST),
  54199. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  54200. f.activeTexture(p.TEXTURE0),
  54201. f.bindTexture(p.TEXTURE_2D, d),
  54202. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGBA, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  54203. p.uniform1i(c.renderType, 1),
  54204. f.disable(p.DEPTH_TEST),
  54205. f.activeTexture(p.TEXTURE1),
  54206. f.bindTexture(p.TEXTURE_2D, u),
  54207. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  54208. x.positionScreen.copy(b),
  54209. x.customUpdateCallback ? x.customUpdateCallback(x) : x.updateLensFlares(),
  54210. p.uniform1i(c.renderType, 2),
  54211. f.enable(p.BLEND);
  54212. for (var S = 0, M = x.lensFlares.length; S < M; S++) {
  54213. var R = x.lensFlares[S];
  54214. R.opacity > .001 && R.scale > .001 && (b.x = R.x,
  54215. b.y = R.y,
  54216. b.z = R.z,
  54217. I = R.size * R.scale / m.w,
  54218. E.x = I * A,
  54219. E.y = I,
  54220. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  54221. p.uniform2f(c.scale, E.x, E.y),
  54222. p.uniform1f(c.rotation, R.rotation),
  54223. p.uniform1f(c.opacity, R.opacity),
  54224. p.uniform3f(c.color, R.color.r, R.color.g, R.color.b),
  54225. f.setBlending(R.blending, R.blendEquation, R.blendSrc, R.blendDst),
  54226. e.setTexture(R.texture, 1),
  54227. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0))
  54228. }
  54229. }
  54230. }
  54231. f.enable(p.CULL_FACE),
  54232. f.enable(p.DEPTH_TEST),
  54233. f.setDepthWrite(!0),
  54234. e.resetGLState()
  54235. }
  54236. }
  54237. }
  54238. ,
  54239. n.SpritePlugin = function(e, t) {
  54240. function i() {
  54241. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  54242. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  54243. a = d.createBuffer(),
  54244. s = d.createBuffer(),
  54245. d.bindBuffer(d.ARRAY_BUFFER, a),
  54246. d.bufferData(d.ARRAY_BUFFER, e, d.STATIC_DRAW),
  54247. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  54248. d.bufferData(d.ELEMENT_ARRAY_BUFFER, t, d.STATIC_DRAW),
  54249. l = r(),
  54250. c = {
  54251. position: d.getAttribLocation(l, "position"),
  54252. uv: d.getAttribLocation(l, "uv")
  54253. },
  54254. h = {
  54255. uvOffset: d.getUniformLocation(l, "uvOffset"),
  54256. uvScale: d.getUniformLocation(l, "uvScale"),
  54257. rotation: d.getUniformLocation(l, "rotation"),
  54258. scale: d.getUniformLocation(l, "scale"),
  54259. color: d.getUniformLocation(l, "color"),
  54260. map: d.getUniformLocation(l, "map"),
  54261. opacity: d.getUniformLocation(l, "opacity"),
  54262. modelViewMatrix: d.getUniformLocation(l, "modelViewMatrix"),
  54263. projectionMatrix: d.getUniformLocation(l, "projectionMatrix"),
  54264. fogType: d.getUniformLocation(l, "fogType"),
  54265. fogDensity: d.getUniformLocation(l, "fogDensity"),
  54266. fogNear: d.getUniformLocation(l, "fogNear"),
  54267. fogFar: d.getUniformLocation(l, "fogFar"),
  54268. fogColor: d.getUniformLocation(l, "fogColor"),
  54269. alphaTest: d.getUniformLocation(l, "alphaTest")
  54270. };
  54271. var i = document.createElement("canvas");
  54272. i.width = 8,
  54273. i.height = 8;
  54274. var o = i.getContext("2d");
  54275. o.fillStyle = "white",
  54276. o.fillRect(0, 0, 8, 8),
  54277. u = new n.Texture(i),
  54278. u.needsUpdate = !0
  54279. }
  54280. function r() {
  54281. var t = d.createProgram()
  54282. , i = d.createShader(d.VERTEX_SHADER)
  54283. , n = d.createShader(d.FRAGMENT_SHADER);
  54284. 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")),
  54285. 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")),
  54286. d.compileShader(i),
  54287. d.compileShader(n),
  54288. d.attachShader(t, i),
  54289. d.attachShader(t, n),
  54290. d.linkProgram(t),
  54291. t
  54292. }
  54293. function o(e, t) {
  54294. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  54295. }
  54296. 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;
  54297. this.render = function(r, v) {
  54298. if (0 !== t.length) {
  54299. void 0 === l && i(),
  54300. d.useProgram(l),
  54301. p.initAttributes(),
  54302. p.enableAttribute(c.position),
  54303. p.enableAttribute(c.uv),
  54304. p.disableUnusedAttributes(),
  54305. p.disable(d.CULL_FACE),
  54306. p.enable(d.BLEND),
  54307. d.bindBuffer(d.ARRAY_BUFFER, a),
  54308. d.vertexAttribPointer(c.position, 2, d.FLOAT, !1, 16, 0),
  54309. d.vertexAttribPointer(c.uv, 2, d.FLOAT, !1, 16, 8),
  54310. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  54311. d.uniformMatrix4fv(h.projectionMatrix, !1, v.projectionMatrix.elements),
  54312. p.activeTexture(d.TEXTURE0),
  54313. d.uniform1i(h.map, 0);
  54314. var A = 0
  54315. , y = 0
  54316. , C = r.fog;
  54317. C ? (d.uniform3f(h.fogColor, C.color.r, C.color.g, C.color.b),
  54318. C instanceof n.Fog ? (d.uniform1f(h.fogNear, C.near),
  54319. d.uniform1f(h.fogFar, C.far),
  54320. d.uniform1i(h.fogType, 1),
  54321. A = 1,
  54322. y = 1) : C instanceof n.FogExp2 && (d.uniform1f(h.fogDensity, C.density),
  54323. d.uniform1i(h.fogType, 2),
  54324. A = 2,
  54325. y = 2)) : (d.uniform1i(h.fogType, 0),
  54326. A = 0,
  54327. y = 0);
  54328. for (var I = 0, E = t.length; I < E; I++) {
  54329. var b = t[I];
  54330. b.modelViewMatrix.multiplyMatrices(v.matrixWorldInverse, b.matrixWorld),
  54331. b.z = -b.modelViewMatrix.elements[14]
  54332. }
  54333. t.sort(o);
  54334. for (var w = [], I = 0, E = t.length; I < E; I++) {
  54335. var b = t[I]
  54336. , _ = b.material;
  54337. d.uniform1f(h.alphaTest, _.alphaTest),
  54338. d.uniformMatrix4fv(h.modelViewMatrix, !1, b.modelViewMatrix.elements),
  54339. b.matrixWorld.decompose(f, g, m),
  54340. w[0] = m.x,
  54341. w[1] = m.y;
  54342. var T = 0;
  54343. r.fog && _.fog && (T = y),
  54344. A !== T && (d.uniform1i(h.fogType, T),
  54345. A = T),
  54346. null !== _.map ? (d.uniform2f(h.uvOffset, _.map.offset.x, _.map.offset.y),
  54347. d.uniform2f(h.uvScale, _.map.repeat.x, _.map.repeat.y)) : (d.uniform2f(h.uvOffset, 0, 0),
  54348. d.uniform2f(h.uvScale, 1, 1)),
  54349. d.uniform1f(h.opacity, _.opacity),
  54350. d.uniform3f(h.color, _.color.r, _.color.g, _.color.b),
  54351. d.uniform1f(h.rotation, _.rotation),
  54352. d.uniform2fv(h.scale, w),
  54353. p.setBlending(_.blending, _.blendEquation, _.blendSrc, _.blendDst),
  54354. p.setDepthTest(_.depthTest),
  54355. p.setDepthWrite(_.depthWrite),
  54356. _.map && _.map.image && _.map.image.width ? e.setTexture(_.map, 0) : e.setTexture(u, 0),
  54357. d.drawElements(d.TRIANGLES, 6, d.UNSIGNED_SHORT, 0)
  54358. }
  54359. p.enable(d.CULL_FACE),
  54360. e.resetGLState()
  54361. }
  54362. }
  54363. }
  54364. ,
  54365. Object.defineProperties(n.Box2.prototype, {
  54366. empty: {
  54367. value: function() {
  54368. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  54369. this.isEmpty()
  54370. }
  54371. },
  54372. isIntersectionBox: {
  54373. value: function(e) {
  54374. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  54375. this.intersectsBox(e)
  54376. }
  54377. }
  54378. }),
  54379. Object.defineProperties(n.Box3.prototype, {
  54380. empty: {
  54381. value: function() {
  54382. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  54383. this.isEmpty()
  54384. }
  54385. },
  54386. isIntersectionBox: {
  54387. value: function(e) {
  54388. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  54389. this.intersectsBox(e)
  54390. }
  54391. },
  54392. isIntersectionSphere: {
  54393. value: function(e) {
  54394. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  54395. this.intersectsSphere(e)
  54396. }
  54397. }
  54398. }),
  54399. Object.defineProperties(n.Matrix3.prototype, {
  54400. multiplyVector3: {
  54401. value: function(e) {
  54402. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  54403. e.applyMatrix3(this)
  54404. }
  54405. },
  54406. multiplyVector3Array: {
  54407. value: function(e) {
  54408. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  54409. this.applyToVector3Array(e)
  54410. }
  54411. }
  54412. }),
  54413. Object.defineProperties(n.Matrix4.prototype, {
  54414. extractPosition: {
  54415. value: function(e) {
  54416. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  54417. this.copyPosition(e)
  54418. }
  54419. },
  54420. setRotationFromQuaternion: {
  54421. value: function(e) {
  54422. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  54423. this.makeRotationFromQuaternion(e)
  54424. }
  54425. },
  54426. multiplyVector3: {
  54427. value: function(e) {
  54428. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  54429. e.applyProjection(this)
  54430. }
  54431. },
  54432. multiplyVector4: {
  54433. value: function(e) {
  54434. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  54435. e.applyMatrix4(this)
  54436. }
  54437. },
  54438. multiplyVector3Array: {
  54439. value: function(e) {
  54440. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  54441. this.applyToVector3Array(e)
  54442. }
  54443. },
  54444. rotateAxis: {
  54445. value: function(e) {
  54446. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  54447. e.transformDirection(this)
  54448. }
  54449. },
  54450. crossVector: {
  54451. value: function(e) {
  54452. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  54453. e.applyMatrix4(this)
  54454. }
  54455. },
  54456. translate: {
  54457. value: function(e) {
  54458. console.error("THREE.Matrix4: .translate() has been removed.")
  54459. }
  54460. },
  54461. rotateX: {
  54462. value: function(e) {
  54463. console.error("THREE.Matrix4: .rotateX() has been removed.")
  54464. }
  54465. },
  54466. rotateY: {
  54467. value: function(e) {
  54468. console.error("THREE.Matrix4: .rotateY() has been removed.")
  54469. }
  54470. },
  54471. rotateZ: {
  54472. value: function(e) {
  54473. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  54474. }
  54475. },
  54476. rotateByAxis: {
  54477. value: function(e, t) {
  54478. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  54479. }
  54480. }
  54481. }),
  54482. Object.defineProperties(n.Plane.prototype, {
  54483. isIntersectionLine: {
  54484. value: function(e) {
  54485. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  54486. this.intersectsLine(e)
  54487. }
  54488. }
  54489. }),
  54490. Object.defineProperties(n.Quaternion.prototype, {
  54491. multiplyVector3: {
  54492. value: function(e) {
  54493. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  54494. e.applyQuaternion(this)
  54495. }
  54496. }
  54497. }),
  54498. Object.defineProperties(n.Ray.prototype, {
  54499. isIntersectionBox: {
  54500. value: function(e) {
  54501. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  54502. this.intersectsBox(e)
  54503. }
  54504. },
  54505. isIntersectionPlane: {
  54506. value: function(e) {
  54507. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  54508. this.intersectsPlane(e)
  54509. }
  54510. },
  54511. isIntersectionSphere: {
  54512. value: function(e) {
  54513. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  54514. this.intersectsSphere(e)
  54515. }
  54516. }
  54517. }),
  54518. Object.defineProperties(n.Vector3.prototype, {
  54519. setEulerFromRotationMatrix: {
  54520. value: function() {
  54521. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  54522. }
  54523. },
  54524. setEulerFromQuaternion: {
  54525. value: function() {
  54526. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  54527. }
  54528. },
  54529. getPositionFromMatrix: {
  54530. value: function(e) {
  54531. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  54532. this.setFromMatrixPosition(e)
  54533. }
  54534. },
  54535. getScaleFromMatrix: {
  54536. value: function(e) {
  54537. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  54538. this.setFromMatrixScale(e)
  54539. }
  54540. },
  54541. getColumnFromMatrix: {
  54542. value: function(e, t) {
  54543. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  54544. this.setFromMatrixColumn(e, t)
  54545. }
  54546. }
  54547. }),
  54548. n.Face4 = function(e, t, i, r, o, a, s) {
  54549. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  54550. new n.Face3(e,t,i,o,a,s)
  54551. }
  54552. ,
  54553. n.Vertex = function(e, t, i) {
  54554. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  54555. new n.Vector3(e,t,i)
  54556. }
  54557. ,
  54558. Object.defineProperties(n.Object3D.prototype, {
  54559. eulerOrder: {
  54560. get: function() {
  54561. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  54562. this.rotation.order
  54563. },
  54564. set: function(e) {
  54565. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  54566. this.rotation.order = e
  54567. }
  54568. },
  54569. getChildByName: {
  54570. value: function(e) {
  54571. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  54572. this.getObjectByName(e)
  54573. }
  54574. },
  54575. renderDepth: {
  54576. set: function(e) {
  54577. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  54578. }
  54579. },
  54580. translate: {
  54581. value: function(e, t) {
  54582. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  54583. this.translateOnAxis(t, e)
  54584. }
  54585. },
  54586. useQuaternion: {
  54587. get: function() {
  54588. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  54589. },
  54590. set: function(e) {
  54591. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  54592. }
  54593. }
  54594. }),
  54595. Object.defineProperties(n, {
  54596. PointCloud: {
  54597. value: function(e, t) {
  54598. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  54599. new n.Points(e,t)
  54600. }
  54601. },
  54602. ParticleSystem: {
  54603. value: function(e, t) {
  54604. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  54605. new n.Points(e,t)
  54606. }
  54607. }
  54608. }),
  54609. Object.defineProperties(n.Light.prototype, {
  54610. onlyShadow: {
  54611. set: function(e) {
  54612. console.warn("THREE.Light: .onlyShadow has been removed.")
  54613. }
  54614. },
  54615. shadowCameraFov: {
  54616. set: function(e) {
  54617. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  54618. this.shadow.camera.fov = e
  54619. }
  54620. },
  54621. shadowCameraLeft: {
  54622. set: function(e) {
  54623. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  54624. this.shadow.camera.left = e
  54625. }
  54626. },
  54627. shadowCameraRight: {
  54628. set: function(e) {
  54629. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  54630. this.shadow.camera.right = e
  54631. }
  54632. },
  54633. shadowCameraTop: {
  54634. set: function(e) {
  54635. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  54636. this.shadow.camera.top = e
  54637. }
  54638. },
  54639. shadowCameraBottom: {
  54640. set: function(e) {
  54641. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  54642. this.shadow.camera.bottom = e
  54643. }
  54644. },
  54645. shadowCameraNear: {
  54646. set: function(e) {
  54647. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  54648. this.shadow.camera.near = e
  54649. }
  54650. },
  54651. shadowCameraFar: {
  54652. set: function(e) {
  54653. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  54654. this.shadow.camera.far = e
  54655. }
  54656. },
  54657. shadowCameraVisible: {
  54658. set: function(e) {
  54659. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  54660. }
  54661. },
  54662. shadowBias: {
  54663. set: function(e) {
  54664. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  54665. this.shadow.bias = e
  54666. }
  54667. },
  54668. shadowDarkness: {
  54669. set: function(e) {
  54670. console.warn("THREE.Light: .shadowDarkness has been removed.")
  54671. }
  54672. },
  54673. shadowMapWidth: {
  54674. set: function(e) {
  54675. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  54676. this.shadow.mapSize.width = e
  54677. }
  54678. },
  54679. shadowMapHeight: {
  54680. set: function(e) {
  54681. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  54682. this.shadow.mapSize.height = e
  54683. }
  54684. }
  54685. }),
  54686. Object.defineProperties(n.BufferAttribute.prototype, {
  54687. length: {
  54688. get: function() {
  54689. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  54690. this.array.length
  54691. }
  54692. }
  54693. }),
  54694. Object.defineProperties(n.BufferGeometry.prototype, {
  54695. drawcalls: {
  54696. get: function() {
  54697. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  54698. this.groups
  54699. }
  54700. },
  54701. offsets: {
  54702. get: function() {
  54703. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  54704. this.groups
  54705. }
  54706. },
  54707. addIndex: {
  54708. value: function(e) {
  54709. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  54710. this.setIndex(e)
  54711. }
  54712. },
  54713. addDrawCall: {
  54714. value: function(e, t, i) {
  54715. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  54716. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  54717. this.addGroup(e, t)
  54718. }
  54719. },
  54720. clearDrawCalls: {
  54721. value: function() {
  54722. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  54723. this.clearGroups()
  54724. }
  54725. },
  54726. computeTangents: {
  54727. value: function() {
  54728. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  54729. }
  54730. },
  54731. computeOffsets: {
  54732. value: function() {
  54733. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  54734. }
  54735. }
  54736. }),
  54737. Object.defineProperties(n.Material.prototype, {
  54738. wrapAround: {
  54739. get: function() {
  54740. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  54741. },
  54742. set: function(e) {
  54743. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  54744. }
  54745. },
  54746. wrapRGB: {
  54747. get: function() {
  54748. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  54749. new n.Color
  54750. }
  54751. }
  54752. }),
  54753. Object.defineProperties(n, {
  54754. PointCloudMaterial: {
  54755. value: function(e) {
  54756. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  54757. new n.PointsMaterial(e)
  54758. }
  54759. },
  54760. ParticleBasicMaterial: {
  54761. value: function(e) {
  54762. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  54763. new n.PointsMaterial(e)
  54764. }
  54765. },
  54766. ParticleSystemMaterial: {
  54767. value: function(e) {
  54768. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  54769. new n.PointsMaterial(e)
  54770. }
  54771. }
  54772. }),
  54773. Object.defineProperties(n.MeshPhongMaterial.prototype, {
  54774. metal: {
  54775. get: function() {
  54776. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  54777. !1
  54778. },
  54779. set: function(e) {
  54780. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  54781. }
  54782. }
  54783. }),
  54784. Object.defineProperties(n.ShaderMaterial.prototype, {
  54785. derivatives: {
  54786. get: function() {
  54787. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  54788. this.extensions.derivatives
  54789. },
  54790. set: function(e) {
  54791. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  54792. this.extensions.derivatives = e
  54793. }
  54794. }
  54795. }),
  54796. Object.defineProperties(n.WebGLRenderer.prototype, {
  54797. supportsFloatTextures: {
  54798. value: function() {
  54799. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  54800. this.extensions.get("OES_texture_float")
  54801. }
  54802. },
  54803. supportsHalfFloatTextures: {
  54804. value: function() {
  54805. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  54806. this.extensions.get("OES_texture_half_float")
  54807. }
  54808. },
  54809. supportsStandardDerivatives: {
  54810. value: function() {
  54811. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  54812. this.extensions.get("OES_standard_derivatives")
  54813. }
  54814. },
  54815. supportsCompressedTextureS3TC: {
  54816. value: function() {
  54817. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  54818. this.extensions.get("WEBGL_compressed_texture_s3tc")
  54819. }
  54820. },
  54821. supportsCompressedTexturePVRTC: {
  54822. value: function() {
  54823. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  54824. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  54825. }
  54826. },
  54827. supportsBlendMinMax: {
  54828. value: function() {
  54829. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  54830. this.extensions.get("EXT_blend_minmax")
  54831. }
  54832. },
  54833. supportsVertexTextures: {
  54834. value: function() {
  54835. return this.capabilities.vertexTextures
  54836. }
  54837. },
  54838. supportsInstancedArrays: {
  54839. value: function() {
  54840. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  54841. this.extensions.get("ANGLE_instanced_arrays")
  54842. }
  54843. },
  54844. enableScissorTest: {
  54845. value: function(e) {
  54846. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  54847. this.setScissorTest(e)
  54848. }
  54849. },
  54850. initMaterial: {
  54851. value: function() {
  54852. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  54853. }
  54854. },
  54855. addPrePlugin: {
  54856. value: function() {
  54857. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  54858. }
  54859. },
  54860. addPostPlugin: {
  54861. value: function() {
  54862. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  54863. }
  54864. },
  54865. updateShadowMap: {
  54866. value: function() {
  54867. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  54868. }
  54869. },
  54870. shadowMapEnabled: {
  54871. get: function() {
  54872. return this.shadowMap.enabled
  54873. },
  54874. set: function(e) {
  54875. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  54876. this.shadowMap.enabled = e
  54877. }
  54878. },
  54879. shadowMapType: {
  54880. get: function() {
  54881. return this.shadowMap.type
  54882. },
  54883. set: function(e) {
  54884. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  54885. this.shadowMap.type = e
  54886. }
  54887. },
  54888. shadowMapCullFace: {
  54889. get: function() {
  54890. return this.shadowMap.cullFace
  54891. },
  54892. set: function(e) {
  54893. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  54894. this.shadowMap.cullFace = e
  54895. }
  54896. }
  54897. }),
  54898. Object.defineProperties(n.WebGLRenderTarget.prototype, {
  54899. wrapS: {
  54900. get: function() {
  54901. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  54902. this.texture.wrapS
  54903. },
  54904. set: function(e) {
  54905. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  54906. this.texture.wrapS = e
  54907. }
  54908. },
  54909. wrapT: {
  54910. get: function() {
  54911. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  54912. this.texture.wrapT
  54913. },
  54914. set: function(e) {
  54915. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  54916. this.texture.wrapT = e
  54917. }
  54918. },
  54919. magFilter: {
  54920. get: function() {
  54921. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  54922. this.texture.magFilter
  54923. },
  54924. set: function(e) {
  54925. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  54926. this.texture.magFilter = e
  54927. }
  54928. },
  54929. minFilter: {
  54930. get: function() {
  54931. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  54932. this.texture.minFilter
  54933. },
  54934. set: function(e) {
  54935. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  54936. this.texture.minFilter = e
  54937. }
  54938. },
  54939. anisotropy: {
  54940. get: function() {
  54941. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  54942. this.texture.anisotropy
  54943. },
  54944. set: function(e) {
  54945. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  54946. this.texture.anisotropy = e
  54947. }
  54948. },
  54949. offset: {
  54950. get: function() {
  54951. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  54952. this.texture.offset
  54953. },
  54954. set: function(e) {
  54955. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  54956. this.texture.offset = e
  54957. }
  54958. },
  54959. repeat: {
  54960. get: function() {
  54961. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  54962. this.texture.repeat
  54963. },
  54964. set: function(e) {
  54965. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  54966. this.texture.repeat = e
  54967. }
  54968. },
  54969. format: {
  54970. get: function() {
  54971. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  54972. this.texture.format
  54973. },
  54974. set: function(e) {
  54975. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  54976. this.texture.format = e
  54977. }
  54978. },
  54979. type: {
  54980. get: function() {
  54981. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  54982. this.texture.type
  54983. },
  54984. set: function(e) {
  54985. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  54986. this.texture.type = e
  54987. }
  54988. },
  54989. generateMipmaps: {
  54990. get: function() {
  54991. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  54992. this.texture.generateMipmaps
  54993. },
  54994. set: function(e) {
  54995. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  54996. this.texture.generateMipmaps = e
  54997. }
  54998. }
  54999. }),
  55000. n.GeometryUtils = {
  55001. merge: function(e, t, i) {
  55002. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");
  55003. var r;
  55004. t instanceof n.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  55005. r = t.matrix,
  55006. t = t.geometry),
  55007. e.merge(t, r, i)
  55008. },
  55009. center: function(e) {
  55010. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  55011. e.center()
  55012. }
  55013. },
  55014. n.ImageUtils = {
  55015. crossOrigin: void 0,
  55016. loadTexture: function(e, t, i, r) {
  55017. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  55018. var o = new n.TextureLoader;
  55019. o.setCrossOrigin(this.crossOrigin);
  55020. var a = o.load(e, i, void 0, r);
  55021. return t && (a.mapping = t),
  55022. a
  55023. },
  55024. loadTextureCube: function(e, t, i, r) {
  55025. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  55026. var o = new n.CubeTextureLoader;
  55027. o.setCrossOrigin(this.crossOrigin);
  55028. var a = o.load(e, i, void 0, r);
  55029. return t && (a.mapping = t),
  55030. a
  55031. },
  55032. loadCompressedTexture: function() {
  55033. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  55034. },
  55035. loadCompressedTextureCube: function() {
  55036. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  55037. }
  55038. },
  55039. n.Projector = function() {
  55040. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  55041. this.projectVector = function(e, t) {
  55042. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  55043. e.project(t)
  55044. }
  55045. ,
  55046. this.unprojectVector = function(e, t) {
  55047. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  55048. e.unproject(t)
  55049. }
  55050. ,
  55051. this.pickingRay = function(e, t) {
  55052. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  55053. }
  55054. }
  55055. ,
  55056. n.CanvasRenderer = function() {
  55057. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  55058. this.domElement = document.createElement("canvas"),
  55059. this.clear = function() {}
  55060. ,
  55061. this.render = function() {}
  55062. ,
  55063. this.setClearColor = function() {}
  55064. ,
  55065. this.setSize = function() {}
  55066. }
  55067. ,
  55068. n.MeshFaceMaterial = n.MultiMaterial,
  55069. n.CurveUtils = {
  55070. tangentQuadraticBezier: function(e, t, i, n) {
  55071. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  55072. },
  55073. tangentCubicBezier: function(e, t, i, n, r) {
  55074. 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
  55075. },
  55076. tangentSpline: function(e, t, i, n, r) {
  55077. var o = 6 * e * e - 6 * e
  55078. , a = 3 * e * e - 4 * e + 1
  55079. , s = -6 * e * e + 6 * e
  55080. , l = 3 * e * e - 2 * e;
  55081. return o + a + s + l
  55082. },
  55083. interpolate: function(e, t, i, n, r) {
  55084. var o = .5 * (i - e)
  55085. , a = .5 * (n - t)
  55086. , s = r * r
  55087. , l = r * s;
  55088. return (2 * t - 2 * i + o + a) * l + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  55089. }
  55090. },
  55091. n.SceneUtils = {
  55092. createMultiMaterialObject: function(e, t) {
  55093. for (var i = new n.Group, r = 0, o = t.length; r < o; r++)
  55094. i.add(new n.Mesh(e,t[r]));
  55095. return i
  55096. },
  55097. detach: function(e, t, i) {
  55098. e.applyMatrix(t.matrixWorld),
  55099. t.remove(e),
  55100. i.add(e)
  55101. },
  55102. attach: function(e, t, i) {
  55103. var r = new n.Matrix4;
  55104. r.getInverse(i.matrixWorld),
  55105. e.applyMatrix(r),
  55106. t.remove(e),
  55107. i.add(e)
  55108. }
  55109. },
  55110. n.ShapeUtils = {
  55111. area: function(e) {
  55112. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  55113. i += e[n].x * e[r].y - e[r].x * e[n].y;
  55114. return .5 * i
  55115. },
  55116. triangulate: function() {
  55117. function e(e, t, i, n, r, o) {
  55118. var a, s, l, c, h, u, d, p, f;
  55119. if (s = e[o[t]].x,
  55120. l = e[o[t]].y,
  55121. c = e[o[i]].x,
  55122. h = e[o[i]].y,
  55123. u = e[o[n]].x,
  55124. d = e[o[n]].y,
  55125. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  55126. return !1;
  55127. var g, m, v, A, y, C, I, E, b, w, _, T, x, S, M;
  55128. for (g = u - c,
  55129. m = d - h,
  55130. v = s - u,
  55131. A = l - d,
  55132. y = c - s,
  55133. C = h - l,
  55134. a = 0; a < r; a++)
  55135. if (p = e[o[a]].x,
  55136. f = e[o[a]].y,
  55137. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = p - s,
  55138. E = f - l,
  55139. b = p - c,
  55140. w = f - h,
  55141. _ = p - u,
  55142. T = f - d,
  55143. M = g * w - m * b,
  55144. x = y * E - C * I,
  55145. S = v * T - A * _,
  55146. M >= -Number.EPSILON && S >= -Number.EPSILON && x >= -Number.EPSILON))
  55147. return !1;
  55148. return !0
  55149. }
  55150. return function(t, i) {
  55151. var r = t.length;
  55152. if (r < 3)
  55153. return null;
  55154. var o, a, s, l = [], c = [], h = [];
  55155. if (n.ShapeUtils.area(t) > 0)
  55156. for (a = 0; a < r; a++)
  55157. c[a] = a;
  55158. else
  55159. for (a = 0; a < r; a++)
  55160. c[a] = r - 1 - a;
  55161. var u = r
  55162. , d = 2 * u;
  55163. for (a = u - 1; u > 2; ) {
  55164. if (d-- <= 0)
  55165. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  55166. i ? h : l;
  55167. if (o = a,
  55168. u <= o && (o = 0),
  55169. a = o + 1,
  55170. u <= a && (a = 0),
  55171. s = a + 1,
  55172. u <= s && (s = 0),
  55173. e(t, o, a, s, u, c)) {
  55174. var p, f, g, m, v;
  55175. for (p = c[o],
  55176. f = c[a],
  55177. g = c[s],
  55178. l.push([t[p], t[f], t[g]]),
  55179. h.push([c[o], c[a], c[s]]),
  55180. m = a,
  55181. v = a + 1; v < u; m++,
  55182. v++)
  55183. c[m] = c[v];
  55184. u--,
  55185. d = 2 * u
  55186. }
  55187. }
  55188. return i ? h : l
  55189. }
  55190. }(),
  55191. triangulateShape: function(e, t) {
  55192. function i(e, t, i) {
  55193. 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
  55194. }
  55195. function r(e, t, n, r, o) {
  55196. var a = t.x - e.x
  55197. , s = t.y - e.y
  55198. , l = r.x - n.x
  55199. , c = r.y - n.y
  55200. , h = e.x - n.x
  55201. , u = e.y - n.y
  55202. , d = s * l - a * c
  55203. , p = s * h - a * u;
  55204. if (Math.abs(d) > Number.EPSILON) {
  55205. var f;
  55206. if (d > 0) {
  55207. if (p < 0 || p > d)
  55208. return [];
  55209. if (f = c * h - l * u,
  55210. f < 0 || f > d)
  55211. return []
  55212. } else {
  55213. if (p > 0 || p < d)
  55214. return [];
  55215. if (f = c * h - l * u,
  55216. f > 0 || f < d)
  55217. return []
  55218. }
  55219. if (0 === f)
  55220. return !o || 0 !== p && p !== d ? [e] : [];
  55221. if (f === d)
  55222. return !o || 0 !== p && p !== d ? [t] : [];
  55223. if (0 === p)
  55224. return [n];
  55225. if (p === d)
  55226. return [r];
  55227. var g = f / d;
  55228. return [{
  55229. x: e.x + g * a,
  55230. y: e.y + g * s
  55231. }]
  55232. }
  55233. if (0 !== p || c * h !== l * u)
  55234. return [];
  55235. var m = 0 === a && 0 === s
  55236. , v = 0 === l && 0 === c;
  55237. if (m && v)
  55238. return e.x !== n.x || e.y !== n.y ? [] : [e];
  55239. if (m)
  55240. return i(n, r, e) ? [e] : [];
  55241. if (v)
  55242. return i(e, t, n) ? [n] : [];
  55243. var A, y, C, I, E, b, w, _;
  55244. return 0 !== a ? (e.x < t.x ? (A = e,
  55245. C = e.x,
  55246. y = t,
  55247. I = t.x) : (A = t,
  55248. C = t.x,
  55249. y = e,
  55250. I = e.x),
  55251. n.x < r.x ? (E = n,
  55252. w = n.x,
  55253. b = r,
  55254. _ = r.x) : (E = r,
  55255. w = r.x,
  55256. b = n,
  55257. _ = n.x)) : (e.y < t.y ? (A = e,
  55258. C = e.y,
  55259. y = t,
  55260. I = t.y) : (A = t,
  55261. C = t.y,
  55262. y = e,
  55263. I = e.y),
  55264. n.y < r.y ? (E = n,
  55265. w = n.y,
  55266. b = r,
  55267. _ = r.y) : (E = r,
  55268. w = r.y,
  55269. b = n,
  55270. _ = n.y)),
  55271. C <= w ? I < w ? [] : I === w ? o ? [] : [E] : I <= _ ? [E, y] : [E, b] : C > _ ? [] : C === _ ? o ? [] : [A] : I <= _ ? [A, y] : [A, b]
  55272. }
  55273. function o(e, t, i, n) {
  55274. var r = t.x - e.x
  55275. , o = t.y - e.y
  55276. , a = i.x - e.x
  55277. , s = i.y - e.y
  55278. , l = n.x - e.x
  55279. , c = n.y - e.y
  55280. , h = r * s - o * a
  55281. , u = r * c - o * l;
  55282. if (Math.abs(h) > Number.EPSILON) {
  55283. var d = l * s - c * a;
  55284. return h > 0 ? u >= 0 && d >= 0 : u >= 0 || d >= 0
  55285. }
  55286. return u > 0
  55287. }
  55288. function a(e, t) {
  55289. function i(e, t) {
  55290. var i = A.length - 1
  55291. , n = e - 1;
  55292. n < 0 && (n = i);
  55293. var r = e + 1;
  55294. r > i && (r = 0);
  55295. var a = o(A[e], A[n], A[r], s[t]);
  55296. if (!a)
  55297. return !1;
  55298. var l = s.length - 1
  55299. , c = t - 1;
  55300. c < 0 && (c = l);
  55301. var h = t + 1;
  55302. return h > l && (h = 0),
  55303. a = o(s[t], s[c], s[h], A[e]),
  55304. !!a
  55305. }
  55306. function n(e, t) {
  55307. var i, n, o;
  55308. for (i = 0; i < A.length; i++)
  55309. if (n = i + 1,
  55310. n %= A.length,
  55311. o = r(e, t, A[i], A[n], !0),
  55312. o.length > 0)
  55313. return !0;
  55314. return !1
  55315. }
  55316. function a(e, i) {
  55317. var n, o, a, s, l;
  55318. for (n = 0; n < y.length; n++)
  55319. for (o = t[y[n]],
  55320. a = 0; a < o.length; a++)
  55321. if (s = a + 1,
  55322. s %= o.length,
  55323. l = r(e, i, o[a], o[s], !0),
  55324. l.length > 0)
  55325. return !0;
  55326. return !1
  55327. }
  55328. 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++)
  55329. y.push(I);
  55330. for (var b = 0, w = 2 * y.length; y.length > 0; ) {
  55331. if (w--,
  55332. w < 0) {
  55333. console.log("Infinite Loop! Holes left:" + y.length + ", Probably Hole outside Shape!");
  55334. break
  55335. }
  55336. for (c = b; c < A.length; c++) {
  55337. h = A[c],
  55338. l = -1;
  55339. for (var I = 0; I < y.length; I++)
  55340. if (d = y[I],
  55341. p = h.x + ":" + h.y + ":" + d,
  55342. void 0 === C[p]) {
  55343. s = t[d];
  55344. for (var _ = 0; _ < s.length; _++)
  55345. if (u = s[_],
  55346. i(c, _) && !n(h, u) && !a(h, u)) {
  55347. l = _,
  55348. y.splice(I, 1),
  55349. f = A.slice(0, c + 1),
  55350. g = A.slice(c),
  55351. m = s.slice(l),
  55352. v = s.slice(0, l + 1),
  55353. A = f.concat(m).concat(v).concat(g),
  55354. b = c;
  55355. break
  55356. }
  55357. if (l >= 0)
  55358. break;
  55359. C[p] = !0
  55360. }
  55361. if (l >= 0)
  55362. break
  55363. }
  55364. }
  55365. return A
  55366. }
  55367. for (var s, l, c, h, u, d, p = {}, f = e.concat(), g = 0, m = t.length; g < m; g++)
  55368. Array.prototype.push.apply(f, t[g]);
  55369. for (s = 0,
  55370. l = f.length; s < l; s++)
  55371. u = f[s].x + ":" + f[s].y,
  55372. void 0 !== p[u] && console.warn("THREE.Shape: Duplicate point", u),
  55373. p[u] = s;
  55374. var v = a(e, t)
  55375. , A = n.ShapeUtils.triangulate(v, !1);
  55376. for (s = 0,
  55377. l = A.length; s < l; s++)
  55378. for (h = A[s],
  55379. c = 0; c < 3; c++)
  55380. u = h[c].x + ":" + h[c].y,
  55381. d = p[u],
  55382. void 0 !== d && (h[c] = d);
  55383. return A.concat()
  55384. },
  55385. isClockWise: function(e) {
  55386. return n.ShapeUtils.area(e) < 0
  55387. },
  55388. b2: function() {
  55389. function e(e, t) {
  55390. var i = 1 - e;
  55391. return i * i * t
  55392. }
  55393. function t(e, t) {
  55394. return 2 * (1 - e) * e * t
  55395. }
  55396. function i(e, t) {
  55397. return e * e * t
  55398. }
  55399. return function(n, r, o, a) {
  55400. return e(n, r) + t(n, o) + i(n, a)
  55401. }
  55402. }(),
  55403. b3: function() {
  55404. function e(e, t) {
  55405. var i = 1 - e;
  55406. return i * i * i * t
  55407. }
  55408. function t(e, t) {
  55409. var i = 1 - e;
  55410. return 3 * i * i * e * t
  55411. }
  55412. function i(e, t) {
  55413. var i = 1 - e;
  55414. return 3 * i * e * e * t
  55415. }
  55416. function n(e, t) {
  55417. return e * e * e * t
  55418. }
  55419. return function(r, o, a, s, l) {
  55420. return e(r, o) + t(r, a) + i(r, s) + n(r, l)
  55421. }
  55422. }()
  55423. },
  55424. n.Curve = function() {}
  55425. ,
  55426. n.Curve.prototype = {
  55427. constructor: n.Curve,
  55428. getPoint: function(e) {
  55429. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  55430. null
  55431. },
  55432. getPointAt: function(e) {
  55433. var t = this.getUtoTmapping(e);
  55434. return this.getPoint(t)
  55435. },
  55436. getPoints: function(e) {
  55437. e || (e = 5);
  55438. var t, i = [];
  55439. for (t = 0; t <= e; t++)
  55440. i.push(this.getPoint(t / e));
  55441. return i
  55442. },
  55443. getSpacedPoints: function(e) {
  55444. e || (e = 5);
  55445. var t, i = [];
  55446. for (t = 0; t <= e; t++)
  55447. i.push(this.getPointAt(t / e));
  55448. return i
  55449. },
  55450. getLength: function() {
  55451. var e = this.getLengths();
  55452. return e[e.length - 1]
  55453. },
  55454. getLengths: function(e) {
  55455. if (e || (e = this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  55456. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  55457. return this.cacheArcLengths;
  55458. this.needsUpdate = !1;
  55459. var t, i, n = [], r = this.getPoint(0), o = 0;
  55460. for (n.push(0),
  55461. i = 1; i <= e; i++)
  55462. t = this.getPoint(i / e),
  55463. o += t.distanceTo(r),
  55464. n.push(o),
  55465. r = t;
  55466. return this.cacheArcLengths = n,
  55467. n
  55468. },
  55469. updateArcLengths: function() {
  55470. this.needsUpdate = !0,
  55471. this.getLengths()
  55472. },
  55473. getUtoTmapping: function(e, t) {
  55474. var i, n = this.getLengths(), r = 0, o = n.length;
  55475. i = t ? t : e * n[o - 1];
  55476. for (var a, s = 0, l = o - 1; s <= l; )
  55477. if (r = Math.floor(s + (l - s) / 2),
  55478. a = n[r] - i,
  55479. a < 0)
  55480. s = r + 1;
  55481. else {
  55482. if (!(a > 0)) {
  55483. l = r;
  55484. break
  55485. }
  55486. l = r - 1
  55487. }
  55488. if (r = l,
  55489. n[r] === i) {
  55490. var c = r / (o - 1);
  55491. return c
  55492. }
  55493. var h = n[r]
  55494. , u = n[r + 1]
  55495. , d = u - h
  55496. , p = (i - h) / d
  55497. , c = (r + p) / (o - 1);
  55498. return c
  55499. },
  55500. getTangent: function(e) {
  55501. var t = 1e-4
  55502. , i = e - t
  55503. , n = e + t;
  55504. i < 0 && (i = 0),
  55505. n > 1 && (n = 1);
  55506. var r = this.getPoint(i)
  55507. , o = this.getPoint(n)
  55508. , a = o.clone().sub(r);
  55509. return a.normalize()
  55510. },
  55511. getTangentAt: function(e) {
  55512. var t = this.getUtoTmapping(e);
  55513. return this.getTangent(t)
  55514. }
  55515. },
  55516. n.Curve.create = function(e, t) {
  55517. return e.prototype = Object.create(n.Curve.prototype),
  55518. e.prototype.constructor = e,
  55519. e.prototype.getPoint = t,
  55520. e
  55521. }
  55522. ,
  55523. n.CurvePath = function() {
  55524. this.curves = [],
  55525. this.autoClose = !1
  55526. }
  55527. ,
  55528. n.CurvePath.prototype = Object.create(n.Curve.prototype),
  55529. n.CurvePath.prototype.constructor = n.CurvePath,
  55530. n.CurvePath.prototype.add = function(e) {
  55531. this.curves.push(e)
  55532. }
  55533. ,
  55534. n.CurvePath.prototype.closePath = function() {
  55535. var e = this.curves[0].getPoint(0)
  55536. , t = this.curves[this.curves.length - 1].getPoint(1);
  55537. e.equals(t) || this.curves.push(new n.LineCurve(t,e))
  55538. }
  55539. ,
  55540. n.CurvePath.prototype.getPoint = function(e) {
  55541. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  55542. if (i[n] >= t) {
  55543. var r = i[n] - t
  55544. , o = this.curves[n]
  55545. , a = 1 - r / o.getLength();
  55546. return o.getPointAt(a)
  55547. }
  55548. n++
  55549. }
  55550. return null
  55551. }
  55552. ,
  55553. n.CurvePath.prototype.getLength = function() {
  55554. var e = this.getCurveLengths();
  55555. return e[e.length - 1]
  55556. }
  55557. ,
  55558. n.CurvePath.prototype.getCurveLengths = function() {
  55559. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  55560. return this.cacheLengths;
  55561. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  55562. t += this.curves[i].getLength(),
  55563. e.push(t);
  55564. return this.cacheLengths = e,
  55565. e
  55566. }
  55567. ,
  55568. n.CurvePath.prototype.createPointsGeometry = function(e) {
  55569. var t = this.getPoints(e);
  55570. return this.createGeometry(t)
  55571. }
  55572. ,
  55573. n.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  55574. var t = this.getSpacedPoints(e);
  55575. return this.createGeometry(t)
  55576. }
  55577. ,
  55578. n.CurvePath.prototype.createGeometry = function(e) {
  55579. for (var t = new n.Geometry, i = 0, r = e.length; i < r; i++) {
  55580. var o = e[i];
  55581. t.vertices.push(new n.Vector3(o.x,o.y,o.z || 0))
  55582. }
  55583. return t
  55584. }
  55585. ,
  55586. n.Font = function(e) {
  55587. this.data = e
  55588. }
  55589. ,
  55590. n.Font.prototype = {
  55591. constructor: n.Font,
  55592. generateShapes: function(e, t, i) {
  55593. function r(e) {
  55594. for (var i = String(e).split(""), n = t / a.resolution, r = 0, s = [], l = 0; l < i.length; l++) {
  55595. var c = o(i[l], n, r);
  55596. r += c.offset,
  55597. s.push(c.path)
  55598. }
  55599. return s
  55600. }
  55601. function o(e, t, r) {
  55602. var o = a.glyphs[e] || a.glyphs["?"];
  55603. if (o) {
  55604. 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;
  55605. if (o.o)
  55606. for (var E = o._cachedOutline || (o._cachedOutline = o.o.split(" ")), b = 0, w = E.length; b < w; ) {
  55607. var _ = E[b++];
  55608. switch (_) {
  55609. case "m":
  55610. s = E[b++] * t + r,
  55611. l = E[b++] * t,
  55612. A.moveTo(s, l);
  55613. break;
  55614. case "l":
  55615. s = E[b++] * t + r,
  55616. l = E[b++] * t,
  55617. A.lineTo(s, l);
  55618. break;
  55619. case "q":
  55620. if (c = E[b++] * t + r,
  55621. h = E[b++] * t,
  55622. p = E[b++] * t + r,
  55623. f = E[b++] * t,
  55624. A.quadraticCurveTo(p, f, c, h),
  55625. v = y[y.length - 1]) {
  55626. u = v.x,
  55627. d = v.y;
  55628. for (var T = 1; T <= i; T++) {
  55629. var x = T / i;
  55630. C(x, u, p, c),
  55631. C(x, d, f, h)
  55632. }
  55633. }
  55634. break;
  55635. case "b":
  55636. if (c = E[b++] * t + r,
  55637. h = E[b++] * t,
  55638. p = E[b++] * t + r,
  55639. f = E[b++] * t,
  55640. g = E[b++] * t + r,
  55641. m = E[b++] * t,
  55642. A.bezierCurveTo(p, f, g, m, c, h),
  55643. v = y[y.length - 1]) {
  55644. u = v.x,
  55645. d = v.y;
  55646. for (var T = 1; T <= i; T++) {
  55647. var x = T / i;
  55648. I(x, u, p, g, c),
  55649. I(x, d, f, m, h)
  55650. }
  55651. }
  55652. }
  55653. }
  55654. return {
  55655. offset: o.ha * t,
  55656. path: A
  55657. }
  55658. }
  55659. }
  55660. void 0 === t && (t = 100),
  55661. void 0 === i && (i = 4);
  55662. for (var a = this.data, s = r(e), l = [], c = 0, h = s.length; c < h; c++)
  55663. Array.prototype.push.apply(l, s[c].toShapes());
  55664. return l
  55665. }
  55666. },
  55667. n.Path = function(e) {
  55668. n.CurvePath.call(this),
  55669. this.actions = [],
  55670. e && this.fromPoints(e)
  55671. }
  55672. ,
  55673. n.Path.prototype = Object.create(n.CurvePath.prototype),
  55674. n.Path.prototype.constructor = n.Path,
  55675. n.Path.prototype.fromPoints = function(e) {
  55676. this.moveTo(e[0].x, e[0].y);
  55677. for (var t = 1, i = e.length; t < i; t++)
  55678. this.lineTo(e[t].x, e[t].y)
  55679. }
  55680. ,
  55681. n.Path.prototype.moveTo = function(e, t) {
  55682. this.actions.push({
  55683. action: "moveTo",
  55684. args: [e, t]
  55685. })
  55686. }
  55687. ,
  55688. n.Path.prototype.lineTo = function(e, t) {
  55689. var i = this.actions[this.actions.length - 1].args
  55690. , r = i[i.length - 2]
  55691. , o = i[i.length - 1]
  55692. , a = new n.LineCurve(new n.Vector2(r,o),new n.Vector2(e,t));
  55693. this.curves.push(a),
  55694. this.actions.push({
  55695. action: "lineTo",
  55696. args: [e, t]
  55697. })
  55698. }
  55699. ,
  55700. n.Path.prototype.quadraticCurveTo = function(e, t, i, r) {
  55701. var o = this.actions[this.actions.length - 1].args
  55702. , a = o[o.length - 2]
  55703. , s = o[o.length - 1]
  55704. , l = new n.QuadraticBezierCurve(new n.Vector2(a,s),new n.Vector2(e,t),new n.Vector2(i,r));
  55705. this.curves.push(l),
  55706. this.actions.push({
  55707. action: "quadraticCurveTo",
  55708. args: [e, t, i, r]
  55709. })
  55710. }
  55711. ,
  55712. n.Path.prototype.bezierCurveTo = function(e, t, i, r, o, a) {
  55713. var s = this.actions[this.actions.length - 1].args
  55714. , l = s[s.length - 2]
  55715. , c = s[s.length - 1]
  55716. , h = new n.CubicBezierCurve(new n.Vector2(l,c),new n.Vector2(e,t),new n.Vector2(i,r),new n.Vector2(o,a));
  55717. this.curves.push(h),
  55718. this.actions.push({
  55719. action: "bezierCurveTo",
  55720. args: [e, t, i, r, o, a]
  55721. })
  55722. }
  55723. ,
  55724. n.Path.prototype.splineThru = function(e) {
  55725. var t = Array.prototype.slice.call(arguments)
  55726. , i = this.actions[this.actions.length - 1].args
  55727. , r = i[i.length - 2]
  55728. , o = i[i.length - 1]
  55729. , a = [new n.Vector2(r,o)];
  55730. Array.prototype.push.apply(a, e);
  55731. var s = new n.SplineCurve(a);
  55732. this.curves.push(s),
  55733. this.actions.push({
  55734. action: "splineThru",
  55735. args: t
  55736. })
  55737. }
  55738. ,
  55739. n.Path.prototype.arc = function(e, t, i, n, r, o) {
  55740. var a = this.actions[this.actions.length - 1].args
  55741. , s = a[a.length - 2]
  55742. , l = a[a.length - 1];
  55743. this.absarc(e + s, t + l, i, n, r, o)
  55744. }
  55745. ,
  55746. n.Path.prototype.absarc = function(e, t, i, n, r, o) {
  55747. this.absellipse(e, t, i, i, n, r, o)
  55748. }
  55749. ,
  55750. n.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  55751. var l = this.actions[this.actions.length - 1].args
  55752. , c = l[l.length - 2]
  55753. , h = l[l.length - 1];
  55754. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  55755. }
  55756. ,
  55757. n.Path.prototype.absellipse = function(e, t, i, r, o, a, s, l) {
  55758. var c = [e, t, i, r, o, a, s, l || 0]
  55759. , h = new n.EllipseCurve(e,t,i,r,o,a,s,l);
  55760. this.curves.push(h);
  55761. var u = h.getPoint(1);
  55762. c.push(u.x),
  55763. c.push(u.y),
  55764. this.actions.push({
  55765. action: "ellipse",
  55766. args: c
  55767. })
  55768. }
  55769. ,
  55770. n.Path.prototype.getSpacedPoints = function(e) {
  55771. e || (e = 40);
  55772. for (var t = [], i = 0; i < e; i++)
  55773. t.push(this.getPoint(i / e));
  55774. return this.autoClose && t.push(t[0]),
  55775. t
  55776. }
  55777. ,
  55778. n.Path.prototype.getPoints = function(e) {
  55779. e = e || 12;
  55780. 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++) {
  55781. var A = this.actions[m]
  55782. , y = A.action
  55783. , C = A.args;
  55784. switch (y) {
  55785. case "moveTo":
  55786. g.push(new n.Vector2(C[0],C[1]));
  55787. break;
  55788. case "lineTo":
  55789. g.push(new n.Vector2(C[0],C[1]));
  55790. break;
  55791. case "quadraticCurveTo":
  55792. t = C[2],
  55793. i = C[3],
  55794. a = C[0],
  55795. s = C[1],
  55796. g.length > 0 ? (h = g[g.length - 1],
  55797. l = h.x,
  55798. c = h.y) : (h = this.actions[m - 1].args,
  55799. l = h[h.length - 2],
  55800. c = h[h.length - 1]);
  55801. for (var I = 1; I <= e; I++) {
  55802. var E = I / e;
  55803. u = p(E, l, a, t),
  55804. d = p(E, c, s, i),
  55805. g.push(new n.Vector2(u,d))
  55806. }
  55807. break;
  55808. case "bezierCurveTo":
  55809. t = C[4],
  55810. i = C[5],
  55811. a = C[0],
  55812. s = C[1],
  55813. r = C[2],
  55814. o = C[3],
  55815. g.length > 0 ? (h = g[g.length - 1],
  55816. l = h.x,
  55817. c = h.y) : (h = this.actions[m - 1].args,
  55818. l = h[h.length - 2],
  55819. c = h[h.length - 1]);
  55820. for (var I = 1; I <= e; I++) {
  55821. var E = I / e;
  55822. u = f(E, l, a, r, t),
  55823. d = f(E, c, s, o, i),
  55824. g.push(new n.Vector2(u,d))
  55825. }
  55826. break;
  55827. case "splineThru":
  55828. h = this.actions[m - 1].args;
  55829. var b = new n.Vector2(h[h.length - 2],h[h.length - 1])
  55830. , w = [b]
  55831. , _ = e * C[0].length;
  55832. w = w.concat(C[0]);
  55833. for (var T = new n.SplineCurve(w), I = 1; I <= _; I++)
  55834. g.push(T.getPointAt(I / _));
  55835. break;
  55836. case "arc":
  55837. 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++) {
  55838. var E = I / N;
  55839. L || (E = 1 - E),
  55840. x = P + E * D,
  55841. u = S + R * Math.cos(x),
  55842. d = M + R * Math.sin(x),
  55843. g.push(new n.Vector2(u,d))
  55844. }
  55845. break;
  55846. case "ellipse":
  55847. 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;
  55848. 0 !== k && (B = Math.cos(k),
  55849. F = Math.sin(k));
  55850. for (var I = 1; I <= N; I++) {
  55851. var E = I / N;
  55852. if (L || (E = 1 - E),
  55853. x = P + E * D,
  55854. u = S + V * Math.cos(x),
  55855. d = M + U * Math.sin(x),
  55856. 0 !== k) {
  55857. var H = u
  55858. , G = d;
  55859. u = (H - S) * B - (G - M) * F + S,
  55860. d = (H - S) * F + (G - M) * B + M
  55861. }
  55862. g.push(new n.Vector2(u,d))
  55863. }
  55864. }
  55865. }
  55866. var z = g[g.length - 1];
  55867. 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),
  55868. this.autoClose && g.push(g[0]),
  55869. g
  55870. }
  55871. ,
  55872. n.Path.prototype.toShapes = function(e, t) {
  55873. function i(e) {
  55874. for (var t = [], i = new n.Path, r = 0, o = e.length; r < o; r++) {
  55875. var a = e[r]
  55876. , s = a.args
  55877. , l = a.action;
  55878. "moveTo" === l && 0 !== i.actions.length && (t.push(i),
  55879. i = new n.Path),
  55880. i[l].apply(i, s)
  55881. }
  55882. return 0 !== i.actions.length && t.push(i),
  55883. t
  55884. }
  55885. function r(e) {
  55886. for (var t = [], i = 0, r = e.length; i < r; i++) {
  55887. var o = e[i]
  55888. , a = new n.Shape;
  55889. a.actions = o.actions,
  55890. a.curves = o.curves,
  55891. t.push(a)
  55892. }
  55893. return t
  55894. }
  55895. function o(e, t) {
  55896. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  55897. var a = t[r]
  55898. , s = t[o]
  55899. , l = s.x - a.x
  55900. , c = s.y - a.y;
  55901. if (Math.abs(c) > Number.EPSILON) {
  55902. if (c < 0 && (a = t[o],
  55903. l = -l,
  55904. s = t[r],
  55905. c = -c),
  55906. e.y < a.y || e.y > s.y)
  55907. continue;
  55908. if (e.y === a.y) {
  55909. if (e.x === a.x)
  55910. return !0
  55911. } else {
  55912. var h = c * (e.x - a.x) - l * (e.y - a.y);
  55913. if (0 === h)
  55914. return !0;
  55915. if (h < 0)
  55916. continue;
  55917. n = !n
  55918. }
  55919. } else {
  55920. if (e.y !== a.y)
  55921. continue;
  55922. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  55923. return !0
  55924. }
  55925. }
  55926. return n
  55927. }
  55928. var a = n.ShapeUtils.isClockWise
  55929. , s = i(this.actions);
  55930. if (0 === s.length)
  55931. return [];
  55932. if (t === !0)
  55933. return r(s);
  55934. var l, c, h, u = [];
  55935. if (1 === s.length)
  55936. return c = s[0],
  55937. h = new n.Shape,
  55938. h.actions = c.actions,
  55939. h.curves = c.curves,
  55940. u.push(h),
  55941. u;
  55942. var d = !a(s[0].getPoints());
  55943. d = e ? !d : d;
  55944. var p, f = [], g = [], m = [], v = 0;
  55945. g[v] = void 0,
  55946. m[v] = [];
  55947. for (var A = 0, y = s.length; A < y; A++)
  55948. c = s[A],
  55949. p = c.getPoints(),
  55950. l = a(p),
  55951. l = e ? !l : l,
  55952. l ? (!d && g[v] && v++,
  55953. g[v] = {
  55954. s: new n.Shape,
  55955. p: p
  55956. },
  55957. g[v].s.actions = c.actions,
  55958. g[v].s.curves = c.curves,
  55959. d && v++,
  55960. m[v] = []) : m[v].push({
  55961. h: c,
  55962. p: p[0]
  55963. });
  55964. if (!g[0])
  55965. return r(s);
  55966. if (g.length > 1) {
  55967. for (var C = !1, I = [], E = 0, b = g.length; E < b; E++)
  55968. f[E] = [];
  55969. for (var E = 0, b = g.length; E < b; E++)
  55970. for (var w = m[E], _ = 0; _ < w.length; _++) {
  55971. for (var T = w[_], x = !0, S = 0; S < g.length; S++)
  55972. o(T.p, g[S].p) && (E !== S && I.push({
  55973. froms: E,
  55974. tos: S,
  55975. hole: _
  55976. }),
  55977. x ? (x = !1,
  55978. f[S].push(T)) : C = !0);
  55979. x && f[E].push(T)
  55980. }
  55981. I.length > 0 && (C || (m = f))
  55982. }
  55983. for (var M, A = 0, R = g.length; A < R; A++) {
  55984. h = g[A].s,
  55985. u.push(h),
  55986. M = m[A];
  55987. for (var P = 0, O = M.length; P < O; P++)
  55988. h.holes.push(M[P].h)
  55989. }
  55990. return u
  55991. }
  55992. ,
  55993. n.Shape = function() {
  55994. n.Path.apply(this, arguments),
  55995. this.holes = []
  55996. }
  55997. ,
  55998. n.Shape.prototype = Object.create(n.Path.prototype),
  55999. n.Shape.prototype.constructor = n.Shape,
  56000. n.Shape.prototype.extrude = function(e) {
  56001. return new n.ExtrudeGeometry(this,e)
  56002. }
  56003. ,
  56004. n.Shape.prototype.makeGeometry = function(e) {
  56005. return new n.ShapeGeometry(this,e)
  56006. }
  56007. ,
  56008. n.Shape.prototype.getPointsHoles = function(e) {
  56009. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  56010. t[i] = this.holes[i].getPoints(e);
  56011. return t
  56012. }
  56013. ,
  56014. n.Shape.prototype.extractAllPoints = function(e) {
  56015. return {
  56016. shape: this.getPoints(e),
  56017. holes: this.getPointsHoles(e)
  56018. }
  56019. }
  56020. ,
  56021. n.Shape.prototype.extractPoints = function(e) {
  56022. return this.extractAllPoints(e)
  56023. }
  56024. ,
  56025. n.LineCurve = function(e, t) {
  56026. this.v1 = e,
  56027. this.v2 = t
  56028. }
  56029. ,
  56030. n.LineCurve.prototype = Object.create(n.Curve.prototype),
  56031. n.LineCurve.prototype.constructor = n.LineCurve,
  56032. n.LineCurve.prototype.getPoint = function(e) {
  56033. var t = this.v2.clone().sub(this.v1);
  56034. return t.multiplyScalar(e).add(this.v1),
  56035. t
  56036. }
  56037. ,
  56038. n.LineCurve.prototype.getPointAt = function(e) {
  56039. return this.getPoint(e)
  56040. }
  56041. ,
  56042. n.LineCurve.prototype.getTangent = function(e) {
  56043. var t = this.v2.clone().sub(this.v1);
  56044. return t.normalize()
  56045. }
  56046. ,
  56047. n.QuadraticBezierCurve = function(e, t, i) {
  56048. this.v0 = e,
  56049. this.v1 = t,
  56050. this.v2 = i
  56051. }
  56052. ,
  56053. n.QuadraticBezierCurve.prototype = Object.create(n.Curve.prototype),
  56054. n.QuadraticBezierCurve.prototype.constructor = n.QuadraticBezierCurve,
  56055. n.QuadraticBezierCurve.prototype.getPoint = function(e) {
  56056. var t = n.ShapeUtils.b2;
  56057. 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))
  56058. }
  56059. ,
  56060. n.QuadraticBezierCurve.prototype.getTangent = function(e) {
  56061. var t = n.CurveUtils.tangentQuadraticBezier;
  56062. 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()
  56063. }
  56064. ,
  56065. n.CubicBezierCurve = function(e, t, i, n) {
  56066. this.v0 = e,
  56067. this.v1 = t,
  56068. this.v2 = i,
  56069. this.v3 = n
  56070. }
  56071. ,
  56072. n.CubicBezierCurve.prototype = Object.create(n.Curve.prototype),
  56073. n.CubicBezierCurve.prototype.constructor = n.CubicBezierCurve,
  56074. n.CubicBezierCurve.prototype.getPoint = function(e) {
  56075. var t = n.ShapeUtils.b3;
  56076. 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))
  56077. }
  56078. ,
  56079. n.CubicBezierCurve.prototype.getTangent = function(e) {
  56080. var t = n.CurveUtils.tangentCubicBezier;
  56081. 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()
  56082. }
  56083. ,
  56084. n.SplineCurve = function(e) {
  56085. this.points = void 0 == e ? [] : e
  56086. }
  56087. ,
  56088. n.SplineCurve.prototype = Object.create(n.Curve.prototype),
  56089. n.SplineCurve.prototype.constructor = n.SplineCurve,
  56090. n.SplineCurve.prototype.getPoint = function(e) {
  56091. var t = this.points
  56092. , i = (t.length - 1) * e
  56093. , r = Math.floor(i)
  56094. , o = i - r
  56095. , a = t[0 === r ? r : r - 1]
  56096. , s = t[r]
  56097. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  56098. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  56099. , h = n.CurveUtils.interpolate;
  56100. return new n.Vector2(h(a.x, s.x, l.x, c.x, o),h(a.y, s.y, l.y, c.y, o))
  56101. }
  56102. ,
  56103. n.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  56104. this.aX = e,
  56105. this.aY = t,
  56106. this.xRadius = i,
  56107. this.yRadius = n,
  56108. this.aStartAngle = r,
  56109. this.aEndAngle = o,
  56110. this.aClockwise = a,
  56111. this.aRotation = s || 0
  56112. }
  56113. ,
  56114. n.EllipseCurve.prototype = Object.create(n.Curve.prototype),
  56115. n.EllipseCurve.prototype.constructor = n.EllipseCurve,
  56116. n.EllipseCurve.prototype.getPoint = function(e) {
  56117. var t = this.aEndAngle - this.aStartAngle;
  56118. t < 0 && (t += 2 * Math.PI),
  56119. t > 2 * Math.PI && (t -= 2 * Math.PI);
  56120. var i;
  56121. i = this.aClockwise === !0 ? this.aEndAngle + (1 - e) * (2 * Math.PI - t) : this.aStartAngle + e * t;
  56122. var r = this.aX + this.xRadius * Math.cos(i)
  56123. , o = this.aY + this.yRadius * Math.sin(i);
  56124. if (0 !== this.aRotation) {
  56125. var a = Math.cos(this.aRotation)
  56126. , s = Math.sin(this.aRotation)
  56127. , l = r
  56128. , c = o;
  56129. r = (l - this.aX) * a - (c - this.aY) * s + this.aX,
  56130. o = (l - this.aX) * s + (c - this.aY) * a + this.aY
  56131. }
  56132. return new n.Vector2(r,o)
  56133. }
  56134. ,
  56135. n.ArcCurve = function(e, t, i, r, o, a) {
  56136. n.EllipseCurve.call(this, e, t, i, i, r, o, a)
  56137. }
  56138. ,
  56139. n.ArcCurve.prototype = Object.create(n.EllipseCurve.prototype),
  56140. n.ArcCurve.prototype.constructor = n.ArcCurve,
  56141. n.LineCurve3 = n.Curve.create(function(e, t) {
  56142. this.v1 = e,
  56143. this.v2 = t
  56144. }, function(e) {
  56145. var t = new n.Vector3;
  56146. return t.subVectors(this.v2, this.v1),
  56147. t.multiplyScalar(e),
  56148. t.add(this.v1),
  56149. t
  56150. }),
  56151. n.QuadraticBezierCurve3 = n.Curve.create(function(e, t, i) {
  56152. this.v0 = e,
  56153. this.v1 = t,
  56154. this.v2 = i
  56155. }, function(e) {
  56156. var t = n.ShapeUtils.b2;
  56157. 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))
  56158. }),
  56159. n.CubicBezierCurve3 = n.Curve.create(function(e, t, i, n) {
  56160. this.v0 = e,
  56161. this.v1 = t,
  56162. this.v2 = i,
  56163. this.v3 = n
  56164. }, function(e) {
  56165. var t = n.ShapeUtils.b3;
  56166. 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))
  56167. }),
  56168. n.SplineCurve3 = n.Curve.create(function(e) {
  56169. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  56170. this.points = void 0 == e ? [] : e
  56171. }, function(e) {
  56172. var t = this.points
  56173. , i = (t.length - 1) * e
  56174. , r = Math.floor(i)
  56175. , o = i - r
  56176. , a = t[0 == r ? r : r - 1]
  56177. , s = t[r]
  56178. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  56179. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  56180. , h = n.CurveUtils.interpolate;
  56181. 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))
  56182. }),
  56183. n.CatmullRomCurve3 = function() {
  56184. function e() {}
  56185. var t = new n.Vector3
  56186. , i = new e
  56187. , r = new e
  56188. , o = new e;
  56189. return e.prototype.init = function(e, t, i, n) {
  56190. this.c0 = e,
  56191. this.c1 = i,
  56192. this.c2 = -3 * e + 3 * t - 2 * i - n,
  56193. this.c3 = 2 * e - 2 * t + i + n
  56194. }
  56195. ,
  56196. e.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  56197. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  56198. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  56199. s *= o,
  56200. l *= o,
  56201. this.init(t, i, s, l)
  56202. }
  56203. ,
  56204. e.prototype.initCatmullRom = function(e, t, i, n, r) {
  56205. this.init(t, i, r * (i - e), r * (n - t))
  56206. }
  56207. ,
  56208. e.prototype.calc = function(e) {
  56209. var t = e * e
  56210. , i = t * e;
  56211. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  56212. }
  56213. ,
  56214. n.Curve.create(function(e) {
  56215. this.points = e || [],
  56216. this.closed = !1
  56217. }, function(e) {
  56218. var a, s, l, c, h = this.points;
  56219. c = h.length,
  56220. c < 2 && console.log("duh, you need at least 2 points"),
  56221. a = (c - (this.closed ? 0 : 1)) * e,
  56222. s = Math.floor(a),
  56223. l = a - s,
  56224. this.closed ? s += s > 0 ? 0 : (Math.floor(Math.abs(s) / h.length) + 1) * h.length : 0 === l && s === c - 1 && (s = c - 2,
  56225. l = 1);
  56226. var u, d, p, f;
  56227. if (this.closed || s > 0 ? u = h[(s - 1) % c] : (t.subVectors(h[0], h[1]).add(h[0]),
  56228. u = t),
  56229. d = h[s % c],
  56230. p = h[(s + 1) % c],
  56231. this.closed || s + 2 < c ? f = h[(s + 2) % c] : (t.subVectors(h[c - 1], h[c - 2]).add(h[c - 1]),
  56232. f = t),
  56233. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  56234. var g = "chordal" === this.type ? .5 : .25
  56235. , m = Math.pow(u.distanceToSquared(d), g)
  56236. , v = Math.pow(d.distanceToSquared(p), g)
  56237. , A = Math.pow(p.distanceToSquared(f), g);
  56238. v < 1e-4 && (v = 1),
  56239. m < 1e-4 && (m = v),
  56240. A < 1e-4 && (A = v),
  56241. i.initNonuniformCatmullRom(u.x, d.x, p.x, f.x, m, v, A),
  56242. r.initNonuniformCatmullRom(u.y, d.y, p.y, f.y, m, v, A),
  56243. o.initNonuniformCatmullRom(u.z, d.z, p.z, f.z, m, v, A)
  56244. } else if ("catmullrom" === this.type) {
  56245. var y = void 0 !== this.tension ? this.tension : .5;
  56246. i.initCatmullRom(u.x, d.x, p.x, f.x, y),
  56247. r.initCatmullRom(u.y, d.y, p.y, f.y, y),
  56248. o.initCatmullRom(u.z, d.z, p.z, f.z, y)
  56249. }
  56250. var C = new n.Vector3(i.calc(l),r.calc(l),o.calc(l));
  56251. return C
  56252. })
  56253. }(),
  56254. n.ClosedSplineCurve3 = function(e) {
  56255. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  56256. n.CatmullRomCurve3.call(this, e),
  56257. this.type = "catmullrom",
  56258. this.closed = !0
  56259. }
  56260. ,
  56261. n.ClosedSplineCurve3.prototype = Object.create(n.CatmullRomCurve3.prototype),
  56262. n.BoxGeometry = function(e, t, i, r, o, a) {
  56263. n.Geometry.call(this),
  56264. this.type = "BoxGeometry",
  56265. this.parameters = {
  56266. width: e,
  56267. height: t,
  56268. depth: i,
  56269. widthSegments: r,
  56270. heightSegments: o,
  56271. depthSegments: a
  56272. },
  56273. this.fromBufferGeometry(new n.BoxBufferGeometry(e,t,i,r,o,a)),
  56274. this.mergeVertices()
  56275. }
  56276. ,
  56277. n.BoxGeometry.prototype = Object.create(n.Geometry.prototype),
  56278. n.BoxGeometry.prototype.constructor = n.BoxGeometry,
  56279. n.CubeGeometry = n.BoxGeometry,
  56280. n.BoxBufferGeometry = function(e, t, i, r, o, a) {
  56281. function s(e, t, i) {
  56282. var n = 0;
  56283. return n += e * t * 2,
  56284. n += e * i * 2,
  56285. n += i * t * 2,
  56286. 4 * n
  56287. }
  56288. function l(e, t, i, r, o, a, s, l, h, u, I) {
  56289. 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++)
  56290. for (var L = O * b - _, D = 0; D < x; D++) {
  56291. var N = D * E - w;
  56292. P[e] = N * r,
  56293. P[t] = L * o,
  56294. P[i] = T,
  56295. p[m] = P.x,
  56296. p[m + 1] = P.y,
  56297. p[m + 2] = P.z,
  56298. P[e] = 0,
  56299. P[t] = 0,
  56300. P[i] = l > 0 ? 1 : -1,
  56301. f[m] = P.x,
  56302. f[m + 1] = P.y,
  56303. f[m + 2] = P.z,
  56304. g[v] = D / h,
  56305. g[v + 1] = 1 - O / u,
  56306. m += 3,
  56307. v += 2,
  56308. M += 1
  56309. }
  56310. for (O = 0; O < u; O++)
  56311. for (D = 0; D < h; D++) {
  56312. var B = y + D + x * O
  56313. , F = y + D + x * (O + 1)
  56314. , V = y + (D + 1) + x * (O + 1)
  56315. , U = y + (D + 1) + x * O;
  56316. d[A] = B,
  56317. d[A + 1] = F,
  56318. d[A + 2] = U,
  56319. d[A + 3] = F,
  56320. d[A + 4] = V,
  56321. d[A + 5] = U,
  56322. A += 6,
  56323. R += 6
  56324. }
  56325. c.addGroup(C, R, I),
  56326. C += R,
  56327. y += M
  56328. }
  56329. n.BufferGeometry.call(this),
  56330. this.type = "BoxBufferGeometry",
  56331. this.parameters = {
  56332. width: e,
  56333. height: t,
  56334. depth: i,
  56335. widthSegments: r,
  56336. heightSegments: o,
  56337. depthSegments: a
  56338. };
  56339. var c = this;
  56340. r = Math.floor(r) || 1,
  56341. o = Math.floor(o) || 1,
  56342. a = Math.floor(a) || 1;
  56343. var h = s(r, o, a)
  56344. , u = h / 4 * 6
  56345. , d = new (u > 65535 ? Uint32Array : Uint16Array)(u)
  56346. , p = new Float32Array(3 * h)
  56347. , f = new Float32Array(3 * h)
  56348. , g = new Float32Array(2 * h)
  56349. , m = 0
  56350. , v = 0
  56351. , A = 0
  56352. , y = 0
  56353. , C = 0;
  56354. l("z", "y", "x", -1, -1, i, t, e, a, o, 0),
  56355. l("z", "y", "x", 1, -1, i, t, -e, a, o, 1),
  56356. l("x", "z", "y", 1, 1, e, i, t, r, a, 2),
  56357. l("x", "z", "y", 1, -1, e, i, -t, r, a, 3),
  56358. l("x", "y", "z", 1, -1, e, t, i, r, o, 4),
  56359. l("x", "y", "z", -1, -1, e, t, -i, r, o, 5),
  56360. this.setIndex(new n.BufferAttribute(d,1)),
  56361. this.addAttribute("position", new n.BufferAttribute(p,3)),
  56362. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  56363. this.addAttribute("uv", new n.BufferAttribute(g,2))
  56364. }
  56365. ,
  56366. n.BoxBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56367. n.BoxBufferGeometry.prototype.constructor = n.BoxBufferGeometry,
  56368. n.CircleGeometry = function(e, t, i, r) {
  56369. n.Geometry.call(this),
  56370. this.type = "CircleGeometry",
  56371. this.parameters = {
  56372. radius: e,
  56373. segments: t,
  56374. thetaStart: i,
  56375. thetaLength: r
  56376. },
  56377. this.fromBufferGeometry(new n.CircleBufferGeometry(e,t,i,r))
  56378. }
  56379. ,
  56380. n.CircleGeometry.prototype = Object.create(n.Geometry.prototype),
  56381. n.CircleGeometry.prototype.constructor = n.CircleGeometry,
  56382. n.CircleBufferGeometry = function(e, t, i, r) {
  56383. n.BufferGeometry.call(this),
  56384. this.type = "CircleBufferGeometry",
  56385. this.parameters = {
  56386. radius: e,
  56387. segments: t,
  56388. thetaStart: i,
  56389. thetaLength: r
  56390. },
  56391. e = e || 50,
  56392. t = void 0 !== t ? Math.max(3, t) : 8,
  56393. i = void 0 !== i ? i : 0,
  56394. r = void 0 !== r ? r : 2 * Math.PI;
  56395. var o = t + 2
  56396. , a = new Float32Array(3 * o)
  56397. , s = new Float32Array(3 * o)
  56398. , l = new Float32Array(2 * o);
  56399. s[2] = 1,
  56400. l[0] = .5,
  56401. l[1] = .5;
  56402. for (var c = 0, h = 3, u = 2; c <= t; c++,
  56403. h += 3,
  56404. u += 2) {
  56405. var d = i + c / t * r;
  56406. a[h] = e * Math.cos(d),
  56407. a[h + 1] = e * Math.sin(d),
  56408. s[h + 2] = 1,
  56409. l[u] = (a[h] / e + 1) / 2,
  56410. l[u + 1] = (a[h + 1] / e + 1) / 2
  56411. }
  56412. for (var p = [], h = 1; h <= t; h++)
  56413. p.push(h, h + 1, 0);
  56414. this.setIndex(new n.BufferAttribute(new Uint16Array(p),1)),
  56415. this.addAttribute("position", new n.BufferAttribute(a,3)),
  56416. this.addAttribute("normal", new n.BufferAttribute(s,3)),
  56417. this.addAttribute("uv", new n.BufferAttribute(l,2)),
  56418. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  56419. }
  56420. ,
  56421. n.CircleBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56422. n.CircleBufferGeometry.prototype.constructor = n.CircleBufferGeometry,
  56423. n.CylinderBufferGeometry = function(e, t, i, r, o, a, s, l) {
  56424. function c() {
  56425. var e = (r + 1) * (o + 1);
  56426. return a === !1 && (e += 2 * (r + 1) + 2 * r),
  56427. e
  56428. }
  56429. function h() {
  56430. var e = r * o * 2 * 3;
  56431. return a === !1 && (e += 2 * r * 3),
  56432. e
  56433. }
  56434. function u() {
  56435. var a, c, h = new n.Vector3, u = new n.Vector3, d = (t - e) / i;
  56436. for (c = 0; c <= o; c++) {
  56437. var p = []
  56438. , f = c / o
  56439. , b = f * (t - e) + e;
  56440. for (a = 0; a <= r; a++) {
  56441. var w = a / r;
  56442. u.x = b * Math.sin(w * l + s),
  56443. u.y = -f * i + E,
  56444. u.z = b * Math.cos(w * l + s),
  56445. m.setXYZ(y, u.x, u.y, u.z),
  56446. h.copy(u),
  56447. (0 === e && 0 === c || 0 === t && c === o) && (h.x = Math.sin(w * l + s),
  56448. h.z = Math.cos(w * l + s)),
  56449. h.setY(Math.sqrt(h.x * h.x + h.z * h.z) * d).normalize(),
  56450. v.setXYZ(y, h.x, h.y, h.z),
  56451. A.setXY(y, w, 1 - f),
  56452. p.push(y),
  56453. y++
  56454. }
  56455. I.push(p)
  56456. }
  56457. for (a = 0; a < r; a++)
  56458. for (c = 0; c < o; c++) {
  56459. var _ = I[c][a]
  56460. , T = I[c + 1][a]
  56461. , x = I[c + 1][a + 1]
  56462. , S = I[c][a + 1];
  56463. g.setX(C, _),
  56464. C++,
  56465. g.setX(C, T),
  56466. C++,
  56467. g.setX(C, S),
  56468. C++,
  56469. g.setX(C, T),
  56470. C++,
  56471. g.setX(C, x),
  56472. C++,
  56473. g.setX(C, S),
  56474. C++
  56475. }
  56476. }
  56477. function d(i) {
  56478. var o, a, c, h = new n.Vector2, u = new n.Vector3, d = i === !0 ? e : t, p = i === !0 ? 1 : -1;
  56479. for (a = y,
  56480. o = 1; o <= r; o++)
  56481. m.setXYZ(y, 0, E * p, 0),
  56482. v.setXYZ(y, 0, p, 0),
  56483. i === !0 ? (h.x = o / r,
  56484. h.y = 0) : (h.x = (o - 1) / r,
  56485. h.y = 1),
  56486. A.setXY(y, h.x, h.y),
  56487. y++;
  56488. for (c = y,
  56489. o = 0; o <= r; o++) {
  56490. var f = o / r;
  56491. u.x = d * Math.sin(f * l + s),
  56492. u.y = E * p,
  56493. u.z = d * Math.cos(f * l + s),
  56494. m.setXYZ(y, u.x, u.y, u.z),
  56495. v.setXYZ(y, 0, p, 0),
  56496. A.setXY(y, f, i === !0 ? 1 : 0),
  56497. y++
  56498. }
  56499. for (o = 0; o < r; o++) {
  56500. var I = a + o
  56501. , b = c + o;
  56502. i === !0 ? (g.setX(C, b),
  56503. C++,
  56504. g.setX(C, b + 1),
  56505. C++,
  56506. g.setX(C, I),
  56507. C++) : (g.setX(C, b + 1),
  56508. C++,
  56509. g.setX(C, b),
  56510. C++,
  56511. g.setX(C, I),
  56512. C++)
  56513. }
  56514. }
  56515. n.BufferGeometry.call(this),
  56516. this.type = "CylinderBufferGeometry",
  56517. this.parameters = {
  56518. radiusTop: e,
  56519. radiusBottom: t,
  56520. height: i,
  56521. radialSegments: r,
  56522. heightSegments: o,
  56523. openEnded: a,
  56524. thetaStart: s,
  56525. thetaLength: l
  56526. },
  56527. e = void 0 !== e ? e : 20,
  56528. t = void 0 !== t ? t : 20,
  56529. i = void 0 !== i ? i : 100,
  56530. r = Math.floor(r) || 8,
  56531. o = Math.floor(o) || 1,
  56532. a = void 0 !== a && a,
  56533. s = void 0 !== s ? s : 0,
  56534. l = void 0 !== l ? l : 2 * Math.PI;
  56535. var p = c()
  56536. , f = h()
  56537. , g = new n.BufferAttribute(new (f > 65535 ? Uint32Array : Uint16Array)(f),1)
  56538. , m = new n.BufferAttribute(new Float32Array(3 * p),3)
  56539. , v = new n.BufferAttribute(new Float32Array(3 * p),3)
  56540. , A = new n.BufferAttribute(new Float32Array(2 * p),2)
  56541. , y = 0
  56542. , C = 0
  56543. , I = []
  56544. , E = i / 2;
  56545. u(),
  56546. a === !1 && (e > 0 && d(!0),
  56547. t > 0 && d(!1)),
  56548. this.setIndex(g),
  56549. this.addAttribute("position", m),
  56550. this.addAttribute("normal", v),
  56551. this.addAttribute("uv", A)
  56552. }
  56553. ,
  56554. n.CylinderBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56555. n.CylinderBufferGeometry.prototype.constructor = n.CylinderBufferGeometry,
  56556. n.CylinderGeometry = function(e, t, i, r, o, a, s, l) {
  56557. n.Geometry.call(this),
  56558. this.type = "CylinderGeometry",
  56559. this.parameters = {
  56560. radiusTop: e,
  56561. radiusBottom: t,
  56562. height: i,
  56563. radialSegments: r,
  56564. heightSegments: o,
  56565. openEnded: a,
  56566. thetaStart: s,
  56567. thetaLength: l
  56568. },
  56569. this.fromBufferGeometry(new n.CylinderBufferGeometry(e,t,i,r,o,a,s,l)),
  56570. this.mergeVertices()
  56571. }
  56572. ,
  56573. n.CylinderGeometry.prototype = Object.create(n.Geometry.prototype),
  56574. n.CylinderGeometry.prototype.constructor = n.CylinderGeometry,
  56575. n.EdgesGeometry = function(e, t) {
  56576. function i(e, t) {
  56577. return e - t
  56578. }
  56579. n.BufferGeometry.call(this),
  56580. t = void 0 !== t ? t : 1;
  56581. var r, o = Math.cos(n.Math.degToRad(t)), a = [0, 0], s = {}, l = ["a", "b", "c"];
  56582. e instanceof n.BufferGeometry ? (r = new n.Geometry,
  56583. r.fromBufferGeometry(e)) : r = e.clone(),
  56584. r.mergeVertices(),
  56585. r.computeFaceNormals();
  56586. for (var c = r.vertices, h = r.faces, u = 0, d = h.length; u < d; u++)
  56587. for (var p = h[u], f = 0; f < 3; f++) {
  56588. a[0] = p[l[f]],
  56589. a[1] = p[l[(f + 1) % 3]],
  56590. a.sort(i);
  56591. var g = a.toString();
  56592. void 0 === s[g] ? s[g] = {
  56593. vert1: a[0],
  56594. vert2: a[1],
  56595. face1: u,
  56596. face2: void 0
  56597. } : s[g].face2 = u
  56598. }
  56599. var m = [];
  56600. for (var g in s) {
  56601. var v = s[g];
  56602. if (void 0 === v.face2 || h[v.face1].normal.dot(h[v.face2].normal) <= o) {
  56603. var A = c[v.vert1];
  56604. m.push(A.x),
  56605. m.push(A.y),
  56606. m.push(A.z),
  56607. A = c[v.vert2],
  56608. m.push(A.x),
  56609. m.push(A.y),
  56610. m.push(A.z)
  56611. }
  56612. }
  56613. this.addAttribute("position", new n.BufferAttribute(new Float32Array(m),3))
  56614. }
  56615. ,
  56616. n.EdgesGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56617. n.EdgesGeometry.prototype.constructor = n.EdgesGeometry,
  56618. n.ExtrudeGeometry = function(e, t) {
  56619. return "undefined" == typeof e ? void (e = []) : (n.Geometry.call(this),
  56620. this.type = "ExtrudeGeometry",
  56621. e = Array.isArray(e) ? e : [e],
  56622. this.addShapeList(e, t),
  56623. void this.computeFaceNormals())
  56624. }
  56625. ;
  56626. n.ExtrudeGeometry.prototype = Object.create(n.Geometry.prototype);
  56627. n.ExtrudeGeometry.prototype.constructor = n.ExtrudeGeometry,
  56628. n.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  56629. for (var i = e.length, n = 0; n < i; n++) {
  56630. var r = e[n];
  56631. this.addShape(r, t)
  56632. }
  56633. }
  56634. ,
  56635. n.ExtrudeGeometry.prototype.addShape = function(e, t) {
  56636. function i(e, t, i) {
  56637. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  56638. t.clone().multiplyScalar(i).add(e)
  56639. }
  56640. function r(e, t, i) {
  56641. 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;
  56642. if (Math.abs(d) > Number.EPSILON) {
  56643. var p = Math.sqrt(u)
  56644. , f = Math.sqrt(c * c + h * h)
  56645. , g = t.x - l / p
  56646. , m = t.y + s / p
  56647. , v = i.x - h / f
  56648. , A = i.y + c / f
  56649. , y = ((v - g) * h - (A - m) * c) / (s * h - l * c);
  56650. r = g + s * y - e.x,
  56651. o = m + l * y - e.y;
  56652. var C = r * r + o * o;
  56653. if (C <= 2)
  56654. return new n.Vector2(r,o);
  56655. a = Math.sqrt(C / 2)
  56656. } else {
  56657. var I = !1;
  56658. s > Number.EPSILON ? c > Number.EPSILON && (I = !0) : s < -Number.EPSILON ? c < -Number.EPSILON && (I = !0) : Math.sign(l) === Math.sign(h) && (I = !0),
  56659. I ? (r = -l,
  56660. o = s,
  56661. a = Math.sqrt(u)) : (r = s,
  56662. o = l,
  56663. a = Math.sqrt(u / 2))
  56664. }
  56665. return new n.Vector2(r / a,o / a)
  56666. }
  56667. function o() {
  56668. if (C) {
  56669. var e = 0
  56670. , t = z * e;
  56671. for (Y = 0; Y < W; Y++)
  56672. G = N[Y],
  56673. c(G[2] + t, G[1] + t, G[0] + t);
  56674. for (e = E + 2 * y,
  56675. t = z * e,
  56676. Y = 0; Y < W; Y++)
  56677. G = N[Y],
  56678. c(G[0] + t, G[1] + t, G[2] + t)
  56679. } else {
  56680. for (Y = 0; Y < W; Y++)
  56681. G = N[Y],
  56682. c(G[2], G[1], G[0]);
  56683. for (Y = 0; Y < W; Y++)
  56684. G = N[Y],
  56685. c(G[0] + z * E, G[1] + z * E, G[2] + z * E)
  56686. }
  56687. }
  56688. function a() {
  56689. var e = 0;
  56690. for (s(B, e),
  56691. e += B.length,
  56692. x = 0,
  56693. S = L.length; x < S; x++)
  56694. T = L[x],
  56695. s(T, e),
  56696. e += T.length
  56697. }
  56698. function s(e, t) {
  56699. var i, n;
  56700. for (Y = e.length; --Y >= 0; ) {
  56701. i = Y,
  56702. n = Y - 1,
  56703. n < 0 && (n = e.length - 1);
  56704. var r = 0
  56705. , o = E + 2 * y;
  56706. for (r = 0; r < o; r++) {
  56707. var a = z * r
  56708. , s = z * (r + 1)
  56709. , l = t + i + a
  56710. , c = t + n + a
  56711. , u = t + n + s
  56712. , d = t + i + s;
  56713. h(l, c, u, d, e, r, o, i, n)
  56714. }
  56715. }
  56716. }
  56717. function l(e, t, i) {
  56718. M.vertices.push(new n.Vector3(e,t,i))
  56719. }
  56720. function c(e, t, i) {
  56721. e += R,
  56722. t += R,
  56723. i += R,
  56724. M.faces.push(new n.Face3(e,t,i,null,null,0));
  56725. var r = _.generateTopUV(M, e, t, i);
  56726. M.faceVertexUvs[0].push(r)
  56727. }
  56728. function h(e, t, i, r, o, a, s, l, c) {
  56729. e += R,
  56730. t += R,
  56731. i += R,
  56732. r += R,
  56733. M.faces.push(new n.Face3(e,t,r,null,null,1)),
  56734. M.faces.push(new n.Face3(t,i,r,null,null,1));
  56735. var h = _.generateSideWallUV(M, e, t, i, r);
  56736. M.faceVertexUvs[0].push([h[0], h[1], h[3]]),
  56737. M.faceVertexUvs[0].push([h[1], h[2], h[3]])
  56738. }
  56739. 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;
  56740. b && (u = b.getSpacedPoints(E),
  56741. w = !0,
  56742. C = !1,
  56743. d = void 0 !== t.frames ? t.frames : new n.TubeGeometry.FrenetFrames(b,E,!1),
  56744. p = new n.Vector3,
  56745. f = new n.Vector3,
  56746. g = new n.Vector3),
  56747. C || (y = 0,
  56748. v = 0,
  56749. A = 0);
  56750. 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);
  56751. if (D) {
  56752. for (O = O.reverse(),
  56753. x = 0,
  56754. S = L.length; x < S; x++)
  56755. T = L[x],
  56756. n.ShapeUtils.isClockWise(T) && (L[x] = T.reverse());
  56757. D = !1
  56758. }
  56759. var N = n.ShapeUtils.triangulateShape(O, L)
  56760. , B = O;
  56761. for (x = 0,
  56762. S = L.length; x < S; x++)
  56763. T = L[x],
  56764. O = O.concat(T);
  56765. 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++,
  56766. Z++,
  56767. q++)
  56768. Z === X && (Z = 0),
  56769. q === X && (q = 0),
  56770. j[Y] = r(B[Y], B[Z], B[q]);
  56771. var K, Q = [], J = j.concat();
  56772. for (x = 0,
  56773. S = L.length; x < S; x++) {
  56774. for (T = L[x],
  56775. K = [],
  56776. Y = 0,
  56777. X = T.length,
  56778. Z = X - 1,
  56779. q = Y + 1; Y < X; Y++,
  56780. Z++,
  56781. q++)
  56782. Z === X && (Z = 0),
  56783. q === X && (q = 0),
  56784. K[Y] = r(T[Y], T[Z], T[q]);
  56785. Q.push(K),
  56786. J = J.concat(K)
  56787. }
  56788. for (F = 0; F < y; F++) {
  56789. for (U = F / y,
  56790. k = v * (1 - U),
  56791. V = A * Math.sin(U * Math.PI / 2),
  56792. Y = 0,
  56793. X = B.length; Y < X; Y++)
  56794. H = i(B[Y], j[Y], V),
  56795. l(H.x, H.y, -k);
  56796. for (x = 0,
  56797. S = L.length; x < S; x++)
  56798. for (T = L[x],
  56799. K = Q[x],
  56800. Y = 0,
  56801. X = T.length; Y < X; Y++)
  56802. H = i(T[Y], K[Y], V),
  56803. l(H.x, H.y, -k)
  56804. }
  56805. for (V = A,
  56806. Y = 0; Y < z; Y++)
  56807. H = C ? i(O[Y], J[Y], V) : O[Y],
  56808. w ? (f.copy(d.normals[0]).multiplyScalar(H.x),
  56809. p.copy(d.binormals[0]).multiplyScalar(H.y),
  56810. g.copy(u[0]).add(f).add(p),
  56811. l(g.x, g.y, g.z)) : l(H.x, H.y, 0);
  56812. var $;
  56813. for ($ = 1; $ <= E; $++)
  56814. for (Y = 0; Y < z; Y++)
  56815. H = C ? i(O[Y], J[Y], V) : O[Y],
  56816. w ? (f.copy(d.normals[$]).multiplyScalar(H.x),
  56817. p.copy(d.binormals[$]).multiplyScalar(H.y),
  56818. g.copy(u[$]).add(f).add(p),
  56819. l(g.x, g.y, g.z)) : l(H.x, H.y, m / E * $);
  56820. for (F = y - 1; F >= 0; F--) {
  56821. for (U = F / y,
  56822. k = v * (1 - U),
  56823. V = A * Math.sin(U * Math.PI / 2),
  56824. Y = 0,
  56825. X = B.length; Y < X; Y++)
  56826. H = i(B[Y], j[Y], V),
  56827. l(H.x, H.y, m + k);
  56828. for (x = 0,
  56829. S = L.length; x < S; x++)
  56830. for (T = L[x],
  56831. K = Q[x],
  56832. Y = 0,
  56833. X = T.length; Y < X; Y++)
  56834. H = i(T[Y], K[Y], V),
  56835. w ? l(H.x, H.y + u[E - 1].y, u[E - 1].x + k) : l(H.x, H.y, m + k)
  56836. }
  56837. o(),
  56838. a()
  56839. }
  56840. ,
  56841. n.ExtrudeGeometry.WorldUVGenerator = {
  56842. generateTopUV: function(e, t, i, r) {
  56843. var o = e.vertices
  56844. , a = o[t]
  56845. , s = o[i]
  56846. , l = o[r];
  56847. return [new n.Vector2(a.x,a.y), new n.Vector2(s.x,s.y), new n.Vector2(l.x,l.y)]
  56848. },
  56849. generateSideWallUV: function(e, t, i, r, o) {
  56850. var a = e.vertices
  56851. , s = a[t]
  56852. , l = a[i]
  56853. , c = a[r]
  56854. , h = a[o];
  56855. 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)]
  56856. }
  56857. },
  56858. n.ShapeGeometry = function(e, t) {
  56859. n.Geometry.call(this),
  56860. this.type = "ShapeGeometry",
  56861. Array.isArray(e) === !1 && (e = [e]),
  56862. this.addShapeList(e, t),
  56863. this.computeFaceNormals()
  56864. }
  56865. ,
  56866. n.ShapeGeometry.prototype = Object.create(n.Geometry.prototype),
  56867. n.ShapeGeometry.prototype.constructor = n.ShapeGeometry,
  56868. n.ShapeGeometry.prototype.addShapeList = function(e, t) {
  56869. for (var i = 0, n = e.length; i < n; i++)
  56870. this.addShape(e[i], t);
  56871. return this
  56872. }
  56873. ,
  56874. n.ShapeGeometry.prototype.addShape = function(e, t) {
  56875. void 0 === t && (t = {});
  56876. 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);
  56877. if (p) {
  56878. for (u = u.reverse(),
  56879. i = 0,
  56880. r = d.length; i < r; i++)
  56881. o = d[i],
  56882. n.ShapeUtils.isClockWise(o) && (d[i] = o.reverse());
  56883. p = !1
  56884. }
  56885. var f = n.ShapeUtils.triangulateShape(u, d);
  56886. for (i = 0,
  56887. r = d.length; i < r; i++)
  56888. o = d[i],
  56889. u = u.concat(o);
  56890. var g, m, v = u.length, A = f.length;
  56891. for (i = 0; i < v; i++)
  56892. g = u[i],
  56893. this.vertices.push(new n.Vector3(g.x,g.y,0));
  56894. for (i = 0; i < A; i++) {
  56895. m = f[i];
  56896. var y = m[0] + c
  56897. , C = m[1] + c
  56898. , I = m[2] + c;
  56899. this.faces.push(new n.Face3(y,C,I,null,null,s)),
  56900. this.faceVertexUvs[0].push(l.generateTopUV(this, y, C, I))
  56901. }
  56902. }
  56903. ,
  56904. n.LatheBufferGeometry = function(e, t, i, r) {
  56905. n.BufferGeometry.call(this),
  56906. this.type = "LatheBufferGeometry",
  56907. this.parameters = {
  56908. points: e,
  56909. segments: t,
  56910. phiStart: i,
  56911. phiLength: r
  56912. },
  56913. t = Math.floor(t) || 12,
  56914. i = i || 0,
  56915. r = r || 2 * Math.PI,
  56916. r = n.Math.clamp(r, 0, 2 * Math.PI);
  56917. 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),
  56918. 1 / t), m = new n.Vector3, v = new n.Vector2;
  56919. for (a = 0; a <= t; a++) {
  56920. var A = i + a * g * r
  56921. , y = Math.sin(A)
  56922. , C = Math.cos(A);
  56923. for (s = 0; s <= e.length - 1; s++)
  56924. m.x = e[s].x * y,
  56925. m.y = e[s].y,
  56926. m.z = e[s].x * C,
  56927. u.setXYZ(p, m.x, m.y, m.z),
  56928. v.x = a / t,
  56929. v.y = s / (e.length - 1),
  56930. d.setXY(p, v.x, v.y),
  56931. p++
  56932. }
  56933. for (a = 0; a < t; a++)
  56934. for (s = 0; s < e.length - 1; s++) {
  56935. o = s + a * e.length;
  56936. var I = o
  56937. , E = o + e.length
  56938. , b = o + e.length + 1
  56939. , w = o + 1;
  56940. h.setX(f, I),
  56941. f++,
  56942. h.setX(f, E),
  56943. f++,
  56944. h.setX(f, w),
  56945. f++,
  56946. h.setX(f, E),
  56947. f++,
  56948. h.setX(f, b),
  56949. f++,
  56950. h.setX(f, w),
  56951. f++
  56952. }
  56953. if (this.setIndex(h),
  56954. this.addAttribute("position", u),
  56955. this.addAttribute("uv", d),
  56956. this.computeVertexNormals(),
  56957. r === 2 * Math.PI) {
  56958. var _ = this.attributes.normal.array
  56959. , T = new n.Vector3
  56960. , x = new n.Vector3
  56961. , S = new n.Vector3;
  56962. for (o = t * e.length * 3,
  56963. a = 0,
  56964. s = 0; a < e.length; a++,
  56965. s += 3)
  56966. T.x = _[s + 0],
  56967. T.y = _[s + 1],
  56968. T.z = _[s + 2],
  56969. x.x = _[o + s + 0],
  56970. x.y = _[o + s + 1],
  56971. x.z = _[o + s + 2],
  56972. S.addVectors(T, x).normalize(),
  56973. _[s + 0] = _[o + s + 0] = S.x,
  56974. _[s + 1] = _[o + s + 1] = S.y,
  56975. _[s + 2] = _[o + s + 2] = S.z
  56976. }
  56977. }
  56978. ,
  56979. n.LatheBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56980. n.LatheBufferGeometry.prototype.constructor = n.LatheBufferGeometry,
  56981. n.LatheGeometry = function(e, t, i, r) {
  56982. n.Geometry.call(this),
  56983. this.type = "LatheGeometry",
  56984. this.parameters = {
  56985. points: e,
  56986. segments: t,
  56987. phiStart: i,
  56988. phiLength: r
  56989. },
  56990. this.fromBufferGeometry(new n.LatheBufferGeometry(e,t,i,r)),
  56991. this.mergeVertices()
  56992. }
  56993. ,
  56994. n.LatheGeometry.prototype = Object.create(n.Geometry.prototype),
  56995. n.LatheGeometry.prototype.constructor = n.LatheGeometry,
  56996. n.PlaneGeometry = function(e, t, i, r) {
  56997. n.Geometry.call(this),
  56998. this.type = "PlaneGeometry",
  56999. this.parameters = {
  57000. width: e,
  57001. height: t,
  57002. widthSegments: i,
  57003. heightSegments: r
  57004. },
  57005. this.fromBufferGeometry(new n.PlaneBufferGeometry(e,t,i,r))
  57006. }
  57007. ,
  57008. n.PlaneGeometry.prototype = Object.create(n.Geometry.prototype),
  57009. n.PlaneGeometry.prototype.constructor = n.PlaneGeometry,
  57010. n.PlaneBufferGeometry = function(e, t, i, r) {
  57011. n.BufferGeometry.call(this),
  57012. this.type = "PlaneBufferGeometry",
  57013. this.parameters = {
  57014. width: e,
  57015. height: t,
  57016. widthSegments: i,
  57017. heightSegments: r
  57018. };
  57019. 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++)
  57020. for (var y = A * d - a, C = 0; C < c; C++) {
  57021. var I = C * u - o;
  57022. p[m] = I,
  57023. p[m + 1] = -y,
  57024. f[m + 2] = 1,
  57025. g[v] = C / s,
  57026. g[v + 1] = 1 - A / l,
  57027. m += 3,
  57028. v += 2
  57029. }
  57030. m = 0;
  57031. for (var E = new (p.length / 3 > 65535 ? Uint32Array : Uint16Array)(s * l * 6), A = 0; A < l; A++)
  57032. for (var C = 0; C < s; C++) {
  57033. var b = C + c * A
  57034. , w = C + c * (A + 1)
  57035. , _ = C + 1 + c * (A + 1)
  57036. , T = C + 1 + c * A;
  57037. E[m] = b,
  57038. E[m + 1] = w,
  57039. E[m + 2] = T,
  57040. E[m + 3] = w,
  57041. E[m + 4] = _,
  57042. E[m + 5] = T,
  57043. m += 6
  57044. }
  57045. this.setIndex(new n.BufferAttribute(E,1)),
  57046. this.addAttribute("position", new n.BufferAttribute(p,3)),
  57047. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  57048. this.addAttribute("uv", new n.BufferAttribute(g,2))
  57049. }
  57050. ,
  57051. n.PlaneBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57052. n.PlaneBufferGeometry.prototype.constructor = n.PlaneBufferGeometry,
  57053. n.RingBufferGeometry = function(e, t, i, r, o, a) {
  57054. n.BufferGeometry.call(this),
  57055. this.type = "RingBufferGeometry",
  57056. this.parameters = {
  57057. innerRadius: e,
  57058. outerRadius: t,
  57059. thetaSegments: i,
  57060. phiSegments: r,
  57061. thetaStart: o,
  57062. thetaLength: a
  57063. },
  57064. e = e || 20,
  57065. t = t || 50,
  57066. o = void 0 !== o ? o : 0,
  57067. a = void 0 !== a ? a : 2 * Math.PI,
  57068. i = void 0 !== i ? Math.max(3, i) : 8,
  57069. r = void 0 !== r ? Math.max(1, r) : 1;
  57070. 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;
  57071. for (l = 0; l <= r; l++) {
  57072. for (c = 0; c <= i; c++)
  57073. s = o + c / i * a,
  57074. C.x = A * Math.cos(s),
  57075. C.y = A * Math.sin(s),
  57076. p.setXYZ(m, C.x, C.y, C.z),
  57077. f.setXYZ(m, 0, 0, 1),
  57078. I.x = (C.x / t + 1) / 2,
  57079. I.y = (C.y / t + 1) / 2,
  57080. g.setXY(m, I.x, I.y),
  57081. m++;
  57082. A += y
  57083. }
  57084. for (l = 0; l < r; l++) {
  57085. var E = l * (i + 1);
  57086. for (c = 0; c < i; c++) {
  57087. s = c + E;
  57088. var b = s
  57089. , w = s + i + 1
  57090. , _ = s + i + 2
  57091. , T = s + 1;
  57092. d.setX(v, b),
  57093. v++,
  57094. d.setX(v, w),
  57095. v++,
  57096. d.setX(v, _),
  57097. v++,
  57098. d.setX(v, b),
  57099. v++,
  57100. d.setX(v, _),
  57101. v++,
  57102. d.setX(v, T),
  57103. v++
  57104. }
  57105. }
  57106. this.setIndex(d),
  57107. this.addAttribute("position", p),
  57108. this.addAttribute("normal", f),
  57109. this.addAttribute("uv", g)
  57110. }
  57111. ,
  57112. n.RingBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57113. n.RingBufferGeometry.prototype.constructor = n.RingBufferGeometry,
  57114. n.RingGeometry = function(e, t, i, r, o, a) {
  57115. n.Geometry.call(this),
  57116. this.type = "RingGeometry",
  57117. this.parameters = {
  57118. innerRadius: e,
  57119. outerRadius: t,
  57120. thetaSegments: i,
  57121. phiSegments: r,
  57122. thetaStart: o,
  57123. thetaLength: a
  57124. },
  57125. this.fromBufferGeometry(new n.RingBufferGeometry(e,t,i,r,o,a))
  57126. }
  57127. ,
  57128. n.RingGeometry.prototype = Object.create(n.Geometry.prototype),
  57129. n.RingGeometry.prototype.constructor = n.RingGeometry,
  57130. n.SphereGeometry = function(e, t, i, r, o, a, s) {
  57131. n.Geometry.call(this),
  57132. this.type = "SphereGeometry",
  57133. this.parameters = {
  57134. radius: e,
  57135. widthSegments: t,
  57136. heightSegments: i,
  57137. phiStart: r,
  57138. phiLength: o,
  57139. thetaStart: a,
  57140. thetaLength: s
  57141. },
  57142. this.fromBufferGeometry(new n.SphereBufferGeometry(e,t,i,r,o,a,s))
  57143. }
  57144. ,
  57145. n.SphereGeometry.prototype = Object.create(n.Geometry.prototype),
  57146. n.SphereGeometry.prototype.constructor = n.SphereGeometry,
  57147. n.SphereBufferGeometry = function(e, t, i, r, o, a, s) {
  57148. n.BufferGeometry.call(this),
  57149. this.type = "SphereBufferGeometry",
  57150. this.parameters = {
  57151. radius: e,
  57152. widthSegments: t,
  57153. heightSegments: i,
  57154. phiStart: r,
  57155. phiLength: o,
  57156. thetaStart: a,
  57157. thetaLength: s
  57158. },
  57159. e = e || 50,
  57160. t = Math.max(3, Math.floor(t) || 8),
  57161. i = Math.max(2, Math.floor(i) || 6),
  57162. r = void 0 !== r ? r : 0,
  57163. o = void 0 !== o ? o : 2 * Math.PI,
  57164. a = void 0 !== a ? a : 0,
  57165. s = void 0 !== s ? s : Math.PI;
  57166. 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++) {
  57167. for (var v = [], A = m / i, y = 0; y <= t; y++) {
  57168. var C = y / t
  57169. , I = -e * Math.cos(r + C * o) * Math.sin(a + A * s)
  57170. , E = e * Math.cos(a + A * s)
  57171. , b = e * Math.sin(r + C * o) * Math.sin(a + A * s);
  57172. g.set(I, E, b).normalize(),
  57173. h.setXYZ(p, I, E, b),
  57174. u.setXYZ(p, g.x, g.y, g.z),
  57175. d.setXY(p, C, 1 - A),
  57176. v.push(p),
  57177. p++
  57178. }
  57179. f.push(v)
  57180. }
  57181. for (var w = [], m = 0; m < i; m++)
  57182. for (var y = 0; y < t; y++) {
  57183. var _ = f[m][y + 1]
  57184. , T = f[m][y]
  57185. , x = f[m + 1][y]
  57186. , S = f[m + 1][y + 1];
  57187. (0 !== m || a > 0) && w.push(_, T, S),
  57188. (m !== i - 1 || l < Math.PI) && w.push(T, x, S)
  57189. }
  57190. this.setIndex(new (h.count > 65535 ? n.Uint32Attribute : n.Uint16Attribute)(w,1)),
  57191. this.addAttribute("position", h),
  57192. this.addAttribute("normal", u),
  57193. this.addAttribute("uv", d),
  57194. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  57195. }
  57196. ,
  57197. n.SphereBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57198. n.SphereBufferGeometry.prototype.constructor = n.SphereBufferGeometry,
  57199. n.TextGeometry = function(e, t) {
  57200. t = t || {};
  57201. var i = t.font;
  57202. if (i instanceof n.Font == !1)
  57203. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  57204. new n.Geometry;
  57205. var r = i.generateShapes(e, t.size, t.curveSegments);
  57206. t.amount = void 0 !== t.height ? t.height : 50,
  57207. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  57208. void 0 === t.bevelSize && (t.bevelSize = 8),
  57209. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  57210. n.ExtrudeGeometry.call(this, r, t),
  57211. this.type = "TextGeometry"
  57212. }
  57213. ,
  57214. n.TextGeometry.prototype = Object.create(n.ExtrudeGeometry.prototype),
  57215. n.TextGeometry.prototype.constructor = n.TextGeometry,
  57216. n.TorusBufferGeometry = function(e, t, i, r, o) {
  57217. n.BufferGeometry.call(this),
  57218. this.type = "TorusBufferGeometry",
  57219. this.parameters = {
  57220. radius: e,
  57221. tube: t,
  57222. radialSegments: i,
  57223. tubularSegments: r,
  57224. arc: o
  57225. },
  57226. e = e || 100,
  57227. t = t || 40,
  57228. i = Math.floor(i) || 8,
  57229. r = Math.floor(r) || 6,
  57230. o = o || 2 * Math.PI;
  57231. 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;
  57232. for (a = 0; a <= i; a++)
  57233. for (s = 0; s <= r; s++) {
  57234. var C = s / r * o
  57235. , I = a / i * Math.PI * 2;
  57236. A.x = (e + t * Math.cos(I)) * Math.cos(C),
  57237. A.y = (e + t * Math.cos(I)) * Math.sin(C),
  57238. A.z = t * Math.sin(I),
  57239. u[f] = A.x,
  57240. u[f + 1] = A.y,
  57241. u[f + 2] = A.z,
  57242. v.x = e * Math.cos(C),
  57243. v.y = e * Math.sin(C),
  57244. y.subVectors(A, v).normalize(),
  57245. d[f] = y.x,
  57246. d[f + 1] = y.y,
  57247. d[f + 2] = y.z,
  57248. p[g] = s / r,
  57249. p[g + 1] = a / i,
  57250. f += 3,
  57251. g += 2
  57252. }
  57253. for (a = 1; a <= i; a++)
  57254. for (s = 1; s <= r; s++) {
  57255. var E = (r + 1) * a + s - 1
  57256. , b = (r + 1) * (a - 1) + s - 1
  57257. , w = (r + 1) * (a - 1) + s
  57258. , _ = (r + 1) * a + s;
  57259. h[m] = E,
  57260. h[m + 1] = b,
  57261. h[m + 2] = _,
  57262. h[m + 3] = b,
  57263. h[m + 4] = w,
  57264. h[m + 5] = _,
  57265. m += 6
  57266. }
  57267. this.setIndex(new n.BufferAttribute(h,1)),
  57268. this.addAttribute("position", new n.BufferAttribute(u,3)),
  57269. this.addAttribute("normal", new n.BufferAttribute(d,3)),
  57270. this.addAttribute("uv", new n.BufferAttribute(p,2))
  57271. }
  57272. ,
  57273. n.TorusBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57274. n.TorusBufferGeometry.prototype.constructor = n.TorusBufferGeometry,
  57275. n.TorusGeometry = function(e, t, i, r, o) {
  57276. n.Geometry.call(this),
  57277. this.type = "TorusGeometry",
  57278. this.parameters = {
  57279. radius: e,
  57280. tube: t,
  57281. radialSegments: i,
  57282. tubularSegments: r,
  57283. arc: o
  57284. },
  57285. this.fromBufferGeometry(new n.TorusBufferGeometry(e,t,i,r,o))
  57286. }
  57287. ,
  57288. n.TorusGeometry.prototype = Object.create(n.Geometry.prototype),
  57289. n.TorusGeometry.prototype.constructor = n.TorusGeometry,
  57290. n.TorusKnotBufferGeometry = function(e, t, i, r, o, a) {
  57291. function s(e, t, i, n, r) {
  57292. var o = Math.cos(e)
  57293. , a = Math.sin(e)
  57294. , s = i / t * e
  57295. , l = Math.cos(s);
  57296. r.x = n * (2 + l) * .5 * o,
  57297. r.y = n * (2 + l) * a * .5,
  57298. r.z = n * Math.sin(s) * .5
  57299. }
  57300. n.BufferGeometry.call(this),
  57301. this.type = "TorusKnotBufferGeometry",
  57302. this.parameters = {
  57303. radius: e,
  57304. tube: t,
  57305. tubularSegments: i,
  57306. radialSegments: r,
  57307. p: o,
  57308. q: a
  57309. },
  57310. e = e || 100,
  57311. t = t || 40,
  57312. i = Math.floor(i) || 64,
  57313. r = Math.floor(r) || 8,
  57314. o = o || 2,
  57315. a = a || 3;
  57316. 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;
  57317. for (l = 0; l <= i; ++l) {
  57318. var T = l / i * o * Math.PI * 2;
  57319. for (s(T, o, a, e, I),
  57320. s(T + .01, o, a, e, E),
  57321. w.subVectors(E, I),
  57322. _.addVectors(E, I),
  57323. b.crossVectors(w, _),
  57324. _.crossVectors(b, w),
  57325. b.normalize(),
  57326. _.normalize(),
  57327. c = 0; c <= r; ++c) {
  57328. var x = c / r * Math.PI * 2
  57329. , S = -t * Math.cos(x)
  57330. , M = t * Math.sin(x);
  57331. A.x = I.x + (S * _.x + M * b.x),
  57332. A.y = I.y + (S * _.y + M * b.y),
  57333. A.z = I.z + (S * _.z + M * b.z),
  57334. p.setXYZ(m, A.x, A.y, A.z),
  57335. y.subVectors(A, I).normalize(),
  57336. f.setXYZ(m, y.x, y.y, y.z),
  57337. C.x = l / i,
  57338. C.y = c / r,
  57339. g.setXY(m, C.x, C.y),
  57340. m++
  57341. }
  57342. }
  57343. for (c = 1; c <= i; c++)
  57344. for (l = 1; l <= r; l++) {
  57345. var R = (r + 1) * (c - 1) + (l - 1)
  57346. , P = (r + 1) * c + (l - 1)
  57347. , O = (r + 1) * c + l
  57348. , L = (r + 1) * (c - 1) + l;
  57349. d.setX(v, R),
  57350. v++,
  57351. d.setX(v, P),
  57352. v++,
  57353. d.setX(v, L),
  57354. v++,
  57355. d.setX(v, P),
  57356. v++,
  57357. d.setX(v, O),
  57358. v++,
  57359. d.setX(v, L),
  57360. v++
  57361. }
  57362. this.setIndex(d),
  57363. this.addAttribute("position", p),
  57364. this.addAttribute("normal", f),
  57365. this.addAttribute("uv", g)
  57366. }
  57367. ,
  57368. n.TorusKnotBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57369. n.TorusKnotBufferGeometry.prototype.constructor = n.TorusKnotBufferGeometry,
  57370. n.TorusKnotGeometry = function(e, t, i, r, o, a, s) {
  57371. n.Geometry.call(this),
  57372. this.type = "TorusKnotGeometry",
  57373. this.parameters = {
  57374. radius: e,
  57375. tube: t,
  57376. tubularSegments: i,
  57377. radialSegments: r,
  57378. p: o,
  57379. q: a
  57380. },
  57381. void 0 !== s && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  57382. this.fromBufferGeometry(new n.TorusKnotBufferGeometry(e,t,i,r,o,a)),
  57383. this.mergeVertices()
  57384. }
  57385. ,
  57386. n.TorusKnotGeometry.prototype = Object.create(n.Geometry.prototype),
  57387. n.TorusKnotGeometry.prototype.constructor = n.TorusKnotGeometry,
  57388. n.TubeGeometry = function(e, t, i, r, o, a) {
  57389. function s(e, t, i) {
  57390. return R.vertices.push(new n.Vector3(e,t,i)) - 1
  57391. }
  57392. n.Geometry.call(this),
  57393. this.type = "TubeGeometry",
  57394. this.parameters = {
  57395. path: e,
  57396. segments: t,
  57397. radius: i,
  57398. radialSegments: r,
  57399. closed: o,
  57400. taper: a
  57401. },
  57402. t = t || 64,
  57403. i = i || 1,
  57404. r = r || 8,
  57405. o = o || !1,
  57406. a = a || n.TubeGeometry.NoTaper;
  57407. 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;
  57408. for (this.tangents = D,
  57409. this.normals = N,
  57410. this.binormals = B,
  57411. v = 0; v < P; v++)
  57412. for (M[v] = [],
  57413. u = v / (P - 1),
  57414. m = e.getPointAt(u),
  57415. l = D[v],
  57416. c = N[v],
  57417. h = B[v],
  57418. p = i * a(u),
  57419. A = 0; A < r; A++)
  57420. d = A / r * 2 * Math.PI,
  57421. f = -p * Math.cos(d),
  57422. g = p * Math.sin(d),
  57423. O.copy(m),
  57424. O.x += f * c.x + g * h.x,
  57425. O.y += f * c.y + g * h.y,
  57426. O.z += f * c.z + g * h.z,
  57427. M[v][A] = s(O.x, O.y, O.z);
  57428. for (v = 0; v < t; v++)
  57429. for (A = 0; A < r; A++)
  57430. y = o ? (v + 1) % t : v + 1,
  57431. C = (A + 1) % r,
  57432. I = M[v][A],
  57433. E = M[y][A],
  57434. b = M[y][C],
  57435. w = M[v][C],
  57436. _ = new n.Vector2(v / t,A / r),
  57437. T = new n.Vector2((v + 1) / t,A / r),
  57438. x = new n.Vector2((v + 1) / t,(A + 1) / r),
  57439. S = new n.Vector2(v / t,(A + 1) / r),
  57440. this.faces.push(new n.Face3(I,E,w)),
  57441. this.faceVertexUvs[0].push([_, T, S]),
  57442. this.faces.push(new n.Face3(E,b,w)),
  57443. this.faceVertexUvs[0].push([T.clone(), x, S.clone()]);
  57444. this.computeFaceNormals(),
  57445. this.computeVertexNormals()
  57446. }
  57447. ,
  57448. n.TubeGeometry.prototype = Object.create(n.Geometry.prototype),
  57449. n.TubeGeometry.prototype.constructor = n.TubeGeometry,
  57450. n.TubeGeometry.NoTaper = function(e) {
  57451. return 1
  57452. }
  57453. ,
  57454. n.TubeGeometry.SinusoidalTaper = function(e) {
  57455. return Math.sin(Math.PI * e)
  57456. }
  57457. ,
  57458. n.TubeGeometry.FrenetFrames = function(e, t, i) {
  57459. function r() {
  57460. f[0] = new n.Vector3,
  57461. g[0] = new n.Vector3,
  57462. a = Number.MAX_VALUE,
  57463. s = Math.abs(p[0].x),
  57464. l = Math.abs(p[0].y),
  57465. c = Math.abs(p[0].z),
  57466. s <= a && (a = s,
  57467. d.set(1, 0, 0)),
  57468. l <= a && (a = l,
  57469. d.set(0, 1, 0)),
  57470. c <= a && d.set(0, 0, 1),
  57471. m.crossVectors(p[0], d).normalize(),
  57472. f[0].crossVectors(p[0], m),
  57473. g[0].crossVectors(p[0], f[0])
  57474. }
  57475. 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;
  57476. for (this.tangents = p,
  57477. this.normals = f,
  57478. this.binormals = g,
  57479. h = 0; h < A; h++)
  57480. u = h / (A - 1),
  57481. p[h] = e.getTangentAt(u),
  57482. p[h].normalize();
  57483. for (r(),
  57484. h = 1; h < A; h++)
  57485. f[h] = f[h - 1].clone(),
  57486. g[h] = g[h - 1].clone(),
  57487. m.crossVectors(p[h - 1], p[h]),
  57488. m.length() > Number.EPSILON && (m.normalize(),
  57489. o = Math.acos(n.Math.clamp(p[h - 1].dot(p[h]), -1, 1)),
  57490. f[h].applyMatrix4(v.makeRotationAxis(m, o))),
  57491. g[h].crossVectors(p[h], f[h]);
  57492. if (i)
  57493. for (o = Math.acos(n.Math.clamp(f[0].dot(f[A - 1]), -1, 1)),
  57494. o /= A - 1,
  57495. p[0].dot(m.crossVectors(f[0], f[A - 1])) > 0 && (o = -o),
  57496. h = 1; h < A; h++)
  57497. f[h].applyMatrix4(v.makeRotationAxis(p[h], o * h)),
  57498. g[h].crossVectors(p[h], f[h])
  57499. }
  57500. ,
  57501. n.PolyhedronGeometry = function(e, t, i, r) {
  57502. function o(e) {
  57503. var t = e.normalize().clone();
  57504. t.index = u.vertices.push(t) - 1;
  57505. var i = l(e) / 2 / Math.PI + .5
  57506. , r = c(e) / Math.PI + .5;
  57507. return t.uv = new n.Vector2(i,1 - r),
  57508. t
  57509. }
  57510. function a(e, t, i, r) {
  57511. var o = new n.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,r);
  57512. u.faces.push(o),
  57513. C.copy(e).add(t).add(i).divideScalar(3);
  57514. var a = l(C);
  57515. u.faceVertexUvs[0].push([h(e.uv, e, a), h(t.uv, t, a), h(i.uv, i, a)])
  57516. }
  57517. function s(e, t) {
  57518. 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++) {
  57519. l[h] = [];
  57520. 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++)
  57521. 0 === g && h === i ? l[h][g] = d : l[h][g] = o(d.clone().lerp(p, g / f))
  57522. }
  57523. for (var h = 0; h < i; h++)
  57524. for (var g = 0; g < 2 * (i - h) - 1; g++) {
  57525. var m = Math.floor(g / 2);
  57526. 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)
  57527. }
  57528. }
  57529. function l(e) {
  57530. return Math.atan2(e.z, -e.x)
  57531. }
  57532. function c(e) {
  57533. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  57534. }
  57535. function h(e, t, i) {
  57536. return i < 0 && 1 === e.x && (e = new n.Vector2(e.x - 1,e.y)),
  57537. 0 === t.x && 0 === t.z && (e = new n.Vector2(i / 2 / Math.PI + .5,e.y)),
  57538. e.clone()
  57539. }
  57540. n.Geometry.call(this),
  57541. this.type = "PolyhedronGeometry",
  57542. this.parameters = {
  57543. vertices: e,
  57544. indices: t,
  57545. radius: i,
  57546. detail: r
  57547. },
  57548. i = i || 1,
  57549. r = r || 0;
  57550. for (var u = this, d = 0, p = e.length; d < p; d += 3)
  57551. o(new n.Vector3(e[d],e[d + 1],e[d + 2]));
  57552. for (var f = this.vertices, g = [], d = 0, m = 0, p = t.length; d < p; d += 3,
  57553. m++) {
  57554. var v = f[t[d]]
  57555. , A = f[t[d + 1]]
  57556. , y = f[t[d + 2]];
  57557. g[m] = new n.Face3(v.index,A.index,y.index,[v.clone(), A.clone(), y.clone()],void 0,m)
  57558. }
  57559. for (var C = new n.Vector3, d = 0, p = g.length; d < p; d++)
  57560. s(g[d], r);
  57561. for (var d = 0, p = this.faceVertexUvs[0].length; d < p; d++) {
  57562. var I = this.faceVertexUvs[0][d]
  57563. , E = I[0].x
  57564. , b = I[1].x
  57565. , w = I[2].x
  57566. , _ = Math.max(E, b, w)
  57567. , T = Math.min(E, b, w);
  57568. _ > .9 && T < .1 && (E < .2 && (I[0].x += 1),
  57569. b < .2 && (I[1].x += 1),
  57570. w < .2 && (I[2].x += 1))
  57571. }
  57572. for (var d = 0, p = this.vertices.length; d < p; d++)
  57573. this.vertices[d].multiplyScalar(i);
  57574. this.mergeVertices(),
  57575. this.computeFaceNormals(),
  57576. this.boundingSphere = new n.Sphere(new n.Vector3,i)
  57577. }
  57578. ,
  57579. n.PolyhedronGeometry.prototype = Object.create(n.Geometry.prototype),
  57580. n.PolyhedronGeometry.prototype.constructor = n.PolyhedronGeometry,
  57581. n.DodecahedronGeometry = function(e, t) {
  57582. var i = (1 + Math.sqrt(5)) / 2
  57583. , r = 1 / i
  57584. , 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]
  57585. , 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];
  57586. n.PolyhedronGeometry.call(this, o, a, e, t),
  57587. this.type = "DodecahedronGeometry",
  57588. this.parameters = {
  57589. radius: e,
  57590. detail: t
  57591. }
  57592. }
  57593. ,
  57594. n.DodecahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  57595. n.DodecahedronGeometry.prototype.constructor = n.DodecahedronGeometry,
  57596. n.IcosahedronGeometry = function(e, t) {
  57597. var i = (1 + Math.sqrt(5)) / 2
  57598. , 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]
  57599. , 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];
  57600. n.PolyhedronGeometry.call(this, r, o, e, t),
  57601. this.type = "IcosahedronGeometry",
  57602. this.parameters = {
  57603. radius: e,
  57604. detail: t
  57605. }
  57606. }
  57607. ,
  57608. n.IcosahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  57609. n.IcosahedronGeometry.prototype.constructor = n.IcosahedronGeometry,
  57610. n.OctahedronGeometry = function(e, t) {
  57611. var i = [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1]
  57612. , 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];
  57613. n.PolyhedronGeometry.call(this, i, r, e, t),
  57614. this.type = "OctahedronGeometry",
  57615. this.parameters = {
  57616. radius: e,
  57617. detail: t
  57618. }
  57619. }
  57620. ,
  57621. n.OctahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  57622. n.OctahedronGeometry.prototype.constructor = n.OctahedronGeometry,
  57623. n.TetrahedronGeometry = function(e, t) {
  57624. var i = [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1]
  57625. , r = [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1];
  57626. n.PolyhedronGeometry.call(this, i, r, e, t),
  57627. this.type = "TetrahedronGeometry",
  57628. this.parameters = {
  57629. radius: e,
  57630. detail: t
  57631. }
  57632. }
  57633. ,
  57634. n.TetrahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  57635. n.TetrahedronGeometry.prototype.constructor = n.TetrahedronGeometry,
  57636. n.ParametricGeometry = function(e, t, i) {
  57637. n.Geometry.call(this),
  57638. this.type = "ParametricGeometry",
  57639. this.parameters = {
  57640. func: e,
  57641. slices: t,
  57642. stacks: i
  57643. };
  57644. var r, o, a, s, l, c = this.vertices, h = this.faces, u = this.faceVertexUvs[0], d = t + 1;
  57645. for (r = 0; r <= i; r++)
  57646. for (l = r / i,
  57647. o = 0; o <= t; o++)
  57648. s = o / t,
  57649. a = e(s, l),
  57650. c.push(a);
  57651. var p, f, g, m, v, A, y, C;
  57652. for (r = 0; r < i; r++)
  57653. for (o = 0; o < t; o++)
  57654. p = r * d + o,
  57655. f = r * d + o + 1,
  57656. g = (r + 1) * d + o + 1,
  57657. m = (r + 1) * d + o,
  57658. v = new n.Vector2(o / t,r / i),
  57659. A = new n.Vector2((o + 1) / t,r / i),
  57660. y = new n.Vector2((o + 1) / t,(r + 1) / i),
  57661. C = new n.Vector2(o / t,(r + 1) / i),
  57662. h.push(new n.Face3(p,f,m)),
  57663. u.push([v, A, C]),
  57664. h.push(new n.Face3(f,g,m)),
  57665. u.push([A.clone(), y, C.clone()]);
  57666. this.computeFaceNormals(),
  57667. this.computeVertexNormals()
  57668. }
  57669. ,
  57670. n.ParametricGeometry.prototype = Object.create(n.Geometry.prototype),
  57671. n.ParametricGeometry.prototype.constructor = n.ParametricGeometry,
  57672. n.WireframeGeometry = function(e) {
  57673. function t(e, t) {
  57674. return e - t
  57675. }
  57676. n.BufferGeometry.call(this);
  57677. var i = [0, 0]
  57678. , r = {}
  57679. , o = ["a", "b", "c"];
  57680. if (e instanceof n.Geometry) {
  57681. for (var a = e.vertices, s = e.faces, l = 0, c = new Uint32Array(6 * s.length), h = 0, u = s.length; h < u; h++)
  57682. for (var d = s[h], p = 0; p < 3; p++) {
  57683. i[0] = d[o[p]],
  57684. i[1] = d[o[(p + 1) % 3]],
  57685. i.sort(t);
  57686. var f = i.toString();
  57687. void 0 === r[f] && (c[2 * l] = i[0],
  57688. c[2 * l + 1] = i[1],
  57689. r[f] = !0,
  57690. l++)
  57691. }
  57692. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  57693. for (var p = 0; p < 2; p++) {
  57694. var m = a[c[2 * h + p]]
  57695. , v = 6 * h + 3 * p;
  57696. g[v + 0] = m.x,
  57697. g[v + 1] = m.y,
  57698. g[v + 2] = m.z
  57699. }
  57700. this.addAttribute("position", new n.BufferAttribute(g,3))
  57701. } else if (e instanceof n.BufferGeometry)
  57702. if (null !== e.index) {
  57703. var A = e.index.array
  57704. , a = e.attributes.position
  57705. , y = e.groups
  57706. , l = 0;
  57707. 0 === y.length && e.addGroup(0, A.length);
  57708. for (var c = new Uint32Array(2 * A.length), C = 0, I = y.length; C < I; ++C)
  57709. for (var E = y[C], b = E.start, w = E.count, h = b, _ = b + w; h < _; h += 3)
  57710. for (var p = 0; p < 3; p++) {
  57711. i[0] = A[h + p],
  57712. i[1] = A[h + (p + 1) % 3],
  57713. i.sort(t);
  57714. var f = i.toString();
  57715. void 0 === r[f] && (c[2 * l] = i[0],
  57716. c[2 * l + 1] = i[1],
  57717. r[f] = !0,
  57718. l++)
  57719. }
  57720. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  57721. for (var p = 0; p < 2; p++) {
  57722. var v = 6 * h + 3 * p
  57723. , T = c[2 * h + p];
  57724. g[v + 0] = a.getX(T),
  57725. g[v + 1] = a.getY(T),
  57726. g[v + 2] = a.getZ(T)
  57727. }
  57728. this.addAttribute("position", new n.BufferAttribute(g,3))
  57729. } else {
  57730. 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++)
  57731. for (var p = 0; p < 3; p++) {
  57732. var v = 18 * h + 6 * p
  57733. , S = 9 * h + 3 * p;
  57734. g[v + 0] = a[S],
  57735. g[v + 1] = a[S + 1],
  57736. g[v + 2] = a[S + 2];
  57737. var T = 9 * h + 3 * ((p + 1) % 3);
  57738. g[v + 3] = a[T],
  57739. g[v + 4] = a[T + 1],
  57740. g[v + 5] = a[T + 2]
  57741. }
  57742. this.addAttribute("position", new n.BufferAttribute(g,3))
  57743. }
  57744. }
  57745. ,
  57746. n.WireframeGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57747. n.WireframeGeometry.prototype.constructor = n.WireframeGeometry,
  57748. n.AxisHelper = function(e) {
  57749. e = e || 1;
  57750. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  57751. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  57752. , r = new n.BufferGeometry;
  57753. r.addAttribute("position", new n.BufferAttribute(t,3)),
  57754. r.addAttribute("color", new n.BufferAttribute(i,3));
  57755. var o = new n.LineBasicMaterial({
  57756. vertexColors: n.VertexColors
  57757. });
  57758. n.LineSegments.call(this, r, o)
  57759. }
  57760. ,
  57761. n.AxisHelper.prototype = Object.create(n.LineSegments.prototype),
  57762. n.AxisHelper.prototype.constructor = n.AxisHelper,
  57763. n.ArrowHelper = function() {
  57764. var e = new n.Geometry;
  57765. e.vertices.push(new n.Vector3(0,0,0), new n.Vector3(0,1,0));
  57766. var t = new n.CylinderGeometry(0,.5,1,5,1);
  57767. return t.translate(0, -.5, 0),
  57768. function(i, r, o, a, s, l) {
  57769. n.Object3D.call(this),
  57770. void 0 === a && (a = 16776960),
  57771. void 0 === o && (o = 1),
  57772. void 0 === s && (s = .2 * o),
  57773. void 0 === l && (l = .2 * s),
  57774. this.position.copy(r),
  57775. this.line = new n.Line(e,new n.LineBasicMaterial({
  57776. color: a
  57777. })),
  57778. this.line.matrixAutoUpdate = !1,
  57779. this.add(this.line),
  57780. this.cone = new n.Mesh(t,new n.MeshBasicMaterial({
  57781. color: a
  57782. })),
  57783. this.cone.matrixAutoUpdate = !1,
  57784. this.add(this.cone),
  57785. this.setDirection(i),
  57786. this.setLength(o, s, l)
  57787. }
  57788. }(),
  57789. n.ArrowHelper.prototype = Object.create(n.Object3D.prototype),
  57790. n.ArrowHelper.prototype.constructor = n.ArrowHelper,
  57791. n.ArrowHelper.prototype.setDirection = function() {
  57792. var e, t = new n.Vector3;
  57793. return function(i) {
  57794. 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(),
  57795. e = Math.acos(i.y),
  57796. this.quaternion.setFromAxisAngle(t, e))
  57797. }
  57798. }(),
  57799. n.ArrowHelper.prototype.setLength = function(e, t, i) {
  57800. void 0 === t && (t = .2 * e),
  57801. void 0 === i && (i = .2 * t),
  57802. this.line.scale.set(1, Math.max(0, e - t), 1),
  57803. this.line.updateMatrix(),
  57804. this.cone.scale.set(i, t, i),
  57805. this.cone.position.y = e,
  57806. this.cone.updateMatrix()
  57807. }
  57808. ,
  57809. n.ArrowHelper.prototype.setColor = function(e) {
  57810. this.line.material.color.set(e),
  57811. this.cone.material.color.set(e)
  57812. }
  57813. ,
  57814. n.BoxHelper = function(e) {
  57815. 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])
  57816. , i = new Float32Array(24)
  57817. , r = new n.BufferGeometry;
  57818. r.setIndex(new n.BufferAttribute(t,1)),
  57819. r.addAttribute("position", new n.BufferAttribute(i,3)),
  57820. n.LineSegments.call(this, r, new n.LineBasicMaterial({
  57821. color: 16776960
  57822. })),
  57823. void 0 !== e && this.update(e)
  57824. }
  57825. ,
  57826. n.BoxHelper.prototype = Object.create(n.LineSegments.prototype),
  57827. n.BoxHelper.prototype.constructor = n.BoxHelper,
  57828. n.BoxHelper.prototype.update = function() {
  57829. var e = new n.Box3;
  57830. return function(t) {
  57831. if (e.setFromObject(t),
  57832. !e.isEmpty()) {
  57833. var i = e.min
  57834. , n = e.max
  57835. , r = this.geometry.attributes.position
  57836. , o = r.array;
  57837. o[0] = n.x,
  57838. o[1] = n.y,
  57839. o[2] = n.z,
  57840. o[3] = i.x,
  57841. o[4] = n.y,
  57842. o[5] = n.z,
  57843. o[6] = i.x,
  57844. o[7] = i.y,
  57845. o[8] = n.z,
  57846. o[9] = n.x,
  57847. o[10] = i.y,
  57848. o[11] = n.z,
  57849. o[12] = n.x,
  57850. o[13] = n.y,
  57851. o[14] = i.z,
  57852. o[15] = i.x,
  57853. o[16] = n.y,
  57854. o[17] = i.z,
  57855. o[18] = i.x,
  57856. o[19] = i.y,
  57857. o[20] = i.z,
  57858. o[21] = n.x,
  57859. o[22] = i.y,
  57860. o[23] = i.z,
  57861. r.needsUpdate = !0,
  57862. this.geometry.computeBoundingSphere()
  57863. }
  57864. }
  57865. }(),
  57866. n.BoundingBoxHelper = function(e, t) {
  57867. var i = void 0 !== t ? t : 8947848;
  57868. this.object = e,
  57869. this.box = new n.Box3,
  57870. n.Mesh.call(this, new n.BoxGeometry(1,1,1), new n.MeshBasicMaterial({
  57871. color: i,
  57872. wireframe: !0
  57873. }))
  57874. }
  57875. ,
  57876. n.BoundingBoxHelper.prototype = Object.create(n.Mesh.prototype),
  57877. n.BoundingBoxHelper.prototype.constructor = n.BoundingBoxHelper,
  57878. n.BoundingBoxHelper.prototype.update = function() {
  57879. this.box.setFromObject(this.object),
  57880. this.box.size(this.scale),
  57881. this.box.center(this.position)
  57882. }
  57883. ,
  57884. n.CameraHelper = function(e) {
  57885. function t(e, t, n) {
  57886. i(e, n),
  57887. i(t, n)
  57888. }
  57889. function i(e, t) {
  57890. r.vertices.push(new n.Vector3),
  57891. r.colors.push(new n.Color(t)),
  57892. void 0 === a[e] && (a[e] = []),
  57893. a[e].push(r.vertices.length - 1)
  57894. }
  57895. var r = new n.Geometry
  57896. , o = new n.LineBasicMaterial({
  57897. color: 16777215,
  57898. vertexColors: n.FaceColors
  57899. })
  57900. , a = {}
  57901. , s = 16755200
  57902. , l = 16711680
  57903. , c = 43775
  57904. , h = 16777215
  57905. , u = 3355443;
  57906. t("n1", "n2", s),
  57907. t("n2", "n4", s),
  57908. t("n4", "n3", s),
  57909. t("n3", "n1", s),
  57910. t("f1", "f2", s),
  57911. t("f2", "f4", s),
  57912. t("f4", "f3", s),
  57913. t("f3", "f1", s),
  57914. t("n1", "f1", s),
  57915. t("n2", "f2", s),
  57916. t("n3", "f3", s),
  57917. t("n4", "f4", s),
  57918. t("p", "n1", l),
  57919. t("p", "n2", l),
  57920. t("p", "n3", l),
  57921. t("p", "n4", l),
  57922. t("u1", "u2", c),
  57923. t("u2", "u3", c),
  57924. t("u3", "u1", c),
  57925. t("c", "t", h),
  57926. t("p", "c", u),
  57927. t("cn1", "cn2", u),
  57928. t("cn3", "cn4", u),
  57929. t("cf1", "cf2", u),
  57930. t("cf3", "cf4", u),
  57931. n.LineSegments.call(this, r, o),
  57932. this.camera = e,
  57933. this.camera.updateProjectionMatrix(),
  57934. this.matrix = e.matrixWorld,
  57935. this.matrixAutoUpdate = !1,
  57936. this.pointMap = a,
  57937. this.update()
  57938. }
  57939. ,
  57940. n.CameraHelper.prototype = Object.create(n.LineSegments.prototype),
  57941. n.CameraHelper.prototype.constructor = n.CameraHelper,
  57942. n.CameraHelper.prototype.update = function() {
  57943. function e(e, n, a, s) {
  57944. r.set(n, a, s).unproject(o);
  57945. var l = i[e];
  57946. if (void 0 !== l)
  57947. for (var c = 0, h = l.length; c < h; c++)
  57948. t.vertices[l[c]].copy(r)
  57949. }
  57950. var t, i, r = new n.Vector3, o = new n.Camera;
  57951. return function() {
  57952. t = this.geometry,
  57953. i = this.pointMap;
  57954. var n = 1
  57955. , r = 1;
  57956. o.projectionMatrix.copy(this.camera.projectionMatrix),
  57957. e("c", 0, 0, -1),
  57958. e("t", 0, 0, 1),
  57959. e("n1", -n, -r, -1),
  57960. e("n2", n, -r, -1),
  57961. e("n3", -n, r, -1),
  57962. e("n4", n, r, -1),
  57963. e("f1", -n, -r, 1),
  57964. e("f2", n, -r, 1),
  57965. e("f3", -n, r, 1),
  57966. e("f4", n, r, 1),
  57967. e("u1", .7 * n, 1.1 * r, -1),
  57968. e("u2", .7 * -n, 1.1 * r, -1),
  57969. e("u3", 0, 2 * r, -1),
  57970. e("cf1", -n, 0, 1),
  57971. e("cf2", n, 0, 1),
  57972. e("cf3", 0, -r, 1),
  57973. e("cf4", 0, r, 1),
  57974. e("cn1", -n, 0, -1),
  57975. e("cn2", n, 0, -1),
  57976. e("cn3", 0, -r, -1),
  57977. e("cn4", 0, r, -1),
  57978. t.verticesNeedUpdate = !0
  57979. }
  57980. }(),
  57981. n.DirectionalLightHelper = function(e, t) {
  57982. n.Object3D.call(this),
  57983. this.light = e,
  57984. this.light.updateMatrixWorld(),
  57985. this.matrix = e.matrixWorld,
  57986. this.matrixAutoUpdate = !1,
  57987. t = t || 1;
  57988. var i = new n.Geometry;
  57989. 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));
  57990. var r = new n.LineBasicMaterial({
  57991. fog: !1
  57992. });
  57993. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  57994. this.lightPlane = new n.Line(i,r),
  57995. this.add(this.lightPlane),
  57996. i = new n.Geometry,
  57997. i.vertices.push(new n.Vector3, new n.Vector3),
  57998. r = new n.LineBasicMaterial({
  57999. fog: !1
  58000. }),
  58001. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  58002. this.targetLine = new n.Line(i,r),
  58003. this.add(this.targetLine),
  58004. this.update()
  58005. }
  58006. ,
  58007. n.DirectionalLightHelper.prototype = Object.create(n.Object3D.prototype),
  58008. n.DirectionalLightHelper.prototype.constructor = n.DirectionalLightHelper,
  58009. n.DirectionalLightHelper.prototype.dispose = function() {
  58010. this.lightPlane.geometry.dispose(),
  58011. this.lightPlane.material.dispose(),
  58012. this.targetLine.geometry.dispose(),
  58013. this.targetLine.material.dispose()
  58014. }
  58015. ,
  58016. n.DirectionalLightHelper.prototype.update = function() {
  58017. var e = new n.Vector3
  58018. , t = new n.Vector3
  58019. , i = new n.Vector3;
  58020. return function() {
  58021. e.setFromMatrixPosition(this.light.matrixWorld),
  58022. t.setFromMatrixPosition(this.light.target.matrixWorld),
  58023. i.subVectors(t, e),
  58024. this.lightPlane.lookAt(i),
  58025. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  58026. this.targetLine.geometry.vertices[1].copy(i),
  58027. this.targetLine.geometry.verticesNeedUpdate = !0,
  58028. this.targetLine.material.color.copy(this.lightPlane.material.color)
  58029. }
  58030. }(),
  58031. n.EdgesHelper = function(e, t, i) {
  58032. var r = void 0 !== t ? t : 16777215;
  58033. n.LineSegments.call(this, new n.EdgesGeometry(e.geometry,i), new n.LineBasicMaterial({
  58034. color: r
  58035. })),
  58036. this.matrix = e.matrixWorld,
  58037. this.matrixAutoUpdate = !1
  58038. }
  58039. ,
  58040. n.EdgesHelper.prototype = Object.create(n.LineSegments.prototype),
  58041. n.EdgesHelper.prototype.constructor = n.EdgesHelper,
  58042. n.FaceNormalsHelper = function(e, t, i, r) {
  58043. this.object = e,
  58044. this.size = void 0 !== t ? t : 1;
  58045. var o = void 0 !== i ? i : 16776960
  58046. , a = void 0 !== r ? r : 1
  58047. , s = 0
  58048. , l = this.object.geometry;
  58049. l instanceof n.Geometry ? s = l.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  58050. var c = new n.BufferGeometry
  58051. , h = new n.Float32Attribute(2 * s * 3,3);
  58052. c.addAttribute("position", h),
  58053. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  58054. color: o,
  58055. linewidth: a
  58056. })),
  58057. this.matrixAutoUpdate = !1,
  58058. this.update()
  58059. }
  58060. ,
  58061. n.FaceNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  58062. n.FaceNormalsHelper.prototype.constructor = n.FaceNormalsHelper,
  58063. n.FaceNormalsHelper.prototype.update = function() {
  58064. var e = new n.Vector3
  58065. , t = new n.Vector3
  58066. , i = new n.Matrix3;
  58067. return function() {
  58068. this.object.updateMatrixWorld(!0),
  58069. i.getNormalMatrix(this.object.matrixWorld);
  58070. 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++) {
  58071. var u = s[c]
  58072. , d = u.normal;
  58073. e.copy(a[u.a]).add(a[u.b]).add(a[u.c]).divideScalar(3).applyMatrix4(n),
  58074. t.copy(d).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  58075. r.setXYZ(l, e.x, e.y, e.z),
  58076. l += 1,
  58077. r.setXYZ(l, t.x, t.y, t.z),
  58078. l += 1
  58079. }
  58080. return r.needsUpdate = !0,
  58081. this
  58082. }
  58083. }(),
  58084. n.GridHelper = function(e, t) {
  58085. var i = new n.Geometry
  58086. , r = new n.LineBasicMaterial({
  58087. vertexColors: n.VertexColors
  58088. });
  58089. this.color1 = new n.Color(4473924),
  58090. this.color2 = new n.Color(8947848);
  58091. for (var o = -e; o <= e; o += t) {
  58092. 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));
  58093. var a = 0 === o ? this.color1 : this.color2;
  58094. i.colors.push(a, a, a, a)
  58095. }
  58096. n.LineSegments.call(this, i, r)
  58097. }
  58098. ,
  58099. n.GridHelper.prototype = Object.create(n.LineSegments.prototype),
  58100. n.GridHelper.prototype.constructor = n.GridHelper,
  58101. n.GridHelper.prototype.setColors = function(e, t) {
  58102. this.color1.set(e),
  58103. this.color2.set(t),
  58104. this.geometry.colorsNeedUpdate = !0
  58105. }
  58106. ,
  58107. n.HemisphereLightHelper = function(e, t) {
  58108. n.Object3D.call(this),
  58109. this.light = e,
  58110. this.light.updateMatrixWorld(),
  58111. this.matrix = e.matrixWorld,
  58112. this.matrixAutoUpdate = !1,
  58113. this.colors = [new n.Color, new n.Color];
  58114. var i = new n.SphereGeometry(t,4,2);
  58115. i.rotateX(-Math.PI / 2);
  58116. for (var r = 0, o = 8; r < o; r++)
  58117. i.faces[r].color = this.colors[r < 4 ? 0 : 1];
  58118. var a = new n.MeshBasicMaterial({
  58119. vertexColors: n.FaceColors,
  58120. wireframe: !0
  58121. });
  58122. this.lightSphere = new n.Mesh(i,a),
  58123. this.add(this.lightSphere),
  58124. this.update()
  58125. }
  58126. ,
  58127. n.HemisphereLightHelper.prototype = Object.create(n.Object3D.prototype),
  58128. n.HemisphereLightHelper.prototype.constructor = n.HemisphereLightHelper,
  58129. n.HemisphereLightHelper.prototype.dispose = function() {
  58130. this.lightSphere.geometry.dispose(),
  58131. this.lightSphere.material.dispose()
  58132. }
  58133. ,
  58134. n.HemisphereLightHelper.prototype.update = function() {
  58135. var e = new n.Vector3;
  58136. return function() {
  58137. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  58138. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  58139. this.lightSphere.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate()),
  58140. this.lightSphere.geometry.colorsNeedUpdate = !0
  58141. }
  58142. }(),
  58143. n.PointLightHelper = function(e, t) {
  58144. this.light = e,
  58145. this.light.updateMatrixWorld();
  58146. var i = new n.SphereGeometry(t,4,2)
  58147. , r = new n.MeshBasicMaterial({
  58148. wireframe: !0,
  58149. fog: !1
  58150. });
  58151. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  58152. n.Mesh.call(this, i, r),
  58153. this.matrix = this.light.matrixWorld,
  58154. this.matrixAutoUpdate = !1
  58155. }
  58156. ,
  58157. n.PointLightHelper.prototype = Object.create(n.Mesh.prototype),
  58158. n.PointLightHelper.prototype.constructor = n.PointLightHelper,
  58159. n.PointLightHelper.prototype.dispose = function() {
  58160. this.geometry.dispose(),
  58161. this.material.dispose()
  58162. }
  58163. ,
  58164. n.PointLightHelper.prototype.update = function() {
  58165. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  58166. }
  58167. ,
  58168. n.SkeletonHelper = function(e) {
  58169. this.bones = this.getBoneList(e);
  58170. for (var t = new n.Geometry, i = 0; i < this.bones.length; i++) {
  58171. var r = this.bones[i];
  58172. r.parent instanceof n.Bone && (t.vertices.push(new n.Vector3),
  58173. t.vertices.push(new n.Vector3),
  58174. t.colors.push(new n.Color(0,0,1)),
  58175. t.colors.push(new n.Color(0,1,0)))
  58176. }
  58177. t.dynamic = !0;
  58178. var o = new n.LineBasicMaterial({
  58179. vertexColors: n.VertexColors,
  58180. depthTest: !1,
  58181. depthWrite: !1,
  58182. transparent: !0
  58183. });
  58184. n.LineSegments.call(this, t, o),
  58185. this.root = e,
  58186. this.matrix = e.matrixWorld,
  58187. this.matrixAutoUpdate = !1,
  58188. this.update()
  58189. }
  58190. ,
  58191. n.SkeletonHelper.prototype = Object.create(n.LineSegments.prototype),
  58192. n.SkeletonHelper.prototype.constructor = n.SkeletonHelper,
  58193. n.SkeletonHelper.prototype.getBoneList = function(e) {
  58194. var t = [];
  58195. e instanceof n.Bone && t.push(e);
  58196. for (var i = 0; i < e.children.length; i++)
  58197. t.push.apply(t, this.getBoneList(e.children[i]));
  58198. return t
  58199. }
  58200. ,
  58201. n.SkeletonHelper.prototype.update = function() {
  58202. 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++) {
  58203. var a = this.bones[o];
  58204. a.parent instanceof n.Bone && (i.multiplyMatrices(t, a.matrixWorld),
  58205. e.vertices[r].setFromMatrixPosition(i),
  58206. i.multiplyMatrices(t, a.parent.matrixWorld),
  58207. e.vertices[r + 1].setFromMatrixPosition(i),
  58208. r += 2)
  58209. }
  58210. e.verticesNeedUpdate = !0,
  58211. e.computeBoundingSphere()
  58212. }
  58213. ,
  58214. n.SpotLightHelper = function(e) {
  58215. n.Object3D.call(this),
  58216. this.light = e,
  58217. this.light.updateMatrixWorld(),
  58218. this.matrix = e.matrixWorld,
  58219. this.matrixAutoUpdate = !1;
  58220. var t = new n.CylinderGeometry(0,1,1,8,1,!0);
  58221. t.translate(0, -.5, 0),
  58222. t.rotateX(-Math.PI / 2);
  58223. var i = new n.MeshBasicMaterial({
  58224. wireframe: !0,
  58225. fog: !1
  58226. });
  58227. this.cone = new n.Mesh(t,i),
  58228. this.add(this.cone),
  58229. this.update()
  58230. }
  58231. ,
  58232. n.SpotLightHelper.prototype = Object.create(n.Object3D.prototype),
  58233. n.SpotLightHelper.prototype.constructor = n.SpotLightHelper,
  58234. n.SpotLightHelper.prototype.dispose = function() {
  58235. this.cone.geometry.dispose(),
  58236. this.cone.material.dispose()
  58237. }
  58238. ,
  58239. n.SpotLightHelper.prototype.update = function() {
  58240. var e = new n.Vector3
  58241. , t = new n.Vector3;
  58242. return function() {
  58243. var i = this.light.distance ? this.light.distance : 1e4
  58244. , n = i * Math.tan(this.light.angle);
  58245. this.cone.scale.set(n, n, i),
  58246. e.setFromMatrixPosition(this.light.matrixWorld),
  58247. t.setFromMatrixPosition(this.light.target.matrixWorld),
  58248. this.cone.lookAt(t.sub(e)),
  58249. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  58250. }
  58251. }(),
  58252. n.VertexNormalsHelper = function(e, t, i, r) {
  58253. this.object = e,
  58254. this.size = void 0 !== t ? t : 1;
  58255. var o = void 0 !== i ? i : 16711680
  58256. , a = void 0 !== r ? r : 1
  58257. , s = 0
  58258. , l = this.object.geometry;
  58259. l instanceof n.Geometry ? s = 3 * l.faces.length : l instanceof n.BufferGeometry && (s = l.attributes.normal.count);
  58260. var c = new n.BufferGeometry
  58261. , h = new n.Float32Attribute(2 * s * 3,3);
  58262. c.addAttribute("position", h),
  58263. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  58264. color: o,
  58265. linewidth: a
  58266. })),
  58267. this.matrixAutoUpdate = !1,
  58268. this.update()
  58269. }
  58270. ,
  58271. n.VertexNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  58272. n.VertexNormalsHelper.prototype.constructor = n.VertexNormalsHelper,
  58273. n.VertexNormalsHelper.prototype.update = function() {
  58274. var e = new n.Vector3
  58275. , t = new n.Vector3
  58276. , i = new n.Matrix3;
  58277. return function() {
  58278. var r = ["a", "b", "c"];
  58279. this.object.updateMatrixWorld(!0),
  58280. i.getNormalMatrix(this.object.matrixWorld);
  58281. var o = this.object.matrixWorld
  58282. , a = this.geometry.attributes.position
  58283. , s = this.object.geometry;
  58284. if (s instanceof n.Geometry)
  58285. for (var l = s.vertices, c = s.faces, h = 0, u = 0, d = c.length; u < d; u++)
  58286. for (var p = c[u], f = 0, g = p.vertexNormals.length; f < g; f++) {
  58287. var m = l[p[r[f]]]
  58288. , v = p.vertexNormals[f];
  58289. e.copy(m).applyMatrix4(o),
  58290. t.copy(v).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  58291. a.setXYZ(h, e.x, e.y, e.z),
  58292. h += 1,
  58293. a.setXYZ(h, t.x, t.y, t.z),
  58294. h += 1
  58295. }
  58296. else if (s instanceof n.BufferGeometry)
  58297. for (var A = s.attributes.position, y = s.attributes.normal, h = 0, f = 0, g = A.count; f < g; f++)
  58298. e.set(A.getX(f), A.getY(f), A.getZ(f)).applyMatrix4(o),
  58299. t.set(y.getX(f), y.getY(f), y.getZ(f)),
  58300. t.applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  58301. a.setXYZ(h, e.x, e.y, e.z),
  58302. h += 1,
  58303. a.setXYZ(h, t.x, t.y, t.z),
  58304. h += 1;
  58305. return a.needsUpdate = !0,
  58306. this
  58307. }
  58308. }(),
  58309. n.WireframeHelper = function(e, t) {
  58310. var i = void 0 !== t ? t : 16777215;
  58311. n.LineSegments.call(this, new n.WireframeGeometry(e.geometry), new n.LineBasicMaterial({
  58312. color: i
  58313. })),
  58314. this.matrix = e.matrixWorld,
  58315. this.matrixAutoUpdate = !1
  58316. }
  58317. ,
  58318. n.WireframeHelper.prototype = Object.create(n.LineSegments.prototype),
  58319. n.WireframeHelper.prototype.constructor = n.WireframeHelper,
  58320. n.ImmediateRenderObject = function(e) {
  58321. n.Object3D.call(this),
  58322. this.material = e,
  58323. this.render = function(e) {}
  58324. }
  58325. ,
  58326. n.ImmediateRenderObject.prototype = Object.create(n.Object3D.prototype),
  58327. n.ImmediateRenderObject.prototype.constructor = n.ImmediateRenderObject,
  58328. n.MorphBlendMesh = function(e, t) {
  58329. n.Mesh.call(this, e, t),
  58330. this.animationsMap = {},
  58331. this.animationsList = [];
  58332. var i = this.geometry.morphTargets.length
  58333. , r = "__default"
  58334. , o = 0
  58335. , a = i - 1
  58336. , s = i / 1;
  58337. this.createAnimation(r, o, a, s),
  58338. this.setAnimationWeight(r, 1)
  58339. }
  58340. ,
  58341. n.MorphBlendMesh.prototype = Object.create(n.Mesh.prototype),
  58342. n.MorphBlendMesh.prototype.constructor = n.MorphBlendMesh,
  58343. n.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  58344. var r = {
  58345. start: t,
  58346. end: i,
  58347. length: i - t + 1,
  58348. fps: n,
  58349. duration: (i - t) / n,
  58350. lastFrame: 0,
  58351. currentFrame: 0,
  58352. active: !1,
  58353. time: 0,
  58354. direction: 1,
  58355. weight: 1,
  58356. directionBackwards: !1,
  58357. mirroredLoop: !1
  58358. };
  58359. this.animationsMap[e] = r,
  58360. this.animationsList.push(r)
  58361. }
  58362. ,
  58363. n.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  58364. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  58365. var s = r.morphTargets[o]
  58366. , l = s.name.match(i);
  58367. if (l && l.length > 1) {
  58368. var c = l[1];
  58369. n[c] || (n[c] = {
  58370. start: 1 / 0,
  58371. end: -(1 / 0)
  58372. });
  58373. var h = n[c];
  58374. o < h.start && (h.start = o),
  58375. o > h.end && (h.end = o),
  58376. t || (t = c)
  58377. }
  58378. }
  58379. for (var c in n) {
  58380. var h = n[c];
  58381. this.createAnimation(c, h.start, h.end, e)
  58382. }
  58383. this.firstAnimation = t
  58384. }
  58385. ,
  58386. n.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  58387. var t = this.animationsMap[e];
  58388. t && (t.direction = 1,
  58389. t.directionBackwards = !1)
  58390. }
  58391. ,
  58392. n.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  58393. var t = this.animationsMap[e];
  58394. t && (t.direction = -1,
  58395. t.directionBackwards = !0)
  58396. }
  58397. ,
  58398. n.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  58399. var i = this.animationsMap[e];
  58400. i && (i.fps = t,
  58401. i.duration = (i.end - i.start) / i.fps)
  58402. }
  58403. ,
  58404. n.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  58405. var i = this.animationsMap[e];
  58406. i && (i.duration = t,
  58407. i.fps = (i.end - i.start) / i.duration)
  58408. }
  58409. ,
  58410. n.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  58411. var i = this.animationsMap[e];
  58412. i && (i.weight = t)
  58413. }
  58414. ,
  58415. n.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  58416. var i = this.animationsMap[e];
  58417. i && (i.time = t)
  58418. }
  58419. ,
  58420. n.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  58421. var t = 0
  58422. , i = this.animationsMap[e];
  58423. return i && (t = i.time),
  58424. t
  58425. }
  58426. ,
  58427. n.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  58428. var t = -1
  58429. , i = this.animationsMap[e];
  58430. return i && (t = i.duration),
  58431. t
  58432. }
  58433. ,
  58434. n.MorphBlendMesh.prototype.playAnimation = function(e) {
  58435. var t = this.animationsMap[e];
  58436. t ? (t.time = 0,
  58437. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  58438. }
  58439. ,
  58440. n.MorphBlendMesh.prototype.stopAnimation = function(e) {
  58441. var t = this.animationsMap[e];
  58442. t && (t.active = !1)
  58443. }
  58444. ,
  58445. n.MorphBlendMesh.prototype.update = function(e) {
  58446. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  58447. var r = this.animationsList[t];
  58448. if (r.active) {
  58449. var o = r.duration / r.length;
  58450. r.time += r.direction * e,
  58451. r.mirroredLoop ? (r.time > r.duration || r.time < 0) && (r.direction *= -1,
  58452. r.time > r.duration && (r.time = r.duration,
  58453. r.directionBackwards = !0),
  58454. r.time < 0 && (r.time = 0,
  58455. r.directionBackwards = !1)) : (r.time = r.time % r.duration,
  58456. r.time < 0 && (r.time += r.duration));
  58457. var a = r.start + n.Math.clamp(Math.floor(r.time / o), 0, r.length - 1)
  58458. , s = r.weight;
  58459. a !== r.currentFrame && (this.morphTargetInfluences[r.lastFrame] = 0,
  58460. this.morphTargetInfluences[r.currentFrame] = 1 * s,
  58461. this.morphTargetInfluences[a] = 0,
  58462. r.lastFrame = r.currentFrame,
  58463. r.currentFrame = a);
  58464. var l = r.time % o / o;
  58465. r.directionBackwards && (l = 1 - l),
  58466. r.currentFrame !== r.lastFrame ? (this.morphTargetInfluences[r.currentFrame] = l * s,
  58467. this.morphTargetInfluences[r.lastFrame] = (1 - l) * s) : this.morphTargetInfluences[r.currentFrame] = s
  58468. }
  58469. }
  58470. }
  58471. ,
  58472. "undefined" != typeof i ? ("undefined" != typeof t && t.exports && (i = t.exports = n),
  58473. i.THREE = n) : this.THREE = n
  58474. window.THREE = n
  58475. getObjLoader()
  58476. initByTHREE(THREE)
  58477. //getWebXRManager()
  58478. }
  58479. , {}]
  58480. }, {}, [116]);
  58481. class PanTransGuide{
  58482. constructor(player){
  58483. this.player = player
  58484. this.currentIndex = 0
  58485. this.getNodes()
  58486. }
  58487. getNodes(){
  58488. this.nodes = []
  58489. let path = this.player.path
  58490. let last
  58491. let index = this.player.model.heroLocations.findIndex(e=>e.name == '沉浸看展') //先去掉之前旧的数据
  58492. if(index>-1){
  58493. let locations = this.player.model.heroLocations[index].heroLocations
  58494. this.player.model.heroLocations.splice(index,1)
  58495. }
  58496. let get = (e, originItem)=>{
  58497. if(e.cameraMode != 'panorama'){
  58498. e.originItem = originItem
  58499. this.nodes.push(e)
  58500. return last = null //断连
  58501. }
  58502. if(last){
  58503. e.visited = true
  58504. path.setWarpDestination(e)
  58505. path.setWarpDestPano()
  58506. let A = path.getHeroPano(last),
  58507. B = path.warpDestPano
  58508. if(e.momentTour == 'black' && A!=B){
  58509. path.nodes = [A.id,B.id];//直接加入
  58510. }else{
  58511. path.nodes = path.findShortestPath(A, B)
  58512. if(path.nodes == null){//两个点之间不相通
  58513. console.log('两个点之间不相通',A.id,B.id)
  58514. path.nodes = [A.id,B.id];//直接加入
  58515. }
  58516. }
  58517. let wholeDis = 0, disSections = []
  58518. path.nodes.forEach((cur,i)=>{
  58519. if(i==0)return
  58520. let prePano = this.player.model.panos.get(path.nodes[i-1])
  58521. let curPano = this.player.model.panos.get(cur)
  58522. let dis = prePano.position.distanceTo(curPano.position)
  58523. disSections.push(dis)
  58524. wholeDis += dis
  58525. },0)
  58526. let quaStart = last.quaternion
  58527. let quaEnd = e.quaternion
  58528. path.nodes.forEach((panoId,j)=>{
  58529. if(j == 0){
  58530. if(path.nodes.length == 1)return this.nodes.push({panoId,quaternion:quaEnd})//原地旋转
  58531. if(!last) return //和上一段末尾重复
  58532. return this.nodes.push({panoId,quaternion:quaStart})
  58533. }
  58534. let r = disSections[j-1] / wholeDis
  58535. let quaternion = quaStart.clone()
  58536. lerp.quaternion(quaternion, quaEnd)(r)
  58537. this.nodes.push({panoId, quaternion})
  58538. })
  58539. }
  58540. last = e
  58541. }
  58542. this.player.model.heroLocations.forEach((e,i)=>{
  58543. if(e.heroLocations){
  58544. e.heroLocations.forEach((a,j)=> get(a, [i,j]))
  58545. }else{
  58546. get(e,[i,0])
  58547. }
  58548. })
  58549. //补 因为last前一个可能不是panorama,导致last没加进nodes
  58550. if(last && !last.visited){
  58551. get(last)
  58552. }
  58553. }
  58554. go(axis){
  58555. if(this.player.flying)return
  58556. let aimNode
  58557. let cur = this.nodes[this.currentIndex]
  58558. if(cur.panoId != this.player.currentPano.id && player.mode == 'panorama'){//已走动){//已走动
  58559. let curs = this.nodes.filter(e=>e.panoId == this.player.currentPano)
  58560. curs.sort((a,b)=>{ //如果有多个,找到和currentIndex最接近的,可能是刚走过的
  58561. let indexA = this.nodes.indexOf(a)
  58562. let indexB = this.nodes.indexOf(b)
  58563. return Math.abs(indexA - this.currentIndex) < Math.abs(indexB - this.currentIndex)
  58564. })
  58565. cur = curs[0]
  58566. if(!cur){//不在道上 . 找离当前位置最近的node
  58567. let disMap = new Map
  58568. let nodes_ = this.nodes.filter(e=>!e.originItem)
  58569. nodes_.forEach(e=>{
  58570. disMap.set(e,player.currentPano.position.distanceToSquared(this.player.model.panos.get(e.panoId).position))
  58571. })
  58572. let sorted = nodes_.slice().sort((a,b)=>{
  58573. return disMap.get(a) - disMap.get(b)
  58574. })
  58575. this.currentIndex = this.nodes.indexOf(sorted[0])//next
  58576. if(axis == -1){
  58577. this.moveIndex(-1)
  58578. }
  58579. aimNode = this.nodes[this.currentIndex]
  58580. }
  58581. }
  58582. let lastIndex = this.currentIndex
  58583. if(!aimNode){
  58584. this.moveIndex(axis)
  58585. aimNode = this.nodes[this.currentIndex]
  58586. }
  58587. if(aimNode.originItem){//要飞出的,直接用导览飞
  58588. player.director.setDestinationItem(aimNode.originItem)
  58589. player.director.goToDestination()
  58590. return
  58591. }
  58592. //let dis = this.player.model.panos.get(aimNode.panoId).position.distanceTo(this.player.position)
  58593. let moveStyle = (lastIndex == 0 && axis == -1 || this.currentIndex == 0 && axis != -1) ? "blackToPano" : "flyToPano"
  58594. this.player[moveStyle]({pano: this.player.model.panos.get(aimNode.panoId), quaternion:aimNode.quaternion}, ()=>{
  58595. //更新导览进度条
  58596. player.director.setDestinationItem( player.director.findNearestItem(true,true) )
  58597. })
  58598. }
  58599. moveIndex(step){
  58600. this.currentIndex += (step + this.nodes.length)
  58601. this.currentIndex %= this.nodes.length
  58602. return this.currentIndex
  58603. }
  58604. }
  58605. //2025新的需求 沉浸看展直接使用导览
  58606. window.tourPlayCtl = {
  58607. go(axis){
  58608. player.guider2.go(axis)
  58609. }
  58610. }
  58611. /*
  58612. function getWebXRManager(){
  58613. class ArrayCamera extends THREE.PerspectiveCamera {
  58614. constructor(array = []) {
  58615. super();
  58616. this.isArrayCamera = true;
  58617. this.cameras = array;
  58618. }
  58619. }
  58620. function WebGLAnimation() {
  58621. let context = null;
  58622. let isAnimating = false;
  58623. let animationLoop = null;
  58624. let requestId = null;
  58625. function onAnimationFrame(time, frame) {
  58626. animationLoop(time, frame);
  58627. requestId = context.requestAnimationFrame(onAnimationFrame);
  58628. }
  58629. return {
  58630. start: function () {
  58631. if (isAnimating === true) return;
  58632. if (animationLoop === null) return;
  58633. requestId = context.requestAnimationFrame(onAnimationFrame);
  58634. isAnimating = true;
  58635. },
  58636. stop: function () {
  58637. context.cancelAnimationFrame(requestId);
  58638. isAnimating = false;
  58639. },
  58640. setAnimationLoop: function (callback) {
  58641. animationLoop = callback;
  58642. },
  58643. setContext: function (value) {
  58644. context = value;
  58645. }
  58646. };
  58647. }
  58648. function WebXRManager( renderer, gl ) {
  58649. var scope = this;
  58650. var session = null;
  58651. // var framebufferScaleFactor = 1.0;
  58652. var referenceSpace = null;
  58653. var referenceSpaceType = 'local-floor';
  58654. var pose = null;
  58655. var controllers = [];
  58656. var sortedInputSources = [];
  58657. function isPresenting() {
  58658. return session !== null && referenceSpace !== null;
  58659. }
  58660. //
  58661. var cameraL = new THREE.PerspectiveCamera();
  58662. cameraL.layers.enable( 1 );
  58663. cameraL.viewport = new THREE.Vector4();
  58664. var cameraR = new THREE.PerspectiveCamera();
  58665. cameraR.layers.enable( 2 );
  58666. cameraR.viewport = new THREE.Vector4();
  58667. var cameraVR = new ArrayCamera( [ cameraL, cameraR ] );
  58668. cameraVR.layers.enable( 1 );
  58669. cameraVR.layers.enable( 2 );
  58670. //
  58671. this.enabled = false;
  58672. this.getController = function ( id ) {
  58673. var controller = controllers[ id ];
  58674. if ( controller === undefined ) {
  58675. controller = new THREE.Group();
  58676. controller.matrixAutoUpdate = false;
  58677. controller.visible = false;
  58678. controllers[ id ] = controller;
  58679. }
  58680. return controller;
  58681. };
  58682. //
  58683. function onSessionEvent( event ) {
  58684. for ( var i = 0; i < controllers.length; i ++ ) {
  58685. if ( sortedInputSources[ i ] === event.inputSource ) {
  58686. controllers[ i ].dispatchEvent( { type: event.type } );
  58687. }
  58688. }
  58689. }
  58690. function onSessionEnd() {
  58691. renderer.setFramebuffer( null );
  58692. renderer.setRenderTarget( renderer.getRenderTarget() ); // Hack #15830
  58693. animation.stop();
  58694. scope.dispatchEvent( { type: 'sessionend' } );
  58695. }
  58696. function onRequestReferenceSpace( value ) {
  58697. referenceSpace = value;
  58698. animation.setContext( session );
  58699. animation.start();
  58700. scope.dispatchEvent( { type: 'sessionstart' } );
  58701. }
  58702. this.setFramebufferScaleFactor = function ( ) {
  58703. // framebufferScaleFactor = value;
  58704. };
  58705. this.setReferenceSpaceType = function ( value ) {
  58706. referenceSpaceType = value;
  58707. };
  58708. this.getSession = function () {
  58709. return session;
  58710. };
  58711. this.setSession = function ( value ) {
  58712. session = value;
  58713. if ( session !== null ) {
  58714. session.addEventListener( 'select', onSessionEvent );
  58715. session.addEventListener( 'selectstart', onSessionEvent );
  58716. session.addEventListener( 'selectend', onSessionEvent );
  58717. session.addEventListener( 'end', onSessionEnd );
  58718. // eslint-disable-next-line no-undef
  58719. session.updateRenderState( { baseLayer: new XRWebGLLayer( session, gl, { antialias: false } ) } );
  58720. session.requestReferenceSpace( referenceSpaceType ).then( onRequestReferenceSpace );
  58721. //
  58722. session.addEventListener( 'inputsourceschange', updateInputSources );
  58723. updateInputSources();
  58724. }
  58725. };
  58726. function updateInputSources() {
  58727. for ( var i = 0; i < controllers.length; i ++ ) {
  58728. sortedInputSources[ i ] = findInputSource( i );
  58729. }
  58730. }
  58731. function findInputSource( id ) {
  58732. var inputSources = session.inputSources;
  58733. for ( var i = 0; i < inputSources.length; i ++ ) {
  58734. var inputSource = inputSources[ i ];
  58735. var handedness = inputSource.handedness;
  58736. if ( id === 0 && ( handedness === 'none' || handedness === 'right' ) ) return inputSource;
  58737. if ( id === 1 && ( handedness === 'left' ) ) return inputSource;
  58738. }
  58739. }
  58740. //
  58741. function updateCamera( camera, parent ) {
  58742. if ( parent === null ) {
  58743. camera.matrixWorld.copy( camera.matrix );
  58744. } else {
  58745. camera.matrixWorld.multiplyMatrices( parent.matrixWorld, camera.matrix );
  58746. }
  58747. camera.matrixWorldInverse.getInverse( camera.matrixWorld );
  58748. }
  58749. this.getCamera = function ( camera ) {
  58750. if ( isPresenting() ) {
  58751. var parent = camera.parent;
  58752. var cameras = cameraVR.cameras;
  58753. updateCamera( cameraVR, parent );
  58754. for ( var i = 0; i < cameras.length; i ++ ) {
  58755. updateCamera( cameras[ i ], parent );
  58756. }
  58757. // update camera and its children
  58758. camera.matrixWorld.copy( cameraVR.matrixWorld );
  58759. var children = camera.children;
  58760. for ( var i = 0, l = children.length; i < l; i ++ ) {
  58761. children[ i ].updateMatrixWorld( true );
  58762. }
  58763. setProjectionFromUnion( cameraVR, cameraL, cameraR );
  58764. return cameraVR;
  58765. }
  58766. return camera;
  58767. };
  58768. this.isPresenting = isPresenting;
  58769. // Animation Loop
  58770. var onAnimationFrameCallback = null;
  58771. function onAnimationFrame( time, frame ) {
  58772. pose = frame.getViewerPose( referenceSpace );
  58773. if ( pose !== null ) {
  58774. var views = pose.views;
  58775. var baseLayer = session.renderState.baseLayer;
  58776. renderer.setFramebuffer( baseLayer.framebuffer );
  58777. for ( var i = 0; i < views.length; i ++ ) {
  58778. var view = views[ i ];
  58779. var viewport = baseLayer.getViewport( view );
  58780. var viewMatrix = view.transform.inverse.matrix;
  58781. var camera = cameraVR.cameras[ i ];
  58782. camera.matrix.fromArray( viewMatrix ).getInverse( camera.matrix );
  58783. camera.projectionMatrix.fromArray( view.projectionMatrix );
  58784. camera.viewport.set( viewport.x, viewport.y, viewport.width, viewport.height );
  58785. if ( i === 0 ) {
  58786. cameraVR.matrix.copy( camera.matrix );
  58787. }
  58788. }
  58789. }
  58790. //
  58791. for ( var i = 0; i < controllers.length; i ++ ) {
  58792. var controller = controllers[ i ];
  58793. var inputSource = sortedInputSources[ i ];
  58794. if ( inputSource ) {
  58795. var inputPose = frame.getPose( inputSource.targetRaySpace, referenceSpace );
  58796. if ( inputPose !== null ) {
  58797. controller.matrix.fromArray( inputPose.transform.matrix );
  58798. controller.matrix.decompose( controller.position, controller.rotation, controller.scale );
  58799. controller.visible = true;
  58800. continue;
  58801. }
  58802. }
  58803. controller.visible = false;
  58804. }
  58805. if ( onAnimationFrameCallback ) onAnimationFrameCallback( time );
  58806. }
  58807. var animation = new WebGLAnimation();
  58808. animation.setAnimationLoop( onAnimationFrame );
  58809. this.setAnimationLoop = function ( callback ) {
  58810. onAnimationFrameCallback = callback;
  58811. };
  58812. this.dispose = function () {};
  58813. // DEPRECATED
  58814. this.getStandingMatrix = function () {
  58815. console.warn( 'THREE.WebXRManager: getStandingMatrix() is no longer needed.' );
  58816. return new THREE.Matrix4();
  58817. };
  58818. this.getDevice = function () {
  58819. console.warn( 'THREE.WebXRManager: getDevice() has been deprecated.' );
  58820. };
  58821. this.setDevice = function () {
  58822. console.warn( 'THREE.WebXRManager: setDevice() has been deprecated.' );
  58823. };
  58824. this.setFrameOfReferenceType = function () {
  58825. console.warn( 'THREE.WebXRManager: setFrameOfReferenceType() has been deprecated.' );
  58826. };
  58827. this.submitFrame = function () {};
  58828. }
  58829. Object.assign( WebXRManager.prototype, THREE.EventDispatcher.prototype );
  58830. THREE.WebXRManager = WebXRManager
  58831. }
  58832. function getWebXRManager(){
  58833. class ArrayCamera extends THREE.PerspectiveCamera {
  58834. constructor(array = []) {
  58835. super();
  58836. this.isArrayCamera = true;
  58837. this.cameras = array;
  58838. }
  58839. }
  58840. class WebXRController {
  58841. constructor() {
  58842. this._targetRay = null;
  58843. this._grip = null;
  58844. this._hand = null;
  58845. }
  58846. getHandSpace() {
  58847. if (this._hand === null) {
  58848. this._hand = new THREE.Group();
  58849. this._hand.matrixAutoUpdate = false;
  58850. this._hand.visible = false;
  58851. this._hand.joints = {};
  58852. this._hand.inputState = {
  58853. pinching: false
  58854. };
  58855. }
  58856. return this._hand;
  58857. }
  58858. getTargetRaySpace() {
  58859. if (this._targetRay === null) {
  58860. this._targetRay = new THREE.Group();
  58861. this._targetRay.matrixAutoUpdate = false;
  58862. this._targetRay.visible = false;
  58863. this._targetRay.hasLinearVelocity = false;
  58864. this._targetRay.linearVelocity = new THREE.Vector3();
  58865. this._targetRay.hasAngularVelocity = false;
  58866. this._targetRay.angularVelocity = new THREE.Vector3();
  58867. }
  58868. return this._targetRay;
  58869. }
  58870. getGripSpace() {
  58871. if (this._grip === null) {
  58872. this._grip = new THREE.Group();
  58873. this._grip.matrixAutoUpdate = false;
  58874. this._grip.visible = false;
  58875. this._grip.hasLinearVelocity = false;
  58876. this._grip.linearVelocity = new THREE.Vector3();
  58877. this._grip.hasAngularVelocity = false;
  58878. this._grip.angularVelocity = new THREE.Vector3();
  58879. }
  58880. return this._grip;
  58881. }
  58882. dispatchEvent(event) {
  58883. if (this._targetRay !== null) {
  58884. this._targetRay.dispatchEvent(event);
  58885. }
  58886. if (this._grip !== null) {
  58887. this._grip.dispatchEvent(event);
  58888. }
  58889. if (this._hand !== null) {
  58890. this._hand.dispatchEvent(event);
  58891. }
  58892. return this;
  58893. }
  58894. disconnect(inputSource) {
  58895. this.dispatchEvent({
  58896. type: 'disconnected',
  58897. data: inputSource
  58898. });
  58899. if (this._targetRay !== null) {
  58900. this._targetRay.visible = false;
  58901. }
  58902. if (this._grip !== null) {
  58903. this._grip.visible = false;
  58904. }
  58905. if (this._hand !== null) {
  58906. this._hand.visible = false;
  58907. }
  58908. return this;
  58909. }
  58910. update(inputSource, frame, referenceSpace) {
  58911. let inputPose = null;
  58912. let gripPose = null;
  58913. let handPose = null;
  58914. const targetRay = this._targetRay;
  58915. const grip = this._grip;
  58916. const hand = this._hand;
  58917. if (inputSource && frame.session.visibilityState !== 'visible-blurred') {
  58918. if (hand && inputSource.hand) {
  58919. handPose = true;
  58920. for (const inputjoint of inputSource.hand.values()) {
  58921. // Update the joints groups with the XRJoint poses
  58922. const jointPose = frame.getJointPose(inputjoint, referenceSpace);
  58923. if (hand.joints[inputjoint.jointName] === undefined) {
  58924. // The transform of this joint will be updated with the joint pose on each frame
  58925. const joint = new THREE.Group();
  58926. joint.matrixAutoUpdate = false;
  58927. joint.visible = false;
  58928. hand.joints[inputjoint.jointName] = joint; // ??
  58929. hand.add(joint);
  58930. }
  58931. const joint = hand.joints[inputjoint.jointName];
  58932. if (jointPose !== null) {
  58933. joint.matrix.fromArray(jointPose.transform.matrix);
  58934. joint.matrix.decompose(joint.position, joint.rotation, joint.scale);
  58935. joint.jointRadius = jointPose.radius;
  58936. }
  58937. joint.visible = jointPose !== null;
  58938. } // Custom events
  58939. // Check pinchz
  58940. const indexTip = hand.joints['index-finger-tip'];
  58941. const thumbTip = hand.joints['thumb-tip'];
  58942. const distance = indexTip.position.distanceTo(thumbTip.position);
  58943. const distanceToPinch = 0.02;
  58944. const threshold = 0.005;
  58945. if (hand.inputState.pinching && distance > distanceToPinch + threshold) {
  58946. hand.inputState.pinching = false;
  58947. this.dispatchEvent({
  58948. type: 'pinchend',
  58949. handedness: inputSource.handedness,
  58950. target: this
  58951. });
  58952. } else if (!hand.inputState.pinching && distance <= distanceToPinch - threshold) {
  58953. hand.inputState.pinching = true;
  58954. this.dispatchEvent({
  58955. type: 'pinchstart',
  58956. handedness: inputSource.handedness,
  58957. target: this
  58958. });
  58959. }
  58960. } else {
  58961. if (grip !== null && inputSource.gripSpace) {
  58962. gripPose = frame.getPose(inputSource.gripSpace, referenceSpace);
  58963. if (gripPose !== null) {
  58964. grip.matrix.fromArray(gripPose.transform.matrix);
  58965. grip.matrix.decompose(grip.position, grip.rotation, grip.scale);
  58966. if (gripPose.linearVelocity) {
  58967. grip.hasLinearVelocity = true;
  58968. grip.linearVelocity.copy(gripPose.linearVelocity);
  58969. } else {
  58970. grip.hasLinearVelocity = false;
  58971. }
  58972. if (gripPose.angularVelocity) {
  58973. grip.hasAngularVelocity = true;
  58974. grip.angularVelocity.copy(gripPose.angularVelocity);
  58975. } else {
  58976. grip.hasAngularVelocity = false;
  58977. }
  58978. }
  58979. }
  58980. }
  58981. if (targetRay !== null) {
  58982. 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
  58983. if (inputPose === null && gripPose !== null) {
  58984. inputPose = gripPose;
  58985. }
  58986. if (inputPose !== null) {
  58987. targetRay.matrix.fromArray(inputPose.transform.matrix);
  58988. targetRay.matrix.decompose(targetRay.position, targetRay.rotation, targetRay.scale);
  58989. if (inputPose.linearVelocity) {
  58990. targetRay.hasLinearVelocity = true;
  58991. targetRay.linearVelocity.copy(inputPose.linearVelocity);
  58992. } else {
  58993. targetRay.hasLinearVelocity = false;
  58994. }
  58995. if (inputPose.angularVelocity) {
  58996. targetRay.hasAngularVelocity = true;
  58997. targetRay.angularVelocity.copy(inputPose.angularVelocity);
  58998. } else {
  58999. targetRay.hasAngularVelocity = false;
  59000. }
  59001. this.dispatchEvent(_moveEvent);
  59002. }
  59003. }
  59004. }
  59005. if (targetRay !== null) {
  59006. targetRay.visible = inputPose !== null;
  59007. }
  59008. if (grip !== null) {
  59009. grip.visible = gripPose !== null;
  59010. }
  59011. if (hand !== null) {
  59012. hand.visible = handPose !== null;
  59013. }
  59014. return this;
  59015. }
  59016. }
  59017. function WebGLAnimation() {
  59018. let context = null;
  59019. let isAnimating = false;
  59020. let animationLoop = null;
  59021. let requestId = null;
  59022. function onAnimationFrame(time, frame) {
  59023. animationLoop(time, frame);
  59024. requestId = context.requestAnimationFrame(onAnimationFrame);
  59025. }
  59026. return {
  59027. start: function () {
  59028. if (isAnimating === true) return;
  59029. if (animationLoop === null) return;
  59030. requestId = context.requestAnimationFrame(onAnimationFrame);
  59031. isAnimating = true;
  59032. },
  59033. stop: function () {
  59034. context.cancelAnimationFrame(requestId);
  59035. isAnimating = false;
  59036. },
  59037. setAnimationLoop: function (callback) {
  59038. animationLoop = callback;
  59039. },
  59040. setContext: function (value) {
  59041. context = value;
  59042. }
  59043. };
  59044. }
  59045. class WebXRManager extends THREE.EventDispatcher {
  59046. constructor(renderer, gl) {
  59047. super();
  59048. const scope = this;
  59049. let session = null;
  59050. let framebufferScaleFactor = 1.0;
  59051. let referenceSpace = null;
  59052. let referenceSpaceType = 'local-floor';
  59053. let customReferenceSpace = null;
  59054. let pose = null;
  59055. let glBinding = null;
  59056. let glProjLayer = null;
  59057. let glBaseLayer = null;
  59058. let xrFrame = null;
  59059. const attributes = gl.getContextAttributes();
  59060. let initialRenderTarget = null;
  59061. let newRenderTarget = null;
  59062. const controllers = [];
  59063. const controllerInputSources = []; //
  59064. const cameraL = new THREE.PerspectiveCamera();
  59065. cameraL.layers.enable(1);
  59066. cameraL.viewport = new THREE.Vector4();
  59067. const cameraR = new THREE.PerspectiveCamera();
  59068. cameraR.layers.enable(2);
  59069. cameraR.viewport = new THREE.Vector4();
  59070. const cameras = [cameraL, cameraR];
  59071. const cameraVR = new ArrayCamera();
  59072. cameraVR.layers.enable(1);
  59073. cameraVR.layers.enable(2);
  59074. let _currentDepthNear = null;
  59075. let _currentDepthFar = null; //
  59076. this.cameraAutoUpdate = true;
  59077. this.enabled = false;
  59078. this.isPresenting = false;
  59079. this.getController = function (index) {
  59080. let controller = controllers[index];
  59081. if (controller === undefined) {
  59082. controller = new WebXRController();
  59083. controllers[index] = controller;
  59084. }
  59085. return controller.getTargetRaySpace();
  59086. };
  59087. this.getControllerGrip = function (index) {
  59088. let controller = controllers[index];
  59089. if (controller === undefined) {
  59090. controller = new WebXRController();
  59091. controllers[index] = controller;
  59092. }
  59093. return controller.getGripSpace();
  59094. };
  59095. this.getHand = function (index) {
  59096. let controller = controllers[index];
  59097. if (controller === undefined) {
  59098. controller = new WebXRController();
  59099. controllers[index] = controller;
  59100. }
  59101. return controller.getHandSpace();
  59102. }; //
  59103. function onSessionEvent(event) {
  59104. const controllerIndex = controllerInputSources.indexOf(event.inputSource);
  59105. if (controllerIndex === -1) {
  59106. return;
  59107. }
  59108. const controller = controllers[controllerIndex];
  59109. if (controller !== undefined) {
  59110. controller.dispatchEvent({
  59111. type: event.type,
  59112. data: event.inputSource
  59113. });
  59114. }
  59115. }
  59116. function onSessionEnd() {
  59117. session.removeEventListener('select', onSessionEvent);
  59118. session.removeEventListener('selectstart', onSessionEvent);
  59119. session.removeEventListener('selectend', onSessionEvent);
  59120. session.removeEventListener('squeeze', onSessionEvent);
  59121. session.removeEventListener('squeezestart', onSessionEvent);
  59122. session.removeEventListener('squeezeend', onSessionEvent);
  59123. session.removeEventListener('end', onSessionEnd);
  59124. session.removeEventListener('inputsourceschange', onInputSourcesChange);
  59125. for (let i = 0; i < controllers.length; i++) {
  59126. const inputSource = controllerInputSources[i];
  59127. if (inputSource === null) continue;
  59128. controllerInputSources[i] = null;
  59129. controllers[i].disconnect(inputSource);
  59130. }
  59131. _currentDepthNear = null;
  59132. _currentDepthFar = null; // restore framebuffer/rendering state
  59133. renderer.setRenderTarget(initialRenderTarget);
  59134. glBaseLayer = null;
  59135. glProjLayer = null;
  59136. glBinding = null;
  59137. session = null;
  59138. newRenderTarget = null; //
  59139. animation.stop();
  59140. scope.isPresenting = false;
  59141. scope.dispatchEvent({
  59142. type: 'sessionend'
  59143. });
  59144. }
  59145. this.setFramebufferScaleFactor = function (value) {
  59146. framebufferScaleFactor = value;
  59147. if (scope.isPresenting === true) {
  59148. console.warn('THREE.WebXRManager: Cannot change framebuffer scale while presenting.');
  59149. }
  59150. };
  59151. this.setReferenceSpaceType = function (value) {
  59152. referenceSpaceType = value;
  59153. if (scope.isPresenting === true) {
  59154. console.warn('THREE.WebXRManager: Cannot change reference space type while presenting.');
  59155. }
  59156. };
  59157. this.getReferenceSpace = function () {
  59158. return customReferenceSpace || referenceSpace;
  59159. };
  59160. this.setReferenceSpace = function (space) {
  59161. customReferenceSpace = space;
  59162. };
  59163. this.getBaseLayer = function () {
  59164. return glProjLayer !== null ? glProjLayer : glBaseLayer;
  59165. };
  59166. this.getBinding = function () {
  59167. return glBinding;
  59168. };
  59169. this.getFrame = function () {
  59170. return xrFrame;
  59171. };
  59172. this.getSession = function () {
  59173. return session;
  59174. };
  59175. this.setSession = async function (value) {
  59176. session = value;
  59177. if (session !== null) {
  59178. initialRenderTarget = renderer.getCurrentRenderTarget();
  59179. session.addEventListener('select', onSessionEvent);
  59180. session.addEventListener('selectstart', onSessionEvent);
  59181. session.addEventListener('selectend', onSessionEvent);
  59182. session.addEventListener('squeeze', onSessionEvent);
  59183. session.addEventListener('squeezestart', onSessionEvent);
  59184. session.addEventListener('squeezeend', onSessionEvent);
  59185. session.addEventListener('end', onSessionEnd);
  59186. session.addEventListener('inputsourceschange', onInputSourcesChange);
  59187. if (attributes.xrCompatible !== true) {
  59188. await gl.makeXRCompatible();
  59189. }
  59190. if (session.renderState.layers === undefined || renderer.capabilities.isWebGL2 === false) {
  59191. const layerInit = {
  59192. antialias: session.renderState.layers === undefined ? attributes.antialias : true,
  59193. alpha: attributes.alpha,
  59194. depth: attributes.depth,
  59195. stencil: attributes.stencil,
  59196. framebufferScaleFactor: framebufferScaleFactor
  59197. };
  59198. glBaseLayer = new XRWebGLLayer(session, gl, layerInit);
  59199. session.updateRenderState({
  59200. baseLayer: glBaseLayer
  59201. });
  59202. newRenderTarget = new THREE.WebGLRenderTarget(glBaseLayer.framebufferWidth, glBaseLayer.framebufferHeight, {
  59203. format: THREE.RGBAFormat,
  59204. type: THREE.UnsignedByteType,
  59205. encoding: renderer.outputEncoding
  59206. });
  59207. } else {
  59208. let depthFormat = null;
  59209. let depthType = null;
  59210. let glDepthFormat = null;
  59211. if (attributes.depth) {
  59212. glDepthFormat = attributes.stencil ? gl.DEPTH24_STENCIL8 : gl.DEPTH_COMPONENT24;
  59213. depthFormat = attributes.stencil ? DepthStencilFormat : DepthFormat;
  59214. depthType = attributes.stencil ? UnsignedInt248Type : UnsignedIntType;
  59215. }
  59216. const projectionlayerInit = {
  59217. colorFormat: gl.RGBA8,
  59218. depthFormat: glDepthFormat,
  59219. scaleFactor: framebufferScaleFactor
  59220. };
  59221. glBinding = new XRWebGLBinding(session, gl);
  59222. glProjLayer = glBinding.createProjectionLayer(projectionlayerInit);
  59223. session.updateRenderState({
  59224. layers: [glProjLayer]
  59225. });
  59226. newRenderTarget = new THREE.WebGLRenderTarget(glProjLayer.textureWidth, glProjLayer.textureHeight, {
  59227. format: THREE.RGBAFormat,
  59228. type: THREE.UnsignedByteType,
  59229. depthTexture: new THREE.DepthTexture(glProjLayer.textureWidth, glProjLayer.textureHeight, depthType, undefined, undefined, undefined, undefined, undefined, undefined, depthFormat),
  59230. stencilBuffer: attributes.stencil,
  59231. encoding: renderer.outputEncoding,
  59232. samples: attributes.antialias ? 4 : 0
  59233. });
  59234. const renderTargetProperties = renderer.properties.get(newRenderTarget);
  59235. renderTargetProperties.__ignoreDepthValues = glProjLayer.ignoreDepthValues;
  59236. }
  59237. newRenderTarget.isXRRenderTarget = true; // TODO Remove this when possible, see #23278
  59238. // Set foveation to maximum.
  59239. this.setFoveation(1.0);
  59240. customReferenceSpace = null;
  59241. referenceSpace = await session.requestReferenceSpace(referenceSpaceType);
  59242. animation.setContext(session);
  59243. animation.start();
  59244. scope.isPresenting = true;
  59245. scope.dispatchEvent({
  59246. type: 'sessionstart'
  59247. });
  59248. }
  59249. };
  59250. function onInputSourcesChange(event) {
  59251. // Notify disconnected
  59252. for (let i = 0; i < event.removed.length; i++) {
  59253. const inputSource = event.removed[i];
  59254. const index = controllerInputSources.indexOf(inputSource);
  59255. if (index >= 0) {
  59256. controllerInputSources[index] = null;
  59257. controllers[index].dispatchEvent({
  59258. type: 'disconnected',
  59259. data: inputSource
  59260. });
  59261. }
  59262. } // Notify connected
  59263. for (let i = 0; i < event.added.length; i++) {
  59264. const inputSource = event.added[i];
  59265. let controllerIndex = controllerInputSources.indexOf(inputSource);
  59266. if (controllerIndex === -1) {
  59267. // Assign input source a controller that currently has no input source
  59268. for (let i = 0; i < controllers.length; i++) {
  59269. if (i >= controllerInputSources.length) {
  59270. controllerInputSources.push(inputSource);
  59271. controllerIndex = i;
  59272. break;
  59273. } else if (controllerInputSources[i] === null) {
  59274. controllerInputSources[i] = inputSource;
  59275. controllerIndex = i;
  59276. break;
  59277. }
  59278. } // If all controllers do currently receive input we ignore new ones
  59279. if (controllerIndex === -1) break;
  59280. }
  59281. const controller = controllers[controllerIndex];
  59282. if (controller) {
  59283. controller.dispatchEvent({
  59284. type: 'connected',
  59285. data: inputSource
  59286. });
  59287. }
  59288. }
  59289. } //
  59290. const cameraLPos = new THREE.Vector3();
  59291. const cameraRPos = new THREE.Vector3();
  59292. function setProjectionFromUnion(camera, cameraL, cameraR) {
  59293. cameraLPos.setFromMatrixPosition(cameraL.matrixWorld);
  59294. cameraRPos.setFromMatrixPosition(cameraR.matrixWorld);
  59295. const ipd = cameraLPos.distanceTo(cameraRPos);
  59296. const projL = cameraL.projectionMatrix.elements;
  59297. const projR = cameraR.projectionMatrix.elements; // VR systems will have identical far and near planes, and
  59298. // most likely identical top and bottom frustum extents.
  59299. // Use the left camera for these values.
  59300. const near = projL[14] / (projL[10] - 1);
  59301. const far = projL[14] / (projL[10] + 1);
  59302. const topFov = (projL[9] + 1) / projL[5];
  59303. const bottomFov = (projL[9] - 1) / projL[5];
  59304. const leftFov = (projL[8] - 1) / projL[0];
  59305. const rightFov = (projR[8] + 1) / projR[0];
  59306. const left = near * leftFov;
  59307. const right = near * rightFov; // Calculate the new camera's position offset from the
  59308. // left camera. xOffset should be roughly half `ipd`.
  59309. const zOffset = ipd / (-leftFov + rightFov);
  59310. const xOffset = zOffset * -leftFov; // TODO: Better way to apply this offset?
  59311. cameraL.matrixWorld.decompose(camera.position, camera.quaternion, camera.scale);
  59312. camera.translateX(xOffset);
  59313. camera.translateZ(zOffset);
  59314. camera.matrixWorld.compose(camera.position, camera.quaternion, camera.scale);
  59315. camera.matrixWorldInverse.copy(camera.matrixWorld).invert(); // Find the union of the frustum values of the cameras and scale
  59316. // the values so that the near plane's position does not change in world space,
  59317. // although must now be relative to the new union camera.
  59318. const near2 = near + zOffset;
  59319. const far2 = far + zOffset;
  59320. const left2 = left - xOffset;
  59321. const right2 = right + (ipd - xOffset);
  59322. const top2 = topFov * far / far2 * near2;
  59323. const bottom2 = bottomFov * far / far2 * near2;
  59324. camera.projectionMatrix.makePerspective(left2, right2, top2, bottom2, near2, far2);
  59325. }
  59326. function updateCamera(camera, parent) {
  59327. if (parent === null) {
  59328. camera.matrixWorld.copy(camera.matrix);
  59329. } else {
  59330. camera.matrixWorld.multiplyMatrices(parent.matrixWorld, camera.matrix);
  59331. }
  59332. camera.matrixWorldInverse.copy(camera.matrixWorld).invert();
  59333. }
  59334. this.updateCamera = function (camera) {
  59335. if (session === null) return;
  59336. cameraVR.near = cameraR.near = cameraL.near = camera.near;
  59337. cameraVR.far = cameraR.far = cameraL.far = camera.far;
  59338. if (_currentDepthNear !== cameraVR.near || _currentDepthFar !== cameraVR.far) {
  59339. // Note that the new renderState won't apply until the next frame. See #18320
  59340. session.updateRenderState({
  59341. depthNear: cameraVR.near,
  59342. depthFar: cameraVR.far
  59343. });
  59344. _currentDepthNear = cameraVR.near;
  59345. _currentDepthFar = cameraVR.far;
  59346. }
  59347. const parent = camera.parent;
  59348. const cameras = cameraVR.cameras;
  59349. updateCamera(cameraVR, parent);
  59350. for (let i = 0; i < cameras.length; i++) {
  59351. updateCamera(cameras[i], parent);
  59352. }
  59353. cameraVR.matrixWorld.decompose(cameraVR.position, cameraVR.quaternion, cameraVR.scale); // update user camera and its children
  59354. camera.position.copy(cameraVR.position);
  59355. camera.quaternion.copy(cameraVR.quaternion);
  59356. camera.scale.copy(cameraVR.scale);
  59357. camera.matrix.copy(cameraVR.matrix);
  59358. camera.matrixWorld.copy(cameraVR.matrixWorld);
  59359. const children = camera.children;
  59360. for (let i = 0, l = children.length; i < l; i++) {
  59361. children[i].updateMatrixWorld(true);
  59362. } // update projection matrix for proper view frustum culling
  59363. if (cameras.length === 2) {
  59364. setProjectionFromUnion(cameraVR, cameraL, cameraR);
  59365. } else {
  59366. // assume single camera setup (AR)
  59367. cameraVR.projectionMatrix.copy(cameraL.projectionMatrix);
  59368. }
  59369. };
  59370. this.getCamera = function () {
  59371. return cameraVR;
  59372. };
  59373. this.getFoveation = function () {
  59374. if (glProjLayer !== null) {
  59375. return glProjLayer.fixedFoveation;
  59376. }
  59377. if (glBaseLayer !== null) {
  59378. return glBaseLayer.fixedFoveation;
  59379. }
  59380. return undefined;
  59381. };
  59382. this.setFoveation = function (foveation) {
  59383. // 0 = no foveation = full resolution
  59384. // 1 = maximum foveation = the edges render at lower resolution
  59385. if (glProjLayer !== null) {
  59386. glProjLayer.fixedFoveation = foveation;
  59387. }
  59388. if (glBaseLayer !== null && glBaseLayer.fixedFoveation !== undefined) {
  59389. glBaseLayer.fixedFoveation = foveation;
  59390. }
  59391. }; // Animation Loop
  59392. let onAnimationFrameCallback = null;
  59393. function onAnimationFrame(time, frame) {
  59394. pose = frame.getViewerPose(customReferenceSpace || referenceSpace);
  59395. xrFrame = frame;
  59396. if (pose !== null) {
  59397. const views = pose.views;
  59398. if (glBaseLayer !== null) {
  59399. renderer.setRenderTargetFramebuffer(newRenderTarget, glBaseLayer.framebuffer);
  59400. renderer.setRenderTarget(newRenderTarget);
  59401. }
  59402. let cameraVRNeedsUpdate = false; // check if it's necessary to rebuild cameraVR's camera list
  59403. if (views.length !== cameraVR.cameras.length) {
  59404. cameraVR.cameras.length = 0;
  59405. cameraVRNeedsUpdate = true;
  59406. }
  59407. for (let i = 0; i < views.length; i++) {
  59408. const view = views[i];
  59409. let viewport = null;
  59410. if (glBaseLayer !== null) {
  59411. viewport = glBaseLayer.getViewport(view);
  59412. } else {
  59413. const glSubImage = glBinding.getViewSubImage(glProjLayer, view);
  59414. viewport = glSubImage.viewport; // For side-by-side projection, we only produce a single texture for both eyes.
  59415. if (i === 0) {
  59416. renderer.setRenderTargetTextures(newRenderTarget, glSubImage.colorTexture, glProjLayer.ignoreDepthValues ? undefined : glSubImage.depthStencilTexture);
  59417. renderer.setRenderTarget(newRenderTarget);
  59418. }
  59419. }
  59420. let camera = cameras[i];
  59421. if (camera === undefined) {
  59422. camera = new THREE.PerspectiveCamera();
  59423. camera.layers.enable(i);
  59424. camera.viewport = new THREE.Vector4();
  59425. cameras[i] = camera;
  59426. }
  59427. camera.matrix.fromArray(view.transform.matrix);
  59428. camera.projectionMatrix.fromArray(view.projectionMatrix);
  59429. camera.viewport.set(viewport.x, viewport.y, viewport.width, viewport.height);
  59430. if (i === 0) {
  59431. cameraVR.matrix.copy(camera.matrix);
  59432. }
  59433. if (cameraVRNeedsUpdate === true) {
  59434. cameraVR.cameras.push(camera);
  59435. }
  59436. }
  59437. } //
  59438. for (let i = 0; i < controllers.length; i++) {
  59439. const inputSource = controllerInputSources[i];
  59440. const controller = controllers[i];
  59441. if (inputSource !== null && controller !== undefined) {
  59442. controller.update(inputSource, frame, customReferenceSpace || referenceSpace);
  59443. }
  59444. }
  59445. if (onAnimationFrameCallback) onAnimationFrameCallback(time, frame);
  59446. xrFrame = null;
  59447. }
  59448. const animation = new WebGLAnimation();
  59449. animation.setAnimationLoop(onAnimationFrame);
  59450. this.setAnimationLoop = function (callback) {
  59451. onAnimationFrameCallback = callback;
  59452. };
  59453. this.dispose = function () {};
  59454. }
  59455. }
  59456. THREE.WebXRManager = WebXRManager
  59457. } */
  59458. /*
  59459. var addMagnifier = function(){
  59460. class Magnifier extends THREE.Object3D {
  59461. constructor () {
  59462. super()
  59463. let circleGeo = new THREE.CircleGeometry(0.1, 100);
  59464. this.camera = new THREE.PerspectiveCamera(50, 1, 0.1, 1); //fov aspect near far
  59465. this.renderTarget = new THREE.WebGLRenderTarget(256,256, {
  59466. minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter,
  59467. format: THREE.RGBAFormat ,
  59468. //type: THREE.FloatType,
  59469. //minFilter: THREE.NearestFilter,
  59470. //magFilter: THREE.NearestFilter,
  59471. } )
  59472. this.mesh = new THREE.Mesh(circleGeo, new THREE.MeshBasicMaterial({
  59473. side: THREE.DoubleSide ,
  59474. map: this.renderTarget.texture ,
  59475. transparent:true,
  59476. depthTest: !1,
  59477. depthWrite: !1,
  59478. }))
  59479. this.overlayMesh = new THREE.Mesh(circleGeo, new THREE.MeshBasicMaterial({
  59480. side: THREE.DoubleSide ,
  59481. map: Texture.load('images/crosshair.png') ,
  59482. transparent:true,
  59483. depthTest: !1,
  59484. depthWrite: !1,
  59485. }))
  59486. this.add(this.mesh)
  59487. this.add(this.overlayMesh)
  59488. player.model.add(this);
  59489. player.magnifier = this;
  59490. }
  59491. update(aimPos){
  59492. const magDistance_ = 0.3;
  59493. var playerPos = player.position
  59494. var vec = playerPos.clone().sub(aimPos).normalize().multiplyScalar(magDistance_)
  59495. this.camera.position.copy(aimPos.clone().add(vec))
  59496. this.camera.lookAt(aimPos)
  59497. var playerCamera = player.camera
  59498. this.quaternion.copy(playerCamera.quaternion);
  59499. var pos2d = player.mouse.clone();
  59500. var shift = 400;
  59501. var clientHeight = player.domElement.clientHeight
  59502. var clientY = - (pos2d.y - 1) * clientHeight / 2;
  59503. pos2d.y = clientY < 300 ? pos2d.y - shift/clientHeight : pos2d.y + shift/clientHeight
  59504. let newPos = new THREE.Vector3(pos2d.x,pos2d.y,0.7).unproject(playerCamera);
  59505. this.position.copy(newPos)
  59506. var renderer = player.sceneRenderer.renderer
  59507. var oldAutoClear = renderer.autoClear
  59508. renderer.autoClear = false
  59509. //renderer.clear( true, true, true );
  59510. renderer.render(player.sceneRenderer.scene, this.camera, this.renderTarget, true)
  59511. renderer.autoClear = oldAutoClear
  59512. }
  59513. }
  59514. new Magnifier()
  59515. }
  59516. */
  59517. /*
  59518. 笔记:
  59519. 导览缩放的几处: 1 搜索smoothZoomFovTo 2 flightStepWalk里
  59520. {
  59521. //到导览中某个点位(假设点位不重复)
  59522. var id = 73
  59523. var p = player.model.heroLocations.find(e=>e.heroLocations && e.heroLocations.find(e=>e.panoId == id))
  59524. var i = player.model.heroLocations.indexOf(p)
  59525. var p1 = p.heroLocations.find(e=>e.panoId == id)
  59526. var j = p.heroLocations.indexOf(p1)
  59527. player.director.goToHighlight([i,j])
  59528. }
  59529. 展示版导览改为就近导览,所以一开始并非第一个。如果在最后一个点上会自动从头开始
  59530. 关于pc-nav 4k
  59531. 两种选择,1 按照正常流程,因为nav为4k所以直接使用4k的tiledPanoRenderTarget, 但useUltraHighResolutionPanos需要开启才能达到4k,否则是2k。这样的话第一个点位需要手动重新替换tiledPanoRenderTarget,所以废弃
  59532. 2 使zoomed一直为true,直接使用zoomRenderTarget。 参考之前写过的三屏的本地4k。 且创建的tiledPanoRenderTarget不能超过2048否则过渡卡顿;且直到到达该点后才能下载4k,否则不会渲染到zoomRenderTarget上
  59533. 如果body使用transform旋转90度,需要改的地方:
  59534. convertScreenPositionToNDC: function(e, t, i) {//rotate 90 body: transform: rotate(90deg);
  59535. return i = i || new n.Vector2,
  59536. i.y = e / $("#player").height() * 2 - 1, //注意,当body旋转90度后,虽然clientX和clinetY是按照正常垂直视角,但player的长宽和原先一样,不会因为倒转而交换
  59537. i.x = t / $("#player").width() * 2 - 1,
  59538. i
  59539. },
  59540. outsideControl的 n.prototype.onTouchMove = function(e) {中的
  59541. this.pan(this.panDelta.x, this.panDelta.y) 改为 this.pan(this.panDelta.y, -this.panDelta.x), //rotate 90
  59542. 还有
  59543. this.rotateLeft(2 * Math.PI * this.rotateDelta.y / $("#player").width() * this.rotateSpeed), //rotate 90
  59544. this.rotateUp(2 * Math.PI * -this.rotateDelta.x / $("#player").height() * this.rotateSpeed),
  59545. ===================
  59546. 一些事件
  59547. player.model.on("floor.changed",(currentFloor, mode, oldFloor)=>{//楼层变化
  59548. player.on("pano.chosen", 旧的pano, 新的pano) //点位变化前
  59549. player.on("flying.ended", 新位置, 旧位置, 新的pano, 旧的pano) //点位变化后,或飞出后
  59550. 一些后缀
  59551. &panoLabel 加pano标签
  59552. */